From 6011a5f318875adc60f8b279b5459218e68767ed Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 5 Mar 2023 00:22:33 +0000 Subject: [PATCH 01/10] sync with cpython cda1d52a --- library/re.po | 465 +++++++++++++++++++++++++------------------------- 1 file changed, 232 insertions(+), 233 deletions(-) diff --git a/library/re.po b/library/re.po index ec7692e3e6..b37a920c9a 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-02-27 00:17+0000\n" +"POT-Creation-Date: 2023-03-05 00:20+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-" @@ -146,7 +146,7 @@ msgstr "" msgid "The special characters are:" msgstr "" -#: ../../library/re.rst:104 ../../library/re.rst:1526 +#: ../../library/re.rst:104 ../../library/re.rst:1530 msgid "``.``" msgstr "``.``" @@ -531,7 +531,7 @@ msgid "" "thus fail to match." msgstr "" -#: ../../library/re.rst:422 +#: ../../library/re.rst:423 msgid "``(?P...)``" msgstr "``(?P...)``" @@ -596,54 +596,56 @@ msgid "``\\g<1>``" msgstr "``\\g<1>``" #: ../../library/re.rst:421 -msgid "Group names containing non-ASCII characters in bytes patterns." +msgid "" +"Group *name* containing characters outside the ASCII range (``b'\\x00'``-" +"``b'\\x7f'``) in :class:`bytes` patterns." msgstr "" -#: ../../library/re.rst:428 +#: ../../library/re.rst:429 msgid "``(?P=name)``" msgstr "``(?P=name)``" -#: ../../library/re.rst:427 +#: ../../library/re.rst:428 msgid "" "A backreference to a named group; it matches whatever text was matched by " "the earlier group named *name*." msgstr "" -#: ../../library/re.rst:433 +#: ../../library/re.rst:434 msgid "``(?#...)``" msgstr "``(?#...)``" -#: ../../library/re.rst:433 +#: ../../library/re.rst:434 msgid "A comment; the contents of the parentheses are simply ignored." msgstr "" -#: ../../library/re.rst:440 +#: ../../library/re.rst:441 msgid "``(?=...)``" msgstr "``(?=...)``" -#: ../../library/re.rst:438 +#: ../../library/re.rst:439 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:447 +#: ../../library/re.rst:448 msgid "``(?!...)``" msgstr "``(?!...)``" -#: ../../library/re.rst:445 +#: ../../library/re.rst:446 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:474 +#: ../../library/re.rst:475 msgid "``(?<=...)``" msgstr "``(?<=...)``" -#: ../../library/re.rst:452 +#: ../../library/re.rst:453 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 " @@ -657,19 +659,19 @@ msgid "" "func:`match` function:" msgstr "" -#: ../../library/re.rst:467 +#: ../../library/re.rst:468 msgid "This example looks for a word following a hyphen:" msgstr "" -#: ../../library/re.rst:473 +#: ../../library/re.rst:474 msgid "Added support for group references of fixed length." msgstr "" -#: ../../library/re.rst:483 +#: ../../library/re.rst:484 msgid "``(?'``." msgstr "" -#: ../../library/re.rst:496 -msgid "Group *id* containing anything except ASCII digits." +#: ../../library/re.rst:497 ../../library/re.rst:1020 +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." msgstr "" -#: ../../library/re.rst:500 +#: ../../library/re.rst:503 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, " @@ -704,11 +709,11 @@ msgid "" "matches the character ``'$'``." msgstr "" -#: ../../library/re.rst:515 +#: ../../library/re.rst:518 msgid "``\\number``" msgstr "``\\number``" -#: ../../library/re.rst:508 +#: ../../library/re.rst:511 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 " @@ -720,19 +725,19 @@ msgid "" "escapes are treated as characters." msgstr "" -#: ../../library/re.rst:520 +#: ../../library/re.rst:523 msgid "``\\A``" msgstr "``\\A``" -#: ../../library/re.rst:520 +#: ../../library/re.rst:523 msgid "Matches only at the start of the string." msgstr "" -#: ../../library/re.rst:536 +#: ../../library/re.rst:539 msgid "``\\b``" msgstr "``\\b``" -#: ../../library/re.rst:525 +#: ../../library/re.rst:528 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 " @@ -742,7 +747,7 @@ msgid "" "baz'`` but not ``'foobar'`` or ``'foo3'``." msgstr "" -#: ../../library/re.rst:532 +#: ../../library/re.rst:535 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 " @@ -751,11 +756,11 @@ msgid "" "compatibility with Python's string literals." msgstr "" -#: ../../library/re.rst:547 +#: ../../library/re.rst:550 msgid "``\\B``" msgstr "``\\B``" -#: ../../library/re.rst:541 +#: ../../library/re.rst:544 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'``, " @@ -766,15 +771,15 @@ msgid "" "the :const:`LOCALE` flag is used." msgstr "" -#: ../../library/re.rst:559 +#: ../../library/re.rst:562 msgid "``\\d``" msgstr "``\\d``" -#: ../../library/re.rst:556 ../../library/re.rst:576 ../../library/re.rst:595 +#: ../../library/re.rst:559 ../../library/re.rst:579 ../../library/re.rst:598 msgid "For Unicode (str) patterns:" msgstr "" -#: ../../library/re.rst:553 +#: ../../library/re.rst:556 msgid "" "Matches any Unicode decimal digit (that is, any character in Unicode " "character category [Nd]). This includes ``[0-9]``, and also many other " @@ -782,30 +787,30 @@ msgid "" "matched." msgstr "" -#: ../../library/re.rst:559 ../../library/re.rst:580 ../../library/re.rst:601 +#: ../../library/re.rst:562 ../../library/re.rst:583 ../../library/re.rst:604 msgid "For 8-bit (bytes) patterns:" msgstr "" -#: ../../library/re.rst:559 +#: ../../library/re.rst:562 msgid "Matches any decimal digit; this is equivalent to ``[0-9]``." msgstr "" -#: ../../library/re.rst:566 +#: ../../library/re.rst:569 msgid "``\\D``" msgstr "``\\D``" -#: ../../library/re.rst:564 +#: ../../library/re.rst:567 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:580 +#: ../../library/re.rst:583 msgid "``\\s``" msgstr "``\\s``" -#: ../../library/re.rst:572 +#: ../../library/re.rst:575 msgid "" "Matches Unicode whitespace characters (which includes " "``[ \\t\\n\\r\\f\\v]``, and also many other characters, for example the non-" @@ -813,35 +818,35 @@ msgid "" "const:`ASCII` flag is used, only ``[ \\t\\n\\r\\f\\v]`` is matched." msgstr "" -#: ../../library/re.rst:579 +#: ../../library/re.rst:582 msgid "" "Matches characters considered whitespace in the ASCII character set; this is " "equivalent to ``[ \\t\\n\\r\\f\\v]``." msgstr "" -#: ../../library/re.rst:587 +#: ../../library/re.rst:590 msgid "``\\S``" msgstr "``\\S``" -#: ../../library/re.rst:585 +#: ../../library/re.rst:588 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:601 +#: ../../library/re.rst:604 msgid "``\\w``" msgstr "``\\w``" -#: ../../library/re.rst:593 +#: ../../library/re.rst:596 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:598 +#: ../../library/re.rst:601 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, " @@ -849,11 +854,11 @@ msgid "" "underscore." msgstr "" -#: ../../library/re.rst:610 +#: ../../library/re.rst:613 msgid "``\\W``" msgstr "``\\W``" -#: ../../library/re.rst:606 +#: ../../library/re.rst:609 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 " @@ -861,34 +866,34 @@ msgid "" "which are neither alphanumeric in the current locale nor the underscore." msgstr "" -#: ../../library/re.rst:615 +#: ../../library/re.rst:618 msgid "``\\Z``" msgstr "``\\Z``" -#: ../../library/re.rst:615 +#: ../../library/re.rst:618 msgid "Matches only at the end of the string." msgstr "" -#: ../../library/re.rst:631 +#: ../../library/re.rst:634 msgid "" "Most of the standard escapes supported by Python string literals are also " "accepted by the regular expression parser::" msgstr "" -#: ../../library/re.rst:638 +#: ../../library/re.rst:641 msgid "" "(Note that ``\\b`` is used to represent word boundaries, and means " "\"backspace\" only inside character classes.)" msgstr "" -#: ../../library/re.rst:641 +#: ../../library/re.rst:644 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:645 +#: ../../library/re.rst:648 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. " @@ -896,26 +901,26 @@ msgid "" "are always at most three digits in length." msgstr "" -#: ../../library/re.rst:650 +#: ../../library/re.rst:653 msgid "The ``'\\u'`` and ``'\\U'`` escape sequences have been added." msgstr "" -#: ../../library/re.rst:653 +#: ../../library/re.rst:656 msgid "" "Unknown escapes consisting of ``'\\'`` and an ASCII letter now are errors." msgstr "" -#: ../../library/re.rst:656 +#: ../../library/re.rst:659 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:664 +#: ../../library/re.rst:667 msgid "Module Contents" msgstr "模組內容" -#: ../../library/re.rst:666 +#: ../../library/re.rst:669 msgid "" "The module defines several functions, constants, and an exception. Some of " "the functions are simplified versions of the full featured methods for " @@ -923,26 +928,26 @@ msgid "" "compiled form." msgstr "" -#: ../../library/re.rst:673 +#: ../../library/re.rst:676 msgid "Flags" msgstr "" -#: ../../library/re.rst:675 +#: ../../library/re.rst:678 msgid "" "Flag constants are now instances of :class:`RegexFlag`, which is a subclass " "of :class:`enum.IntFlag`." msgstr "" -#: ../../library/re.rst:682 +#: ../../library/re.rst:685 msgid "" "An :class:`enum.IntFlag` class containing the regex options listed below." msgstr "" -#: ../../library/re.rst:684 +#: ../../library/re.rst:687 msgid "- added to ``__all__``" msgstr "" -#: ../../library/re.rst:689 +#: ../../library/re.rst:692 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\d``, ``\\D``, ``\\s`` and " "``\\S`` perform ASCII-only matching instead of full Unicode matching. This " @@ -950,7 +955,7 @@ msgid "" "Corresponds to the inline flag ``(?a)``." msgstr "" -#: ../../library/re.rst:694 +#: ../../library/re.rst:697 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 ``(?" @@ -958,13 +963,13 @@ msgid "" "default for strings (and Unicode matching isn't allowed for bytes)." msgstr "" -#: ../../library/re.rst:703 +#: ../../library/re.rst:706 msgid "" "Display debug information about compiled expression. No corresponding inline " "flag." msgstr "" -#: ../../library/re.rst:710 +#: ../../library/re.rst:713 msgid "" "Perform case-insensitive matching; expressions like ``[A-Z]`` will also " "match lowercase letters. Full Unicode matching (such as ``Ü`` matching " @@ -974,7 +979,7 @@ msgid "" "flag ``(?i)``." msgstr "" -#: ../../library/re.rst:717 +#: ../../library/re.rst:720 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 " @@ -985,7 +990,7 @@ msgid "" "matched." msgstr "" -#: ../../library/re.rst:728 +#: ../../library/re.rst:731 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching " "dependent on the current locale. This flag can be used only with bytes " @@ -996,20 +1001,20 @@ msgid "" "locales/languages. Corresponds to the inline flag ``(?L)``." msgstr "" -#: ../../library/re.rst:737 +#: ../../library/re.rst:740 msgid "" ":const:`re.LOCALE` can be used only with bytes patterns and is not " "compatible with :const:`re.ASCII`." msgstr "" -#: ../../library/re.rst:741 +#: ../../library/re.rst:744 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:750 +#: ../../library/re.rst:753 msgid "" "When specified, the pattern character ``'^'`` matches at the beginning of " "the string and at the beginning of each line (immediately following each " @@ -1020,7 +1025,7 @@ msgid "" "the end of the string. Corresponds to the inline flag ``(?m)``." msgstr "" -#: ../../library/re.rst:760 +#: ../../library/re.rst:763 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 " @@ -1028,14 +1033,14 @@ msgid "" "value::" msgstr "" -#: ../../library/re.rst:773 +#: ../../library/re.rst:776 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:783 +#: ../../library/re.rst:786 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 " @@ -1048,53 +1053,53 @@ msgid "" "ignored." msgstr "" -#: ../../library/re.rst:793 +#: ../../library/re.rst:796 msgid "" "This means that the two following regular expression objects that match a " "decimal number are functionally equal::" msgstr "" -#: ../../library/re.rst:801 +#: ../../library/re.rst:804 msgid "Corresponds to the inline flag ``(?x)``." msgstr "" -#: ../../library/re.rst:805 +#: ../../library/re.rst:808 msgid "Functions" msgstr "" -#: ../../library/re.rst:809 +#: ../../library/re.rst:812 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:814 +#: ../../library/re.rst:817 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:818 +#: ../../library/re.rst:821 msgid "The sequence ::" msgstr "" -#: ../../library/re.rst:823 +#: ../../library/re.rst:826 msgid "is equivalent to ::" msgstr "" "等價於:\n" "\n" "::" -#: ../../library/re.rst:827 +#: ../../library/re.rst:830 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:833 +#: ../../library/re.rst:836 msgid "" "The compiled versions of the most recent patterns passed to :func:`re." "compile` and the module-level matching functions are cached, so programs " @@ -1102,7 +1107,7 @@ msgid "" "compiling regular expressions." msgstr "" -#: ../../library/re.rst:841 +#: ../../library/re.rst:844 msgid "" "Scan through *string* looking for the first location where the regular " "expression *pattern* produces a match, and return a corresponding :ref:" @@ -1111,7 +1116,7 @@ msgid "" "length match at some point in the string." msgstr "" -#: ../../library/re.rst:850 +#: ../../library/re.rst:853 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 " @@ -1139,7 +1144,7 @@ msgid "" "length match." msgstr "" -#: ../../library/re.rst:874 +#: ../../library/re.rst:877 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 " @@ -1148,42 +1153,42 @@ msgid "" "final element of the list. ::" msgstr "" -#: ../../library/re.rst:889 +#: ../../library/re.rst:892 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:896 +#: ../../library/re.rst:899 msgid "" "That way, separator components are always found at the same relative indices " "within the result list." msgstr "" -#: ../../library/re.rst:899 +#: ../../library/re.rst:902 msgid "" "Empty matches for the pattern split the string only when not adjacent to a " "previous empty match." msgstr "" -#: ../../library/re.rst:909 ../../library/re.rst:999 ../../library/re.rst:1027 +#: ../../library/re.rst:912 ../../library/re.rst:1002 ../../library/re.rst:1031 msgid "Added the optional flags argument." msgstr "" -#: ../../library/re.rst:912 +#: ../../library/re.rst:915 msgid "" "Added support of splitting on a pattern that could match an empty string." msgstr "" -#: ../../library/re.rst:918 +#: ../../library/re.rst:921 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:922 +#: ../../library/re.rst:925 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. " @@ -1193,11 +1198,11 @@ msgid "" "result." msgstr "" -#: ../../library/re.rst:934 ../../library/re.rst:945 +#: ../../library/re.rst:937 ../../library/re.rst:948 msgid "Non-empty matches can now start just after a previous empty match." msgstr "" -#: ../../library/re.rst:940 +#: ../../library/re.rst:943 msgid "" "Return an :term:`iterator` yielding :ref:`match objects ` " "over all non-overlapping matches for the RE *pattern* in *string*. The " @@ -1205,7 +1210,7 @@ msgid "" "found. Empty matches are included in the result." msgstr "" -#: ../../library/re.rst:951 +#: ../../library/re.rst:954 msgid "" "Return the string obtained by replacing the leftmost non-overlapping " "occurrences of *pattern* in *string* by the replacement *repl*. If the " @@ -1219,18 +1224,18 @@ msgid "" "For example::" msgstr "" -#: ../../library/re.rst:967 +#: ../../library/re.rst:970 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:979 +#: ../../library/re.rst:982 msgid "The pattern may be a string or a :ref:`pattern object `." msgstr "" -#: ../../library/re.rst:981 +#: ../../library/re.rst:984 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, " @@ -1239,7 +1244,7 @@ msgid "" "'abxd')`` returns ``'-a-b--d-'``." msgstr "" -#: ../../library/re.rst:989 +#: ../../library/re.rst:992 msgid "" "In string-type *repl* arguments, in addition to the character escapes and " "backreferences described above, ``\\g`` will use the substring matched " @@ -1252,59 +1257,53 @@ msgid "" "RE." msgstr "" -#: ../../library/re.rst:1002 ../../library/re.rst:1030 -#: ../../library/re.rst:1264 +#: ../../library/re.rst:1005 ../../library/re.rst:1034 +#: ../../library/re.rst:1268 msgid "Unmatched groups are replaced with an empty string." msgstr "" -#: ../../library/re.rst:1005 +#: ../../library/re.rst:1008 msgid "" "Unknown escapes in *pattern* consisting of ``'\\'`` and an ASCII letter now " "are errors." msgstr "" -#: ../../library/re.rst:1009 +#: ../../library/re.rst:1012 msgid "" "Unknown escapes in *repl* consisting of ``'\\'`` and an ASCII letter now are " "errors." msgstr "" -#: ../../library/re.rst:1013 +#: ../../library/re.rst:1016 msgid "" "Empty matches for the pattern are replaced when adjacent to a previous non-" "empty match." msgstr "" -#: ../../library/re.rst:1017 -msgid "" -"Group *id* containing anything except ASCII digits. Group names containing " -"non-ASCII characters in bytes replacement strings." -msgstr "" - -#: ../../library/re.rst:1024 +#: ../../library/re.rst:1028 msgid "" "Perform the same operation as :func:`sub`, but return a tuple ``(new_string, " "number_of_subs_made)``." msgstr "" -#: ../../library/re.rst:1036 +#: ../../library/re.rst:1040 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:1051 +#: ../../library/re.rst:1055 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:1059 +#: ../../library/re.rst:1063 msgid "The ``'_'`` character is no longer escaped." msgstr "" -#: ../../library/re.rst:1062 +#: ../../library/re.rst:1066 msgid "" "Only characters that can have special meaning in a regular expression are " "escaped. As a result, ``'!'``, ``'\"'``, ``'%'``, ``\"'\"``, ``','``, " @@ -1312,15 +1311,15 @@ msgid "" "are no longer escaped." msgstr "" -#: ../../library/re.rst:1071 +#: ../../library/re.rst:1075 msgid "Clear the regular expression cache." msgstr "" -#: ../../library/re.rst:1075 +#: ../../library/re.rst:1079 msgid "Exceptions" msgstr "" -#: ../../library/re.rst:1079 +#: ../../library/re.rst:1083 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 +1328,41 @@ msgid "" "pattern. The error instance has the following additional attributes:" msgstr "" -#: ../../library/re.rst:1087 +#: ../../library/re.rst:1091 msgid "The unformatted error message." msgstr "" -#: ../../library/re.rst:1091 +#: ../../library/re.rst:1095 msgid "The regular expression pattern." msgstr "" -#: ../../library/re.rst:1095 +#: ../../library/re.rst:1099 msgid "The index in *pattern* where compilation failed (may be ``None``)." msgstr "" -#: ../../library/re.rst:1099 +#: ../../library/re.rst:1103 msgid "The line corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1103 +#: ../../library/re.rst:1107 msgid "The column corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1105 +#: ../../library/re.rst:1109 msgid "Added additional attributes." msgstr "新增額外屬性。" -#: ../../library/re.rst:1111 +#: ../../library/re.rst:1115 msgid "Regular Expression Objects" msgstr "" -#: ../../library/re.rst:1113 +#: ../../library/re.rst:1117 msgid "" "Compiled regular expression objects support the following methods and " "attributes:" msgstr "" -#: ../../library/re.rst:1118 +#: ../../library/re.rst:1122 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 +1371,7 @@ msgid "" "some point in the string." msgstr "" -#: ../../library/re.rst:1124 +#: ../../library/re.rst:1128 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 +1380,7 @@ msgid "" "necessarily at the index where the search is to start." msgstr "" -#: ../../library/re.rst:1130 +#: ../../library/re.rst:1134 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 +1390,7 @@ msgid "" "equivalent to ``rx.search(string[:50], 0)``. ::" msgstr "" -#: ../../library/re.rst:1145 +#: ../../library/re.rst:1149 msgid "" "If zero or more characters at the *beginning* of *string* match this regular " "expression, return a corresponding :ref:`match object `. " @@ -1399,19 +1398,19 @@ msgid "" "different from a zero-length match." msgstr "" -#: ../../library/re.rst:1150 ../../library/re.rst:1168 +#: ../../library/re.rst:1154 ../../library/re.rst:1172 msgid "" "The optional *pos* and *endpos* parameters have the same meaning as for the :" "meth:`~Pattern.search` method. ::" msgstr "" -#: ../../library/re.rst:1158 +#: ../../library/re.rst:1162 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:1164 +#: ../../library/re.rst:1168 msgid "" "If the whole *string* matches this regular expression, return a " "corresponding :ref:`match object `. Return ``None`` if the " @@ -1419,76 +1418,76 @@ msgid "" "length match." msgstr "" -#: ../../library/re.rst:1182 +#: ../../library/re.rst:1186 msgid "Identical to the :func:`split` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1187 +#: ../../library/re.rst:1191 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:1194 +#: ../../library/re.rst:1198 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:1201 +#: ../../library/re.rst:1205 msgid "Identical to the :func:`sub` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1206 +#: ../../library/re.rst:1210 msgid "Identical to the :func:`subn` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1211 +#: ../../library/re.rst:1215 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:1218 +#: ../../library/re.rst:1222 msgid "The number of capturing groups in the pattern." msgstr "" -#: ../../library/re.rst:1223 +#: ../../library/re.rst:1227 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:1230 +#: ../../library/re.rst:1234 msgid "The pattern string from which the pattern object was compiled." msgstr "" -#: ../../library/re.rst:1233 +#: ../../library/re.rst:1237 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Compiled " "regular expression objects are considered atomic." msgstr "" -#: ../../library/re.rst:1241 +#: ../../library/re.rst:1245 msgid "Match Objects" msgstr "" -#: ../../library/re.rst:1243 +#: ../../library/re.rst:1247 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:1252 +#: ../../library/re.rst:1256 msgid "Match objects support the following methods and attributes:" msgstr "" -#: ../../library/re.rst:1257 +#: ../../library/re.rst:1261 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 +1496,7 @@ msgid "" "``\\g``) are replaced by the contents of the corresponding group." msgstr "" -#: ../../library/re.rst:1269 +#: ../../library/re.rst:1273 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 +1511,7 @@ msgid "" "the pattern that matched multiple times, the last match is returned. ::" msgstr "" -#: ../../library/re.rst:1291 +#: ../../library/re.rst:1295 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 +1519,57 @@ msgid "" "`IndexError` exception is raised." msgstr "" -#: ../../library/re.rst:1296 +#: ../../library/re.rst:1300 msgid "A moderately complicated example::" msgstr "" -#: ../../library/re.rst:1304 +#: ../../library/re.rst:1308 msgid "Named groups can also be referred to by their index::" msgstr "" -#: ../../library/re.rst:1311 +#: ../../library/re.rst:1315 msgid "If a group matches multiple times, only the last match is accessible::" msgstr "" -#: ../../library/re.rst:1320 +#: ../../library/re.rst:1324 msgid "" "This is identical to ``m.group(g)``. This allows easier access to an " "individual group from a match::" msgstr "" -#: ../../library/re.rst:1331 +#: ../../library/re.rst:1335 msgid "Named groups are supported as well::" msgstr "" -#: ../../library/re.rst:1344 +#: ../../library/re.rst:1348 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:1348 ../../library/re.rst:1573 +#: ../../library/re.rst:1352 ../../library/re.rst:1577 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/re.rst:1354 +#: ../../library/re.rst:1358 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:1367 +#: ../../library/re.rst:1371 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:1379 +#: ../../library/re.rst:1383 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 +1578,7 @@ msgid "" "matched by group *g* (equivalent to ``m.group(g)``) is ::" msgstr "" -#: ../../library/re.rst:1387 +#: ../../library/re.rst:1391 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 +1586,32 @@ msgid "" "2, and ``m.start(2)`` raises an :exc:`IndexError` exception." msgstr "" -#: ../../library/re.rst:1392 +#: ../../library/re.rst:1396 msgid "An example that will remove *remove_this* from email addresses::" msgstr "" -#: ../../library/re.rst:1402 +#: ../../library/re.rst:1406 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:1409 +#: ../../library/re.rst:1413 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:1416 +#: ../../library/re.rst:1420 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:1423 +#: ../../library/re.rst:1427 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 +1620,43 @@ msgid "" "applied to the same string." msgstr "" -#: ../../library/re.rst:1432 +#: ../../library/re.rst:1436 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:1438 +#: ../../library/re.rst:1442 msgid "" "The :ref:`regular expression object ` whose :meth:`~Pattern." "match` or :meth:`~Pattern.search` method produced this match instance." msgstr "" -#: ../../library/re.rst:1444 +#: ../../library/re.rst:1448 msgid "The string passed to :meth:`~Pattern.match` or :meth:`~Pattern.search`." msgstr "" -#: ../../library/re.rst:1447 +#: ../../library/re.rst:1451 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Match objects " "are considered atomic." msgstr "" -#: ../../library/re.rst:1455 +#: ../../library/re.rst:1459 msgid "Regular Expression Examples" msgstr "" -#: ../../library/re.rst:1459 +#: ../../library/re.rst:1463 msgid "Checking for a Pair" msgstr "" -#: ../../library/re.rst:1461 +#: ../../library/re.rst:1465 msgid "" "In this example, we'll use the following helper function to display match " "objects a little more gracefully::" msgstr "" -#: ../../library/re.rst:1469 +#: ../../library/re.rst:1473 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 +1664,28 @@ msgid "" "\"2\" through \"9\" representing the card with that value." msgstr "" -#: ../../library/re.rst:1474 +#: ../../library/re.rst:1478 msgid "To see if a given string is a valid hand, one could do the following::" msgstr "" -#: ../../library/re.rst:1484 +#: ../../library/re.rst:1488 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:1494 +#: ../../library/re.rst:1498 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:1513 +#: ../../library/re.rst:1517 msgid "Simulating scanf()" msgstr "" -#: ../../library/re.rst:1517 +#: ../../library/re.rst:1521 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 +1694,124 @@ msgid "" "expressions." msgstr "" -#: ../../library/re.rst:1524 +#: ../../library/re.rst:1528 msgid ":c:func:`scanf` Token" msgstr "" -#: ../../library/re.rst:1524 +#: ../../library/re.rst:1528 msgid "Regular Expression" msgstr "" -#: ../../library/re.rst:1526 +#: ../../library/re.rst:1530 msgid "``%c``" msgstr "``%c``" -#: ../../library/re.rst:1528 +#: ../../library/re.rst:1532 msgid "``%5c``" msgstr "``%5c``" -#: ../../library/re.rst:1528 +#: ../../library/re.rst:1532 msgid "``.{5}``" msgstr "``.{5}``" -#: ../../library/re.rst:1530 +#: ../../library/re.rst:1534 msgid "``%d``" msgstr "``%d``" -#: ../../library/re.rst:1530 +#: ../../library/re.rst:1534 msgid "``[-+]?\\d+``" msgstr "``[-+]?\\d+``" -#: ../../library/re.rst:1532 +#: ../../library/re.rst:1536 msgid "``%e``, ``%E``, ``%f``, ``%g``" msgstr "``%e``, ``%E``, ``%f``, ``%g``" -#: ../../library/re.rst:1532 +#: ../../library/re.rst:1536 msgid "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" msgstr "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" -#: ../../library/re.rst:1534 +#: ../../library/re.rst:1538 msgid "``%i``" msgstr "``%i``" -#: ../../library/re.rst:1534 +#: ../../library/re.rst:1538 msgid "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" msgstr "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" -#: ../../library/re.rst:1536 +#: ../../library/re.rst:1540 msgid "``%o``" msgstr "``%o``" -#: ../../library/re.rst:1536 +#: ../../library/re.rst:1540 msgid "``[-+]?[0-7]+``" msgstr "``[-+]?[0-7]+``" -#: ../../library/re.rst:1538 +#: ../../library/re.rst:1542 msgid "``%s``" msgstr "``%s``" -#: ../../library/re.rst:1538 +#: ../../library/re.rst:1542 msgid "``\\S+``" msgstr "``\\S+``" -#: ../../library/re.rst:1540 +#: ../../library/re.rst:1544 msgid "``%u``" msgstr "``%u``" -#: ../../library/re.rst:1540 +#: ../../library/re.rst:1544 msgid "``\\d+``" msgstr "``\\d+``" -#: ../../library/re.rst:1542 +#: ../../library/re.rst:1546 msgid "``%x``, ``%X``" msgstr "``%x``\\ 、\\ ``%X``" -#: ../../library/re.rst:1542 +#: ../../library/re.rst:1546 msgid "``[-+]?(0[xX])?[\\dA-Fa-f]+``" msgstr "``[-+]?(0[xX])?[\\dA-Fa-f]+``" -#: ../../library/re.rst:1545 +#: ../../library/re.rst:1549 msgid "To extract the filename and numbers from a string like ::" msgstr "" -#: ../../library/re.rst:1549 +#: ../../library/re.rst:1553 msgid "you would use a :c:func:`scanf` format like ::" msgstr "" -#: ../../library/re.rst:1553 +#: ../../library/re.rst:1557 msgid "The equivalent regular expression would be ::" msgstr "" -#: ../../library/re.rst:1561 +#: ../../library/re.rst:1565 msgid "search() vs. match()" msgstr "" -#: ../../library/re.rst:1565 +#: ../../library/re.rst:1569 msgid "" "Python offers different primitive operations based on regular expressions:" msgstr "" -#: ../../library/re.rst:1567 +#: ../../library/re.rst:1571 msgid ":func:`re.match` checks for a match only at the beginning of the string" msgstr "" -#: ../../library/re.rst:1568 +#: ../../library/re.rst:1572 msgid "" ":func:`re.search` checks for a match anywhere in the string (this is what " "Perl does by default)" msgstr "" -#: ../../library/re.rst:1570 +#: ../../library/re.rst:1574 msgid ":func:`re.fullmatch` checks for entire string to be a match" msgstr "" -#: ../../library/re.rst:1582 +#: ../../library/re.rst:1586 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:1590 +#: ../../library/re.rst:1594 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 +1819,11 @@ msgid "" "line. ::" msgstr "" -#: ../../library/re.rst:1600 +#: ../../library/re.rst:1604 msgid "Making a Phonebook" msgstr "" -#: ../../library/re.rst:1602 +#: ../../library/re.rst:1606 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 +1831,37 @@ msgid "" "following example that creates a phonebook." msgstr "" -#: ../../library/re.rst:1607 +#: ../../library/re.rst:1611 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:1620 +#: ../../library/re.rst:1624 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:1633 +#: ../../library/re.rst:1637 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:1646 +#: ../../library/re.rst:1650 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:1661 +#: ../../library/re.rst:1665 msgid "Text Munging" msgstr "" -#: ../../library/re.rst:1663 +#: ../../library/re.rst:1667 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 +1869,11 @@ msgid "" "each word of a sentence except for the first and last characters::" msgstr "" -#: ../../library/re.rst:1680 +#: ../../library/re.rst:1684 msgid "Finding all Adverbs" msgstr "" -#: ../../library/re.rst:1682 +#: ../../library/re.rst:1686 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 +1881,11 @@ msgid "" "manner::" msgstr "" -#: ../../library/re.rst:1693 +#: ../../library/re.rst:1697 msgid "Finding all Adverbs and their Positions" msgstr "" -#: ../../library/re.rst:1695 +#: ../../library/re.rst:1699 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 +1894,11 @@ msgid "" "text, they would use :func:`finditer` in the following manner::" msgstr "" -#: ../../library/re.rst:1709 +#: ../../library/re.rst:1713 msgid "Raw String Notation" msgstr "" -#: ../../library/re.rst:1711 +#: ../../library/re.rst:1715 msgid "" "Raw string notation (``r\"text\"``) keeps regular expressions sane. Without " "it, every backslash (``'\\'``) in a regular expression would have to be " @@ -1907,7 +1906,7 @@ msgid "" "lines of code are functionally identical::" msgstr "" -#: ../../library/re.rst:1721 +#: ../../library/re.rst:1725 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 +1914,29 @@ msgid "" "following lines of code functionally identical::" msgstr "" -#: ../../library/re.rst:1733 +#: ../../library/re.rst:1737 msgid "Writing a Tokenizer" msgstr "" -#: ../../library/re.rst:1735 +#: ../../library/re.rst:1739 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:1739 +#: ../../library/re.rst:1743 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:1795 +#: ../../library/re.rst:1799 msgid "The tokenizer produces the following output::" msgstr "" -#: ../../library/re.rst:1818 +#: ../../library/re.rst:1822 msgid "" "Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O'Reilly Media, " "2009. The third edition of the book no longer covers Python at all, but the " From a27313c7ab883668d7b2b989e452ff5f8c522fab Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 6 Mar 2023 00:19:35 +0000 Subject: [PATCH 02/10] sync with cpython a7ec32e7 --- library/stdtypes.po | 1883 ++++++++++++++++++++++--------------------- 1 file changed, 944 insertions(+), 939 deletions(-) diff --git a/library/stdtypes.po b/library/stdtypes.po index 5eedb27511..b4ca86d33d 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-22 00:16+0000\n" +"POT-Creation-Date: 2023-03-06 00:17+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -122,21 +122,21 @@ msgstr "" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:143 #: ../../library/stdtypes.rst:275 ../../library/stdtypes.rst:364 -#: ../../library/stdtypes.rst:414 ../../library/stdtypes.rst:921 -#: ../../library/stdtypes.rst:1126 +#: ../../library/stdtypes.rst:414 ../../library/stdtypes.rst:923 +#: ../../library/stdtypes.rst:1128 msgid "Operation" msgstr "" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:275 #: ../../library/stdtypes.rst:364 ../../library/stdtypes.rst:414 -#: ../../library/stdtypes.rst:921 ../../library/stdtypes.rst:1126 +#: ../../library/stdtypes.rst:923 ../../library/stdtypes.rst:1128 msgid "Result" msgstr "結果" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:275 -#: ../../library/stdtypes.rst:414 ../../library/stdtypes.rst:921 -#: ../../library/stdtypes.rst:1126 ../../library/stdtypes.rst:2371 -#: ../../library/stdtypes.rst:3589 +#: ../../library/stdtypes.rst:414 ../../library/stdtypes.rst:923 +#: ../../library/stdtypes.rst:1128 ../../library/stdtypes.rst:2373 +#: ../../library/stdtypes.rst:3591 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:923 ../../library/stdtypes.rst:926 -#: ../../library/stdtypes.rst:1137 ../../library/stdtypes.rst:2377 -#: ../../library/stdtypes.rst:3595 +#: ../../library/stdtypes.rst:925 ../../library/stdtypes.rst:928 +#: ../../library/stdtypes.rst:1139 ../../library/stdtypes.rst:2379 +#: ../../library/stdtypes.rst:3597 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:1165 -#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:2383 -#: ../../library/stdtypes.rst:3599 ../../library/stdtypes.rst:3601 +#: ../../library/stdtypes.rst:308 ../../library/stdtypes.rst:1167 +#: ../../library/stdtypes.rst:2383 ../../library/stdtypes.rst:2385 +#: ../../library/stdtypes.rst:3601 ../../library/stdtypes.rst:3603 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:935 -#: ../../library/stdtypes.rst:1168 ../../library/stdtypes.rst:2385 -#: ../../library/stdtypes.rst:2387 ../../library/stdtypes.rst:2389 -#: ../../library/stdtypes.rst:2391 ../../library/stdtypes.rst:3603 -#: ../../library/stdtypes.rst:3605 ../../library/stdtypes.rst:3607 -#: ../../library/stdtypes.rst:3609 +#: ../../library/stdtypes.rst:93 ../../library/stdtypes.rst:937 +#: ../../library/stdtypes.rst:1170 ../../library/stdtypes.rst:2387 +#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:2391 +#: ../../library/stdtypes.rst:2393 ../../library/stdtypes.rst:3605 +#: ../../library/stdtypes.rst:3607 ../../library/stdtypes.rst:3609 +#: ../../library/stdtypes.rst:3611 msgid "\\(3)" msgstr "\\(3)" #: ../../library/stdtypes.rst:102 ../../library/stdtypes.rst:319 -#: ../../library/stdtypes.rst:432 ../../library/stdtypes.rst:972 -#: ../../library/stdtypes.rst:1176 ../../library/stdtypes.rst:2417 -#: ../../library/stdtypes.rst:3639 +#: ../../library/stdtypes.rst:432 ../../library/stdtypes.rst:974 +#: ../../library/stdtypes.rst:1178 ../../library/stdtypes.rst:2419 +#: ../../library/stdtypes.rst:3641 msgid "Notes:" msgstr "註解:" @@ -229,9 +229,9 @@ msgstr "" msgid "This table summarizes the comparison operations:" msgstr "" -#: ../../library/stdtypes.rst:143 ../../library/stdtypes.rst:2348 -#: ../../library/stdtypes.rst:2371 ../../library/stdtypes.rst:3566 -#: ../../library/stdtypes.rst:3589 +#: ../../library/stdtypes.rst:143 ../../library/stdtypes.rst:2350 +#: ../../library/stdtypes.rst:2373 ../../library/stdtypes.rst:3568 +#: ../../library/stdtypes.rst:3591 msgid "Meaning" msgstr "" @@ -513,8 +513,8 @@ msgid "" "zero." msgstr "" -#: ../../library/stdtypes.rst:301 ../../library/stdtypes.rst:1158 -#: ../../library/stdtypes.rst:2379 ../../library/stdtypes.rst:3626 +#: ../../library/stdtypes.rst:301 ../../library/stdtypes.rst:1160 +#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:3628 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:1147 ../../library/stdtypes.rst:1150 -#: ../../library/stdtypes.rst:2404 ../../library/stdtypes.rst:2407 -#: ../../library/stdtypes.rst:2410 ../../library/stdtypes.rst:3622 -#: ../../library/stdtypes.rst:3629 +#: ../../library/stdtypes.rst:1149 ../../library/stdtypes.rst:1152 +#: ../../library/stdtypes.rst:2406 ../../library/stdtypes.rst:2409 +#: ../../library/stdtypes.rst:2412 ../../library/stdtypes.rst:3624 +#: ../../library/stdtypes.rst:3631 msgid "\\(5)" msgstr "\\(5)" @@ -689,9 +689,9 @@ msgid "bitwise :dfn:`or` of *x* and *y*" msgstr "" #: ../../library/stdtypes.rst:416 ../../library/stdtypes.rst:419 -#: ../../library/stdtypes.rst:422 ../../library/stdtypes.rst:1171 -#: ../../library/stdtypes.rst:2393 ../../library/stdtypes.rst:2397 -#: ../../library/stdtypes.rst:3611 ../../library/stdtypes.rst:3615 +#: ../../library/stdtypes.rst:422 ../../library/stdtypes.rst:1173 +#: ../../library/stdtypes.rst:2395 ../../library/stdtypes.rst:2399 +#: ../../library/stdtypes.rst:3613 ../../library/stdtypes.rst:3617 msgid "\\(4)" msgstr "\\(4)" @@ -792,7 +792,7 @@ msgid "" msgstr "" #: ../../library/stdtypes.rst:473 ../../library/stdtypes.rst:496 -#: ../../library/stdtypes.rst:539 ../../library/stdtypes.rst:583 +#: ../../library/stdtypes.rst:541 ../../library/stdtypes.rst:585 msgid "Equivalent to::" msgstr "" "等價於:\n" @@ -835,25 +835,30 @@ msgstr "" #: ../../library/stdtypes.rst:532 msgid "" "The default values can be used to conveniently turn an integer into a single " -"byte object. However, when using the default arguments, don't try to " -"convert a value greater than 255 or you'll get an :exc:`OverflowError`::" +"byte object::" +msgstr "" + +#: ../../library/stdtypes.rst:538 +msgid "" +"However, when using the default arguments, don't try to convert a value " +"greater than 255 or you'll get an :exc:`OverflowError`." msgstr "" -#: ../../library/stdtypes.rst:552 +#: ../../library/stdtypes.rst:554 msgid "Added default argument values for ``length`` and ``byteorder``." msgstr "" -#: ../../library/stdtypes.rst:557 +#: ../../library/stdtypes.rst:559 msgid "Return the integer represented by the given array of bytes." msgstr "" -#: ../../library/stdtypes.rst:570 +#: ../../library/stdtypes.rst:572 msgid "" "The argument *bytes* must either be a :term:`bytes-like object` or an " "iterable producing bytes." msgstr "" -#: ../../library/stdtypes.rst:573 +#: ../../library/stdtypes.rst:575 msgid "" "The *byteorder* argument determines the byte order used to represent the " "integer, and defaults to ``\"big\"``. If *byteorder* is ``\"big\"``, the " @@ -863,17 +868,17 @@ msgid "" "byteorder` as the byte order value." msgstr "" -#: ../../library/stdtypes.rst:580 +#: ../../library/stdtypes.rst:582 msgid "" "The *signed* argument indicates whether two's complement is used to " "represent the integer." msgstr "" -#: ../../library/stdtypes.rst:600 +#: ../../library/stdtypes.rst:602 msgid "Added default argument value for ``byteorder``." msgstr "" -#: ../../library/stdtypes.rst:605 +#: ../../library/stdtypes.rst:607 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 " @@ -881,30 +886,30 @@ msgid "" "denominator." msgstr "" -#: ../../library/stdtypes.rst:613 +#: ../../library/stdtypes.rst:615 msgid "Additional Methods on Float" msgstr "" -#: ../../library/stdtypes.rst:615 +#: ../../library/stdtypes.rst:617 msgid "" "The float type implements the :class:`numbers.Real` :term:`abstract base " "class`. float also has the following additional methods." msgstr "" -#: ../../library/stdtypes.rst:620 +#: ../../library/stdtypes.rst:622 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." msgstr "" -#: ../../library/stdtypes.rst:627 +#: ../../library/stdtypes.rst:629 msgid "" "Return ``True`` if the float instance is finite with integral value, and " "``False`` otherwise::" msgstr "" -#: ../../library/stdtypes.rst:635 +#: ../../library/stdtypes.rst:637 msgid "" "Two methods support conversion to and from hexadecimal strings. Since " "Python's floats are stored internally as binary numbers, converting a float " @@ -914,30 +919,30 @@ msgid "" "numerical work." msgstr "" -#: ../../library/stdtypes.rst:646 +#: ../../library/stdtypes.rst:648 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:654 +#: ../../library/stdtypes.rst:656 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:659 +#: ../../library/stdtypes.rst:661 msgid "" "Note that :meth:`float.hex` is an instance method, while :meth:`float." "fromhex` is a class method." msgstr "" -#: ../../library/stdtypes.rst:662 +#: ../../library/stdtypes.rst:664 msgid "A hexadecimal string takes the form::" msgstr "" -#: ../../library/stdtypes.rst:666 +#: ../../library/stdtypes.rst:668 msgid "" "where the optional ``sign`` may by either ``+`` or ``-``, ``integer`` and " "``fraction`` are strings of hexadecimal digits, and ``exponent`` is a " @@ -951,7 +956,7 @@ msgid "" "by :meth:`float.fromhex`." msgstr "" -#: ../../library/stdtypes.rst:679 +#: ../../library/stdtypes.rst:681 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 " @@ -959,17 +964,17 @@ msgid "" "number ``(3 + 10./16 + 7./16**2) * 2.0**10``, or ``3740.0``::" msgstr "" -#: ../../library/stdtypes.rst:689 +#: ../../library/stdtypes.rst:691 msgid "" "Applying the reverse conversion to ``3740.0`` gives a different hexadecimal " "string representing the same number::" msgstr "" -#: ../../library/stdtypes.rst:699 +#: ../../library/stdtypes.rst:701 msgid "Hashing of numeric types" msgstr "" -#: ../../library/stdtypes.rst:701 +#: ../../library/stdtypes.rst:703 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." @@ -985,24 +990,24 @@ msgid "" "of :data:`sys.hash_info`." msgstr "" -#: ../../library/stdtypes.rst:716 +#: ../../library/stdtypes.rst:718 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:719 +#: ../../library/stdtypes.rst:721 msgid "Here are the rules in detail:" msgstr "" -#: ../../library/stdtypes.rst:721 +#: ../../library/stdtypes.rst:723 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:725 +#: ../../library/stdtypes.rst:727 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 " @@ -1010,20 +1015,20 @@ msgid "" "value ``sys.hash_info.inf``." msgstr "" -#: ../../library/stdtypes.rst:730 +#: ../../library/stdtypes.rst:732 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:734 +#: ../../library/stdtypes.rst:736 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:738 +#: ../../library/stdtypes.rst:740 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." @@ -1032,18 +1037,18 @@ msgid "" "1))``. Again, if the result is ``-1``, it's replaced with ``-2``." msgstr "" -#: ../../library/stdtypes.rst:746 +#: ../../library/stdtypes.rst:748 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:801 +#: ../../library/stdtypes.rst:803 msgid "Iterator Types" msgstr "" -#: ../../library/stdtypes.rst:809 +#: ../../library/stdtypes.rst:811 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 " @@ -1051,13 +1056,13 @@ msgid "" "support the iteration methods." msgstr "" -#: ../../library/stdtypes.rst:814 +#: ../../library/stdtypes.rst:816 msgid "" "One method needs to be defined for container objects to provide :term:" "`iterable` support:" msgstr "" -#: ../../library/stdtypes.rst:821 +#: ../../library/stdtypes.rst:823 msgid "" "Return an :term:`iterator` object. The object is required to support the " "iterator protocol described below. If a container supports different types " @@ -1069,13 +1074,13 @@ msgid "" "in the Python/C API." msgstr "" -#: ../../library/stdtypes.rst:830 +#: ../../library/stdtypes.rst:832 msgid "" "The iterator objects themselves are required to support the following two " "methods, which together form the :dfn:`iterator protocol`:" msgstr "" -#: ../../library/stdtypes.rst:836 +#: ../../library/stdtypes.rst:838 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:" @@ -1083,7 +1088,7 @@ msgid "" "tp_iter` slot of the type structure for Python objects in the Python/C API." msgstr "" -#: ../../library/stdtypes.rst:845 +#: ../../library/stdtypes.rst:847 msgid "" "Return the next item from the :term:`iterator`. If there are no further " "items, raise the :exc:`StopIteration` exception. This method corresponds to " @@ -1091,7 +1096,7 @@ msgid "" "Python objects in the Python/C API." msgstr "" -#: ../../library/stdtypes.rst:850 +#: ../../library/stdtypes.rst:852 msgid "" "Python defines several iterator objects to support iteration over general " "and specific sequence types, dictionaries, and other more specialized " @@ -1099,18 +1104,18 @@ msgid "" "the iterator protocol." msgstr "" -#: ../../library/stdtypes.rst:855 +#: ../../library/stdtypes.rst:857 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:863 +#: ../../library/stdtypes.rst:865 msgid "Generator Types" msgstr "" -#: ../../library/stdtypes.rst:865 +#: ../../library/stdtypes.rst:867 msgid "" "Python's :term:`generator`\\s provide a convenient way to implement the " "iterator protocol. If a container object's :meth:`__iter__` method is " @@ -1120,11 +1125,11 @@ msgid "" "found in :ref:`the documentation for the yield expression `." msgstr "" -#: ../../library/stdtypes.rst:877 +#: ../../library/stdtypes.rst:879 msgid "Sequence Types --- :class:`list`, :class:`tuple`, :class:`range`" msgstr "" -#: ../../library/stdtypes.rst:879 +#: ../../library/stdtypes.rst:881 msgid "" "There are three basic sequence types: lists, tuples, and range objects. " "Additional sequence types tailored for processing of :ref:`binary data " @@ -1132,11 +1137,11 @@ msgid "" "sections." msgstr "" -#: ../../library/stdtypes.rst:888 +#: ../../library/stdtypes.rst:890 msgid "Common Sequence Operations" msgstr "" -#: ../../library/stdtypes.rst:892 +#: ../../library/stdtypes.rst:894 msgid "" "The operations in the following table are supported by most sequence types, " "both mutable and immutable. The :class:`collections.abc.Sequence` ABC is " @@ -1144,7 +1149,7 @@ msgid "" "sequence types." msgstr "" -#: ../../library/stdtypes.rst:897 +#: ../../library/stdtypes.rst:899 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* " @@ -1152,7 +1157,7 @@ msgid "" "restrictions imposed by *s*." msgstr "" -#: ../../library/stdtypes.rst:902 +#: ../../library/stdtypes.rst:904 msgid "" "The ``in`` and ``not in`` operations have the same priorities as the " "comparison operations. The ``+`` (concatenation) and ``*`` (repetition) " @@ -1160,125 +1165,125 @@ msgid "" "[3]_" msgstr "" -#: ../../library/stdtypes.rst:923 +#: ../../library/stdtypes.rst:925 msgid "``x in s``" msgstr "``x in s``" -#: ../../library/stdtypes.rst:923 +#: ../../library/stdtypes.rst:925 msgid "``True`` if an item of *s* is equal to *x*, else ``False``" msgstr "" -#: ../../library/stdtypes.rst:926 +#: ../../library/stdtypes.rst:928 msgid "``x not in s``" msgstr "``x not in s``" -#: ../../library/stdtypes.rst:926 +#: ../../library/stdtypes.rst:928 msgid "``False`` if an item of *s* is equal to *x*, else ``True``" msgstr "" -#: ../../library/stdtypes.rst:929 +#: ../../library/stdtypes.rst:931 msgid "``s + t``" msgstr "``s + t``" -#: ../../library/stdtypes.rst:929 +#: ../../library/stdtypes.rst:931 msgid "the concatenation of *s* and *t*" msgstr "" -#: ../../library/stdtypes.rst:929 +#: ../../library/stdtypes.rst:931 msgid "(6)(7)" msgstr "(6)(7)" -#: ../../library/stdtypes.rst:932 +#: ../../library/stdtypes.rst:934 msgid "``s * n`` or ``n * s``" msgstr "``s * n`` 或 ``n * s``" -#: ../../library/stdtypes.rst:932 +#: ../../library/stdtypes.rst:934 msgid "equivalent to adding *s* to itself *n* times" msgstr "" -#: ../../library/stdtypes.rst:932 +#: ../../library/stdtypes.rst:934 msgid "(2)(7)" msgstr "(2)(7)" -#: ../../library/stdtypes.rst:935 +#: ../../library/stdtypes.rst:937 msgid "``s[i]``" msgstr "``s[i]``" -#: ../../library/stdtypes.rst:935 +#: ../../library/stdtypes.rst:937 msgid "*i*\\ th item of *s*, origin 0" msgstr "" -#: ../../library/stdtypes.rst:937 +#: ../../library/stdtypes.rst:939 msgid "``s[i:j]``" msgstr "``s[i:j]``" -#: ../../library/stdtypes.rst:937 +#: ../../library/stdtypes.rst:939 msgid "slice of *s* from *i* to *j*" msgstr "" -#: ../../library/stdtypes.rst:937 +#: ../../library/stdtypes.rst:939 msgid "(3)(4)" msgstr "(3)(4)" -#: ../../library/stdtypes.rst:939 +#: ../../library/stdtypes.rst:941 msgid "``s[i:j:k]``" msgstr "``s[i:j:k]``" -#: ../../library/stdtypes.rst:939 +#: ../../library/stdtypes.rst:941 msgid "slice of *s* from *i* to *j* with step *k*" msgstr "" -#: ../../library/stdtypes.rst:939 +#: ../../library/stdtypes.rst:941 msgid "(3)(5)" msgstr "(3)(5)" -#: ../../library/stdtypes.rst:942 +#: ../../library/stdtypes.rst:944 msgid "``len(s)``" msgstr "``len(s)``" -#: ../../library/stdtypes.rst:942 +#: ../../library/stdtypes.rst:944 msgid "length of *s*" msgstr "" -#: ../../library/stdtypes.rst:944 +#: ../../library/stdtypes.rst:946 msgid "``min(s)``" msgstr "``min(s)``" -#: ../../library/stdtypes.rst:944 +#: ../../library/stdtypes.rst:946 msgid "smallest item of *s*" msgstr "" -#: ../../library/stdtypes.rst:946 +#: ../../library/stdtypes.rst:948 msgid "``max(s)``" msgstr "``max(s)``" -#: ../../library/stdtypes.rst:946 +#: ../../library/stdtypes.rst:948 msgid "largest item of *s*" msgstr "" -#: ../../library/stdtypes.rst:948 +#: ../../library/stdtypes.rst:950 msgid "``s.index(x[, i[, j]])``" msgstr "``s.index(x[, i[, j]])``" -#: ../../library/stdtypes.rst:948 +#: ../../library/stdtypes.rst:950 msgid "" "index of the first occurrence of *x* in *s* (at or after index *i* and " "before index *j*)" msgstr "" -#: ../../library/stdtypes.rst:948 ../../library/stdtypes.rst:3597 +#: ../../library/stdtypes.rst:950 ../../library/stdtypes.rst:3599 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/stdtypes.rst:952 +#: ../../library/stdtypes.rst:954 msgid "``s.count(x)``" msgstr "``s.count(x)``" -#: ../../library/stdtypes.rst:952 +#: ../../library/stdtypes.rst:954 msgid "total number of occurrences of *x* in *s*" msgstr "" -#: ../../library/stdtypes.rst:956 +#: ../../library/stdtypes.rst:958 msgid "" "Sequences of the same type also support comparisons. In particular, tuples " "and lists are compared lexicographically by comparing corresponding " @@ -1287,7 +1292,7 @@ msgid "" "(For full details see :ref:`comparisons` in the language reference.)" msgstr "" -#: ../../library/stdtypes.rst:966 +#: ../../library/stdtypes.rst:968 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 " @@ -1296,7 +1301,7 @@ msgid "" "drops below zero)." msgstr "" -#: ../../library/stdtypes.rst:975 +#: ../../library/stdtypes.rst:977 msgid "" "While the ``in`` and ``not in`` operations are used only for simple " "containment testing in the general case, some specialised sequences (such " @@ -1304,7 +1309,7 @@ msgid "" "subsequence testing::" msgstr "" -#: ../../library/stdtypes.rst:984 +#: ../../library/stdtypes.rst:986 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 " @@ -1312,7 +1317,7 @@ msgid "" "Python programmers; consider::" msgstr "" -#: ../../library/stdtypes.rst:996 +#: ../../library/stdtypes.rst:998 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 " @@ -1320,20 +1325,20 @@ msgid "" "list. You can create a list of different lists this way::" msgstr "" -#: ../../library/stdtypes.rst:1008 +#: ../../library/stdtypes.rst:1010 msgid "" "Further explanation is available in the FAQ entry :ref:`faq-multidimensional-" "list`." msgstr "" -#: ../../library/stdtypes.rst:1012 +#: ../../library/stdtypes.rst:1014 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:1017 +#: ../../library/stdtypes.rst:1019 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 " @@ -1342,7 +1347,7 @@ msgid "" "to *j*, the slice is empty." msgstr "" -#: ../../library/stdtypes.rst:1024 +#: ../../library/stdtypes.rst:1026 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 " @@ -1355,7 +1360,7 @@ msgid "" "``None``, it is treated like ``1``." msgstr "" -#: ../../library/stdtypes.rst:1035 +#: ../../library/stdtypes.rst:1037 msgid "" "Concatenating immutable sequences always results in a new object. This " "means that building up a sequence by repeated concatenation will have a " @@ -1363,14 +1368,14 @@ msgid "" "runtime cost, you must switch to one of the alternatives below:" msgstr "" -#: ../../library/stdtypes.rst:1040 +#: ../../library/stdtypes.rst:1042 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:1044 +#: ../../library/stdtypes.rst:1046 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 :" @@ -1378,22 +1383,22 @@ msgid "" "an efficient overallocation mechanism" msgstr "" -#: ../../library/stdtypes.rst:1049 +#: ../../library/stdtypes.rst:1051 msgid "if concatenating :class:`tuple` objects, extend a :class:`list` instead" msgstr "" -#: ../../library/stdtypes.rst:1051 +#: ../../library/stdtypes.rst:1053 msgid "for other types, investigate the relevant class documentation" msgstr "" -#: ../../library/stdtypes.rst:1055 +#: ../../library/stdtypes.rst:1057 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:1060 +#: ../../library/stdtypes.rst:1062 msgid "" "``index`` raises :exc:`ValueError` when *x* is not found in *s*. Not all " "implementations support passing the additional arguments *i* and *j*. These " @@ -1403,42 +1408,42 @@ msgid "" "start of the sequence rather than the start of the slice." msgstr "" -#: ../../library/stdtypes.rst:1071 +#: ../../library/stdtypes.rst:1073 msgid "Immutable Sequence Types" msgstr "" -#: ../../library/stdtypes.rst:1078 +#: ../../library/stdtypes.rst:1080 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:1082 +#: ../../library/stdtypes.rst:1084 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:1086 +#: ../../library/stdtypes.rst:1088 msgid "" "Attempting to hash an immutable sequence that contains unhashable values " "will result in :exc:`TypeError`." msgstr "" -#: ../../library/stdtypes.rst:1093 +#: ../../library/stdtypes.rst:1095 msgid "Mutable Sequence Types" msgstr "" -#: ../../library/stdtypes.rst:1100 +#: ../../library/stdtypes.rst:1102 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:1104 +#: ../../library/stdtypes.rst:1106 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 " @@ -1446,145 +1451,145 @@ msgid "" "integers that meet the value restriction ``0 <= x <= 255``)." msgstr "" -#: ../../library/stdtypes.rst:1128 +#: ../../library/stdtypes.rst:1130 msgid "``s[i] = x``" msgstr "``s[i] = x``" -#: ../../library/stdtypes.rst:1128 +#: ../../library/stdtypes.rst:1130 msgid "item *i* of *s* is replaced by *x*" msgstr "" -#: ../../library/stdtypes.rst:1131 +#: ../../library/stdtypes.rst:1133 msgid "``s[i:j] = t``" msgstr "``s[i:j] = t``" -#: ../../library/stdtypes.rst:1131 +#: ../../library/stdtypes.rst:1133 msgid "" "slice of *s* from *i* to *j* is replaced by the contents of the iterable *t*" msgstr "" -#: ../../library/stdtypes.rst:1135 +#: ../../library/stdtypes.rst:1137 msgid "``del s[i:j]``" msgstr "``del s[i:j]``" -#: ../../library/stdtypes.rst:1135 +#: ../../library/stdtypes.rst:1137 msgid "same as ``s[i:j] = []``" msgstr "" -#: ../../library/stdtypes.rst:1137 +#: ../../library/stdtypes.rst:1139 msgid "``s[i:j:k] = t``" msgstr "``s[i:j:k] = t``" -#: ../../library/stdtypes.rst:1137 +#: ../../library/stdtypes.rst:1139 msgid "the elements of ``s[i:j:k]`` are replaced by those of *t*" msgstr "" -#: ../../library/stdtypes.rst:1140 +#: ../../library/stdtypes.rst:1142 msgid "``del s[i:j:k]``" msgstr "``del s[i:j:k]``" -#: ../../library/stdtypes.rst:1140 +#: ../../library/stdtypes.rst:1142 msgid "removes the elements of ``s[i:j:k]`` from the list" msgstr "" -#: ../../library/stdtypes.rst:1143 +#: ../../library/stdtypes.rst:1145 msgid "``s.append(x)``" msgstr "``s.append(x)``" -#: ../../library/stdtypes.rst:1143 +#: ../../library/stdtypes.rst:1145 msgid "" "appends *x* to the end of the sequence (same as ``s[len(s):len(s)] = [x]``)" msgstr "" -#: ../../library/stdtypes.rst:1147 +#: ../../library/stdtypes.rst:1149 msgid "``s.clear()``" msgstr "``s.clear()``" -#: ../../library/stdtypes.rst:1147 +#: ../../library/stdtypes.rst:1149 msgid "removes all items from *s* (same as ``del s[:]``)" msgstr "" -#: ../../library/stdtypes.rst:1150 +#: ../../library/stdtypes.rst:1152 msgid "``s.copy()``" msgstr "``s.copy()``" -#: ../../library/stdtypes.rst:1150 +#: ../../library/stdtypes.rst:1152 msgid "creates a shallow copy of *s* (same as ``s[:]``)" msgstr "" -#: ../../library/stdtypes.rst:1153 +#: ../../library/stdtypes.rst:1155 msgid "``s.extend(t)`` or ``s += t``" msgstr "``s.extend(t)`` 或 ``s += t``" -#: ../../library/stdtypes.rst:1153 +#: ../../library/stdtypes.rst:1155 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:1158 +#: ../../library/stdtypes.rst:1160 msgid "``s *= n``" msgstr "``s *= n``" -#: ../../library/stdtypes.rst:1158 +#: ../../library/stdtypes.rst:1160 msgid "updates *s* with its contents repeated *n* times" msgstr "" -#: ../../library/stdtypes.rst:1161 +#: ../../library/stdtypes.rst:1163 msgid "``s.insert(i, x)``" msgstr "``s.insert(i, x)``" -#: ../../library/stdtypes.rst:1161 +#: ../../library/stdtypes.rst:1163 msgid "" "inserts *x* into *s* at the index given by *i* (same as ``s[i:i] = [x]``)" msgstr "" -#: ../../library/stdtypes.rst:1165 +#: ../../library/stdtypes.rst:1167 msgid "``s.pop()`` or ``s.pop(i)``" msgstr "``s.pop()`` 或 ``s.pop(i)``" -#: ../../library/stdtypes.rst:1165 +#: ../../library/stdtypes.rst:1167 msgid "retrieves the item at *i* and also removes it from *s*" msgstr "" -#: ../../library/stdtypes.rst:1168 +#: ../../library/stdtypes.rst:1170 msgid "``s.remove(x)``" msgstr "``s.remove(x)``" -#: ../../library/stdtypes.rst:1168 +#: ../../library/stdtypes.rst:1170 msgid "remove the first item from *s* where ``s[i]`` is equal to *x*" msgstr "" -#: ../../library/stdtypes.rst:1171 +#: ../../library/stdtypes.rst:1173 msgid "``s.reverse()``" msgstr "``s.reverse()``" -#: ../../library/stdtypes.rst:1171 +#: ../../library/stdtypes.rst:1173 msgid "reverses the items of *s* in place" msgstr "" -#: ../../library/stdtypes.rst:1179 +#: ../../library/stdtypes.rst:1181 msgid "*t* must have the same length as the slice it is replacing." msgstr "" -#: ../../library/stdtypes.rst:1182 +#: ../../library/stdtypes.rst:1184 msgid "" "The optional argument *i* defaults to ``-1``, so that by default the last " "item is removed and returned." msgstr "" -#: ../../library/stdtypes.rst:1186 +#: ../../library/stdtypes.rst:1188 msgid ":meth:`remove` raises :exc:`ValueError` when *x* is not found in *s*." msgstr "" -#: ../../library/stdtypes.rst:1189 +#: ../../library/stdtypes.rst:1191 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:1194 +#: ../../library/stdtypes.rst:1196 msgid "" ":meth:`clear` and :meth:`!copy` are included for consistency with the " "interfaces of mutable containers that don't support slicing operations (such " @@ -1593,11 +1598,11 @@ msgid "" "classes provide it." msgstr "" -#: ../../library/stdtypes.rst:1200 +#: ../../library/stdtypes.rst:1202 msgid ":meth:`clear` and :meth:`!copy` methods." msgstr "" -#: ../../library/stdtypes.rst:1204 +#: ../../library/stdtypes.rst:1206 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 " @@ -1605,39 +1610,39 @@ msgid "" "explained for ``s * n`` under :ref:`typesseq-common`." msgstr "" -#: ../../library/stdtypes.rst:1213 +#: ../../library/stdtypes.rst:1215 msgid "Lists" msgstr "List(串列)" -#: ../../library/stdtypes.rst:1217 +#: ../../library/stdtypes.rst:1219 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:1223 +#: ../../library/stdtypes.rst:1225 msgid "Lists may be constructed in several ways:" msgstr "" -#: ../../library/stdtypes.rst:1225 +#: ../../library/stdtypes.rst:1227 msgid "Using a pair of square brackets to denote the empty list: ``[]``" msgstr "" -#: ../../library/stdtypes.rst:1226 +#: ../../library/stdtypes.rst:1228 msgid "" "Using square brackets, separating items with commas: ``[a]``, ``[a, b, c]``" msgstr "" -#: ../../library/stdtypes.rst:1227 +#: ../../library/stdtypes.rst:1229 msgid "Using a list comprehension: ``[x for x in iterable]``" msgstr "" -#: ../../library/stdtypes.rst:1228 +#: ../../library/stdtypes.rst:1230 msgid "Using the type constructor: ``list()`` or ``list(iterable)``" msgstr "" -#: ../../library/stdtypes.rst:1230 +#: ../../library/stdtypes.rst:1232 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 " @@ -1648,20 +1653,20 @@ msgid "" "new empty list, ``[]``." msgstr "" -#: ../../library/stdtypes.rst:1239 +#: ../../library/stdtypes.rst:1241 msgid "" "Many other operations also produce lists, including the :func:`sorted` built-" "in." msgstr "" -#: ../../library/stdtypes.rst:1242 +#: ../../library/stdtypes.rst:1244 msgid "" "Lists implement all of the :ref:`common ` and :ref:`mutable " "` sequence operations. Lists also provide the following " "additional method:" msgstr "" -#: ../../library/stdtypes.rst:1248 +#: ../../library/stdtypes.rst:1250 msgid "" "This method sorts the list in place, using only ``<`` comparisons between " "items. Exceptions are not suppressed - if any comparison operations fail, " @@ -1669,13 +1674,13 @@ msgid "" "partially modified state)." msgstr "" -#: ../../library/stdtypes.rst:1253 +#: ../../library/stdtypes.rst:1255 msgid "" ":meth:`sort` accepts two arguments that can only be passed by keyword (:ref:" "`keyword-only arguments `):" msgstr "" -#: ../../library/stdtypes.rst:1256 +#: ../../library/stdtypes.rst:1258 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 " @@ -1684,19 +1689,19 @@ msgid "" "list items are sorted directly without calculating a separate key value." msgstr "" -#: ../../library/stdtypes.rst:1263 +#: ../../library/stdtypes.rst:1265 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:1266 +#: ../../library/stdtypes.rst:1268 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:1269 +#: ../../library/stdtypes.rst:1271 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 " @@ -1704,7 +1709,7 @@ msgid "" "new sorted list instance)." msgstr "" -#: ../../library/stdtypes.rst:1274 +#: ../../library/stdtypes.rst:1276 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 " @@ -1712,12 +1717,12 @@ msgid "" "department, then by salary grade)." msgstr "" -#: ../../library/stdtypes.rst:1279 +#: ../../library/stdtypes.rst:1281 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/stdtypes.rst:1283 +#: ../../library/stdtypes.rst:1285 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 " @@ -1725,11 +1730,11 @@ msgid "" "detect that the list has been mutated during a sort." msgstr "" -#: ../../library/stdtypes.rst:1292 +#: ../../library/stdtypes.rst:1294 msgid "Tuples" msgstr "" -#: ../../library/stdtypes.rst:1296 +#: ../../library/stdtypes.rst:1298 msgid "" "Tuples are immutable sequences, typically used to store collections of " "heterogeneous data (such as the 2-tuples produced by the :func:`enumerate` " @@ -1738,27 +1743,27 @@ msgid "" "class:`dict` instance)." msgstr "" -#: ../../library/stdtypes.rst:1304 +#: ../../library/stdtypes.rst:1306 msgid "Tuples may be constructed in a number of ways:" msgstr "" -#: ../../library/stdtypes.rst:1306 +#: ../../library/stdtypes.rst:1308 msgid "Using a pair of parentheses to denote the empty tuple: ``()``" msgstr "" -#: ../../library/stdtypes.rst:1307 +#: ../../library/stdtypes.rst:1309 msgid "Using a trailing comma for a singleton tuple: ``a,`` or ``(a,)``" msgstr "" -#: ../../library/stdtypes.rst:1308 +#: ../../library/stdtypes.rst:1310 msgid "Separating items with commas: ``a, b, c`` or ``(a, b, c)``" msgstr "" -#: ../../library/stdtypes.rst:1309 +#: ../../library/stdtypes.rst:1311 msgid "Using the :func:`tuple` built-in: ``tuple()`` or ``tuple(iterable)``" msgstr "" -#: ../../library/stdtypes.rst:1311 +#: ../../library/stdtypes.rst:1313 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 " @@ -1769,7 +1774,7 @@ msgid "" "``()``." msgstr "" -#: ../../library/stdtypes.rst:1319 +#: ../../library/stdtypes.rst:1321 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 " @@ -1778,30 +1783,30 @@ msgid "" "call with a 3-tuple as the sole argument." msgstr "" -#: ../../library/stdtypes.rst:1325 +#: ../../library/stdtypes.rst:1327 msgid "" "Tuples implement all of the :ref:`common ` sequence " "operations." msgstr "" -#: ../../library/stdtypes.rst:1328 +#: ../../library/stdtypes.rst:1330 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:1336 +#: ../../library/stdtypes.rst:1338 msgid "Ranges" msgstr "" -#: ../../library/stdtypes.rst:1340 +#: ../../library/stdtypes.rst:1342 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:1347 +#: ../../library/stdtypes.rst:1349 msgid "" "The arguments to the range constructor must be integers (either built-in :" "class:`int` or any object that implements the :meth:`~object.__index__` " @@ -1810,38 +1815,38 @@ msgid "" "zero, :exc:`ValueError` is raised." msgstr "" -#: ../../library/stdtypes.rst:1353 +#: ../../library/stdtypes.rst:1355 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:1357 +#: ../../library/stdtypes.rst:1359 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:1361 +#: ../../library/stdtypes.rst:1363 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:1366 +#: ../../library/stdtypes.rst:1368 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:1370 +#: ../../library/stdtypes.rst:1372 msgid "Range examples::" msgstr "" -#: ../../library/stdtypes.rst:1387 +#: ../../library/stdtypes.rst:1389 msgid "" "Ranges implement all of the :ref:`common ` sequence " "operations except concatenation and repetition (due to the fact that range " @@ -1849,23 +1854,23 @@ msgid "" "repetition and concatenation will usually violate that pattern)." msgstr "" -#: ../../library/stdtypes.rst:1394 +#: ../../library/stdtypes.rst:1396 msgid "" "The value of the *start* parameter (or ``0`` if the parameter was not " "supplied)" msgstr "" -#: ../../library/stdtypes.rst:1399 +#: ../../library/stdtypes.rst:1401 msgid "The value of the *stop* parameter" msgstr "" -#: ../../library/stdtypes.rst:1403 +#: ../../library/stdtypes.rst:1405 msgid "" "The value of the *step* parameter (or ``1`` if the parameter was not " "supplied)" msgstr "" -#: ../../library/stdtypes.rst:1406 +#: ../../library/stdtypes.rst:1408 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 " @@ -1874,14 +1879,14 @@ msgid "" "individual items and subranges as needed)." msgstr "" -#: ../../library/stdtypes.rst:1412 +#: ../../library/stdtypes.rst:1414 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:1432 +#: ../../library/stdtypes.rst:1434 msgid "" "Testing range objects for equality with ``==`` and ``!=`` compares them as " "sequences. That is, two range objects are considered equal if they " @@ -1891,111 +1896,111 @@ msgid "" "3)`` or ``range(0, 3, 2) == range(0, 4, 2)``.)" msgstr "" -#: ../../library/stdtypes.rst:1439 +#: ../../library/stdtypes.rst:1441 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:1445 +#: ../../library/stdtypes.rst:1447 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:1450 +#: ../../library/stdtypes.rst:1452 msgid "" "The :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step` " "attributes." msgstr "" -#: ../../library/stdtypes.rst:1456 +#: ../../library/stdtypes.rst:1458 msgid "" "The `linspace recipe `_ shows " "how to implement a lazy version of range suitable for floating point " "applications." msgstr "" -#: ../../library/stdtypes.rst:1468 +#: ../../library/stdtypes.rst:1470 msgid "Text Sequence Type --- :class:`str`" msgstr "" -#: ../../library/stdtypes.rst:1470 +#: ../../library/stdtypes.rst:1472 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:1475 +#: ../../library/stdtypes.rst:1477 msgid "Single quotes: ``'allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:1476 +#: ../../library/stdtypes.rst:1478 msgid "Double quotes: ``\"allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:1477 +#: ../../library/stdtypes.rst:1479 msgid "" "Triple quoted: ``'''Three single quotes'''``, ``\"\"\"Three double " "quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:1479 +#: ../../library/stdtypes.rst:1481 msgid "" "Triple quoted strings may span multiple lines - all associated whitespace " "will be included in the string literal." msgstr "" -#: ../../library/stdtypes.rst:1482 +#: ../../library/stdtypes.rst:1484 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:1486 +#: ../../library/stdtypes.rst:1488 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:1490 +#: ../../library/stdtypes.rst:1492 msgid "" "Strings may also be created from other objects using the :class:`str` " "constructor." msgstr "" -#: ../../library/stdtypes.rst:1493 +#: ../../library/stdtypes.rst:1495 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:1499 +#: ../../library/stdtypes.rst:1501 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:1503 +#: ../../library/stdtypes.rst:1505 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:1515 +#: ../../library/stdtypes.rst:1517 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:1519 +#: ../../library/stdtypes.rst:1521 msgid "" "If neither *encoding* nor *errors* is given, ``str(object)`` returns :meth:" "`type(object).__str__(object) `, which is the \"informal\" " @@ -2005,7 +2010,7 @@ msgid "" "`repr(object) `." msgstr "" -#: ../../library/stdtypes.rst:1531 +#: ../../library/stdtypes.rst:1533 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 " @@ -2017,7 +2022,7 @@ msgid "" "buffer objects." msgstr "" -#: ../../library/stdtypes.rst:1540 +#: ../../library/stdtypes.rst:1542 msgid "" "Passing a :class:`bytes` object to :func:`str` without the *encoding* or " "*errors* arguments falls under the first case of returning the informal " @@ -2025,7 +2030,7 @@ msgid "" "Python). For example::" msgstr "" -#: ../../library/stdtypes.rst:1548 +#: ../../library/stdtypes.rst:1550 msgid "" "For more information on the ``str`` class and its methods, see :ref:" "`textseq` and the :ref:`string-methods` section below. To output formatted " @@ -2033,17 +2038,17 @@ msgid "" "addition, see the :ref:`stringservices` section." msgstr "" -#: ../../library/stdtypes.rst:1560 +#: ../../library/stdtypes.rst:1562 msgid "String Methods" msgstr "" -#: ../../library/stdtypes.rst:1565 +#: ../../library/stdtypes.rst:1567 msgid "" "Strings implement all of the :ref:`common ` sequence " "operations, along with the additional methods described below." msgstr "" -#: ../../library/stdtypes.rst:1568 +#: ../../library/stdtypes.rst:1570 msgid "" "Strings also support two styles of string formatting, one providing a large " "degree of flexibility and customization (see :meth:`str.format`, :ref:" @@ -2053,33 +2058,33 @@ msgid "" "handle (:ref:`old-string-formatting`)." msgstr "" -#: ../../library/stdtypes.rst:1575 +#: ../../library/stdtypes.rst:1577 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:1581 +#: ../../library/stdtypes.rst:1583 msgid "" "Return a copy of the string with its first character capitalized and the " "rest lowercased." msgstr "" -#: ../../library/stdtypes.rst:1584 +#: ../../library/stdtypes.rst:1586 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:1591 +#: ../../library/stdtypes.rst:1593 msgid "" "Return a casefolded copy of the string. Casefolded strings may be used for " "caseless matching." msgstr "" -#: ../../library/stdtypes.rst:1594 +#: ../../library/stdtypes.rst:1596 msgid "" "Casefolding is similar to lowercasing but more aggressive because it is " "intended to remove all case distinctions in a string. For example, the " @@ -2088,43 +2093,43 @@ msgid "" "`casefold` converts it to ``\"ss\"``." msgstr "" -#: ../../library/stdtypes.rst:1600 +#: ../../library/stdtypes.rst:1602 msgid "" "The casefolding algorithm is described in section 3.13 of the Unicode " "Standard." msgstr "" -#: ../../library/stdtypes.rst:1608 +#: ../../library/stdtypes.rst:1610 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:1616 +#: ../../library/stdtypes.rst:1618 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:1620 +#: ../../library/stdtypes.rst:1622 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:1626 +#: ../../library/stdtypes.rst:1628 msgid "Return the string encoded to :class:`bytes`." msgstr "" -#: ../../library/stdtypes.rst:1628 ../../library/stdtypes.rst:2763 +#: ../../library/stdtypes.rst:1630 ../../library/stdtypes.rst:2765 msgid "" "*encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for " "possible values." msgstr "" -#: ../../library/stdtypes.rst:1631 +#: ../../library/stdtypes.rst:1633 msgid "" "*errors* controls how encoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -2133,24 +2138,24 @@ msgid "" "register_error`. See :ref:`error-handlers` for details." msgstr "" -#: ../../library/stdtypes.rst:1638 +#: ../../library/stdtypes.rst:1640 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:1643 ../../library/stdtypes.rst:2782 +#: ../../library/stdtypes.rst:1645 ../../library/stdtypes.rst:2784 msgid "Added support for keyword arguments." msgstr "新增關鍵字引數的支援。" -#: ../../library/stdtypes.rst:1646 ../../library/stdtypes.rst:2785 +#: ../../library/stdtypes.rst:1648 ../../library/stdtypes.rst:2787 msgid "" "The value of the *errors* argument is now checked in :ref:`devmode` and in :" "ref:`debug mode `." msgstr "" -#: ../../library/stdtypes.rst:1653 +#: ../../library/stdtypes.rst:1655 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. " @@ -2158,7 +2163,7 @@ msgid "" "*end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:1661 +#: ../../library/stdtypes.rst:1663 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 " @@ -2174,21 +2179,21 @@ msgid "" "printed." msgstr "" -#: ../../library/stdtypes.rst:1682 +#: ../../library/stdtypes.rst:1684 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:1688 +#: ../../library/stdtypes.rst:1690 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:1698 +#: ../../library/stdtypes.rst:1700 msgid "" "Perform a string formatting operation. The string on which this method is " "called can contain literal text or replacement fields delimited by braces " @@ -2198,13 +2203,13 @@ msgid "" "the corresponding argument." msgstr "" -#: ../../library/stdtypes.rst:1708 +#: ../../library/stdtypes.rst:1710 msgid "" "See :ref:`formatstrings` for a description of the various formatting options " "that can be specified in format strings." msgstr "" -#: ../../library/stdtypes.rst:1712 +#: ../../library/stdtypes.rst:1714 msgid "" "When formatting a number (:class:`int`, :class:`float`, :class:`complex`, :" "class:`decimal.Decimal` and subclasses) with the ``n`` type (ex: ``'{:n}'." @@ -2215,26 +2220,26 @@ msgid "" "This temporary change affects other threads." msgstr "" -#: ../../library/stdtypes.rst:1721 +#: ../../library/stdtypes.rst:1723 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:1729 +#: ../../library/stdtypes.rst:1731 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:1745 +#: ../../library/stdtypes.rst:1747 msgid "" "Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is " "not found." msgstr "" -#: ../../library/stdtypes.rst:1751 +#: ../../library/stdtypes.rst:1753 msgid "" "Return ``True`` if all characters in the string are alphanumeric and there " "is at least one character, ``False`` otherwise. A character ``c`` is " @@ -2242,7 +2247,7 @@ msgid "" "isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``." msgstr "" -#: ../../library/stdtypes.rst:1759 +#: ../../library/stdtypes.rst:1761 msgid "" "Return ``True`` if all characters in the string are alphabetic and there is " "at least one character, ``False`` otherwise. Alphabetic characters are " @@ -2252,14 +2257,14 @@ msgid "" "\"Alphabetic\" property defined in the Unicode Standard." msgstr "" -#: ../../library/stdtypes.rst:1768 +#: ../../library/stdtypes.rst:1770 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:1777 +#: ../../library/stdtypes.rst:1779 msgid "" "Return ``True`` if all characters in the string are decimal characters and " "there is at least one character, ``False`` otherwise. Decimal characters are " @@ -2268,7 +2273,7 @@ msgid "" "General Category \"Nd\"." msgstr "" -#: ../../library/stdtypes.rst:1787 +#: ../../library/stdtypes.rst:1789 msgid "" "Return ``True`` if all characters in the string are digits and there is at " "least one character, ``False`` otherwise. Digits include decimal characters " @@ -2278,32 +2283,32 @@ msgid "" "property value Numeric_Type=Digit or Numeric_Type=Decimal." msgstr "" -#: ../../library/stdtypes.rst:1797 +#: ../../library/stdtypes.rst:1799 msgid "" "Return ``True`` if the string is a valid identifier according to the " "language definition, section :ref:`identifiers`." msgstr "" -#: ../../library/stdtypes.rst:1800 +#: ../../library/stdtypes.rst:1802 msgid "" "Call :func:`keyword.iskeyword` to test whether string ``s`` is a reserved " "identifier, such as :keyword:`def` and :keyword:`class`." msgstr "" -#: ../../library/stdtypes.rst:1803 +#: ../../library/stdtypes.rst:1805 msgid "Example: ::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/stdtypes.rst:1816 +#: ../../library/stdtypes.rst:1818 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:1822 +#: ../../library/stdtypes.rst:1824 msgid "" "Return ``True`` if all characters in the string are numeric characters, and " "there is at least one character, ``False`` otherwise. Numeric characters " @@ -2313,7 +2318,7 @@ msgid "" "Numeric_Type=Decimal or Numeric_Type=Numeric." msgstr "" -#: ../../library/stdtypes.rst:1832 +#: ../../library/stdtypes.rst:1834 msgid "" "Return ``True`` if all characters in the string are printable or the string " "is empty, ``False`` otherwise. Nonprintable characters are those characters " @@ -2324,20 +2329,20 @@ msgid "" "of strings written to :data:`sys.stdout` or :data:`sys.stderr`.)" msgstr "" -#: ../../library/stdtypes.rst:1843 +#: ../../library/stdtypes.rst:1845 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:1846 +#: ../../library/stdtypes.rst:1848 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:1854 +#: ../../library/stdtypes.rst:1856 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 " @@ -2345,13 +2350,13 @@ msgid "" "otherwise." msgstr "" -#: ../../library/stdtypes.rst:1861 +#: ../../library/stdtypes.rst:1863 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:1879 +#: ../../library/stdtypes.rst:1881 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 " @@ -2359,26 +2364,26 @@ msgid "" "elements is the string providing this method." msgstr "" -#: ../../library/stdtypes.rst:1887 +#: ../../library/stdtypes.rst:1889 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:1894 +#: ../../library/stdtypes.rst:1896 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "lowercase." msgstr "" -#: ../../library/stdtypes.rst:1897 +#: ../../library/stdtypes.rst:1899 msgid "" "The lowercasing algorithm used is described in section 3.13 of the Unicode " "Standard." msgstr "" -#: ../../library/stdtypes.rst:1903 +#: ../../library/stdtypes.rst:1905 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 " @@ -2387,19 +2392,19 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:1913 +#: ../../library/stdtypes.rst:1915 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:1924 +#: ../../library/stdtypes.rst:1926 msgid "" "This static method returns a translation table usable for :meth:`str." "translate`." msgstr "" -#: ../../library/stdtypes.rst:1926 +#: ../../library/stdtypes.rst:1928 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, " @@ -2407,7 +2412,7 @@ msgid "" "converted to ordinals." msgstr "" -#: ../../library/stdtypes.rst:1931 +#: ../../library/stdtypes.rst:1933 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 " @@ -2415,7 +2420,7 @@ msgid "" "whose characters will be mapped to ``None`` in the result." msgstr "" -#: ../../library/stdtypes.rst:1939 +#: ../../library/stdtypes.rst:1941 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 " @@ -2423,47 +2428,47 @@ msgid "" "containing the string itself, followed by two empty strings." msgstr "" -#: ../../library/stdtypes.rst:1947 +#: ../../library/stdtypes.rst:1949 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:1961 +#: ../../library/stdtypes.rst:1963 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:1975 +#: ../../library/stdtypes.rst:1977 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:1982 +#: ../../library/stdtypes.rst:1984 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:1989 +#: ../../library/stdtypes.rst:1991 msgid "" "Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is " "not found." msgstr "" -#: ../../library/stdtypes.rst:1995 +#: ../../library/stdtypes.rst:1997 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:2002 +#: ../../library/stdtypes.rst:2004 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 " @@ -2471,7 +2476,7 @@ msgid "" "containing two empty strings, followed by the string itself." msgstr "" -#: ../../library/stdtypes.rst:2010 +#: ../../library/stdtypes.rst:2012 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 " @@ -2480,7 +2485,7 @@ msgid "" "behaves like :meth:`split` which is described in detail below." msgstr "" -#: ../../library/stdtypes.rst:2019 +#: ../../library/stdtypes.rst:2021 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 " @@ -2489,13 +2494,13 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2029 +#: ../../library/stdtypes.rst:2031 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:2039 +#: ../../library/stdtypes.rst:2041 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, " @@ -2504,7 +2509,7 @@ msgid "" "possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:2045 +#: ../../library/stdtypes.rst:2047 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns " @@ -2513,23 +2518,23 @@ msgid "" "Splitting an empty string with a specified separator returns ``['']``." msgstr "" -#: ../../library/stdtypes.rst:2051 ../../library/stdtypes.rst:2067 -#: ../../library/stdtypes.rst:2119 ../../library/stdtypes.rst:2187 -#: ../../library/stdtypes.rst:2254 ../../library/stdtypes.rst:3101 -#: ../../library/stdtypes.rst:3117 ../../library/stdtypes.rst:3208 -#: ../../library/stdtypes.rst:3224 ../../library/stdtypes.rst:3249 -#: ../../library/stdtypes.rst:3263 ../../library/stdtypes.rst:3291 -#: ../../library/stdtypes.rst:3305 ../../library/stdtypes.rst:3323 -#: ../../library/stdtypes.rst:3350 ../../library/stdtypes.rst:3373 -#: ../../library/stdtypes.rst:3400 ../../library/stdtypes.rst:3442 -#: ../../library/stdtypes.rst:3466 +#: ../../library/stdtypes.rst:2053 ../../library/stdtypes.rst:2069 +#: ../../library/stdtypes.rst:2121 ../../library/stdtypes.rst:2189 +#: ../../library/stdtypes.rst:2256 ../../library/stdtypes.rst:3103 +#: ../../library/stdtypes.rst:3119 ../../library/stdtypes.rst:3210 +#: ../../library/stdtypes.rst:3226 ../../library/stdtypes.rst:3251 +#: ../../library/stdtypes.rst:3265 ../../library/stdtypes.rst:3293 +#: ../../library/stdtypes.rst:3307 ../../library/stdtypes.rst:3325 +#: ../../library/stdtypes.rst:3352 ../../library/stdtypes.rst:3375 +#: ../../library/stdtypes.rst:3402 ../../library/stdtypes.rst:3444 +#: ../../library/stdtypes.rst:3468 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/stdtypes.rst:2060 +#: ../../library/stdtypes.rst:2062 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, " @@ -2539,131 +2544,131 @@ msgid "" "returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:2082 +#: ../../library/stdtypes.rst:2084 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:2086 +#: ../../library/stdtypes.rst:2088 msgid "" "This method splits on the following line boundaries. In particular, the " "boundaries are a superset of :term:`universal newlines`." msgstr "" -#: ../../library/stdtypes.rst:2090 +#: ../../library/stdtypes.rst:2092 msgid "Representation" msgstr "" -#: ../../library/stdtypes.rst:2090 +#: ../../library/stdtypes.rst:2092 msgid "Description" msgstr "描述" -#: ../../library/stdtypes.rst:2092 +#: ../../library/stdtypes.rst:2094 msgid "``\\n``" msgstr "``\\n``" -#: ../../library/stdtypes.rst:2092 +#: ../../library/stdtypes.rst:2094 msgid "Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2094 +#: ../../library/stdtypes.rst:2096 msgid "``\\r``" msgstr "``\\r``" -#: ../../library/stdtypes.rst:2094 +#: ../../library/stdtypes.rst:2096 msgid "Carriage Return" msgstr "" -#: ../../library/stdtypes.rst:2096 +#: ../../library/stdtypes.rst:2098 msgid "``\\r\\n``" msgstr "``\\r\\n``" -#: ../../library/stdtypes.rst:2096 +#: ../../library/stdtypes.rst:2098 msgid "Carriage Return + Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2098 +#: ../../library/stdtypes.rst:2100 msgid "``\\v`` or ``\\x0b``" msgstr "``\\v`` 或 ``\\x0b``" -#: ../../library/stdtypes.rst:2098 +#: ../../library/stdtypes.rst:2100 msgid "Line Tabulation" msgstr "" -#: ../../library/stdtypes.rst:2100 +#: ../../library/stdtypes.rst:2102 msgid "``\\f`` or ``\\x0c``" msgstr "``\\f`` 或 ``\\x0c``" -#: ../../library/stdtypes.rst:2100 +#: ../../library/stdtypes.rst:2102 msgid "Form Feed" msgstr "" -#: ../../library/stdtypes.rst:2102 +#: ../../library/stdtypes.rst:2104 msgid "``\\x1c``" msgstr "``\\x1c``" -#: ../../library/stdtypes.rst:2102 +#: ../../library/stdtypes.rst:2104 msgid "File Separator" msgstr "" -#: ../../library/stdtypes.rst:2104 +#: ../../library/stdtypes.rst:2106 msgid "``\\x1d``" msgstr "``\\x1d``" -#: ../../library/stdtypes.rst:2104 +#: ../../library/stdtypes.rst:2106 msgid "Group Separator" msgstr "" -#: ../../library/stdtypes.rst:2106 +#: ../../library/stdtypes.rst:2108 msgid "``\\x1e``" msgstr "``\\x1e``" -#: ../../library/stdtypes.rst:2106 +#: ../../library/stdtypes.rst:2108 msgid "Record Separator" msgstr "" -#: ../../library/stdtypes.rst:2108 +#: ../../library/stdtypes.rst:2110 msgid "``\\x85``" msgstr "``\\x85``" -#: ../../library/stdtypes.rst:2108 +#: ../../library/stdtypes.rst:2110 msgid "Next Line (C1 Control Code)" msgstr "" -#: ../../library/stdtypes.rst:2110 +#: ../../library/stdtypes.rst:2112 msgid "``\\u2028``" msgstr "``\\u2028``" -#: ../../library/stdtypes.rst:2110 +#: ../../library/stdtypes.rst:2112 msgid "Line Separator" msgstr "" -#: ../../library/stdtypes.rst:2112 +#: ../../library/stdtypes.rst:2114 msgid "``\\u2029``" msgstr "``\\u2029``" -#: ../../library/stdtypes.rst:2112 +#: ../../library/stdtypes.rst:2114 msgid "Paragraph Separator" msgstr "" -#: ../../library/stdtypes.rst:2117 +#: ../../library/stdtypes.rst:2119 msgid "``\\v`` and ``\\f`` added to list of line boundaries." msgstr "" -#: ../../library/stdtypes.rst:2126 +#: ../../library/stdtypes.rst:2128 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:2135 +#: ../../library/stdtypes.rst:2137 msgid "For comparison, ``split('\\n')`` gives::" msgstr "" -#: ../../library/stdtypes.rst:2145 +#: ../../library/stdtypes.rst:2147 msgid "" "Return ``True`` if string starts with the *prefix*, otherwise return " "``False``. *prefix* can also be a tuple of prefixes to look for. With " @@ -2671,7 +2676,7 @@ msgid "" "*end*, stop comparing string at that position." msgstr "" -#: ../../library/stdtypes.rst:2153 +#: ../../library/stdtypes.rst:2155 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 " @@ -2680,7 +2685,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2164 +#: ../../library/stdtypes.rst:2166 msgid "" "The outermost leading and trailing *chars* argument values are stripped from " "the string. Characters are removed from the leading end until reaching a " @@ -2688,20 +2693,20 @@ msgid "" "A similar action takes place on the trailing end. For example::" msgstr "" -#: ../../library/stdtypes.rst:2177 +#: ../../library/stdtypes.rst:2179 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:2184 +#: ../../library/stdtypes.rst:2186 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:2192 ../../library/stdtypes.rst:3410 +#: ../../library/stdtypes.rst:2194 ../../library/stdtypes.rst:3412 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 " @@ -2709,19 +2714,19 @@ msgid "" "which may not be the desired result::" msgstr "" -#: ../../library/stdtypes.rst:2200 +#: ../../library/stdtypes.rst:2202 msgid "" "The :func:`string.capwords` function does not have this problem, as it " "splits words on spaces only." msgstr "" -#: ../../library/stdtypes.rst:2203 +#: ../../library/stdtypes.rst:2205 msgid "" "Alternatively, a workaround for apostrophes can be constructed using regular " "expressions::" msgstr "" -#: ../../library/stdtypes.rst:2218 +#: ../../library/stdtypes.rst:2220 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 " @@ -2733,19 +2738,19 @@ msgid "" "exception, to map the character to itself." msgstr "" -#: ../../library/stdtypes.rst:2227 +#: ../../library/stdtypes.rst:2229 msgid "" "You can use :meth:`str.maketrans` to create a translation map from character-" "to-character mappings in different formats." msgstr "" -#: ../../library/stdtypes.rst:2230 +#: ../../library/stdtypes.rst:2232 msgid "" "See also the :mod:`codecs` module for a more flexible approach to custom " "character mappings." msgstr "" -#: ../../library/stdtypes.rst:2236 +#: ../../library/stdtypes.rst:2238 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`` " @@ -2754,13 +2759,13 @@ msgid "" "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:2242 +#: ../../library/stdtypes.rst:2244 msgid "" "The uppercasing algorithm used is described in section 3.13 of the Unicode " "Standard." msgstr "" -#: ../../library/stdtypes.rst:2248 +#: ../../library/stdtypes.rst:2250 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 " @@ -2768,11 +2773,11 @@ msgid "" "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2266 +#: ../../library/stdtypes.rst:2268 msgid "``printf``-style String Formatting" msgstr "" -#: ../../library/stdtypes.rst:2279 +#: ../../library/stdtypes.rst:2281 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 " @@ -2783,7 +2788,7 @@ msgid "" "or extensibility." msgstr "" -#: ../../library/stdtypes.rst:2287 +#: ../../library/stdtypes.rst:2289 msgid "" "String objects have one unique built-in operation: the ``%`` operator " "(modulo). This is also known as the string *formatting* or *interpolation* " @@ -2793,7 +2798,7 @@ msgid "" "in the C language." msgstr "" -#: ../../library/stdtypes.rst:2293 +#: ../../library/stdtypes.rst:2295 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 " @@ -2801,36 +2806,36 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:2303 ../../library/stdtypes.rst:3521 +#: ../../library/stdtypes.rst:2305 ../../library/stdtypes.rst:3523 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: ../../library/stdtypes.rst:2306 ../../library/stdtypes.rst:3524 +#: ../../library/stdtypes.rst:2308 ../../library/stdtypes.rst:3526 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../library/stdtypes.rst:2308 ../../library/stdtypes.rst:3526 +#: ../../library/stdtypes.rst:2310 ../../library/stdtypes.rst:3528 msgid "" "Mapping key (optional), consisting of a parenthesised sequence of characters " "(for example, ``(somename)``)." msgstr "" -#: ../../library/stdtypes.rst:2311 ../../library/stdtypes.rst:3529 +#: ../../library/stdtypes.rst:2313 ../../library/stdtypes.rst:3531 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: ../../library/stdtypes.rst:2314 ../../library/stdtypes.rst:3532 +#: ../../library/stdtypes.rst:2316 ../../library/stdtypes.rst:3534 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:2318 ../../library/stdtypes.rst:3536 +#: ../../library/stdtypes.rst:2320 ../../library/stdtypes.rst:3538 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. " "If specified as ``'*'`` (an asterisk), the actual precision is read from the " @@ -2838,15 +2843,15 @@ msgid "" "the precision." msgstr "" -#: ../../library/stdtypes.rst:2323 ../../library/stdtypes.rst:3541 +#: ../../library/stdtypes.rst:2325 ../../library/stdtypes.rst:3543 msgid "Length modifier (optional)." msgstr "" -#: ../../library/stdtypes.rst:2325 ../../library/stdtypes.rst:3543 +#: ../../library/stdtypes.rst:2327 ../../library/stdtypes.rst:3545 msgid "Conversion type." msgstr "" -#: ../../library/stdtypes.rst:2327 +#: ../../library/stdtypes.rst:2329 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 " @@ -2854,279 +2859,279 @@ msgid "" "selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:2336 ../../library/stdtypes.rst:3554 +#: ../../library/stdtypes.rst:2338 ../../library/stdtypes.rst:3556 msgid "" "In this case no ``*`` specifiers may occur in a format (since they require a " "sequential parameter list)." msgstr "" -#: ../../library/stdtypes.rst:2339 ../../library/stdtypes.rst:3557 +#: ../../library/stdtypes.rst:2341 ../../library/stdtypes.rst:3559 msgid "The conversion flag characters are:" msgstr "" -#: ../../library/stdtypes.rst:2348 ../../library/stdtypes.rst:3566 +#: ../../library/stdtypes.rst:2350 ../../library/stdtypes.rst:3568 msgid "Flag" msgstr "" -#: ../../library/stdtypes.rst:2350 ../../library/stdtypes.rst:3568 +#: ../../library/stdtypes.rst:2352 ../../library/stdtypes.rst:3570 msgid "``'#'``" msgstr "``'#'``" -#: ../../library/stdtypes.rst:2350 ../../library/stdtypes.rst:3568 +#: ../../library/stdtypes.rst:2352 ../../library/stdtypes.rst:3570 msgid "" "The value conversion will use the \"alternate form\" (where defined below)." msgstr "" -#: ../../library/stdtypes.rst:2353 ../../library/stdtypes.rst:3571 +#: ../../library/stdtypes.rst:2355 ../../library/stdtypes.rst:3573 msgid "``'0'``" msgstr "``'0'``" -#: ../../library/stdtypes.rst:2353 ../../library/stdtypes.rst:3571 +#: ../../library/stdtypes.rst:2355 ../../library/stdtypes.rst:3573 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: ../../library/stdtypes.rst:2355 ../../library/stdtypes.rst:3573 +#: ../../library/stdtypes.rst:2357 ../../library/stdtypes.rst:3575 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/stdtypes.rst:2355 ../../library/stdtypes.rst:3573 +#: ../../library/stdtypes.rst:2357 ../../library/stdtypes.rst:3575 msgid "" "The converted value is left adjusted (overrides the ``'0'`` conversion if " "both are given)." msgstr "" -#: ../../library/stdtypes.rst:2358 ../../library/stdtypes.rst:3576 +#: ../../library/stdtypes.rst:2360 ../../library/stdtypes.rst:3578 msgid "``' '``" msgstr "``' '``" -#: ../../library/stdtypes.rst:2358 ../../library/stdtypes.rst:3576 +#: ../../library/stdtypes.rst:2360 ../../library/stdtypes.rst:3578 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." msgstr "" -#: ../../library/stdtypes.rst:2361 ../../library/stdtypes.rst:3579 +#: ../../library/stdtypes.rst:2363 ../../library/stdtypes.rst:3581 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/stdtypes.rst:2361 ../../library/stdtypes.rst:3579 +#: ../../library/stdtypes.rst:2363 ../../library/stdtypes.rst:3581 msgid "" "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides " "a \"space\" flag)." msgstr "" -#: ../../library/stdtypes.rst:2365 ../../library/stdtypes.rst:3583 +#: ../../library/stdtypes.rst:2367 ../../library/stdtypes.rst:3585 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:2368 ../../library/stdtypes.rst:3586 +#: ../../library/stdtypes.rst:2370 ../../library/stdtypes.rst:3588 msgid "The conversion types are:" msgstr "" -#: ../../library/stdtypes.rst:2371 ../../library/stdtypes.rst:3589 +#: ../../library/stdtypes.rst:2373 ../../library/stdtypes.rst:3591 msgid "Conversion" msgstr "" -#: ../../library/stdtypes.rst:2373 ../../library/stdtypes.rst:3591 +#: ../../library/stdtypes.rst:2375 ../../library/stdtypes.rst:3593 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/stdtypes.rst:2373 ../../library/stdtypes.rst:2375 -#: ../../library/stdtypes.rst:3591 ../../library/stdtypes.rst:3593 +#: ../../library/stdtypes.rst:2375 ../../library/stdtypes.rst:2377 +#: ../../library/stdtypes.rst:3593 ../../library/stdtypes.rst:3595 msgid "Signed integer decimal." msgstr "" -#: ../../library/stdtypes.rst:2375 ../../library/stdtypes.rst:3593 +#: ../../library/stdtypes.rst:2377 ../../library/stdtypes.rst:3595 msgid "``'i'``" msgstr "``'i'``" -#: ../../library/stdtypes.rst:2377 ../../library/stdtypes.rst:3595 +#: ../../library/stdtypes.rst:2379 ../../library/stdtypes.rst:3597 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/stdtypes.rst:2377 ../../library/stdtypes.rst:3595 +#: ../../library/stdtypes.rst:2379 ../../library/stdtypes.rst:3597 msgid "Signed octal value." msgstr "" -#: ../../library/stdtypes.rst:2379 ../../library/stdtypes.rst:3597 +#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:3599 msgid "``'u'``" msgstr "``'u'``" -#: ../../library/stdtypes.rst:2379 ../../library/stdtypes.rst:3597 +#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:3599 msgid "Obsolete type -- it is identical to ``'d'``." msgstr "" -#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:3599 +#: ../../library/stdtypes.rst:2383 ../../library/stdtypes.rst:3601 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:3599 +#: ../../library/stdtypes.rst:2383 ../../library/stdtypes.rst:3601 msgid "Signed hexadecimal (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2383 ../../library/stdtypes.rst:3601 +#: ../../library/stdtypes.rst:2385 ../../library/stdtypes.rst:3603 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/stdtypes.rst:2383 ../../library/stdtypes.rst:3601 +#: ../../library/stdtypes.rst:2385 ../../library/stdtypes.rst:3603 msgid "Signed hexadecimal (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2385 ../../library/stdtypes.rst:3603 +#: ../../library/stdtypes.rst:2387 ../../library/stdtypes.rst:3605 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/stdtypes.rst:2385 ../../library/stdtypes.rst:3603 +#: ../../library/stdtypes.rst:2387 ../../library/stdtypes.rst:3605 msgid "Floating point exponential format (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2387 ../../library/stdtypes.rst:3605 +#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:3607 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/stdtypes.rst:2387 ../../library/stdtypes.rst:3605 +#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:3607 msgid "Floating point exponential format (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:3607 +#: ../../library/stdtypes.rst:2391 ../../library/stdtypes.rst:3609 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:2391 -#: ../../library/stdtypes.rst:3607 ../../library/stdtypes.rst:3609 +#: ../../library/stdtypes.rst:2391 ../../library/stdtypes.rst:2393 +#: ../../library/stdtypes.rst:3609 ../../library/stdtypes.rst:3611 msgid "Floating point decimal format." msgstr "" -#: ../../library/stdtypes.rst:2391 ../../library/stdtypes.rst:3609 +#: ../../library/stdtypes.rst:2393 ../../library/stdtypes.rst:3611 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/stdtypes.rst:2393 ../../library/stdtypes.rst:3611 +#: ../../library/stdtypes.rst:2395 ../../library/stdtypes.rst:3613 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/stdtypes.rst:2393 ../../library/stdtypes.rst:3611 +#: ../../library/stdtypes.rst:2395 ../../library/stdtypes.rst:3613 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:2397 ../../library/stdtypes.rst:3615 +#: ../../library/stdtypes.rst:2399 ../../library/stdtypes.rst:3617 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/stdtypes.rst:2397 ../../library/stdtypes.rst:3615 +#: ../../library/stdtypes.rst:2399 ../../library/stdtypes.rst:3617 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:2401 ../../library/stdtypes.rst:3619 +#: ../../library/stdtypes.rst:2403 ../../library/stdtypes.rst:3621 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/stdtypes.rst:2401 +#: ../../library/stdtypes.rst:2403 msgid "Single character (accepts integer or single character string)." msgstr "" -#: ../../library/stdtypes.rst:2404 ../../library/stdtypes.rst:3632 +#: ../../library/stdtypes.rst:2406 ../../library/stdtypes.rst:3634 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/stdtypes.rst:2404 +#: ../../library/stdtypes.rst:2406 msgid "String (converts any Python object using :func:`repr`)." msgstr "" -#: ../../library/stdtypes.rst:2407 ../../library/stdtypes.rst:3626 +#: ../../library/stdtypes.rst:2409 ../../library/stdtypes.rst:3628 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/stdtypes.rst:2407 +#: ../../library/stdtypes.rst:2409 msgid "String (converts any Python object using :func:`str`)." msgstr "" -#: ../../library/stdtypes.rst:2410 ../../library/stdtypes.rst:3629 +#: ../../library/stdtypes.rst:2412 ../../library/stdtypes.rst:3631 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/stdtypes.rst:2410 +#: ../../library/stdtypes.rst:2412 msgid "String (converts any Python object using :func:`ascii`)." msgstr "" -#: ../../library/stdtypes.rst:2413 ../../library/stdtypes.rst:3635 +#: ../../library/stdtypes.rst:2415 ../../library/stdtypes.rst:3637 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/stdtypes.rst:2413 ../../library/stdtypes.rst:3635 +#: ../../library/stdtypes.rst:2415 ../../library/stdtypes.rst:3637 msgid "No argument is converted, results in a ``'%'`` character in the result." msgstr "" -#: ../../library/stdtypes.rst:2420 ../../library/stdtypes.rst:3642 +#: ../../library/stdtypes.rst:2422 ../../library/stdtypes.rst:3644 msgid "" "The alternate form causes a leading octal specifier (``'0o'``) to be " "inserted before the first digit." msgstr "" -#: ../../library/stdtypes.rst:2424 ../../library/stdtypes.rst:3646 +#: ../../library/stdtypes.rst:2426 ../../library/stdtypes.rst:3648 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:2428 ../../library/stdtypes.rst:3650 +#: ../../library/stdtypes.rst:2430 ../../library/stdtypes.rst:3652 msgid "" "The alternate form causes the result to always contain a decimal point, even " "if no digits follow it." msgstr "" -#: ../../library/stdtypes.rst:2431 ../../library/stdtypes.rst:3653 +#: ../../library/stdtypes.rst:2433 ../../library/stdtypes.rst:3655 msgid "" "The precision determines the number of digits after the decimal point and " "defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2435 ../../library/stdtypes.rst:3657 +#: ../../library/stdtypes.rst:2437 ../../library/stdtypes.rst:3659 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:2438 ../../library/stdtypes.rst:3660 +#: ../../library/stdtypes.rst:2440 ../../library/stdtypes.rst:3662 msgid "" "The precision determines the number of significant digits before and after " "the decimal point and defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2442 ../../library/stdtypes.rst:3664 +#: ../../library/stdtypes.rst:2444 ../../library/stdtypes.rst:3666 msgid "If precision is ``N``, the output is truncated to ``N`` characters." msgstr "" -#: ../../library/stdtypes.rst:2445 ../../library/stdtypes.rst:3673 +#: ../../library/stdtypes.rst:2447 ../../library/stdtypes.rst:3675 msgid "See :pep:`237`." msgstr "參閱 :pep:`237`\\ 。" -#: ../../library/stdtypes.rst:2447 +#: ../../library/stdtypes.rst:2449 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:2452 +#: ../../library/stdtypes.rst:2454 msgid "" "``%f`` conversions for numbers whose absolute value is over 1e50 are no " "longer replaced by ``%g`` conversions." msgstr "" -#: ../../library/stdtypes.rst:2463 +#: ../../library/stdtypes.rst:2465 msgid "" "Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:" "`memoryview`" msgstr "" -#: ../../library/stdtypes.rst:2471 +#: ../../library/stdtypes.rst:2473 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 :" @@ -3134,17 +3139,17 @@ msgid "" "objects without needing to make a copy." msgstr "" -#: ../../library/stdtypes.rst:2476 +#: ../../library/stdtypes.rst:2478 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:2482 +#: ../../library/stdtypes.rst:2484 msgid "Bytes Objects" msgstr "" -#: ../../library/stdtypes.rst:2486 +#: ../../library/stdtypes.rst:2488 msgid "" "Bytes objects are immutable sequences of single bytes. Since many major " "binary protocols are based on the ASCII text encoding, bytes objects offer " @@ -3152,40 +3157,40 @@ msgid "" "and are closely related to string objects in a variety of other ways." msgstr "" -#: ../../library/stdtypes.rst:2493 +#: ../../library/stdtypes.rst:2495 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:2496 +#: ../../library/stdtypes.rst:2498 msgid "Single quotes: ``b'still allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:2497 +#: ../../library/stdtypes.rst:2499 msgid "Double quotes: ``b\"still allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:2498 +#: ../../library/stdtypes.rst:2500 msgid "" "Triple quoted: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:2500 +#: ../../library/stdtypes.rst:2502 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:2504 +#: ../../library/stdtypes.rst:2506 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:2508 +#: ../../library/stdtypes.rst:2510 msgid "" "While bytes literals and representations are based on ASCII text, bytes " "objects actually behave like immutable sequences of integers, with each " @@ -3198,29 +3203,29 @@ msgid "" "compatible will usually lead to data corruption)." msgstr "" -#: ../../library/stdtypes.rst:2518 +#: ../../library/stdtypes.rst:2520 msgid "" "In addition to the literal forms, bytes objects can be created in a number " "of other ways:" msgstr "" -#: ../../library/stdtypes.rst:2521 +#: ../../library/stdtypes.rst:2523 msgid "A zero-filled bytes object of a specified length: ``bytes(10)``" msgstr "" -#: ../../library/stdtypes.rst:2522 +#: ../../library/stdtypes.rst:2524 msgid "From an iterable of integers: ``bytes(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2523 +#: ../../library/stdtypes.rst:2525 msgid "Copying existing binary data via the buffer protocol: ``bytes(obj)``" msgstr "" -#: ../../library/stdtypes.rst:2525 +#: ../../library/stdtypes.rst:2527 msgid "Also see the :ref:`bytes ` built-in." msgstr "" -#: ../../library/stdtypes.rst:2527 +#: ../../library/stdtypes.rst:2529 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -3228,32 +3233,32 @@ msgid "" "that format:" msgstr "" -#: ../../library/stdtypes.rst:2533 +#: ../../library/stdtypes.rst:2535 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:2540 +#: ../../library/stdtypes.rst:2542 msgid "" ":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just " "spaces." msgstr "" -#: ../../library/stdtypes.rst:2544 +#: ../../library/stdtypes.rst:2546 msgid "" "A reverse conversion function exists to transform a bytes object into its " "hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2549 ../../library/stdtypes.rst:2634 +#: ../../library/stdtypes.rst:2551 ../../library/stdtypes.rst:2636 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." msgstr "" -#: ../../library/stdtypes.rst:2555 +#: ../../library/stdtypes.rst:2557 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, " @@ -3262,13 +3267,13 @@ msgid "" "the separator position from the right, negative values from the left." msgstr "" -#: ../../library/stdtypes.rst:2572 +#: ../../library/stdtypes.rst:2574 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:2576 +#: ../../library/stdtypes.rst:2578 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 " @@ -3276,58 +3281,58 @@ msgid "" "and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2581 +#: ../../library/stdtypes.rst:2583 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:2589 +#: ../../library/stdtypes.rst:2591 msgid "Bytearray Objects" msgstr "" -#: ../../library/stdtypes.rst:2593 +#: ../../library/stdtypes.rst:2595 msgid "" ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` " "objects." msgstr "" -#: ../../library/stdtypes.rst:2598 +#: ../../library/stdtypes.rst:2600 msgid "" "There is no dedicated literal syntax for bytearray objects, instead they are " "always created by calling the constructor:" msgstr "" -#: ../../library/stdtypes.rst:2601 +#: ../../library/stdtypes.rst:2603 msgid "Creating an empty instance: ``bytearray()``" msgstr "" -#: ../../library/stdtypes.rst:2602 +#: ../../library/stdtypes.rst:2604 msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" msgstr "" -#: ../../library/stdtypes.rst:2603 +#: ../../library/stdtypes.rst:2605 msgid "From an iterable of integers: ``bytearray(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2604 +#: ../../library/stdtypes.rst:2606 msgid "" "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" -#: ../../library/stdtypes.rst:2606 +#: ../../library/stdtypes.rst:2608 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:2610 +#: ../../library/stdtypes.rst:2612 msgid "Also see the :ref:`bytearray ` built-in." msgstr "" -#: ../../library/stdtypes.rst:2612 +#: ../../library/stdtypes.rst:2614 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -3335,33 +3340,33 @@ msgid "" "in that format:" msgstr "" -#: ../../library/stdtypes.rst:2618 +#: ../../library/stdtypes.rst:2620 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:2625 +#: ../../library/stdtypes.rst:2627 msgid "" ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not " "just spaces." msgstr "" -#: ../../library/stdtypes.rst:2629 +#: ../../library/stdtypes.rst:2631 msgid "" "A reverse conversion function exists to transform a bytearray object into " "its hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2642 +#: ../../library/stdtypes.rst:2644 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:2647 +#: ../../library/stdtypes.rst:2649 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 " @@ -3369,7 +3374,7 @@ msgid "" "both indexing and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2652 +#: ../../library/stdtypes.rst:2654 msgid "" "The representation of bytearray objects uses the bytes literal format " "(``bytearray(b'...')``) since it is often more useful than e.g. " @@ -3377,11 +3382,11 @@ msgid "" "a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:2661 +#: ../../library/stdtypes.rst:2663 msgid "Bytes and Bytearray Operations" msgstr "" -#: ../../library/stdtypes.rst:2666 +#: ../../library/stdtypes.rst:2668 msgid "" "Both bytes and bytearray objects support the :ref:`common ` " "sequence operations. They interoperate not just with operands of the same " @@ -3390,107 +3395,107 @@ msgid "" "return type of the result may depend on the order of operands." msgstr "" -#: ../../library/stdtypes.rst:2674 +#: ../../library/stdtypes.rst:2676 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:2681 +#: ../../library/stdtypes.rst:2683 msgid "and::" msgstr "" "和:\n" "\n" "::" -#: ../../library/stdtypes.rst:2686 +#: ../../library/stdtypes.rst:2688 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:2691 +#: ../../library/stdtypes.rst:2693 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:2694 +#: ../../library/stdtypes.rst:2696 msgid "" "The following methods on bytes and bytearray objects can be used with " "arbitrary binary data." msgstr "" -#: ../../library/stdtypes.rst:2700 +#: ../../library/stdtypes.rst:2702 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:2704 ../../library/stdtypes.rst:2809 -#: ../../library/stdtypes.rst:2831 ../../library/stdtypes.rst:2897 -#: ../../library/stdtypes.rst:2910 +#: ../../library/stdtypes.rst:2706 ../../library/stdtypes.rst:2811 +#: ../../library/stdtypes.rst:2833 ../../library/stdtypes.rst:2899 +#: ../../library/stdtypes.rst:2912 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:2707 +#: ../../library/stdtypes.rst:2709 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:2710 ../../library/stdtypes.rst:2821 -#: ../../library/stdtypes.rst:2834 ../../library/stdtypes.rst:2900 -#: ../../library/stdtypes.rst:2913 +#: ../../library/stdtypes.rst:2712 ../../library/stdtypes.rst:2823 +#: ../../library/stdtypes.rst:2836 ../../library/stdtypes.rst:2902 +#: ../../library/stdtypes.rst:2915 msgid "Also accept an integer in the range 0 to 255 as the subsequence." msgstr "" -#: ../../library/stdtypes.rst:2717 +#: ../../library/stdtypes.rst:2719 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:2726 +#: ../../library/stdtypes.rst:2728 msgid "The *prefix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2730 ../../library/stdtypes.rst:2752 -#: ../../library/stdtypes.rst:2885 ../../library/stdtypes.rst:2978 -#: ../../library/stdtypes.rst:2992 ../../library/stdtypes.rst:3023 -#: ../../library/stdtypes.rst:3037 ../../library/stdtypes.rst:3079 -#: ../../library/stdtypes.rst:3149 ../../library/stdtypes.rst:3167 -#: ../../library/stdtypes.rst:3195 ../../library/stdtypes.rst:3334 -#: ../../library/stdtypes.rst:3389 ../../library/stdtypes.rst:3432 -#: ../../library/stdtypes.rst:3453 ../../library/stdtypes.rst:3475 -#: ../../library/stdtypes.rst:3677 +#: ../../library/stdtypes.rst:2732 ../../library/stdtypes.rst:2754 +#: ../../library/stdtypes.rst:2887 ../../library/stdtypes.rst:2980 +#: ../../library/stdtypes.rst:2994 ../../library/stdtypes.rst:3025 +#: ../../library/stdtypes.rst:3039 ../../library/stdtypes.rst:3081 +#: ../../library/stdtypes.rst:3151 ../../library/stdtypes.rst:3169 +#: ../../library/stdtypes.rst:3197 ../../library/stdtypes.rst:3336 +#: ../../library/stdtypes.rst:3391 ../../library/stdtypes.rst:3434 +#: ../../library/stdtypes.rst:3455 ../../library/stdtypes.rst:3477 +#: ../../library/stdtypes.rst:3679 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:2739 +#: ../../library/stdtypes.rst:2741 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:2748 +#: ../../library/stdtypes.rst:2750 msgid "The *suffix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2761 +#: ../../library/stdtypes.rst:2763 msgid "Return the bytes decoded to a :class:`str`." msgstr "" -#: ../../library/stdtypes.rst:2766 +#: ../../library/stdtypes.rst:2768 msgid "" "*errors* controls how decoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -3498,21 +3503,21 @@ msgid "" "`codecs.register_error`. See :ref:`error-handlers` for details." msgstr "" -#: ../../library/stdtypes.rst:2772 +#: ../../library/stdtypes.rst:2774 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:2778 +#: ../../library/stdtypes.rst:2780 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:2793 +#: ../../library/stdtypes.rst:2795 msgid "" "Return ``True`` if the binary data ends with the specified *suffix*, " "otherwise return ``False``. *suffix* can also be a tuple of suffixes to " @@ -3520,11 +3525,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2798 +#: ../../library/stdtypes.rst:2800 msgid "The suffix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2804 +#: ../../library/stdtypes.rst:2806 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 " @@ -3532,20 +3537,20 @@ msgid "" "``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2814 +#: ../../library/stdtypes.rst:2816 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:2828 +#: ../../library/stdtypes.rst:2830 msgid "" "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence " "is not found." msgstr "" -#: ../../library/stdtypes.rst:2841 +#: ../../library/stdtypes.rst:2843 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 " @@ -3555,7 +3560,7 @@ msgid "" "method." msgstr "" -#: ../../library/stdtypes.rst:2852 +#: ../../library/stdtypes.rst:2854 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 " @@ -3563,7 +3568,7 @@ msgid "" "objects ` and have the same length." msgstr "" -#: ../../library/stdtypes.rst:2863 +#: ../../library/stdtypes.rst:2865 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 " @@ -3572,24 +3577,24 @@ msgid "" "by two empty bytes or bytearray objects." msgstr "" -#: ../../library/stdtypes.rst:2870 ../../library/stdtypes.rst:2927 +#: ../../library/stdtypes.rst:2872 ../../library/stdtypes.rst:2929 msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2876 +#: ../../library/stdtypes.rst:2878 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:2880 +#: ../../library/stdtypes.rst:2882 msgid "" "The subsequence to search for and its replacement may be any :term:`bytes-" "like object`." msgstr "" -#: ../../library/stdtypes.rst:2892 +#: ../../library/stdtypes.rst:2894 msgid "" "Return the highest index in the sequence where the subsequence *sub* is " "found, such that *sub* is contained within ``s[start:end]``. Optional " @@ -3597,13 +3602,13 @@ msgid "" "``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:2907 +#: ../../library/stdtypes.rst:2909 msgid "" "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence " "*sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2920 +#: ../../library/stdtypes.rst:2922 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 " @@ -3612,7 +3617,7 @@ msgid "" "followed by a copy of the original sequence." msgstr "" -#: ../../library/stdtypes.rst:2933 +#: ../../library/stdtypes.rst:2935 msgid "" "Return ``True`` if the binary data starts with the specified *prefix*, " "otherwise return ``False``. *prefix* can also be a tuple of prefixes to " @@ -3620,11 +3625,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2938 +#: ../../library/stdtypes.rst:2940 msgid "The prefix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2944 +#: ../../library/stdtypes.rst:2946 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 " @@ -3632,22 +3637,22 @@ msgid "" "object of length 256." msgstr "" -#: ../../library/stdtypes.rst:2949 +#: ../../library/stdtypes.rst:2951 msgid "" "You can use the :func:`bytes.maketrans` method to create a translation table." msgstr "" -#: ../../library/stdtypes.rst:2952 +#: ../../library/stdtypes.rst:2954 msgid "" "Set the *table* argument to ``None`` for translations that only delete " "characters::" msgstr "" -#: ../../library/stdtypes.rst:2958 +#: ../../library/stdtypes.rst:2960 msgid "*delete* is now supported as a keyword argument." msgstr "" -#: ../../library/stdtypes.rst:2962 +#: ../../library/stdtypes.rst:2964 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 " @@ -3656,7 +3661,7 @@ msgid "" "instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:2971 +#: ../../library/stdtypes.rst:2973 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). " @@ -3664,7 +3669,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2985 +#: ../../library/stdtypes.rst:2987 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). " @@ -3672,7 +3677,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2999 +#: ../../library/stdtypes.rst:3001 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 " @@ -3682,14 +3687,14 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3011 +#: ../../library/stdtypes.rst:3013 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:3030 +#: ../../library/stdtypes.rst:3032 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). " @@ -3697,7 +3702,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3044 +#: ../../library/stdtypes.rst:3046 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 " @@ -3707,7 +3712,7 @@ msgid "" "described in detail below." msgstr "" -#: ../../library/stdtypes.rst:3055 +#: ../../library/stdtypes.rst:3057 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 " @@ -3717,14 +3722,14 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3067 +#: ../../library/stdtypes.rst:3069 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:3086 +#: ../../library/stdtypes.rst:3088 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 " @@ -3733,7 +3738,7 @@ msgid "" "limit on the number of splits (all possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:3092 +#: ../../library/stdtypes.rst:3094 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',')`` " @@ -3744,7 +3749,7 @@ msgid "" "object being split. The *sep* argument may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3110 +#: ../../library/stdtypes.rst:3112 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 " @@ -3754,7 +3759,7 @@ msgid "" "without a specified separator returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:3131 +#: ../../library/stdtypes.rst:3133 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 " @@ -3764,13 +3769,13 @@ msgid "" "a prefix or suffix; rather, all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3144 +#: ../../library/stdtypes.rst:3146 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`." msgstr "" -#: ../../library/stdtypes.rst:3153 +#: ../../library/stdtypes.rst:3155 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 " @@ -3778,14 +3783,14 @@ msgid "" "operate in place, and instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3161 +#: ../../library/stdtypes.rst:3163 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:3174 +#: ../../library/stdtypes.rst:3176 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 " @@ -3801,7 +3806,7 @@ msgid "" "by one regardless of how the byte value is represented when printed::" msgstr "" -#: ../../library/stdtypes.rst:3202 +#: ../../library/stdtypes.rst:3204 msgid "" "Return ``True`` if all bytes in the sequence are alphabetical ASCII " "characters or ASCII decimal digits and the sequence is not empty, ``False`` " @@ -3810,7 +3815,7 @@ msgid "" "digits are those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:3219 +#: ../../library/stdtypes.rst:3221 msgid "" "Return ``True`` if all bytes in the sequence are alphabetic ASCII characters " "and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII " @@ -3818,35 +3823,35 @@ msgid "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:3235 +#: ../../library/stdtypes.rst:3237 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:3245 +#: ../../library/stdtypes.rst:3247 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:3260 +#: ../../library/stdtypes.rst:3262 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:3270 ../../library/stdtypes.rst:3312 -#: ../../library/stdtypes.rst:3328 ../../library/stdtypes.rst:3378 -#: ../../library/stdtypes.rst:3447 +#: ../../library/stdtypes.rst:3272 ../../library/stdtypes.rst:3314 +#: ../../library/stdtypes.rst:3330 ../../library/stdtypes.rst:3380 +#: ../../library/stdtypes.rst:3449 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:3278 +#: ../../library/stdtypes.rst:3280 msgid "" "Return ``True`` if all bytes in the sequence are ASCII whitespace and the " "sequence is not empty, ``False`` otherwise. ASCII whitespace characters are " @@ -3854,27 +3859,27 @@ msgid "" "newline, carriage return, vertical tab, form feed)." msgstr "" -#: ../../library/stdtypes.rst:3287 +#: ../../library/stdtypes.rst:3289 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:3302 +#: ../../library/stdtypes.rst:3304 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:3320 +#: ../../library/stdtypes.rst:3322 msgid "" "Return a copy of the sequence with all the uppercase ASCII characters " "converted to their corresponding lowercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3345 +#: ../../library/stdtypes.rst:3347 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 " @@ -3882,20 +3887,20 @@ msgid "" "*keepends* is given and true." msgstr "" -#: ../../library/stdtypes.rst:3357 +#: ../../library/stdtypes.rst:3359 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:3370 +#: ../../library/stdtypes.rst:3372 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:3382 +#: ../../library/stdtypes.rst:3384 msgid "" "Unlike :func:`str.swapcase()`, it is always the case that ``bin.swapcase()." "swapcase() == bin`` for the binary versions. Case conversions are " @@ -3903,14 +3908,14 @@ msgid "" "Unicode code points." msgstr "" -#: ../../library/stdtypes.rst:3396 +#: ../../library/stdtypes.rst:3398 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:3405 +#: ../../library/stdtypes.rst:3407 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -3918,18 +3923,18 @@ msgid "" "values are uncased." msgstr "" -#: ../../library/stdtypes.rst:3418 +#: ../../library/stdtypes.rst:3420 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "" -#: ../../library/stdtypes.rst:3439 +#: ../../library/stdtypes.rst:3441 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3460 +#: ../../library/stdtypes.rst:3462 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 " @@ -3938,11 +3943,11 @@ msgid "" "*width* is less than or equal to ``len(seq)``." msgstr "" -#: ../../library/stdtypes.rst:3482 +#: ../../library/stdtypes.rst:3484 msgid "``printf``-style Bytes Formatting" msgstr "" -#: ../../library/stdtypes.rst:3499 +#: ../../library/stdtypes.rst:3501 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 " @@ -3950,7 +3955,7 @@ msgid "" "dictionary, wrap it in a tuple." msgstr "" -#: ../../library/stdtypes.rst:3504 +#: ../../library/stdtypes.rst:3506 msgid "" "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " @@ -3960,7 +3965,7 @@ msgid "" "func:`sprintf` in the C language." msgstr "" -#: ../../library/stdtypes.rst:3511 +#: ../../library/stdtypes.rst:3513 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 " @@ -3968,7 +3973,7 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:3545 +#: ../../library/stdtypes.rst:3547 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 " @@ -3976,73 +3981,73 @@ msgid "" "mapping key selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:3619 +#: ../../library/stdtypes.rst:3621 msgid "Single byte (accepts integer or single byte objects)." msgstr "" -#: ../../library/stdtypes.rst:3622 +#: ../../library/stdtypes.rst:3624 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/stdtypes.rst:3622 +#: ../../library/stdtypes.rst:3624 msgid "" "Bytes (any object that follows the :ref:`buffer protocol ` or " "has :meth:`__bytes__`)." msgstr "" -#: ../../library/stdtypes.rst:3626 +#: ../../library/stdtypes.rst:3628 msgid "" "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3629 +#: ../../library/stdtypes.rst:3631 msgid "" "Bytes (converts any Python object using ``repr(obj).encode('ascii', " "'backslashreplace')``)." msgstr "" -#: ../../library/stdtypes.rst:3632 +#: ../../library/stdtypes.rst:3634 msgid "" "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3632 +#: ../../library/stdtypes.rst:3634 msgid "\\(7)" msgstr "\\(7)" -#: ../../library/stdtypes.rst:3667 +#: ../../library/stdtypes.rst:3669 msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3670 +#: ../../library/stdtypes.rst:3672 msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3682 +#: ../../library/stdtypes.rst:3684 msgid ":pep:`461` - Adding % formatting to bytes and bytearray" msgstr "" -#: ../../library/stdtypes.rst:3689 +#: ../../library/stdtypes.rst:3691 msgid "Memory Views" msgstr "" -#: ../../library/stdtypes.rst:3691 +#: ../../library/stdtypes.rst:3693 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:3697 +#: ../../library/stdtypes.rst:3699 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:3701 +#: ../../library/stdtypes.rst:3703 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 " @@ -4050,7 +4055,7 @@ msgid "" "other types such as :class:`array.array` may have bigger elements." msgstr "" -#: ../../library/stdtypes.rst:3706 +#: ../../library/stdtypes.rst:3708 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 " @@ -4060,13 +4065,13 @@ msgid "" "bytes in a single element." msgstr "" -#: ../../library/stdtypes.rst:3713 +#: ../../library/stdtypes.rst:3715 msgid "" "A :class:`memoryview` supports slicing and indexing to expose its data. One-" "dimensional slicing will result in a subview::" msgstr "" -#: ../../library/stdtypes.rst:3726 +#: ../../library/stdtypes.rst:3728 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 " @@ -4077,82 +4082,82 @@ msgid "" "memoryviews can be indexed with the empty tuple." msgstr "" -#: ../../library/stdtypes.rst:3735 +#: ../../library/stdtypes.rst:3737 msgid "Here is an example with a non-byte format::" msgstr "" -#: ../../library/stdtypes.rst:3747 +#: ../../library/stdtypes.rst:3749 msgid "" "If the underlying object is writable, the memoryview supports one-" "dimensional slice assignment. Resizing is not allowed::" msgstr "" -#: ../../library/stdtypes.rst:3768 +#: ../../library/stdtypes.rst:3770 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:3780 +#: ../../library/stdtypes.rst:3782 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:3784 +#: ../../library/stdtypes.rst:3786 msgid "" "memoryview is now registered automatically with :class:`collections.abc." "Sequence`" msgstr "" -#: ../../library/stdtypes.rst:3788 +#: ../../library/stdtypes.rst:3790 msgid "memoryviews can now be indexed with tuple of integers." msgstr "" -#: ../../library/stdtypes.rst:3791 +#: ../../library/stdtypes.rst:3793 msgid ":class:`memoryview` has several methods:" msgstr "" -#: ../../library/stdtypes.rst:3795 +#: ../../library/stdtypes.rst:3797 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:3799 +#: ../../library/stdtypes.rst:3801 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:3818 +#: ../../library/stdtypes.rst:3820 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:3834 +#: ../../library/stdtypes.rst:3836 msgid "" "Note that, as with floating point numbers, ``v is w`` does *not* imply ``v " "== w`` for memoryview objects." msgstr "" -#: ../../library/stdtypes.rst:3837 +#: ../../library/stdtypes.rst:3839 msgid "" "Previous versions compared the raw memory disregarding the item format and " "the logical array structure." msgstr "" -#: ../../library/stdtypes.rst:3843 +#: ../../library/stdtypes.rst:3845 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:3852 +#: ../../library/stdtypes.rst:3854 msgid "" "For non-contiguous arrays the result is equal to the flattened list " "representation with all elements converted to bytes. :meth:`tobytes` " @@ -4160,7 +4165,7 @@ msgid "" "module syntax." msgstr "" -#: ../../library/stdtypes.rst:3857 +#: ../../library/stdtypes.rst:3859 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' " @@ -4169,36 +4174,36 @@ msgid "" "to C first. *order=None* is the same as *order='C'*." msgstr "" -#: ../../library/stdtypes.rst:3866 +#: ../../library/stdtypes.rst:3868 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the buffer. ::" msgstr "" -#: ../../library/stdtypes.rst:3875 +#: ../../library/stdtypes.rst:3877 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:3882 +#: ../../library/stdtypes.rst:3884 msgid "Return the data in the buffer as a list of elements. ::" msgstr "" -#: ../../library/stdtypes.rst:3892 +#: ../../library/stdtypes.rst:3894 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:3899 +#: ../../library/stdtypes.rst:3901 msgid "" "Return a readonly version of the memoryview object. The original memoryview " "object is unchanged. ::" msgstr "" -#: ../../library/stdtypes.rst:3918 +#: ../../library/stdtypes.rst:3920 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 :" @@ -4207,20 +4212,20 @@ msgid "" "resources) as soon as possible." msgstr "" -#: ../../library/stdtypes.rst:3924 +#: ../../library/stdtypes.rst:3926 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:3935 +#: ../../library/stdtypes.rst:3937 msgid "" "The context management protocol can be used for a similar effect, using the " "``with`` statement::" msgstr "" -#: ../../library/stdtypes.rst:3951 +#: ../../library/stdtypes.rst:3953 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 " @@ -4229,57 +4234,57 @@ msgid "" "contiguous -> 1D." msgstr "" -#: ../../library/stdtypes.rst:3957 +#: ../../library/stdtypes.rst:3959 msgid "" "The destination format is restricted to a single element native format in :" "mod:`struct` syntax. One of the formats must be a byte format ('B', 'b' or " "'c'). The byte length of the result must be the same as the original length." msgstr "" -#: ../../library/stdtypes.rst:3962 +#: ../../library/stdtypes.rst:3964 msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "" -#: ../../library/stdtypes.rst:3985 +#: ../../library/stdtypes.rst:3987 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "" -#: ../../library/stdtypes.rst:3998 +#: ../../library/stdtypes.rst:4000 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "" -#: ../../library/stdtypes.rst:4024 +#: ../../library/stdtypes.rst:4026 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "" -#: ../../library/stdtypes.rst:4038 +#: ../../library/stdtypes.rst:4040 msgid "The source format is no longer restricted when casting to a byte view." msgstr "" -#: ../../library/stdtypes.rst:4041 +#: ../../library/stdtypes.rst:4043 msgid "There are also several readonly attributes available:" msgstr "" -#: ../../library/stdtypes.rst:4045 +#: ../../library/stdtypes.rst:4047 msgid "The underlying object of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4056 +#: ../../library/stdtypes.rst:4058 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:4075 +#: ../../library/stdtypes.rst:4077 msgid "Multi-dimensional arrays::" msgstr "" -#: ../../library/stdtypes.rst:4092 +#: ../../library/stdtypes.rst:4094 msgid "A bool indicating whether the memory is read only." msgstr "" -#: ../../library/stdtypes.rst:4096 +#: ../../library/stdtypes.rst:4098 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 " @@ -4287,59 +4292,59 @@ msgid "" "restricted to native single element formats." msgstr "" -#: ../../library/stdtypes.rst:4101 +#: ../../library/stdtypes.rst:4103 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:4107 +#: ../../library/stdtypes.rst:4109 msgid "The size in bytes of each element of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4120 +#: ../../library/stdtypes.rst:4122 msgid "" "An integer indicating how many dimensions of a multi-dimensional array the " "memory represents." msgstr "" -#: ../../library/stdtypes.rst:4125 +#: ../../library/stdtypes.rst:4127 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:4128 ../../library/stdtypes.rst:4136 +#: ../../library/stdtypes.rst:4130 ../../library/stdtypes.rst:4138 msgid "An empty tuple instead of ``None`` when ndim = 0." msgstr "" -#: ../../library/stdtypes.rst:4133 +#: ../../library/stdtypes.rst:4135 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:4141 +#: ../../library/stdtypes.rst:4143 msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" -#: ../../library/stdtypes.rst:4145 +#: ../../library/stdtypes.rst:4147 msgid "A bool indicating whether the memory is C-:term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4151 +#: ../../library/stdtypes.rst:4153 msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4157 +#: ../../library/stdtypes.rst:4159 msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4165 +#: ../../library/stdtypes.rst:4167 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "" -#: ../../library/stdtypes.rst:4169 +#: ../../library/stdtypes.rst:4171 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -4349,7 +4354,7 @@ msgid "" "`collections` module.)" msgstr "" -#: ../../library/stdtypes.rst:4176 +#: ../../library/stdtypes.rst:4178 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 " @@ -4357,7 +4362,7 @@ msgid "" "slicing, or other sequence-like behavior." msgstr "" -#: ../../library/stdtypes.rst:4181 +#: ../../library/stdtypes.rst:4183 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -4369,18 +4374,18 @@ msgid "" "of another set." msgstr "" -#: ../../library/stdtypes.rst:4189 +#: ../../library/stdtypes.rst:4191 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:4193 +#: ../../library/stdtypes.rst:4195 msgid "The constructors for both classes work the same:" msgstr "" -#: ../../library/stdtypes.rst:4198 +#: ../../library/stdtypes.rst:4200 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 " @@ -4388,92 +4393,92 @@ msgid "" "*iterable* is not specified, a new empty set is returned." msgstr "" -#: ../../library/stdtypes.rst:4204 +#: ../../library/stdtypes.rst:4206 msgid "Sets can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4206 +#: ../../library/stdtypes.rst:4208 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4207 +#: ../../library/stdtypes.rst:4209 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" -#: ../../library/stdtypes.rst:4208 +#: ../../library/stdtypes.rst:4210 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" msgstr "" -#: ../../library/stdtypes.rst:4210 +#: ../../library/stdtypes.rst:4212 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" msgstr "" -#: ../../library/stdtypes.rst:4215 +#: ../../library/stdtypes.rst:4217 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" -#: ../../library/stdtypes.rst:4219 +#: ../../library/stdtypes.rst:4221 msgid "Test *x* for membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4223 +#: ../../library/stdtypes.rst:4225 msgid "Test *x* for non-membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4227 +#: ../../library/stdtypes.rst:4229 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:4233 +#: ../../library/stdtypes.rst:4235 msgid "Test whether every element in the set is in *other*." msgstr "" -#: ../../library/stdtypes.rst:4237 +#: ../../library/stdtypes.rst:4239 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4243 +#: ../../library/stdtypes.rst:4245 msgid "Test whether every element in *other* is in the set." msgstr "" -#: ../../library/stdtypes.rst:4247 +#: ../../library/stdtypes.rst:4249 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4253 +#: ../../library/stdtypes.rst:4255 msgid "Return a new set with elements from the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4258 +#: ../../library/stdtypes.rst:4260 msgid "Return a new set with elements common to the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4263 +#: ../../library/stdtypes.rst:4265 msgid "Return a new set with elements in the set that are not in the others." msgstr "" -#: ../../library/stdtypes.rst:4268 +#: ../../library/stdtypes.rst:4270 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" -#: ../../library/stdtypes.rst:4272 +#: ../../library/stdtypes.rst:4274 msgid "Return a shallow copy of the set." msgstr "" -#: ../../library/stdtypes.rst:4275 +#: ../../library/stdtypes.rst:4277 msgid "" "Note, the non-operator versions of :meth:`union`, :meth:`intersection`, :" "meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and :meth:" @@ -4483,7 +4488,7 @@ msgid "" "the more readable ``set('abc').intersection('cbs')``." msgstr "" -#: ../../library/stdtypes.rst:4282 +#: ../../library/stdtypes.rst:4284 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 " @@ -4493,14 +4498,14 @@ msgid "" "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -#: ../../library/stdtypes.rst:4289 +#: ../../library/stdtypes.rst:4291 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:4293 +#: ../../library/stdtypes.rst:4295 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 " @@ -4508,71 +4513,71 @@ msgid "" "``ab``." msgstr "" -#: ../../library/stdtypes.rst:4298 +#: ../../library/stdtypes.rst:4300 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:4301 +#: ../../library/stdtypes.rst:4303 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:4303 +#: ../../library/stdtypes.rst:4305 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:4307 +#: ../../library/stdtypes.rst:4309 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" msgstr "" -#: ../../library/stdtypes.rst:4313 +#: ../../library/stdtypes.rst:4315 msgid "Update the set, adding elements from all others." msgstr "" -#: ../../library/stdtypes.rst:4318 +#: ../../library/stdtypes.rst:4320 msgid "Update the set, keeping only elements found in it and all others." msgstr "" -#: ../../library/stdtypes.rst:4323 +#: ../../library/stdtypes.rst:4325 msgid "Update the set, removing elements found in others." msgstr "" -#: ../../library/stdtypes.rst:4328 +#: ../../library/stdtypes.rst:4330 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" -#: ../../library/stdtypes.rst:4332 +#: ../../library/stdtypes.rst:4334 msgid "Add element *elem* to the set." msgstr "" -#: ../../library/stdtypes.rst:4336 +#: ../../library/stdtypes.rst:4338 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." msgstr "" -#: ../../library/stdtypes.rst:4341 +#: ../../library/stdtypes.rst:4343 msgid "Remove element *elem* from the set if it is present." msgstr "" -#: ../../library/stdtypes.rst:4345 +#: ../../library/stdtypes.rst:4347 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." msgstr "" -#: ../../library/stdtypes.rst:4350 +#: ../../library/stdtypes.rst:4352 msgid "Remove all elements from the set." msgstr "" -#: ../../library/stdtypes.rst:4353 +#: ../../library/stdtypes.rst:4355 msgid "" "Note, the non-operator versions of the :meth:`update`, :meth:" "`intersection_update`, :meth:`difference_update`, and :meth:" @@ -4580,18 +4585,18 @@ msgid "" "argument." msgstr "" -#: ../../library/stdtypes.rst:4358 +#: ../../library/stdtypes.rst:4360 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:4366 +#: ../../library/stdtypes.rst:4368 msgid "Mapping Types --- :class:`dict`" msgstr "" -#: ../../library/stdtypes.rst:4376 +#: ../../library/stdtypes.rst:4378 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -4600,7 +4605,7 @@ msgid "" "module.)" msgstr "" -#: ../../library/stdtypes.rst:4382 +#: ../../library/stdtypes.rst:4384 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -4609,33 +4614,33 @@ msgid "" "and ``True``) can be used interchangeably to index the same dictionary entry." msgstr "" -#: ../../library/stdtypes.rst:4393 +#: ../../library/stdtypes.rst:4395 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:4396 +#: ../../library/stdtypes.rst:4398 msgid "Dictionaries can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4398 +#: ../../library/stdtypes.rst:4400 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:4400 +#: ../../library/stdtypes.rst:4402 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" -#: ../../library/stdtypes.rst:4401 +#: ../../library/stdtypes.rst:4403 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" msgstr "" -#: ../../library/stdtypes.rst:4404 +#: ../../library/stdtypes.rst:4406 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 " @@ -4647,7 +4652,7 @@ msgid "" "value for that key becomes the corresponding value in the new dictionary." msgstr "" -#: ../../library/stdtypes.rst:4414 +#: ../../library/stdtypes.rst:4416 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 " @@ -4655,39 +4660,39 @@ msgid "" "the value from the positional argument." msgstr "" -#: ../../library/stdtypes.rst:4419 +#: ../../library/stdtypes.rst:4421 msgid "" "To illustrate, the following examples all return a dictionary equal to " "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -#: ../../library/stdtypes.rst:4431 +#: ../../library/stdtypes.rst:4433 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:4435 +#: ../../library/stdtypes.rst:4437 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -#: ../../library/stdtypes.rst:4440 +#: ../../library/stdtypes.rst:4442 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4444 +#: ../../library/stdtypes.rst:4446 msgid "Return the number of items in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4448 +#: ../../library/stdtypes.rst:4450 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." msgstr "" -#: ../../library/stdtypes.rst:4453 +#: ../../library/stdtypes.rst:4455 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 " @@ -4698,51 +4703,51 @@ msgid "" "an instance variable::" msgstr "" -#: ../../library/stdtypes.rst:4471 +#: ../../library/stdtypes.rst:4473 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:4477 +#: ../../library/stdtypes.rst:4479 msgid "Set ``d[key]`` to *value*." msgstr "" -#: ../../library/stdtypes.rst:4481 +#: ../../library/stdtypes.rst:4483 msgid "" "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the " "map." msgstr "" -#: ../../library/stdtypes.rst:4486 +#: ../../library/stdtypes.rst:4488 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "" -#: ../../library/stdtypes.rst:4490 +#: ../../library/stdtypes.rst:4492 msgid "Equivalent to ``not key in d``." msgstr "" -#: ../../library/stdtypes.rst:4494 +#: ../../library/stdtypes.rst:4496 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4499 +#: ../../library/stdtypes.rst:4501 msgid "Remove all items from the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4503 +#: ../../library/stdtypes.rst:4505 msgid "Return a shallow copy of the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4507 +#: ../../library/stdtypes.rst:4509 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" -#: ../../library/stdtypes.rst:4509 +#: ../../library/stdtypes.rst:4511 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 " @@ -4751,70 +4756,70 @@ msgid "" "` instead." msgstr "" -#: ../../library/stdtypes.rst:4517 +#: ../../library/stdtypes.rst:4519 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:4523 +#: ../../library/stdtypes.rst:4525 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4528 +#: ../../library/stdtypes.rst:4530 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." msgstr "" -#: ../../library/stdtypes.rst:4533 +#: ../../library/stdtypes.rst:4535 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:4539 +#: ../../library/stdtypes.rst:4541 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:4542 +#: ../../library/stdtypes.rst:4544 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:4546 +#: ../../library/stdtypes.rst:4548 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." msgstr "" -#: ../../library/stdtypes.rst:4552 +#: ../../library/stdtypes.rst:4554 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4559 +#: ../../library/stdtypes.rst:4561 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:4565 +#: ../../library/stdtypes.rst:4567 msgid "" "Update the dictionary with the key/value pairs from *other*, overwriting " "existing keys. Return ``None``." msgstr "" -#: ../../library/stdtypes.rst:4568 +#: ../../library/stdtypes.rst:4570 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 " @@ -4822,71 +4827,71 @@ msgid "" "pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:4575 +#: ../../library/stdtypes.rst:4577 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4578 +#: ../../library/stdtypes.rst:4580 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:4588 +#: ../../library/stdtypes.rst:4590 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:4596 +#: ../../library/stdtypes.rst:4598 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:4602 +#: ../../library/stdtypes.rst:4604 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:4606 +#: ../../library/stdtypes.rst:4608 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:4624 +#: ../../library/stdtypes.rst:4626 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:4628 +#: ../../library/stdtypes.rst:4630 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:4640 +#: ../../library/stdtypes.rst:4642 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4645 +#: ../../library/stdtypes.rst:4647 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:4652 +#: ../../library/stdtypes.rst:4654 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:4654 +#: ../../library/stdtypes.rst:4656 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 " @@ -4894,23 +4899,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:4659 +#: ../../library/stdtypes.rst:4661 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:4664 +#: ../../library/stdtypes.rst:4666 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4668 +#: ../../library/stdtypes.rst:4670 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4671 +#: ../../library/stdtypes.rst:4673 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -4918,39 +4923,39 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:4676 +#: ../../library/stdtypes.rst:4678 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:4679 +#: ../../library/stdtypes.rst:4681 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:4684 +#: ../../library/stdtypes.rst:4686 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:4689 +#: ../../library/stdtypes.rst:4691 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:4692 +#: ../../library/stdtypes.rst:4694 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4697 +#: ../../library/stdtypes.rst:4699 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:4702 +#: ../../library/stdtypes.rst:4704 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 " @@ -4961,15 +4966,15 @@ msgid "" "``<``, or ``^``)." msgstr "" -#: ../../library/stdtypes.rst:4709 +#: ../../library/stdtypes.rst:4711 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:4750 +#: ../../library/stdtypes.rst:4752 msgid "Context Manager Types" msgstr "" -#: ../../library/stdtypes.rst:4757 +#: ../../library/stdtypes.rst:4759 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 " @@ -4977,7 +4982,7 @@ msgid "" "before the statement body is executed and exited when the statement ends:" msgstr "" -#: ../../library/stdtypes.rst:4765 +#: ../../library/stdtypes.rst:4767 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 " @@ -4985,14 +4990,14 @@ msgid "" "using this context manager." msgstr "" -#: ../../library/stdtypes.rst:4770 +#: ../../library/stdtypes.rst:4772 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:4774 +#: ../../library/stdtypes.rst:4776 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 " @@ -5002,7 +5007,7 @@ msgid "" "the :keyword:`!with` statement." msgstr "" -#: ../../library/stdtypes.rst:4784 +#: ../../library/stdtypes.rst:4786 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -5011,7 +5016,7 @@ msgid "" "arguments are ``None``." msgstr "" -#: ../../library/stdtypes.rst:4789 +#: ../../library/stdtypes.rst:4791 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -5022,7 +5027,7 @@ msgid "" "statement." msgstr "" -#: ../../library/stdtypes.rst:4796 +#: ../../library/stdtypes.rst:4798 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -5031,7 +5036,7 @@ msgid "" "method has actually failed." msgstr "" -#: ../../library/stdtypes.rst:4802 +#: ../../library/stdtypes.rst:4804 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -5040,7 +5045,7 @@ msgid "" "management protocol. See the :mod:`contextlib` module for some examples." msgstr "" -#: ../../library/stdtypes.rst:4808 +#: ../../library/stdtypes.rst:4810 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -5050,7 +5055,7 @@ msgid "" "rather than the iterator produced by an undecorated generator function." msgstr "" -#: ../../library/stdtypes.rst:4815 +#: ../../library/stdtypes.rst:4817 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 " @@ -5059,23 +5064,23 @@ msgid "" "a single class dictionary lookup is negligible." msgstr "" -#: ../../library/stdtypes.rst:4823 +#: ../../library/stdtypes.rst:4825 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" msgstr "" -#: ../../library/stdtypes.rst:4828 +#: ../../library/stdtypes.rst:4830 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." msgstr "" -#: ../../library/stdtypes.rst:4835 +#: ../../library/stdtypes.rst:4837 msgid "Generic Alias Type" msgstr "" -#: ../../library/stdtypes.rst:4841 +#: ../../library/stdtypes.rst:4843 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -5085,19 +5090,19 @@ msgid "" "are intended primarily for use with :term:`type annotations `." msgstr "" -#: ../../library/stdtypes.rst:4851 +#: ../../library/stdtypes.rst:4853 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:4854 +#: ../../library/stdtypes.rst:4856 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." msgstr "" -#: ../../library/stdtypes.rst:4857 +#: ../../library/stdtypes.rst:4859 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 " @@ -5106,7 +5111,7 @@ msgid "" "`bytes`." msgstr "" -#: ../../library/stdtypes.rst:4863 +#: ../../library/stdtypes.rst:4865 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 " @@ -5115,7 +5120,7 @@ msgid "" "the :class:`str` data type and the :class:`bytes` data type:" msgstr "" -#: ../../library/stdtypes.rst:4869 +#: ../../library/stdtypes.rst:4871 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 " @@ -5123,7 +5128,7 @@ msgid "" "annotations with the ``GenericAlias`` ``re.Match[str]``." msgstr "" -#: ../../library/stdtypes.rst:4875 +#: ../../library/stdtypes.rst:4877 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." @@ -5132,21 +5137,21 @@ msgid "" "objects>` objects with ``re.Match[bytes]``." msgstr "" -#: ../../library/stdtypes.rst:4881 +#: ../../library/stdtypes.rst:4883 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:4887 +#: ../../library/stdtypes.rst:4889 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:4895 +#: ../../library/stdtypes.rst:4897 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 " @@ -5154,13 +5159,13 @@ msgid "" "of type :class:`str` and values of type :class:`int`::" msgstr "" -#: ../../library/stdtypes.rst:4903 +#: ../../library/stdtypes.rst:4905 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" msgstr "" -#: ../../library/stdtypes.rst:4911 +#: ../../library/stdtypes.rst:4913 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -5169,331 +5174,331 @@ msgid "" "discouraged, but will run without errors::" msgstr "" -#: ../../library/stdtypes.rst:4921 +#: ../../library/stdtypes.rst:4923 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "" -#: ../../library/stdtypes.rst:4932 +#: ../../library/stdtypes.rst:4934 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "" -#: ../../library/stdtypes.rst:4940 +#: ../../library/stdtypes.rst:4942 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" msgstr "" -#: ../../library/stdtypes.rst:4948 +#: ../../library/stdtypes.rst:4950 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:4959 +#: ../../library/stdtypes.rst:4961 msgid "Standard Generic Classes" msgstr "" -#: ../../library/stdtypes.rst:4961 +#: ../../library/stdtypes.rst:4963 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "" -#: ../../library/stdtypes.rst:4964 +#: ../../library/stdtypes.rst:4966 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:4965 +#: ../../library/stdtypes.rst:4967 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:4966 +#: ../../library/stdtypes.rst:4968 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:4967 +#: ../../library/stdtypes.rst:4969 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:4968 +#: ../../library/stdtypes.rst:4970 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:4969 +#: ../../library/stdtypes.rst:4971 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:4970 +#: ../../library/stdtypes.rst:4972 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:4971 +#: ../../library/stdtypes.rst:4973 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:4972 +#: ../../library/stdtypes.rst:4974 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:4973 +#: ../../library/stdtypes.rst:4975 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:4974 +#: ../../library/stdtypes.rst:4976 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:4975 +#: ../../library/stdtypes.rst:4977 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:4976 +#: ../../library/stdtypes.rst:4978 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:4977 +#: ../../library/stdtypes.rst:4979 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:4978 +#: ../../library/stdtypes.rst:4980 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:4979 +#: ../../library/stdtypes.rst:4981 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:4980 +#: ../../library/stdtypes.rst:4982 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:4981 +#: ../../library/stdtypes.rst:4983 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:4982 +#: ../../library/stdtypes.rst:4984 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:4983 +#: ../../library/stdtypes.rst:4985 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:4984 +#: ../../library/stdtypes.rst:4986 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:4985 +#: ../../library/stdtypes.rst:4987 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:4986 +#: ../../library/stdtypes.rst:4988 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:4987 +#: ../../library/stdtypes.rst:4989 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:4988 +#: ../../library/stdtypes.rst:4990 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:4989 +#: ../../library/stdtypes.rst:4991 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:4990 +#: ../../library/stdtypes.rst:4992 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:4991 +#: ../../library/stdtypes.rst:4993 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:4992 +#: ../../library/stdtypes.rst:4994 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:4993 +#: ../../library/stdtypes.rst:4995 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:4994 +#: ../../library/stdtypes.rst:4996 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:4995 +#: ../../library/stdtypes.rst:4997 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:4996 +#: ../../library/stdtypes.rst:4998 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:4997 +#: ../../library/stdtypes.rst:4999 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:4998 +#: ../../library/stdtypes.rst:5000 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:4999 +#: ../../library/stdtypes.rst:5001 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:5000 +#: ../../library/stdtypes.rst:5002 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:5001 +#: ../../library/stdtypes.rst:5003 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:5002 +#: ../../library/stdtypes.rst:5004 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:5003 +#: ../../library/stdtypes.rst:5005 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:5004 +#: ../../library/stdtypes.rst:5006 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:5005 +#: ../../library/stdtypes.rst:5007 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:5006 +#: ../../library/stdtypes.rst:5008 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:5007 +#: ../../library/stdtypes.rst:5009 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:5008 +#: ../../library/stdtypes.rst:5010 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:5009 +#: ../../library/stdtypes.rst:5011 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:5010 +#: ../../library/stdtypes.rst:5012 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:5011 +#: ../../library/stdtypes.rst:5013 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5012 +#: ../../library/stdtypes.rst:5014 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5013 +#: ../../library/stdtypes.rst:5015 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5014 +#: ../../library/stdtypes.rst:5016 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5015 +#: ../../library/stdtypes.rst:5017 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5016 +#: ../../library/stdtypes.rst:5018 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5017 +#: ../../library/stdtypes.rst:5019 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5022 +#: ../../library/stdtypes.rst:5024 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "" -#: ../../library/stdtypes.rst:5024 +#: ../../library/stdtypes.rst:5026 msgid "All parameterized generics implement special read-only attributes." msgstr "" -#: ../../library/stdtypes.rst:5028 +#: ../../library/stdtypes.rst:5030 msgid "This attribute points at the non-parameterized generic class::" msgstr "" -#: ../../library/stdtypes.rst:5036 +#: ../../library/stdtypes.rst:5038 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:5046 +#: ../../library/stdtypes.rst:5048 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" msgstr "" -#: ../../library/stdtypes.rst:5057 +#: ../../library/stdtypes.rst:5059 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:5064 +#: ../../library/stdtypes.rst:5066 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." msgstr "" -#: ../../library/stdtypes.rst:5073 +#: ../../library/stdtypes.rst:5075 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../library/stdtypes.rst:5073 +#: ../../library/stdtypes.rst:5075 msgid "Introducing Python's framework for type annotations." msgstr "" -#: ../../library/stdtypes.rst:5078 +#: ../../library/stdtypes.rst:5080 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr "" -#: ../../library/stdtypes.rst:5076 +#: ../../library/stdtypes.rst:5078 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:5081 +#: ../../library/stdtypes.rst:5083 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" msgstr "" -#: ../../library/stdtypes.rst:5081 +#: ../../library/stdtypes.rst:5083 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../library/stdtypes.rst:5090 +#: ../../library/stdtypes.rst:5092 msgid "Union Type" msgstr "" -#: ../../library/stdtypes.rst:5096 +#: ../../library/stdtypes.rst:5098 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -5502,7 +5507,7 @@ msgid "" "Union`." msgstr "" -#: ../../library/stdtypes.rst:5103 +#: ../../library/stdtypes.rst:5105 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 " @@ -5510,76 +5515,76 @@ msgid "" "class:`float`::" msgstr "" -#: ../../library/stdtypes.rst:5113 +#: ../../library/stdtypes.rst:5115 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "" -#: ../../library/stdtypes.rst:5115 +#: ../../library/stdtypes.rst:5117 msgid "Unions of unions are flattened::" msgstr "" -#: ../../library/stdtypes.rst:5119 +#: ../../library/stdtypes.rst:5121 msgid "Redundant types are removed::" msgstr "" -#: ../../library/stdtypes.rst:5123 +#: ../../library/stdtypes.rst:5125 msgid "When comparing unions, the order is ignored::" msgstr "" -#: ../../library/stdtypes.rst:5127 +#: ../../library/stdtypes.rst:5129 msgid "It is compatible with :data:`typing.Union`::" msgstr "" -#: ../../library/stdtypes.rst:5131 +#: ../../library/stdtypes.rst:5133 msgid "Optional types can be spelled as a union with ``None``::" msgstr "" -#: ../../library/stdtypes.rst:5138 +#: ../../library/stdtypes.rst:5140 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "" -#: ../../library/stdtypes.rst:5144 +#: ../../library/stdtypes.rst:5146 msgid "" "However, union objects containing :ref:`parameterized generics ` cannot be used::" msgstr "" -#: ../../library/stdtypes.rst:5152 +#: ../../library/stdtypes.rst:5154 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:5165 +#: ../../library/stdtypes.rst:5167 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:5183 +#: ../../library/stdtypes.rst:5185 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr "" -#: ../../library/stdtypes.rst:5191 +#: ../../library/stdtypes.rst:5193 msgid "Other Built-in Types" msgstr "" -#: ../../library/stdtypes.rst:5193 +#: ../../library/stdtypes.rst:5195 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:5200 +#: ../../library/stdtypes.rst:5202 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:5202 +#: ../../library/stdtypes.rst:5204 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 " @@ -5590,7 +5595,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:5209 +#: ../../library/stdtypes.rst:5211 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -5601,32 +5606,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:5217 +#: ../../library/stdtypes.rst:5219 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:5225 +#: ../../library/stdtypes.rst:5227 msgid "Classes and Class Instances" msgstr "" -#: ../../library/stdtypes.rst:5227 +#: ../../library/stdtypes.rst:5229 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "" -#: ../../library/stdtypes.rst:5233 +#: ../../library/stdtypes.rst:5235 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:5235 +#: ../../library/stdtypes.rst:5237 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:5238 +#: ../../library/stdtypes.rst:5240 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -5634,15 +5639,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:5242 +#: ../../library/stdtypes.rst:5244 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`\\ 。" -#: ../../library/stdtypes.rst:5248 +#: ../../library/stdtypes.rst:5250 msgid "Methods" msgstr "" -#: ../../library/stdtypes.rst:5252 +#: ../../library/stdtypes.rst:5254 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 " @@ -5650,7 +5655,7 @@ msgid "" "support them." msgstr "" -#: ../../library/stdtypes.rst:5257 +#: ../../library/stdtypes.rst:5259 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:" @@ -5662,7 +5667,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:5266 +#: ../../library/stdtypes.rst:5268 msgid "" "Like function objects, bound method objects support getting arbitrary " "attributes. However, since method attributes are actually stored on the " @@ -5672,15 +5677,15 @@ msgid "" "attribute, you need to explicitly set it on the underlying function object::" msgstr "" -#: ../../library/stdtypes.rst:5286 ../../library/stdtypes.rst:5317 +#: ../../library/stdtypes.rst:5288 ../../library/stdtypes.rst:5319 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`\\ 。" -#: ../../library/stdtypes.rst:5294 +#: ../../library/stdtypes.rst:5296 msgid "Code Objects" msgstr "" -#: ../../library/stdtypes.rst:5300 +#: ../../library/stdtypes.rst:5302 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -5690,23 +5695,23 @@ msgid "" "`__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:5307 +#: ../../library/stdtypes.rst:5309 msgid "" "Accessing ``__code__`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"__code__\"``." msgstr "" -#: ../../library/stdtypes.rst:5314 +#: ../../library/stdtypes.rst:5316 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:5323 +#: ../../library/stdtypes.rst:5325 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:5329 +#: ../../library/stdtypes.rst:5331 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 " @@ -5714,30 +5719,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:5334 +#: ../../library/stdtypes.rst:5336 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:5340 +#: ../../library/stdtypes.rst:5342 msgid "The Null Object" msgstr "" -#: ../../library/stdtypes.rst:5342 +#: ../../library/stdtypes.rst:5344 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:5346 +#: ../../library/stdtypes.rst:5348 msgid "It is written as ``None``." msgstr "" -#: ../../library/stdtypes.rst:5353 +#: ../../library/stdtypes.rst:5355 msgid "The Ellipsis Object" msgstr "" -#: ../../library/stdtypes.rst:5355 +#: ../../library/stdtypes.rst:5357 msgid "" "This object is commonly used by slicing (see :ref:`slicings`). It supports " "no special operations. There is exactly one ellipsis object, named :const:" @@ -5745,15 +5750,15 @@ msgid "" "`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:5360 +#: ../../library/stdtypes.rst:5362 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "" -#: ../../library/stdtypes.rst:5366 +#: ../../library/stdtypes.rst:5368 msgid "The NotImplemented Object" msgstr "" -#: ../../library/stdtypes.rst:5368 +#: ../../library/stdtypes.rst:5370 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 " @@ -5761,15 +5766,15 @@ msgid "" "``type(NotImplemented)()`` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:5373 +#: ../../library/stdtypes.rst:5375 msgid "It is written as ``NotImplemented``." msgstr "" -#: ../../library/stdtypes.rst:5379 +#: ../../library/stdtypes.rst:5381 msgid "Boolean Values" msgstr "" -#: ../../library/stdtypes.rst:5381 +#: ../../library/stdtypes.rst:5383 msgid "" "Boolean values are the two constant objects ``False`` and ``True``. They " "are used to represent truth values (although other values can also be " @@ -5780,81 +5785,81 @@ msgid "" "(see section :ref:`truth` above)." msgstr "" -#: ../../library/stdtypes.rst:5394 +#: ../../library/stdtypes.rst:5396 msgid "They are written as ``False`` and ``True``, respectively." msgstr "" -#: ../../library/stdtypes.rst:5400 +#: ../../library/stdtypes.rst:5402 msgid "Internal Objects" msgstr "" -#: ../../library/stdtypes.rst:5402 +#: ../../library/stdtypes.rst:5404 msgid "" "See :ref:`types` for this information. It describes stack frame objects, " "traceback objects, and slice objects." msgstr "" -#: ../../library/stdtypes.rst:5409 +#: ../../library/stdtypes.rst:5411 msgid "Special Attributes" msgstr "" -#: ../../library/stdtypes.rst:5411 +#: ../../library/stdtypes.rst:5413 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:5418 +#: ../../library/stdtypes.rst:5420 msgid "" "A dictionary or other mapping object used to store an object's (writable) " "attributes." msgstr "" -#: ../../library/stdtypes.rst:5424 +#: ../../library/stdtypes.rst:5426 msgid "The class to which a class instance belongs." msgstr "" -#: ../../library/stdtypes.rst:5429 +#: ../../library/stdtypes.rst:5431 msgid "The tuple of base classes of a class object." msgstr "" -#: ../../library/stdtypes.rst:5434 +#: ../../library/stdtypes.rst:5436 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:5440 +#: ../../library/stdtypes.rst:5442 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:5448 +#: ../../library/stdtypes.rst:5450 msgid "" "This attribute is a tuple of classes that are considered when looking for " "base classes during method resolution." msgstr "" -#: ../../library/stdtypes.rst:5454 +#: ../../library/stdtypes.rst:5456 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:5461 +#: ../../library/stdtypes.rst:5463 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:5472 +#: ../../library/stdtypes.rst:5474 msgid "Integer string conversion length limitation" msgstr "" -#: ../../library/stdtypes.rst:5474 +#: ../../library/stdtypes.rst:5476 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 " @@ -5862,7 +5867,7 @@ msgid "" "binary conversions are unlimited. The limit can be configured." msgstr "" -#: ../../library/stdtypes.rst:5479 +#: ../../library/stdtypes.rst:5481 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 " @@ -5872,25 +5877,25 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:5486 +#: ../../library/stdtypes.rst:5488 msgid "" "Limiting conversion size offers a practical way to avoid `CVE-2020-10735 " "`_." msgstr "" -#: ../../library/stdtypes.rst:5489 +#: ../../library/stdtypes.rst:5491 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:5493 +#: ../../library/stdtypes.rst:5495 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:5515 +#: ../../library/stdtypes.rst:5517 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -5898,94 +5903,94 @@ msgid "" "str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:5520 +#: ../../library/stdtypes.rst:5522 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:5535 +#: ../../library/stdtypes.rst:5537 msgid "Affected APIs" msgstr "" -#: ../../library/stdtypes.rst:5537 +#: ../../library/stdtypes.rst:5539 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" msgstr "" -#: ../../library/stdtypes.rst:5540 +#: ../../library/stdtypes.rst:5542 msgid "``int(string)`` with default base 10." msgstr "" -#: ../../library/stdtypes.rst:5541 +#: ../../library/stdtypes.rst:5543 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "" -#: ../../library/stdtypes.rst:5542 +#: ../../library/stdtypes.rst:5544 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:5543 +#: ../../library/stdtypes.rst:5545 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:5544 +#: ../../library/stdtypes.rst:5546 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:5547 +#: ../../library/stdtypes.rst:5549 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:5549 +#: ../../library/stdtypes.rst:5551 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "" -#: ../../library/stdtypes.rst:5550 +#: ../../library/stdtypes.rst:5552 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr "" -#: ../../library/stdtypes.rst:5551 +#: ../../library/stdtypes.rst:5553 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr "" -#: ../../library/stdtypes.rst:5552 +#: ../../library/stdtypes.rst:5554 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr "" -#: ../../library/stdtypes.rst:5553 +#: ../../library/stdtypes.rst:5555 msgid ":class:`str` to :class:`float`." msgstr "" -#: ../../library/stdtypes.rst:5554 +#: ../../library/stdtypes.rst:5556 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr "" -#: ../../library/stdtypes.rst:5557 +#: ../../library/stdtypes.rst:5559 msgid "Configuring the limit" msgstr "" -#: ../../library/stdtypes.rst:5559 +#: ../../library/stdtypes.rst:5561 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:5562 +#: ../../library/stdtypes.rst:5564 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:5565 +#: ../../library/stdtypes.rst:5567 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" msgstr "" -#: ../../library/stdtypes.rst:5567 +#: ../../library/stdtypes.rst:5569 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 " @@ -5994,38 +5999,38 @@ msgid "" "int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:5573 +#: ../../library/stdtypes.rst:5575 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:5576 +#: ../../library/stdtypes.rst:5578 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:5580 +#: ../../library/stdtypes.rst:5582 msgid "" "Information about the default and minimum can be found in :attr:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:5582 +#: ../../library/stdtypes.rst:5584 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:5584 +#: ../../library/stdtypes.rst:5586 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:5591 +#: ../../library/stdtypes.rst:5593 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 " @@ -6037,7 +6042,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:5600 +#: ../../library/stdtypes.rst:5602 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 " @@ -6045,11 +6050,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:5606 +#: ../../library/stdtypes.rst:5608 msgid "Recommended configuration" msgstr "" -#: ../../library/stdtypes.rst:5608 +#: ../../library/stdtypes.rst:5610 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 " @@ -6057,45 +6062,45 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.11." msgstr "" -#: ../../library/stdtypes.rst:5613 +#: ../../library/stdtypes.rst:5615 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/stdtypes.rst:5625 +#: ../../library/stdtypes.rst:5627 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:5629 +#: ../../library/stdtypes.rst:5631 msgid "Footnotes" msgstr "註解" -#: ../../library/stdtypes.rst:5630 +#: ../../library/stdtypes.rst:5632 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:5633 +#: ../../library/stdtypes.rst:5635 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:5636 +#: ../../library/stdtypes.rst:5638 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:5638 +#: ../../library/stdtypes.rst:5640 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:5641 +#: ../../library/stdtypes.rst:5643 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." From e64cd545601350eb9ca7bf2ce32ec6d6efcf32d2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 7 Mar 2023 00:20:21 +0000 Subject: [PATCH 03/10] sync with cpython 280b975c --- sphinx.po | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sphinx.po b/sphinx.po index 09e7f94057..641c0aac60 100644 --- a/sphinx.po +++ b/sphinx.po @@ -9,7 +9,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-03-07 00:18+0000\n" "PO-Revision-Date: 2022-06-27 11:06+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -46,23 +46,35 @@ msgstr "自從版本 {deprecated} 後不推薦使用,將會自版本 {removed} msgid "Deprecated since version {deprecated}, removed in version {removed}" msgstr "自從版本 {deprecated} 後不推薦使用,已從版本 {removed} 中移除。" +#: ../../tools/templates/dummy.html:12 +msgid "Return value: Always NULL." +msgstr "" + #: ../../tools/templates/dummy.html:13 +msgid "Return value: New reference." +msgstr "" + +#: ../../tools/templates/dummy.html:14 +msgid "Return value: Borrowed reference." +msgstr "" + +#: ../../tools/templates/dummy.html:18 msgid "in development" msgstr "開發中" -#: ../../tools/templates/dummy.html:14 +#: ../../tools/templates/dummy.html:19 msgid "pre-release" msgstr "預發行" -#: ../../tools/templates/dummy.html:15 +#: ../../tools/templates/dummy.html:20 msgid "stable" msgstr "穩定版本" -#: ../../tools/templates/dummy.html:16 +#: ../../tools/templates/dummy.html:21 msgid "security-fixes" msgstr "安全性修護" -#: ../../tools/templates/dummy.html:17 +#: ../../tools/templates/dummy.html:22 msgid "EOL" msgstr "停止維護" From ad974013fa133f9e141d608a7d05aa4a07d0af9f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 8 Mar 2023 00:18:54 +0000 Subject: [PATCH 04/10] sync with cpython df3ed54e --- whatsnew/3.11.po | 1393 ++++++++++++++++++++++++++-------------------- 1 file changed, 796 insertions(+), 597 deletions(-) diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 5a635a7b69..316de7f57f 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: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-03-08 00:17+0000\n" "PO-Revision-Date: 2022-12-26 19:43+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -165,7 +165,7 @@ msgid "" "pep670>`" msgstr ":pep:`670`:\\ :ref:`轉換為靜態行內函式的巨集 `" -#: ../../whatsnew/3.11.rst:110 ../../whatsnew/3.11.rst:2175 +#: ../../whatsnew/3.11.rst:110 ../../whatsnew/3.11.rst:2207 msgid "New Features" msgstr "新增特性" @@ -2088,57 +2088,47 @@ msgstr "更快的 CPython" #: ../../whatsnew/3.11.rst:1322 msgid "" -"CPython 3.11 is on average `25% faster `_ than CPython 3.10 when measured with the " +"CPython 3.11 is an average of `25% faster `_ than CPython 3.10 as measured with the " "`pyperformance `_ benchmark suite, " -"and compiled with GCC on Ubuntu Linux. Depending on your workload, the " -"speedup could be up to 10-60% faster." +"when compiled with GCC on Ubuntu Linux. Depending on your workload, the " +"overall speedup could be 10-60%." msgstr "" -"當使用基準量測套裝軟體 `pyperformance `_ 量測並以 GCC 於 Ubuntu Linux 上編譯,Python 3.11 平均比 " -"Python 3.10 `快了 25% `_。根據程式工作量可能有所不同,加速程度可能高達 10-60%。" -#: ../../whatsnew/3.11.rst:1328 +#: ../../whatsnew/3.11.rst:1329 msgid "" -"This project focuses on two major areas in Python: faster startup and faster " -"runtime. Other optimizations not under this project are listed in " -"`Optimizations`_." +"This project focuses on two major areas in Python: :ref:`whatsnew311-faster-" +"startup` and :ref:`whatsnew311-faster-runtime`. Optimizations not covered by " +"this project are listed separately under :ref:`whatsnew311-optimizations`." msgstr "" -"這個計畫著重於 Python 的兩個地方:更快的啟動 (faster startup) 與更快的運行程" -"式 (faster runtime)。其他不在此計畫的最佳化項目列於 `Optimizations`_。" -#: ../../whatsnew/3.11.rst:1335 +#: ../../whatsnew/3.11.rst:1338 msgid "Faster Startup" msgstr "更快的啟動" -#: ../../whatsnew/3.11.rst:1340 +#: ../../whatsnew/3.11.rst:1343 msgid "Frozen imports / Static code objects" msgstr "凍結引入 (Frozen imports) / 靜態程式碼物件 (Static code objects)" -#: ../../whatsnew/3.11.rst:1342 +#: ../../whatsnew/3.11.rst:1345 msgid "" -"Python caches bytecode in the :ref:`__pycache__` directory to " -"speed up module loading." +"Python caches :term:`bytecode` in the :ref:`__pycache__ ` " +"directory to speed up module loading." msgstr "" -"Python 將位元組碼於 :ref:`__pycache__` 目錄中存為快取來加速模組" -"的載入。" -#: ../../whatsnew/3.11.rst:1345 +#: ../../whatsnew/3.11.rst:1348 msgid "Previously in 3.10, Python module execution looked like this:" msgstr "在先前的 3.10 中,執行 Python 模組會像是這樣:" -#: ../../whatsnew/3.11.rst:1351 +#: ../../whatsnew/3.11.rst:1354 msgid "" "In Python 3.11, the core modules essential for Python startup are " -"\"frozen\". This means that their code objects (and bytecode) are statically " -"allocated by the interpreter. This reduces the steps in module execution " -"process to this:" +"\"frozen\". This means that their :ref:`codeobjects` (and bytecode) are " +"statically allocated by the interpreter. This reduces the steps in module " +"execution process to:" msgstr "" -"在 Python 3.11 中,核心模組在 Python 啟動時必須被「凍結」,這意味著它們的程式" -"碼物件(和位元組碼)是由直譯器靜態分配的。這將模組執行過程中的步驟減少為:" -#: ../../whatsnew/3.11.rst:1359 +#: ../../whatsnew/3.11.rst:1363 msgid "" "Interpreter startup is now 10-15% faster in Python 3.11. This has a big " "impact for short-running programs using Python." @@ -2146,39 +2136,35 @@ msgstr "" "在 Python 3.11 中直譯器啟動速度快了 10-15%。這對於使用 Python 所撰寫的短暫程" "式有著巨大影響。" -#: ../../whatsnew/3.11.rst:1362 +#: ../../whatsnew/3.11.rst:1366 msgid "" -"(Contributed by Eric Snow, Guido van Rossum and Kumar Aditya in numerous " -"issues.)" +"(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:1368 +#: ../../whatsnew/3.11.rst:1372 msgid "Faster Runtime" msgstr "更快的運行程式" -#: ../../whatsnew/3.11.rst:1373 +#: ../../whatsnew/3.11.rst:1377 msgid "Cheaper, lazy Python frames" msgstr "所需資源更少 (cheaper) 且惰性的 (lazy)) Python 幀 (frame)" -#: ../../whatsnew/3.11.rst:1375 +#: ../../whatsnew/3.11.rst:1379 msgid "" -"Python frames are created whenever Python calls a Python function. This " -"frame holds execution information. The following are new frame optimizations:" +"Python frames, holding execution information, are created whenever Python " +"calls a Python function. The following are new frame optimizations:" msgstr "" -"每當 Python 呼叫 Python 函數時,就會建立 Python 幀。該幀保存執行資訊。以下是" -"針對幀而做的新最佳化:" -#: ../../whatsnew/3.11.rst:1378 +#: ../../whatsnew/3.11.rst:1383 msgid "Streamlined the frame creation process." msgstr "使幀的建立過程更有效率。" -#: ../../whatsnew/3.11.rst:1379 +#: ../../whatsnew/3.11.rst:1384 msgid "" "Avoided memory allocation by generously re-using frame space on the C stack." msgstr "在 C 堆疊 (stack) 中盡量重複利用幀的空間來避免記憶體分配。" -#: ../../whatsnew/3.11.rst:1380 +#: ../../whatsnew/3.11.rst:1385 msgid "" "Streamlined the internal frame struct to contain only essential information. " "Frames previously held extra debugging and memory management information." @@ -2186,28 +2172,25 @@ msgstr "" "讓內部幀結構只包含必要資訊,使其更加精簡。在過去,幀必須帶有額外的偵錯與記憶" "體管理的資訊。" -#: ../../whatsnew/3.11.rst:1383 +#: ../../whatsnew/3.11.rst:1388 msgid "" -"Old-style frame objects are now created only when requested by debuggers or " -"by Python introspection functions such as ``sys._getframe`` or ``inspect." -"currentframe``. For most user code, no frame objects are created at all. As " -"a result, nearly all Python functions calls have sped up significantly. We " -"measured a 3-7% speedup in pyperformance." +"Old-style :ref:`frame objects ` are now created only when " +"requested by debuggers or by Python introspection functions such as :func:" +"`sys._getframe` and :func:`inspect.currentframe`. For most user code, no " +"frame objects are created at all. As a result, nearly all Python functions " +"calls have sped up significantly. We measured a 3-7% speedup in " +"pyperformance." msgstr "" -"舊式幀物件現在僅在除錯器或 Python 自我檢查函式(例如 ``sys._getframe`` 或 " -"``inspect.currentframe``)請求時才建立。對於大多數使用者程式碼,根本不會建立" -"任何幀物件。結果幾乎所有 Python 函式呼叫都顯著加速。我們以 pyperformance 測得" -"了 3-7% 的加速。" -#: ../../whatsnew/3.11.rst:1389 +#: ../../whatsnew/3.11.rst:1395 msgid "(Contributed by Mark Shannon in :issue:`44590`.)" msgstr "(由 Mark Shannon 於 :issue:`44590` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1396 +#: ../../whatsnew/3.11.rst:1402 msgid "Inlined Python function calls" msgstr "行內 Python 函式呼叫" -#: ../../whatsnew/3.11.rst:1398 +#: ../../whatsnew/3.11.rst:1404 msgid "" "During a Python function call, Python will call an evaluating C function to " "interpret that function's code. This effectively limits pure Python " @@ -2216,7 +2199,7 @@ msgstr "" "在 Python 函式呼叫期間,Python 將呼叫一個正在求值的 C 函式來直譯該函式的程式" "碼,這有效地將純 Python 遞迴限制在對 C 堆疊的安全範圍內。" -#: ../../whatsnew/3.11.rst:1402 +#: ../../whatsnew/3.11.rst:1408 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. " @@ -2226,77 +2209,59 @@ msgstr "" "一個新框架 (frame),並「跳轉」到新框架內的新程式碼,這避免了呼叫整個 C 直譯函" "式。" -#: ../../whatsnew/3.11.rst:1406 +#: ../../whatsnew/3.11.rst:1412 msgid "" -"Most Python function calls now consume no C stack space. This speeds up most " -"of such calls. In simple recursive functions like fibonacci or factorial, a " -"1.7x speedup was observed. This also means recursive functions can recurse " -"significantly deeper (if the user increases the recursion limit). We " -"measured a 1-3% improvement in pyperformance." +"Most Python function calls now consume no C stack space, speeding them up. " +"In simple recursive functions like fibonacci or factorial, we observed a " +"1.7x speedup. This also means recursive functions can recurse significantly " +"deeper (if the user increases the recursion limit with :func:`sys." +"setrecursionlimit`). We measured a 1-3% improvement in pyperformance." msgstr "" -"現在大多數 Python 函式的呼叫不會佔用 C 堆疊空間,這加快了大多數此類呼叫的速" -"度。在斐波那契 (fibonacci) 或階乘等簡單遞迴函式中,觀察到 1.7 倍的加速。這也" -"意味著遞迴函式可以遞迴得更深(如果使用者有增加遞迴限制)。我們在 " -"pyperformance 測得 1-3% 的改進。" -#: ../../whatsnew/3.11.rst:1412 +#: ../../whatsnew/3.11.rst:1419 msgid "(Contributed by Pablo Galindo and Mark Shannon in :issue:`45256`.)" msgstr "(由 Pablo Galindo 與 Mark Shannon 於 :issue:`45256` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1418 +#: ../../whatsnew/3.11.rst:1425 msgid "PEP 659: Specializing Adaptive Interpreter" msgstr "PEP 659:特化的適應性直譯器" -#: ../../whatsnew/3.11.rst:1420 +#: ../../whatsnew/3.11.rst:1427 msgid "" -":pep:`659` is one of the key parts of the faster CPython project. The " +":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 " "regions where objects and types rarely change. This concept is known as " "*type stability*." msgstr "" -":pep:`659` 是加速 CPython 專案的關鍵部分之一。一般的想法是,雖然 Python 是一" -"種動態語言,但大多數程式碼都有物件和型別很少去更改的區域。這個概念被稱為\\ *" -"型別穩定 (type stability)*\\ 。" -#: ../../whatsnew/3.11.rst:1424 +#: ../../whatsnew/3.11.rst:1431 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 " "more specialized one. This specialized operation uses fast paths available " "only to those use cases/types, which generally outperform their generic " "counterparts. This also brings in another concept called *inline caching*, " -"where Python caches the results of expensive operations directly in the " -"bytecode." +"where Python caches the results of expensive operations directly in the :" +"term:`bytecode`." msgstr "" -"在運行時間,Python 將嘗試在執行中的程式碼內尋找常用模式和型別穩定,然後 " -"Python 將用更特化的操作替換當前操作。這種特化操作運用了僅適用於那些用例/型別" -"的快速路徑,這通常優於它們的泛用對應 (generic counterparts)。這也引入了另一個" -"稱為\\ *行內快取 (inline caching)*\\ 的概念,其中 Python 將繁重操作的結果直接" -"快取在位元組碼中。" -#: ../../whatsnew/3.11.rst:1431 +#: ../../whatsnew/3.11.rst:1439 msgid "" "The specializer will also combine certain common instruction pairs into one " -"superinstruction. This reduces the overhead during execution." +"superinstruction, reducing the overhead during execution." msgstr "" -"特化程式 (specializer) 還將某些常用指示 (common instruction) 組合成一個超級指" -"示 (superinstruction),這減少了執行期間的開銷。" -#: ../../whatsnew/3.11.rst:1434 +#: ../../whatsnew/3.11.rst:1442 msgid "" "Python will only specialize when it sees code that is \"hot\" (executed " -"multiple times). This prevents Python from wasting time for run-once code. " +"multiple times). This prevents Python from wasting time on run-once code. " "Python can also de-specialize when code is too dynamic or when the use " "changes. Specialization is attempted periodically, and specialization " -"attempts are not too expensive. This allows specialization to adapt to new " +"attempts are not too expensive, allowing specialization to adapt to new " "circumstances." msgstr "" -"Python 只會在看到「熱」(被多次執行的)程式碼時特化,這可以防止 Python 將時間" -"浪費在只運行一次的程式碼上。當程式碼過於動態或用途發生變化時,Python 也可以去" -"特化 (de-specialize)。特化會定期被嘗試執行,而嘗試的成本也不會太高,這讓特化" -"得以適應新的環境。" -#: ../../whatsnew/3.11.rst:1441 +#: ../../whatsnew/3.11.rst:1449 msgid "" "(PEP written by Mark Shannon, with ideas inspired by Stefan Brunthaler. See :" "pep:`659` for more information. Implementation by Mark Shannon and Brandt " @@ -2306,129 +2271,141 @@ msgstr "" "`659`。由 Mark Shannon 和 Brandt Bucher 實作,Irit Katriel 和 Dennis Sweeney " "亦提供了額外的幫助。)" -#: ../../whatsnew/3.11.rst:1449 +#: ../../whatsnew/3.11.rst:1457 msgid "Operation" msgstr "操作" -#: ../../whatsnew/3.11.rst:1449 +#: ../../whatsnew/3.11.rst:1457 msgid "Form" msgstr "形式" -#: ../../whatsnew/3.11.rst:1449 +#: ../../whatsnew/3.11.rst:1457 msgid "Specialization" msgstr "特化" -#: ../../whatsnew/3.11.rst:1449 +#: ../../whatsnew/3.11.rst:1457 msgid "Operation speedup (up to)" msgstr "操作加速程度(上限)" -#: ../../whatsnew/3.11.rst:1449 +#: ../../whatsnew/3.11.rst:1457 msgid "Contributor(s)" msgstr "貢獻者" -#: ../../whatsnew/3.11.rst:1452 +#: ../../whatsnew/3.11.rst:1460 msgid "Binary operations" msgstr "二元操作" -#: ../../whatsnew/3.11.rst:1452 -msgid "``x+x; x*x; x-x;``" -msgstr "``x+x; x*x; x-x;``" +#: ../../whatsnew/3.11.rst:1460 +msgid "``x + x``" +msgstr "" + +#: ../../whatsnew/3.11.rst:1462 +msgid "``x - x``" +msgstr "" -#: ../../whatsnew/3.11.rst:1452 +#: ../../whatsnew/3.11.rst:1464 +msgid "``x * x``" +msgstr "" + +#: ../../whatsnew/3.11.rst:1460 msgid "" -"Binary add, multiply and subtract for common types such as ``int``, " -"``float``, and ``str`` take custom fast paths for their underlying types." +"Binary add, multiply and subtract for common types such as :class:`int`, :" +"class:`float` and :class:`str` take custom fast paths for their underlying " +"types." msgstr "" -"常見型別如 ``int``、``float`` 與 ``str`` 的二元加法、乘法與減法,為底層型別採" -"取了特製的快速路徑。" -#: ../../whatsnew/3.11.rst:1452 +#: ../../whatsnew/3.11.rst:1460 msgid "10%" msgstr "10%" -#: ../../whatsnew/3.11.rst:1452 +#: ../../whatsnew/3.11.rst:1460 msgid "Mark Shannon, Dong-hee Na, Brandt Bucher, Dennis Sweeney" msgstr "Mark Shannon, Dong-hee Na, Brandt Bucher, Dennis Sweeney" -#: ../../whatsnew/3.11.rst:1457 +#: ../../whatsnew/3.11.rst:1466 msgid "Subscript" msgstr "下標" -#: ../../whatsnew/3.11.rst:1457 +#: ../../whatsnew/3.11.rst:1466 msgid "``a[i]``" msgstr "``a[i]``" -#: ../../whatsnew/3.11.rst:1457 +#: ../../whatsnew/3.11.rst:1466 msgid "" -"Subscripting container types such as ``list``, ``tuple`` and ``dict`` " -"directly index the underlying data structures." +"Subscripting container types such as :class:`list`, :class:`tuple` and :" +"class:`dict` directly index the underlying data structures." msgstr "" -"下標容器型別如 ``list``、``tuple`` 和 ``dict`` 直接索引底層的資料結構。" -#: ../../whatsnew/3.11.rst:1461 +#: ../../whatsnew/3.11.rst:1470 msgid "" -"Subscripting custom ``__getitem__`` is also inlined similar to :ref:`inline-" -"calls`." -msgstr "下標自定義 ``__getitem__`` 也是行內的,類似於 :ref:`inline-calls`。" +"Subscripting custom :meth:`~object.__getitem__` is also inlined similar to :" +"ref:`inline-calls`." +msgstr "" -#: ../../whatsnew/3.11.rst:1457 ../../whatsnew/3.11.rst:1464 +#: ../../whatsnew/3.11.rst:1466 ../../whatsnew/3.11.rst:1473 msgid "10-25%" msgstr "10-25%" -#: ../../whatsnew/3.11.rst:1457 +#: ../../whatsnew/3.11.rst:1466 msgid "Irit Katriel, Mark Shannon" msgstr "Irit Katriel, Mark Shannon" -#: ../../whatsnew/3.11.rst:1464 +#: ../../whatsnew/3.11.rst:1473 msgid "Store subscript" msgstr "儲存下標" -#: ../../whatsnew/3.11.rst:1464 +#: ../../whatsnew/3.11.rst:1473 msgid "``a[i] = z``" msgstr "``a[i] = z``" -#: ../../whatsnew/3.11.rst:1464 +#: ../../whatsnew/3.11.rst:1473 msgid "Similar to subscripting specialization above." msgstr "類似於上面的下標特化。" -#: ../../whatsnew/3.11.rst:1464 +#: ../../whatsnew/3.11.rst:1473 msgid "Dennis Sweeney" msgstr "Dennis Sweeney" -#: ../../whatsnew/3.11.rst:1467 +#: ../../whatsnew/3.11.rst:1476 msgid "Calls" msgstr "呼叫" -#: ../../whatsnew/3.11.rst:1467 -msgid "``f(arg)`` ``C(arg)``" -msgstr "``f(arg)`` ``C(arg)``" +#: ../../whatsnew/3.11.rst:1476 +msgid "``f(arg)``" +msgstr "" + +#: ../../whatsnew/3.11.rst:1478 +msgid "``C(arg)``" +msgstr "" -#: ../../whatsnew/3.11.rst:1467 +#: ../../whatsnew/3.11.rst:1476 msgid "" -"Calls to common builtin (C) functions and types such as ``len`` and ``str`` " -"directly call their underlying C version. This avoids going through the " -"internal calling convention." +"Calls to common builtin (C) functions and types such as :func:`len` and :" +"class:`str` directly call their underlying C version. This avoids going " +"through the internal calling convention." msgstr "" -"常見內建 (C) 函式和型別的呼叫,例如 ``len`` 和 ``str``,會直接呼叫它們的 C 版" -"本底層,這避免了通過內部呼叫的慣例。" -#: ../../whatsnew/3.11.rst:1467 +#: ../../whatsnew/3.11.rst:1476 msgid "20%" msgstr "20%" -#: ../../whatsnew/3.11.rst:1467 +#: ../../whatsnew/3.11.rst:1476 msgid "Mark Shannon, Ken Jin" msgstr "Mark Shannon, Ken Jin" -#: ../../whatsnew/3.11.rst:1473 +#: ../../whatsnew/3.11.rst:1481 msgid "Load global variable" msgstr "載入全域變數" -#: ../../whatsnew/3.11.rst:1473 -msgid "``print`` ``len``" -msgstr "``print`` ``len``" +#: ../../whatsnew/3.11.rst:1481 +msgid "``print``" +msgstr "" -#: ../../whatsnew/3.11.rst:1473 +#: ../../whatsnew/3.11.rst:1483 +msgid "``len``" +msgstr "" + +#: ../../whatsnew/3.11.rst:1481 msgid "" "The object's index in the globals/builtins namespace is cached. Loading " "globals and builtins require zero namespace lookups." @@ -2436,24 +2413,24 @@ msgstr "" "全域/內建之命名空間內的物件索引被快取起來。載入全域與內建變數不需要任何命名空" "間的查找。" -#: ../../whatsnew/3.11.rst:1473 -msgid "[1]_" -msgstr "[1]_" +#: ../../whatsnew/3.11.rst:1481 +msgid "[#load-global]_" +msgstr "" -#: ../../whatsnew/3.11.rst:1473 ../../whatsnew/3.11.rst:1477 -#: ../../whatsnew/3.11.rst:1486 +#: ../../whatsnew/3.11.rst:1481 ../../whatsnew/3.11.rst:1485 +#: ../../whatsnew/3.11.rst:1494 msgid "Mark Shannon" msgstr "Mark Shannon" -#: ../../whatsnew/3.11.rst:1477 +#: ../../whatsnew/3.11.rst:1485 msgid "Load attribute" msgstr "載入屬性" -#: ../../whatsnew/3.11.rst:1477 +#: ../../whatsnew/3.11.rst:1485 msgid "``o.attr``" msgstr "``o.attr``" -#: ../../whatsnew/3.11.rst:1477 +#: ../../whatsnew/3.11.rst:1485 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 " @@ -2462,19 +2439,19 @@ msgstr "" "和載入全域變數類似,類別/物件之命名空間內的屬性索引被快取起來。在大部分情況" "中,載入屬性不需要任何命名空間的查找。" -#: ../../whatsnew/3.11.rst:1477 -msgid "[2]_" -msgstr "[2]_" +#: ../../whatsnew/3.11.rst:1485 +msgid "[#load-attr]_" +msgstr "" -#: ../../whatsnew/3.11.rst:1482 +#: ../../whatsnew/3.11.rst:1490 msgid "Load methods for call" msgstr "載入要呼叫的方法" -#: ../../whatsnew/3.11.rst:1482 +#: ../../whatsnew/3.11.rst:1490 msgid "``o.meth()``" msgstr "``o.meth()``" -#: ../../whatsnew/3.11.rst:1482 +#: ../../whatsnew/3.11.rst:1490 msgid "" "The actual address of the method is cached. Method loading now has no " "namespace lookups -- even for classes with long inheritance chains." @@ -2482,61 +2459,59 @@ msgstr "" "方法的真實記憶體地址被快取 (cache) 起來,方法的載入現在不需要命名空間的查找 " "-- 即便有很長繼承鏈結的類別也是。" -#: ../../whatsnew/3.11.rst:1482 +#: ../../whatsnew/3.11.rst:1490 msgid "10-20%" msgstr "10-20%" -#: ../../whatsnew/3.11.rst:1482 +#: ../../whatsnew/3.11.rst:1490 msgid "Ken Jin, Mark Shannon" msgstr "Ken Jin, Mark Shannon" -#: ../../whatsnew/3.11.rst:1486 +#: ../../whatsnew/3.11.rst:1494 msgid "Store attribute" msgstr "儲存屬性" -#: ../../whatsnew/3.11.rst:1486 +#: ../../whatsnew/3.11.rst:1494 msgid "``o.attr = z``" msgstr "``o.attr = z``" -#: ../../whatsnew/3.11.rst:1486 +#: ../../whatsnew/3.11.rst:1494 msgid "Similar to load attribute optimization." msgstr "和載入屬性的最佳化相似。" -#: ../../whatsnew/3.11.rst:1486 +#: ../../whatsnew/3.11.rst:1494 msgid "2% in pyperformance" msgstr "2% 於 pyperformance 中" -#: ../../whatsnew/3.11.rst:1489 +#: ../../whatsnew/3.11.rst:1497 msgid "Unpack Sequence" msgstr "拆解 (unpack) 序列" -#: ../../whatsnew/3.11.rst:1489 +#: ../../whatsnew/3.11.rst:1497 msgid "``*seq``" msgstr "``*seq``" -#: ../../whatsnew/3.11.rst:1489 +#: ../../whatsnew/3.11.rst:1497 msgid "" -"Specialized for common containers such as ``list`` and ``tuple``. Avoids " -"internal calling convention." -msgstr "為像是 ``list`` 和 ``tuple`` 的常見容器所特化,避免了內部呼叫慣例。" +"Specialized for common containers such as :class:`list` and :class:`tuple`. " +"Avoids internal calling convention." +msgstr "" -#: ../../whatsnew/3.11.rst:1489 +#: ../../whatsnew/3.11.rst:1497 msgid "8%" msgstr "8%" -#: ../../whatsnew/3.11.rst:1489 +#: ../../whatsnew/3.11.rst:1497 msgid "Brandt Bucher" msgstr "Brandt Bucher" -#: ../../whatsnew/3.11.rst:1493 +#: ../../whatsnew/3.11.rst:1502 msgid "" -"A similar optimization already existed since Python 3.8. 3.11 specializes " +"A similar optimization already existed since Python 3.8. 3.11 specializes " "for more forms and reduces some overhead." msgstr "" -"類似的最佳化自從 Python 3.8 就存在。3.11 特別處理了更多形式並減少效能開銷 " -"(overhead)。" -#: ../../whatsnew/3.11.rst:1496 +#: ../../whatsnew/3.11.rst:1505 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:" @@ -2545,11 +2520,11 @@ msgstr "" "類似的最佳化自從 Python 3.10 就存在。3.11 特別處理了更多形式。此外,所有屬性" "載入也被 :issue:`45947` 所加速。" -#: ../../whatsnew/3.11.rst:1504 +#: ../../whatsnew/3.11.rst:1513 msgid "Misc" msgstr "雜項" -#: ../../whatsnew/3.11.rst:1506 +#: ../../whatsnew/3.11.rst:1515 msgid "" "Objects now require less memory due to lazily created object namespaces. " "Their namespace dictionaries now also share keys more freely. (Contributed " @@ -2559,7 +2534,14 @@ msgstr "" "字典現在也更自由地共享鍵。(由 Mark Shannon 於 :issue:`45340` 和 :issue:" "`40116` 貢獻。 )" -#: ../../whatsnew/3.11.rst:1510 +#: ../../whatsnew/3.11.rst:1519 +msgid "" +"\"Zero-cost\" exceptions are implemented, eliminating the cost of :keyword:" +"`try` statements when no exception is raised. (Contributed by Mark Shannon " +"in :issue:`40222`.)" +msgstr "" + +#: ../../whatsnew/3.11.rst:1523 msgid "" "A more concise representation of exceptions in the interpreter reduced the " "time required for catching an exception by about 10%. (Contributed by Irit " @@ -2568,53 +2550,55 @@ msgstr "" "在直譯器內使用更簡潔的例外表示法將捕獲一個例外所需的時間減少了大約 10%。 由 " "Irit Katriel 在 :issue:`45711` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1518 +#: ../../whatsnew/3.11.rst:1527 +msgid "" +":mod:`re`'s regular expression matching engine has been partially " +"refactored, and now uses computed gotos (or \"threaded code\") on supported " +"platforms. As a result, Python 3.11 executes the `pyperformance regular " +"expression benchmarks `_ up to 10% faster than Python 3.10. (Contributed by Brandt " +"Bucher in :gh:`91404`.)" +msgstr "" + +#: ../../whatsnew/3.11.rst:1538 msgid "FAQ" msgstr "FAQ" -#: ../../whatsnew/3.11.rst:1520 -msgid "Q: How should I write my code to utilize these speedups?" -msgstr "問:我該如何在程式碼中獲取這些加速?" +#: ../../whatsnew/3.11.rst:1543 +msgid "How should I write my code to utilize these speedups?" +msgstr "" -#: ../../whatsnew/3.11.rst:1524 +#: ../../whatsnew/3.11.rst:1545 msgid "" -"A: You don't have to change your code. Write Pythonic code that follows " -"common best practices. The Faster CPython project optimizes for common code " +"Write Pythonic code that follows common best practices; you don't have to " +"change your code. The Faster CPython project optimizes for common code " "patterns we observe." msgstr "" -"答:你不需要改變你的程式碼。撰寫符合 Python 風格 (Pythonic) 且依循常見最佳實" -"踐的程式碼就好。CPython 加速計畫中,我們為所觀察到的常見程式編寫模式來做最佳" -"化。" -#: ../../whatsnew/3.11.rst:1527 -msgid "Q: Will CPython 3.11 use more memory?" -msgstr "問:Python 3.11 會不會使用更多記憶體?" +#: ../../whatsnew/3.11.rst:1553 +msgid "Will CPython 3.11 use more memory?" +msgstr "" -#: ../../whatsnew/3.11.rst:1531 +#: ../../whatsnew/3.11.rst:1555 msgid "" -"A: Maybe not. We don't expect memory use to exceed 20% more than 3.10. This " +"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 " "as mentioned above." msgstr "" -"答:也許不會。我們預期不會有超出 3.10 20% 的記憶體使用量。這數字會和上述禎物" -"件與物件字典的記憶體最佳化而有所偏差。" -#: ../../whatsnew/3.11.rst:1534 -msgid "Q: I don't see any speedups in my workload. Why?" -msgstr "問:我在我的程式當中沒感覺到任何加速,為什麼?" +#: ../../whatsnew/3.11.rst:1563 +msgid "I don't see any speedups in my workload. Why?" +msgstr "" -#: ../../whatsnew/3.11.rst:1539 +#: ../../whatsnew/3.11.rst:1565 msgid "" -"A: 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 " -"extension library like numpy, there won't be significant speedup. This " +"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 " +"extension library like NumPy, there won't be significant speedups. This " "project currently benefits pure-Python workloads the most." msgstr "" -"答:某些程式中不會有顯著的好處。如果你的程式花了大部分的時間在 I/O 操作上,或" -"已經將大部分計算用像是 numpy 的 C 擴充函式庫處理,那就不會有明顯的加速。這個" -"計畫是對純 Python 的工作負荷最有幫助。" -#: ../../whatsnew/3.11.rst:1543 +#: ../../whatsnew/3.11.rst:1570 msgid "" "Furthermore, the pyperformance figures are a geometric mean. Even within the " "pyperformance benchmarks, certain benchmarks have slowed down slightly, " @@ -2623,19 +2607,19 @@ msgstr "" "此外,pyperformance 數值為一個幾何平均數 (geometric mean)。即便在 " "pyperformance 基準量測中,某些測試稍微慢了一些,但其他加快了將近兩倍!" -#: ../../whatsnew/3.11.rst:1546 -msgid "Q: Is there a JIT compiler?" -msgstr "問:有用到 JIT 編譯器嗎?" +#: ../../whatsnew/3.11.rst:1578 +msgid "Is there a JIT compiler?" +msgstr "" -#: ../../whatsnew/3.11.rst:1548 -msgid "A: No. We're still exploring other optimizations." -msgstr "答:沒有,我們還在探索其他最佳化方式。" +#: ../../whatsnew/3.11.rst:1580 +msgid "No. We're still exploring other optimizations." +msgstr "" -#: ../../whatsnew/3.11.rst:1554 +#: ../../whatsnew/3.11.rst:1586 msgid "About" msgstr "關於" -#: ../../whatsnew/3.11.rst:1556 +#: ../../whatsnew/3.11.rst:1588 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 " @@ -2646,11 +2630,11 @@ msgstr "" "(microsoft) 所資助以全職發展該計畫,Pablo Galindo Salgado 亦由彭博有限合夥企" "業 (Bloomberg LP) 資助來兼職開發,更有許許多多來自社群的自發性貢獻者。" -#: ../../whatsnew/3.11.rst:1565 +#: ../../whatsnew/3.11.rst:1597 msgid "CPython bytecode changes" msgstr "CPython 位元組碼 (bytecode) 變更" -#: ../../whatsnew/3.11.rst:1567 +#: ../../whatsnew/3.11.rst:1599 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 " @@ -2664,11 +2648,11 @@ msgstr "" "(populated) 快取看起來像任意指示,因此在讀取或修改包含加速資料的原始且適應 " "(adaptive) 位元組碼時應格外小心。" -#: ../../whatsnew/3.11.rst:1579 +#: ../../whatsnew/3.11.rst:1611 msgid "New opcodes" msgstr "新增 opcode" -#: ../../whatsnew/3.11.rst:1581 +#: ../../whatsnew/3.11.rst:1613 msgid "" ":opcode:`ASYNC_GEN_WRAP`, :opcode:`RETURN_GENERATOR` and :opcode:`SEND`, " "used in generators and co-routines." @@ -2676,7 +2660,7 @@ msgstr "" ":opcode:`ASYNC_GEN_WRAP`、:opcode:`RETURN_GENERATOR` 和 :opcode:`SEND` 被用於" "產生器與協程。" -#: ../../whatsnew/3.11.rst:1584 +#: ../../whatsnew/3.11.rst:1616 msgid "" ":opcode:`COPY_FREE_VARS`, which avoids needing special caller-side code for " "closures." @@ -2684,17 +2668,17 @@ msgstr "" ":opcode:`COPY_FREE_VARS`,避免了為閉包 (closure) 而生的特殊呼叫方 (caller-" "side) 程式碼的需求。" -#: ../../whatsnew/3.11.rst:1587 +#: ../../whatsnew/3.11.rst:1619 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:1590 +#: ../../whatsnew/3.11.rst:1622 msgid ":opcode:`MAKE_CELL`, to create :ref:`cell-objects`." msgstr ":opcode:`MAKE_CELL` 被用於建立 :ref:`cell-objects`。" -#: ../../whatsnew/3.11.rst:1592 +#: ../../whatsnew/3.11.rst:1624 msgid "" ":opcode:`CHECK_EG_MATCH` and :opcode:`PREP_RERAISE_STAR`, to handle the :" "ref:`new exception groups and except* ` added in :pep:" @@ -2703,29 +2687,29 @@ msgstr "" ":opcode:`CHECK_EG_MATCH` 和 :opcode:`PREP_RERAISE_STAR`,處理 :pep:`654` 所加" "入的\\ :ref:`新增例外群組和 except* `。" -#: ../../whatsnew/3.11.rst:1596 +#: ../../whatsnew/3.11.rst:1628 msgid ":opcode:`PUSH_EXC_INFO`, for use in exception handlers." msgstr ":opcode:`PUSH_EXC_INFO` 被用於例外處理函式。" -#: ../../whatsnew/3.11.rst:1598 +#: ../../whatsnew/3.11.rst:1630 msgid "" ":opcode:`RESUME`, a no-op, for internal tracing, debugging and optimization " "checks." msgstr ":opcode:`RESUME`,為無操作 (no-po),用於內部追查、除錯和最佳化檢查。" -#: ../../whatsnew/3.11.rst:1605 +#: ../../whatsnew/3.11.rst:1637 msgid "Replaced opcodes" msgstr "被取代的操作碼 (opcode)" -#: ../../whatsnew/3.11.rst:1608 +#: ../../whatsnew/3.11.rst:1640 msgid "Replaced Opcode(s)" msgstr "被取代的操作碼" -#: ../../whatsnew/3.11.rst:1608 +#: ../../whatsnew/3.11.rst:1640 msgid "New Opcode(s)" msgstr "新的操作碼" -#: ../../whatsnew/3.11.rst:1608 +#: ../../whatsnew/3.11.rst:1640 msgid "Notes" msgstr "註記" @@ -2737,11 +2721,11 @@ msgstr ":opcode:`!BINARY_*`" msgid ":opcode:`!INPLACE_*`" msgstr ":opcode:`!INPLACE_*`" -#: ../../whatsnew/3.11.rst:1610 +#: ../../whatsnew/3.11.rst:1642 msgid ":opcode:`BINARY_OP`" msgstr ":opcode:`BINARY_OP`" -#: ../../whatsnew/3.11.rst:1610 +#: ../../whatsnew/3.11.rst:1642 msgid "Replaced all numeric binary/in-place opcodes with a single opcode" msgstr "以單一一個操作碼來取代所有數值的、二進位/原位 (in-place) 操作碼" @@ -2773,7 +2757,7 @@ msgstr ":opcode:`PRECALL`" msgid ":opcode:`PUSH_NULL`" msgstr ":opcode:`PUSH_NULL`" -#: ../../whatsnew/3.11.rst:1613 +#: ../../whatsnew/3.11.rst:1645 msgid "" "Decouples argument shifting for methods from handling of keyword arguments; " "allows better specialization of calls" @@ -2813,7 +2797,7 @@ msgstr ":opcode:`COPY`" msgid ":opcode:`SWAP`" msgstr ":opcode:`SWAP`" -#: ../../whatsnew/3.11.rst:1618 +#: ../../whatsnew/3.11.rst:1650 msgid "Stack manipulation instructions" msgstr "堆疊操作指示" @@ -2825,7 +2809,7 @@ msgstr ":opcode:`!JUMP_IF_NOT_EXC_MATCH`" msgid ":opcode:`CHECK_EXC_MATCH`" msgstr ":opcode:`CHECK_EXC_MATCH`" -#: ../../whatsnew/3.11.rst:1625 +#: ../../whatsnew/3.11.rst:1657 msgid "Now performs check but doesn't jump" msgstr "現在執行檢查但不跳位 (jump)" @@ -2853,7 +2837,7 @@ msgstr ":opcode:`POP_JUMP_BACKWARD_IF_* `" msgid ":opcode:`POP_JUMP_FORWARD_IF_* `" msgstr ":opcode:`POP_JUMP_FORWARD_IF_* `" -#: ../../whatsnew/3.11.rst:1627 +#: ../../whatsnew/3.11.rst:1659 msgid "" "See [#bytecode-jump]_; ``TRUE``, ``FALSE``, ``NONE`` and ``NOT_NONE`` " "variants for each direction" @@ -2869,15 +2853,15 @@ msgstr ":opcode:`!SETUP_WITH`" msgid ":opcode:`!SETUP_ASYNC_WITH`" msgstr ":opcode:`!SETUP_ASYNC_WITH`" -#: ../../whatsnew/3.11.rst:1633 +#: ../../whatsnew/3.11.rst:1665 msgid ":opcode:`BEFORE_WITH`" msgstr ":opcode:`BEFORE_WITH`" -#: ../../whatsnew/3.11.rst:1633 +#: ../../whatsnew/3.11.rst:1665 msgid ":keyword:`with` block setup" msgstr ":keyword:`with` 區塊設置" -#: ../../whatsnew/3.11.rst:1637 +#: ../../whatsnew/3.11.rst:1669 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 " @@ -2887,11 +2871,11 @@ msgstr "" "`JUMP_IF_TRUE_OR_POP` 和 :opcode:`JUMP_IF_FALSE_OR_POP`。該引數現在是當前指" "示 (instruction) 的偏移量而不是絕對位置。" -#: ../../whatsnew/3.11.rst:1648 +#: ../../whatsnew/3.11.rst:1680 msgid "Changed/removed opcodes" msgstr "有更動/被移除的 opcode" -#: ../../whatsnew/3.11.rst:1650 +#: ../../whatsnew/3.11.rst:1682 msgid "" "Changed :opcode:`MATCH_CLASS` and :opcode:`MATCH_KEYS` to no longer push an " "additional boolean value to indicate success/failure. Instead, ``None`` is " @@ -2901,7 +2885,7 @@ msgstr "" "值來表示成功/失敗。取而代之的是會在失敗時推送 ``None``,而非一個包含提取值的" "元組。" -#: ../../whatsnew/3.11.rst:1655 +#: ../../whatsnew/3.11.rst:1687 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`)." @@ -2909,7 +2893,7 @@ msgstr "" "更改了運作於例外的操作碼以反映它們現在在堆疊中的表示為一項而不是三項(請參" "閱 :gh:`89874`)。" -#: ../../whatsnew/3.11.rst:1659 +#: ../../whatsnew/3.11.rst:1691 msgid "" "Removed :opcode:`!COPY_DICT_WITHOUT_KEYS`, :opcode:`!GEN_START`, :opcode:`!" "POP_BLOCK`, :opcode:`!SETUP_FINALLY` and :opcode:`!YIELD_FROM`." @@ -2917,26 +2901,26 @@ msgstr "" "刪除 :opcode:`!COPY_DICT_WITHOUT_KEYS`、:opcode:`!GEN_START`、:opcode:`!" "POP_BLOCK`、:opcode:`!SETUP_FINALLY` 和 :opcode:`!YIELD_FROM`。" -#: ../../whatsnew/3.11.rst:1667 ../../whatsnew/3.11.rst:2543 +#: ../../whatsnew/3.11.rst:1699 ../../whatsnew/3.11.rst:2575 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.11.rst:1669 +#: ../../whatsnew/3.11.rst:1701 msgid "" "This section lists Python APIs that have been deprecated in Python 3.11." msgstr "這個部分列出了在 Python 3.11 中棄用的 Python API。" -#: ../../whatsnew/3.11.rst:1671 +#: ../../whatsnew/3.11.rst:1703 msgid "" "Deprecated C APIs are :ref:`listed separately `." msgstr "被棄用的 C API 被\\ :ref:`獨立列出 `。" -#: ../../whatsnew/3.11.rst:1678 +#: ../../whatsnew/3.11.rst:1710 msgid "Language/Builtins" msgstr "語言/內建" -#: ../../whatsnew/3.11.rst:1680 +#: ../../whatsnew/3.11.rst:1712 msgid "" "Chaining :class:`classmethod` descriptors (introduced in :issue:`19072`) is " "now deprecated. It can no longer be used to wrap other descriptors such as :" @@ -2951,7 +2935,7 @@ msgstr "" "慮使用 Python 3.10 中添加的 :attr:`!__wrapped__` 屬性。(由 Raymond " "Hettinger 在 :gh:`89519` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1688 +#: ../../whatsnew/3.11.rst:1720 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 " @@ -2963,7 +2947,7 @@ msgstr "" "Python 版本中,他們將引發一個 :exc:`SyntaxWarning` 並最終引發一個 :exc:" "`SyntaxError`。(由 Serhiy Storchaka 在 :gh:`81548` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1694 +#: ../../whatsnew/3.11.rst:1726 msgid "" "The delegation of :func:`int` to :meth:`~object.__trunc__` is now " "deprecated. Calling ``int(a)`` when ``type(a)`` implements :meth:`!" @@ -2976,93 +2960,93 @@ msgstr "" "meth:`~object.__index__`,呼叫 ``int(a)`` 現在會引發一個 :exc:" "`DeprecationWarning`。(由 Zackery Spytz 在 :issue:`44977` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1704 +#: ../../whatsnew/3.11.rst:1736 msgid "Modules" msgstr "模組" -#: ../../whatsnew/3.11.rst:1708 +#: ../../whatsnew/3.11.rst:1740 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:1712 +#: ../../whatsnew/3.11.rst:1744 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.11.rst:1712 +#: ../../whatsnew/3.11.rst:1744 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.11.rst:1712 +#: ../../whatsnew/3.11.rst:1744 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.11.rst:1712 +#: ../../whatsnew/3.11.rst:1744 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.11.rst:1712 +#: ../../whatsnew/3.11.rst:1744 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.11.rst:1714 +#: ../../whatsnew/3.11.rst:1746 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.11.rst:1714 +#: ../../whatsnew/3.11.rst:1746 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.11.rst:1714 +#: ../../whatsnew/3.11.rst:1746 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.11.rst:1714 +#: ../../whatsnew/3.11.rst:1746 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.11.rst:1714 +#: ../../whatsnew/3.11.rst:1746 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.11.rst:1716 +#: ../../whatsnew/3.11.rst:1748 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.11.rst:1716 +#: ../../whatsnew/3.11.rst:1748 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.11.rst:1716 +#: ../../whatsnew/3.11.rst:1748 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.11.rst:1716 +#: ../../whatsnew/3.11.rst:1748 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.11.rst:1716 +#: ../../whatsnew/3.11.rst:1748 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.11.rst:1718 +#: ../../whatsnew/3.11.rst:1750 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.11.rst:1718 +#: ../../whatsnew/3.11.rst:1750 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.11.rst:1718 +#: ../../whatsnew/3.11.rst:1750 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.11.rst:1718 +#: ../../whatsnew/3.11.rst:1750 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.11.rst:1721 +#: ../../whatsnew/3.11.rst:1753 msgid "" "(Contributed by Brett Cannon in :issue:`47061` and Victor Stinner in :gh:" "`68966`.)" @@ -3070,7 +3054,7 @@ msgstr "" "(由 Brett Cannon 和 Victor Stinner 分別於 :issue:`47061` 與 :gh:`68966` 中所" "貢獻。)" -#: ../../whatsnew/3.11.rst:1724 +#: ../../whatsnew/3.11.rst:1756 msgid "" "The :mod:`asynchat`, :mod:`asyncore` and :mod:`smtpd` modules have been " "deprecated since at least Python 3.6. Their documentation and deprecation " @@ -3081,7 +3065,7 @@ msgstr "" "用,它們的文件與棄用警告現在已被更新為會提示它們即將於 Python 3.12 中移除。" "(由 Hugo van Kemenade 於 :issue:`47022` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1729 +#: ../../whatsnew/3.11.rst:1761 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:" @@ -3092,7 +3076,7 @@ msgstr "" "析 Python 3.10 或更新版本。有關詳細資訊請參閱 :pep:`617`,它引入了新的 PEG 剖" "析器。(由 Victor Stinner 在 :issue:`40360` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1734 +#: ../../whatsnew/3.11.rst:1766 msgid "" "Undocumented modules :mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!" "sre_parse` are now deprecated. (Contributed by Serhiy Storchaka in :issue:" @@ -3102,11 +3086,11 @@ msgstr "" "sre_parse` 模組現在已被棄用。(由 Serhiy Storchaka 在 :issue:`47152` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:1742 +#: ../../whatsnew/3.11.rst:1774 msgid "Standard Library" msgstr "標準函式庫" -#: ../../whatsnew/3.11.rst:1744 +#: ../../whatsnew/3.11.rst:1776 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 " @@ -3115,23 +3099,23 @@ msgstr "" "以下 :mod:`configparser` 相關項目已在 Python 3.2 中棄用,它們的棄用警告現在會" "提示它們即將於 Python 3.12 中移除:" -#: ../../whatsnew/3.11.rst:1748 +#: ../../whatsnew/3.11.rst:1780 msgid "the :class:`!configparser.SafeConfigParser` class" msgstr ":class:`!configparser.SafeConfigParser` 類別" -#: ../../whatsnew/3.11.rst:1749 +#: ../../whatsnew/3.11.rst:1781 msgid "the :attr:`!configparser.ParsingError.filename` property" msgstr ":attr:`!configparser.ParsingError.filename` 屬性" -#: ../../whatsnew/3.11.rst:1750 +#: ../../whatsnew/3.11.rst:1782 msgid "the :meth:`configparser.RawConfigParser.readfp` method" msgstr ":meth:`configparser.RawConfigParser.readfp` 方法" -#: ../../whatsnew/3.11.rst:1752 +#: ../../whatsnew/3.11.rst:1784 msgid "(Contributed by Hugo van Kemenade in :issue:`45173`.)" msgstr "(由 Hugo van Kemenade 於 :issue:`45173` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1754 +#: ../../whatsnew/3.11.rst:1786 msgid "" ":class:`!configparser.LegacyInterpolation` has been deprecated in the " "docstring since Python 3.2, and is not listed in the :mod:`configparser` " @@ -3146,7 +3130,7 @@ msgstr "" "BasicInterpolation` 或 :class:`configparser.ExtendedInterpolation`。(由 " "Hugo van Kemenade 在 :issue:`46607` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1761 +#: ../../whatsnew/3.11.rst:1793 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 " @@ -3157,35 +3141,35 @@ msgstr "" "用、並將在未來的 Python 版本中刪除,取而代之的是在 Python 3.9 中添加的替代方" "案:" -#: ../../whatsnew/3.11.rst:1766 +#: ../../whatsnew/3.11.rst:1798 msgid ":func:`importlib.resources.contents`" msgstr ":func:`importlib.resources.contents`" -#: ../../whatsnew/3.11.rst:1767 +#: ../../whatsnew/3.11.rst:1799 msgid ":func:`importlib.resources.is_resource`" msgstr ":func:`importlib.resources.is_resource`" -#: ../../whatsnew/3.11.rst:1768 +#: ../../whatsnew/3.11.rst:1800 msgid ":func:`importlib.resources.open_binary`" msgstr ":func:`importlib.resources.open_binary`" -#: ../../whatsnew/3.11.rst:1769 +#: ../../whatsnew/3.11.rst:1801 msgid ":func:`importlib.resources.open_text`" msgstr ":func:`importlib.resources.open_text`" -#: ../../whatsnew/3.11.rst:1770 +#: ../../whatsnew/3.11.rst:1802 msgid ":func:`importlib.resources.read_binary`" msgstr ":func:`importlib.resources.read_binary`" -#: ../../whatsnew/3.11.rst:1771 +#: ../../whatsnew/3.11.rst:1803 msgid ":func:`importlib.resources.read_text`" msgstr ":func:`importlib.resources.read_text`" -#: ../../whatsnew/3.11.rst:1772 +#: ../../whatsnew/3.11.rst:1804 msgid ":func:`importlib.resources.path`" msgstr ":func:`importlib.resources.path`" -#: ../../whatsnew/3.11.rst:1774 +#: ../../whatsnew/3.11.rst:1806 msgid "" "The :func:`locale.getdefaultlocale` function is deprecated and will be " "removed in Python 3.13. Use :func:`locale.setlocale`, :func:`locale." @@ -3197,7 +3181,7 @@ msgstr "" "` 和 :func:`locale.getlocale`。(Victor Stinner " "於 :gh:`90817` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1780 +#: ../../whatsnew/3.11.rst:1812 msgid "" "The :func:`locale.resetlocale` function is deprecated and will be removed in " "Python 3.13. Use ``locale.setlocale(locale.LC_ALL, \"\")`` instead. " @@ -3207,7 +3191,7 @@ msgstr "" "``locale.setlocale(locale.LC_ALL, \"\")``。(由 Victor Stinner 於 :gh:" "`90817` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1784 +#: ../../whatsnew/3.11.rst:1816 msgid "" "Stricter rules will now be applied for numerical group references and group " "names in :ref:`regular expressions `. Only sequences of ASCII " @@ -3223,7 +3207,7 @@ msgstr "" "字母、數字和底線。目前,會針對違反這些規則的語法發出棄用警告。(由 Serhiy " "Storchaka 在 :gh:`91760` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1792 +#: ../../whatsnew/3.11.rst:1824 msgid "" "In the :mod:`re` module, the :func:`!re.template` function and the " "corresponding :data:`!re.TEMPLATE` and :data:`!re.T` flags are deprecated, " @@ -3236,7 +3220,7 @@ msgstr "" "將在 Python 3.13 中被刪除。(由 Serhiy Storchaka 和 Miro Hrončok 在 :gh:" "`92728` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1798 +#: ../../whatsnew/3.11.rst:1830 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:" @@ -3249,7 +3233,7 @@ msgstr "" "誤地標記為已棄用,其文件字串現在已更正)。(由 Hugo van Kemenade 在 :issue:" "`45837` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1804 +#: ../../whatsnew/3.11.rst:1836 msgid "" ":class:`typing.Text`, which exists solely to provide compatibility support " "between Python 2 and Python 3 code, is now deprecated. Its removal is " @@ -3260,7 +3244,7 @@ msgstr "" "用。目前未計劃刪除它,但鼓勵用戶盡可能使用 :class:`str` 代替。(由 Alex " "Waygood 在 :gh:`92332` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1810 +#: ../../whatsnew/3.11.rst:1842 msgid "" "The keyword argument syntax for constructing :data:`typing.TypedDict` types " "is now deprecated. Support will be removed in Python 3.13. (Contributed by " @@ -3269,7 +3253,7 @@ msgstr "" "用於建構 :data:`typing.TypedDict` 型別的關鍵字引數語法現已棄用。將在 Python " "3.13 中停止支援。(由 Jingchen Ye 在 :gh:`90224` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1814 +#: ../../whatsnew/3.11.rst:1846 msgid "" ":class:`!webbrowser.MacOSX` is deprecated and will be removed in Python " "3.13. It is untested, undocumented, and not used by :mod:`webbrowser` " @@ -3279,7 +3263,7 @@ msgstr "" "過、沒紀錄於文件、也沒有被 :mod:`webbrowser` 本身使用。(由 Dong-hee Na 於 :" "issue:`42255`。)" -#: ../../whatsnew/3.11.rst:1818 +#: ../../whatsnew/3.11.rst:1850 msgid "" "The behavior of returning a value from a :class:`~unittest.TestCase` and :" "class:`~unittest.IsolatedAsyncioTestCase` test methods (other than the " @@ -3289,7 +3273,7 @@ msgstr "" "IsolatedAsyncioTestCase` 測試方法(預設的 ``None`` 值除外)給定值的行為現已棄" "用。" -#: ../../whatsnew/3.11.rst:1822 +#: ../../whatsnew/3.11.rst:1854 msgid "" "Deprecated the following not-formally-documented :mod:`unittest` functions, " "scheduled for removal in Python 3.13:" @@ -3297,49 +3281,49 @@ msgstr "" "棄用以下並沒有正式紀錄於文件中的 :mod:`unittest` 函式,並預計於 Python 3.13 " "中移除:" -#: ../../whatsnew/3.11.rst:1825 +#: ../../whatsnew/3.11.rst:1857 msgid ":func:`!unittest.findTestCases`" msgstr ":func:`!unittest.findTestCases`" -#: ../../whatsnew/3.11.rst:1826 +#: ../../whatsnew/3.11.rst:1858 msgid ":func:`!unittest.makeSuite`" msgstr ":func:`!unittest.makeSuite`" -#: ../../whatsnew/3.11.rst:1827 +#: ../../whatsnew/3.11.rst:1859 msgid ":func:`!unittest.getTestCaseNames`" msgstr ":func:`!unittest.getTestCaseNames`" -#: ../../whatsnew/3.11.rst:1829 +#: ../../whatsnew/3.11.rst:1861 msgid "Use :class:`~unittest.TestLoader` methods instead:" msgstr "改用 :class:`~unittest.TestLoader` 方法:" -#: ../../whatsnew/3.11.rst:1831 +#: ../../whatsnew/3.11.rst:1863 msgid ":meth:`unittest.TestLoader.loadTestsFromModule`" msgstr ":meth:`unittest.TestLoader.loadTestsFromModule`" -#: ../../whatsnew/3.11.rst:1832 +#: ../../whatsnew/3.11.rst:1864 msgid ":meth:`unittest.TestLoader.loadTestsFromTestCase`" msgstr ":meth:`unittest.TestLoader.loadTestsFromTestCase`" -#: ../../whatsnew/3.11.rst:1833 +#: ../../whatsnew/3.11.rst:1865 msgid ":meth:`unittest.TestLoader.getTestCaseNames`" msgstr ":meth:`unittest.TestLoader.getTestCaseNames`" -#: ../../whatsnew/3.11.rst:1835 +#: ../../whatsnew/3.11.rst:1867 msgid "(Contributed by Erlend E. Aasland in :issue:`5846`.)" msgstr "(由 Erlend E. Aasland 於 :issue:`5846` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1842 ../../whatsnew/3.11.rst:2571 +#: ../../whatsnew/3.11.rst:1874 ../../whatsnew/3.11.rst:2603 msgid "Pending Removal in Python 3.12" msgstr "Python 3.12 中待決議的移除項目" -#: ../../whatsnew/3.11.rst:1844 +#: ../../whatsnew/3.11.rst:1876 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:1847 +#: ../../whatsnew/3.11.rst:1879 msgid "" "C APIs pending removal are :ref:`listed separately `." @@ -3347,270 +3331,270 @@ msgstr "" "待定的 C API 移除項目為\\ :ref:`獨立列出的 `。" -#: ../../whatsnew/3.11.rst:1850 +#: ../../whatsnew/3.11.rst:1882 msgid "The :mod:`asynchat` module" msgstr ":mod:`asynchat` 模組" -#: ../../whatsnew/3.11.rst:1851 +#: ../../whatsnew/3.11.rst:1883 msgid "The :mod:`asyncore` module" msgstr ":mod:`asyncore` 模組" -#: ../../whatsnew/3.11.rst:1852 +#: ../../whatsnew/3.11.rst:1884 msgid "The :ref:`entire distutils package `" msgstr ":ref:`整個 distutils 套件 `" -#: ../../whatsnew/3.11.rst:1853 +#: ../../whatsnew/3.11.rst:1885 msgid "The :mod:`imp` module" msgstr ":mod:`imp` 模組" -#: ../../whatsnew/3.11.rst:1854 +#: ../../whatsnew/3.11.rst:1886 msgid "The :class:`typing.io ` namespace" msgstr ":class:`typing.io ` 命名空間" -#: ../../whatsnew/3.11.rst:1855 +#: ../../whatsnew/3.11.rst:1887 msgid "The :class:`typing.re ` namespace" msgstr ":class:`typing.re ` 命名空間" -#: ../../whatsnew/3.11.rst:1856 +#: ../../whatsnew/3.11.rst:1888 msgid ":func:`!cgi.log`" msgstr ":func:`!cgi.log`" -#: ../../whatsnew/3.11.rst:1857 +#: ../../whatsnew/3.11.rst:1889 msgid ":func:`importlib.find_loader`" msgstr ":func:`importlib.find_loader`" -#: ../../whatsnew/3.11.rst:1858 +#: ../../whatsnew/3.11.rst:1890 msgid ":meth:`importlib.abc.Loader.module_repr`" msgstr ":meth:`importlib.abc.Loader.module_repr`" -#: ../../whatsnew/3.11.rst:1859 +#: ../../whatsnew/3.11.rst:1891 msgid ":meth:`importlib.abc.MetaPathFinder.find_module`" msgstr ":meth:`importlib.abc.MetaPathFinder.find_module`" -#: ../../whatsnew/3.11.rst:1860 +#: ../../whatsnew/3.11.rst:1892 msgid ":meth:`importlib.abc.PathEntryFinder.find_loader`" msgstr ":meth:`importlib.abc.PathEntryFinder.find_loader`" -#: ../../whatsnew/3.11.rst:1861 +#: ../../whatsnew/3.11.rst:1893 msgid ":meth:`importlib.abc.PathEntryFinder.find_module`" msgstr ":meth:`importlib.abc.PathEntryFinder.find_module`" -#: ../../whatsnew/3.11.rst:1862 +#: ../../whatsnew/3.11.rst:1894 msgid ":meth:`!importlib.machinery.BuiltinImporter.find_module`" msgstr ":meth:`!importlib.machinery.BuiltinImporter.find_module`" -#: ../../whatsnew/3.11.rst:1863 +#: ../../whatsnew/3.11.rst:1895 msgid ":meth:`!importlib.machinery.BuiltinLoader.module_repr`" msgstr ":meth:`!importlib.machinery.BuiltinLoader.module_repr`" -#: ../../whatsnew/3.11.rst:1864 +#: ../../whatsnew/3.11.rst:1896 msgid ":meth:`!importlib.machinery.FileFinder.find_loader`" msgstr ":meth:`!importlib.machinery.FileFinder.find_loader`" -#: ../../whatsnew/3.11.rst:1865 +#: ../../whatsnew/3.11.rst:1897 msgid ":meth:`!importlib.machinery.FileFinder.find_module`" msgstr ":meth:`!importlib.machinery.FileFinder.find_module`" -#: ../../whatsnew/3.11.rst:1866 +#: ../../whatsnew/3.11.rst:1898 msgid ":meth:`!importlib.machinery.FrozenImporter.find_module`" msgstr ":meth:`!importlib.machinery.FrozenImporter.find_module`" -#: ../../whatsnew/3.11.rst:1867 +#: ../../whatsnew/3.11.rst:1899 msgid ":meth:`!importlib.machinery.FrozenLoader.module_repr`" msgstr ":meth:`!importlib.machinery.FrozenLoader.module_repr`" -#: ../../whatsnew/3.11.rst:1868 +#: ../../whatsnew/3.11.rst:1900 msgid ":meth:`importlib.machinery.PathFinder.find_module`" msgstr ":meth:`importlib.machinery.PathFinder.find_module`" -#: ../../whatsnew/3.11.rst:1869 +#: ../../whatsnew/3.11.rst:1901 msgid ":meth:`!importlib.machinery.WindowsRegistryFinder.find_module`" msgstr ":meth:`!importlib.machinery.WindowsRegistryFinder.find_module`" -#: ../../whatsnew/3.11.rst:1870 +#: ../../whatsnew/3.11.rst:1902 msgid ":func:`importlib.util.module_for_loader`" msgstr ":func:`importlib.util.module_for_loader`" -#: ../../whatsnew/3.11.rst:1871 +#: ../../whatsnew/3.11.rst:1903 msgid ":func:`!importlib.util.set_loader_wrapper`" msgstr ":func:`!importlib.util.set_loader_wrapper`" -#: ../../whatsnew/3.11.rst:1872 +#: ../../whatsnew/3.11.rst:1904 msgid ":func:`!importlib.util.set_package_wrapper`" msgstr ":func:`!importlib.util.set_package_wrapper`" -#: ../../whatsnew/3.11.rst:1873 +#: ../../whatsnew/3.11.rst:1905 msgid ":class:`pkgutil.ImpImporter`" msgstr ":class:`pkgutil.ImpImporter`" -#: ../../whatsnew/3.11.rst:1874 +#: ../../whatsnew/3.11.rst:1906 msgid ":class:`pkgutil.ImpLoader`" msgstr ":class:`pkgutil.ImpLoader`" -#: ../../whatsnew/3.11.rst:1875 +#: ../../whatsnew/3.11.rst:1907 msgid ":meth:`pathlib.Path.link_to`" msgstr ":meth:`pathlib.Path.link_to`" -#: ../../whatsnew/3.11.rst:1876 +#: ../../whatsnew/3.11.rst:1908 msgid ":func:`!sqlite3.enable_shared_cache`" msgstr ":func:`!sqlite3.enable_shared_cache`" -#: ../../whatsnew/3.11.rst:1877 +#: ../../whatsnew/3.11.rst:1909 msgid ":func:`!sqlite3.OptimizedUnicode`" msgstr ":func:`!sqlite3.OptimizedUnicode`" -#: ../../whatsnew/3.11.rst:1878 +#: ../../whatsnew/3.11.rst:1910 msgid ":envvar:`PYTHONTHREADDEBUG` environment variable" msgstr ":envvar:`PYTHONTHREADDEBUG` 環境變數" -#: ../../whatsnew/3.11.rst:1879 +#: ../../whatsnew/3.11.rst:1911 msgid "The following deprecated aliases in :mod:`unittest`:" msgstr ":mod:`unittest` 中被棄用的別名:" -#: ../../whatsnew/3.11.rst:1882 +#: ../../whatsnew/3.11.rst:1914 msgid "Deprecated alias" msgstr "已棄用的別名" -#: ../../whatsnew/3.11.rst:1882 +#: ../../whatsnew/3.11.rst:1914 msgid "Method Name" msgstr "方法名稱" -#: ../../whatsnew/3.11.rst:1882 +#: ../../whatsnew/3.11.rst:1914 msgid "Deprecated in" msgstr "棄用於" -#: ../../whatsnew/3.11.rst:1884 +#: ../../whatsnew/3.11.rst:1916 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.11.rst:1884 ../../whatsnew/3.11.rst:1891 +#: ../../whatsnew/3.11.rst:1916 ../../whatsnew/3.11.rst:1923 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.11.rst:1884 ../../whatsnew/3.11.rst:1885 -#: ../../whatsnew/3.11.rst:1886 ../../whatsnew/3.11.rst:1887 -#: ../../whatsnew/3.11.rst:1888 ../../whatsnew/3.11.rst:1889 -#: ../../whatsnew/3.11.rst:1890 +#: ../../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 ../../whatsnew/3.11.rst:1921 +#: ../../whatsnew/3.11.rst:1922 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.11.rst:1885 +#: ../../whatsnew/3.11.rst:1917 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.11.rst:1885 +#: ../../whatsnew/3.11.rst:1917 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.11.rst:1886 +#: ../../whatsnew/3.11.rst:1918 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.11.rst:1886 ../../whatsnew/3.11.rst:1892 +#: ../../whatsnew/3.11.rst:1918 ../../whatsnew/3.11.rst:1924 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.11.rst:1887 +#: ../../whatsnew/3.11.rst:1919 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.11.rst:1887 ../../whatsnew/3.11.rst:1893 +#: ../../whatsnew/3.11.rst:1919 ../../whatsnew/3.11.rst:1925 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.11.rst:1888 +#: ../../whatsnew/3.11.rst:1920 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.11.rst:1888 ../../whatsnew/3.11.rst:1894 +#: ../../whatsnew/3.11.rst:1920 ../../whatsnew/3.11.rst:1926 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.11.rst:1889 +#: ../../whatsnew/3.11.rst:1921 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.11.rst:1889 ../../whatsnew/3.11.rst:1895 +#: ../../whatsnew/3.11.rst:1921 ../../whatsnew/3.11.rst:1927 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.11.rst:1890 +#: ../../whatsnew/3.11.rst:1922 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.11.rst:1890 +#: ../../whatsnew/3.11.rst:1922 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.11.rst:1891 +#: ../../whatsnew/3.11.rst:1923 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.11.rst:1891 ../../whatsnew/3.11.rst:1892 -#: ../../whatsnew/3.11.rst:1893 ../../whatsnew/3.11.rst:1894 -#: ../../whatsnew/3.11.rst:1895 ../../whatsnew/3.11.rst:1896 -#: ../../whatsnew/3.11.rst:1897 +#: ../../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 ../../whatsnew/3.11.rst:1928 +#: ../../whatsnew/3.11.rst:1929 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.11.rst:1892 +#: ../../whatsnew/3.11.rst:1924 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.11.rst:1893 +#: ../../whatsnew/3.11.rst:1925 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.11.rst:1894 +#: ../../whatsnew/3.11.rst:1926 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.11.rst:1895 +#: ../../whatsnew/3.11.rst:1927 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.11.rst:1896 +#: ../../whatsnew/3.11.rst:1928 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.11.rst:1896 +#: ../../whatsnew/3.11.rst:1928 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.11.rst:1897 +#: ../../whatsnew/3.11.rst:1929 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.11.rst:1897 +#: ../../whatsnew/3.11.rst:1929 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.11.rst:1898 +#: ../../whatsnew/3.11.rst:1930 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.11.rst:1898 +#: ../../whatsnew/3.11.rst:1930 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.11.rst:1898 +#: ../../whatsnew/3.11.rst:1930 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.11.rst:1905 ../../whatsnew/3.11.rst:2597 +#: ../../whatsnew/3.11.rst:1937 ../../whatsnew/3.11.rst:2629 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.11.rst:1907 +#: ../../whatsnew/3.11.rst:1939 msgid "This section lists Python APIs that have been removed in Python 3.11." msgstr "此部分列出 Python 3.11 中移除的 Python API。" -#: ../../whatsnew/3.11.rst:1909 +#: ../../whatsnew/3.11.rst:1941 msgid "" "Removed C APIs are :ref:`listed separately `." msgstr "被移除的 C API 被\\ :ref:`獨立列出 `。" -#: ../../whatsnew/3.11.rst:1911 +#: ../../whatsnew/3.11.rst:1943 msgid "" "Removed the :func:`!@asyncio.coroutine` :term:`decorator` enabling legacy " "generator-based coroutines to be compatible with :keyword:`async` / :keyword:" @@ -3623,7 +3607,7 @@ msgstr "" "相容。該函數自 Python 3.8 起已被棄用,計劃於 Python 3.10 刪除。請改用 :" "keyword:`async def`。(由 Illia Volochii 在 :issue:`43216` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1918 +#: ../../whatsnew/3.11.rst:1950 msgid "" "Removed :class:`!asyncio.coroutines.CoroWrapper` used for wrapping legacy " "generator-based coroutine objects in the debug mode. (Contributed by Illia " @@ -3632,7 +3616,7 @@ msgstr "" "移除除錯模式中用於包裝遺留基於產生器之協程物件的 :class:`!asyncio.coroutines." "CoroWrapper`。(由 Illia Volochii 於 :issue:`43216` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1922 +#: ../../whatsnew/3.11.rst:1954 msgid "" "Due to significant security concerns, the *reuse_address* parameter of :meth:" "`asyncio.loop.create_datagram_endpoint`, disabled in Python 3.9, is now " @@ -3645,7 +3629,7 @@ msgstr "" "socket 選項 ``SO_REUSEADDR`` 的行為所致。(由 Hugo van Kemenade 於 :issue:" "`45129` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1928 +#: ../../whatsnew/3.11.rst:1960 msgid "" "Removed the :mod:`!binhex` module, deprecated in Python 3.9. Also removed " "the related, similarly-deprecated :mod:`binascii` functions:" @@ -3653,31 +3637,31 @@ msgstr "" "移除 Python 3.9 中棄用的 :mod:`!binhex` 模組,與其相關且相似的 :mod:" "`binascii` 函式也一併被移除:" -#: ../../whatsnew/3.11.rst:1931 +#: ../../whatsnew/3.11.rst:1963 msgid ":func:`!binascii.a2b_hqx`" msgstr ":func:`!binascii.a2b_hqx`" -#: ../../whatsnew/3.11.rst:1932 +#: ../../whatsnew/3.11.rst:1964 msgid ":func:`!binascii.b2a_hqx`" msgstr ":func:`!binascii.b2a_hqx`" -#: ../../whatsnew/3.11.rst:1933 +#: ../../whatsnew/3.11.rst:1965 msgid ":func:`!binascii.rlecode_hqx`" msgstr ":func:`!binascii.rlecode_hqx`" -#: ../../whatsnew/3.11.rst:1934 +#: ../../whatsnew/3.11.rst:1966 msgid ":func:`!binascii.rldecode_hqx`" msgstr ":func:`!binascii.rldecode_hqx`" -#: ../../whatsnew/3.11.rst:1936 +#: ../../whatsnew/3.11.rst:1968 msgid "The :func:`binascii.crc_hqx` function remains available." msgstr ":func:`binascii.crc_hqx` 維持可用。" -#: ../../whatsnew/3.11.rst:1938 +#: ../../whatsnew/3.11.rst:1970 msgid "(Contributed by Victor Stinner in :issue:`45085`.)" msgstr "(由 Victor Stinner 於 :issue:`45085` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1940 +#: ../../whatsnew/3.11.rst:1972 msgid "" "Removed the :mod:`distutils` ``bdist_msi`` command deprecated in Python 3.9. " "Use ``bdist_wheel`` (wheel packages) instead. (Contributed by Hugo van " @@ -3687,7 +3671,7 @@ msgstr "" "``bdist_wheel``\\ (wheel 套件)。(由 Hugo van Kemenade 於 :issue:`45124` 中" "貢獻。)" -#: ../../whatsnew/3.11.rst:1944 +#: ../../whatsnew/3.11.rst:1976 msgid "" "Removed the :meth:`~object.__getitem__` methods of :class:`xml.dom.pulldom." "DOMEventStream`, :class:`wsgiref.util.FileWrapper` and :class:`fileinput." @@ -3699,7 +3683,7 @@ msgstr "" "`~object.__getitem__` 方法移除。(由 Hugo van Kemenade 在 :issue:`45132` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:1949 +#: ../../whatsnew/3.11.rst:1981 msgid "" "Removed the deprecated :mod:`gettext` functions :func:`!lgettext`, :func:`!" "ldgettext`, :func:`!lngettext` and :func:`!ldngettext`. Also removed the :" @@ -3716,11 +3700,11 @@ msgstr "" "和 :func:`!install` 的 *codeset* 參數,因為它們僅被用於 :func:`!l*gettext` 函" "式。 (由 Dong-hee Na 和 Serhiy Storchaka 在 :issue:`44235` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1959 +#: ../../whatsnew/3.11.rst:1991 msgid "Removed from the :mod:`inspect` module:" msgstr "於 :mod:`inspect` 模組中移除:" -#: ../../whatsnew/3.11.rst:1961 +#: ../../whatsnew/3.11.rst:1993 msgid "" "The :func:`!getargspec` function, deprecated since Python 3.0; use :func:" "`inspect.signature` or :func:`inspect.getfullargspec` instead." @@ -3728,7 +3712,7 @@ msgstr "" "Python 3.0 中棄用的 :func:`!getargspec`;改用 :func:`inspect.signature` 或 :" "func:`inspect.getfullargspec`。" -#: ../../whatsnew/3.11.rst:1964 +#: ../../whatsnew/3.11.rst:1996 msgid "" "The :func:`!formatargspec` function, deprecated since Python 3.5; use the :" "func:`inspect.signature` function or the :class:`inspect.Signature` object " @@ -3737,7 +3721,7 @@ msgstr "" "Python 3.5 中棄用的 :func:`!formatargspec` 函式;請直接用 :func:`inspect." "signature` 函式或 :class:`inspect.Signature` 物件。" -#: ../../whatsnew/3.11.rst:1968 +#: ../../whatsnew/3.11.rst:2000 msgid "" "The undocumented :meth:`!Signature.from_builtin` and :meth:`!Signature." "from_function` methods, deprecated since Python 3.5; use the :meth:" @@ -3747,11 +3731,11 @@ msgstr "" "meth:`!Signature.from_function` 方法;改用 :meth:`Signature.from_callable() " "` 方法。" -#: ../../whatsnew/3.11.rst:1973 +#: ../../whatsnew/3.11.rst:2005 msgid "(Contributed by Hugo van Kemenade in :issue:`45320`.)" msgstr "(由 Hugo van Kemenade 於 :issue:`45320` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1975 +#: ../../whatsnew/3.11.rst:2007 msgid "" "Removed the :meth:`~object.__class_getitem__` method from :class:`pathlib." "PurePath`, because it was not used and added by mistake in previous " @@ -3761,7 +3745,7 @@ msgstr "" "因為它是前一版本中誤加且沒被使用。(由 Nikita Sobolev 於 :issue:`46483` 中所" "貢獻。)" -#: ../../whatsnew/3.11.rst:1980 +#: ../../whatsnew/3.11.rst:2012 msgid "" "Removed the :class:`!MailmanProxy` class in the :mod:`smtpd` module, as it " "is unusable without the external :mod:`!mailman` package. (Contributed by " @@ -3770,7 +3754,7 @@ msgstr "" "移除 :mod:`smtpd` 模組中的 :class:`!MailmanProxy` 類別,因為它無法獨立於外部" "套件 :mod:`!mailman` 使用。(由 Dong-hee Na 於 :issue:`35800` 貢獻。)" -#: ../../whatsnew/3.11.rst:1984 +#: ../../whatsnew/3.11.rst:2016 msgid "" "Removed the deprecated :meth:`!split` method of :class:`!_tkinter." "TkappType`. (Contributed by Erlend E. Aasland in :issue:`38371`.)" @@ -3778,7 +3762,7 @@ msgstr "" "移除 :class:`!_tkinter.TkappType` 已被棄用的 :meth:`!split` 方法。(由 " "Erlend E. Aasland 於 :issue:`38371` 貢獻。)" -#: ../../whatsnew/3.11.rst:1987 +#: ../../whatsnew/3.11.rst:2019 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 " @@ -3787,7 +3771,7 @@ msgstr "" "從 :mod:`unittest` 中刪除了命名空間套件支援。它在 Python 3.4 中引入,但自 " "Python 3.7 以來已無法運作。(由 Inada Naoki 在 :issue:`23882` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1991 +#: ../../whatsnew/3.11.rst:2023 msgid "" "Removed the undocumented private :meth:`!float.__set_format__()` method, " "previously known as :meth:`!float.__setformat__()` in Python 3.7. Its " @@ -3800,7 +3784,7 @@ msgstr "" "到:「你大概不會想要使用這個函式,它只為了讓 Python 測試系列套件 (suite) 使用" "而存在。」(由 Victor Stinner 於 :issue:`46852` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1997 +#: ../../whatsnew/3.11.rst:2029 msgid "" "The :option:`!--experimental-isolated-subinterpreters` configure flag (and " "corresponding :c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` macro) have " @@ -3809,7 +3793,7 @@ msgstr "" "移除 :option:`!--experimental-isolated-subinterpreters` 配置旗標(與對應的 :" "c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` 巨集)。" -#: ../../whatsnew/3.11.rst:2001 +#: ../../whatsnew/3.11.rst:2033 msgid "" "`Pynche `_ --- The Pythonically Natural " "Color and Hue Editor --- has been moved out of ``Tools/scripts`` and is " @@ -3820,11 +3804,11 @@ msgstr "" "編輯器 --- 已被移出 ``Tools/scripts``,`獨立開發 `_\\ 於 Python 原始碼之外。" -#: ../../whatsnew/3.11.rst:2011 ../../whatsnew/3.11.rst:2241 +#: ../../whatsnew/3.11.rst:2043 ../../whatsnew/3.11.rst:2273 msgid "Porting to Python 3.11" msgstr "移植至 Python 3.11" -#: ../../whatsnew/3.11.rst:2013 +#: ../../whatsnew/3.11.rst:2045 msgid "" "This section lists previously described changes and other bugfixes in the " "Python API that may require changes to your Python code." @@ -3832,13 +3816,13 @@ msgstr "" "本部分列出了之前描述的 Python API 中可能需要你去更改 Python 程式碼的變更和其" "他錯誤修復。" -#: ../../whatsnew/3.11.rst:2016 +#: ../../whatsnew/3.11.rst:2048 msgid "" "Porting notes for the C API are :ref:`listed separately `." msgstr "C API 的移植被\\ :ref:`獨立列出 `。" -#: ../../whatsnew/3.11.rst:2019 +#: ../../whatsnew/3.11.rst:2051 msgid "" ":func:`open`, :func:`io.open`, :func:`codecs.open` and :class:`fileinput." "FileInput` no longer accept ``'U'`` (\"universal newline\") in the file " @@ -3855,7 +3839,7 @@ msgstr "" "ref:`newline 參數 `\\ 控制了通用換行符的作用方式。" "(由 Victor Stinner 在 :issue:`37330` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2028 +#: ../../whatsnew/3.11.rst:2060 msgid "" ":class:`ast.AST` node positions are now validated when provided to :func:" "`compile` and other related functions. If invalid positions are detected, a :" @@ -3866,7 +3850,7 @@ msgstr "" "證。如果檢測到無效位置,則會引發 :exc:`ValueError`。(由 Pablo Galindo 在 :" "gh:`93351` 中貢獻)" -#: ../../whatsnew/3.11.rst:2032 +#: ../../whatsnew/3.11.rst:2064 msgid "" "Prohibited passing non-:class:`concurrent.futures.ThreadPoolExecutor` " "executors to :meth:`asyncio.loop.set_default_executor` following a " @@ -3876,7 +3860,7 @@ msgstr "" "ThreadPoolExecutor` 執行器傳遞給 :meth:`asyncio.loop.set_default_executor`。" "(由 Illia Volochii 在 :issue:`43234` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2037 +#: ../../whatsnew/3.11.rst:2069 msgid "" ":mod:`calendar`: The :class:`calendar.LocaleTextCalendar` and :class:" "`calendar.LocaleHTMLCalendar` classes now use :func:`locale.getlocale`, " @@ -3888,7 +3872,7 @@ msgstr "" "getlocale` 而非 :func:`locale.getdefaultlocale`。(由 Victor Stinner 在 :" "issue:`46659` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2043 +#: ../../whatsnew/3.11.rst:2075 msgid "" "The :mod:`pdb` module now reads the :file:`.pdbrc` configuration file with " "the ``'UTF-8'`` encoding. (Contributed by Srinivas Reddy Thatiparthy (శ్రీనివాస్ " @@ -3897,7 +3881,7 @@ msgstr "" ":mod:`pdb` 模組現在會讀取 ``'UTF-8'`` 編碼的 :file:`.pdbrc` 配置檔案。" "(Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) 於 :issue:`41137` 貢獻。)" -#: ../../whatsnew/3.11.rst:2047 +#: ../../whatsnew/3.11.rst:2079 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 " @@ -3909,7 +3893,7 @@ msgstr "" "`set` 到 :class:`list` 的自動轉換。此外,如果抽樣大小大於總體大小,則會引發 :" "exc:`ValueError`。(由 Raymond Hettinger 在 :issue:`40465` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2053 +#: ../../whatsnew/3.11.rst:2085 msgid "" "The *random* optional parameter of :func:`random.shuffle` was removed. It " "was previously an arbitrary random function to use for the shuffle; now, :" @@ -3919,7 +3903,7 @@ msgstr "" "(shuffle) 的任意隨機函式;現在都會使用 :func:`random.random`\\ (這是它以前的" "預設值)。" -#: ../../whatsnew/3.11.rst:2057 +#: ../../whatsnew/3.11.rst:2089 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 " @@ -3930,7 +3914,7 @@ msgstr "" "運算式的開頭使用。自 Python 3.6 以來,在其他地方使用它們已被棄用。 (由 " "Serhiy Storchaka 在 :issue:`47066` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2062 +#: ../../whatsnew/3.11.rst:2094 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, " @@ -3941,11 +3925,11 @@ msgstr "" "致捕獲群組 (capture group) 得到錯誤的結果。因此,這可能會在這些情況下更改捕獲" "的輸出。(Ma Lin 在 :issue:`35859` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2071 +#: ../../whatsnew/3.11.rst:2103 msgid "Build Changes" msgstr "建置變更" -#: ../../whatsnew/3.11.rst:2073 +#: ../../whatsnew/3.11.rst:2105 msgid "" "CPython now has :pep:`11` :pep:`Tier 3 support <11#tier-3>` for cross " "compiling to the `WebAssembly `_ platforms " @@ -3969,11 +3953,11 @@ msgstr "" "Christian Heimes 和 Ethan Smith 在 :gh:`84461` 貢獻,WASI 由 Christian " "Heimes 在 :gh:`90473` 貢獻;平台在 :gh:`95085` 中推廣)" -#: ../../whatsnew/3.11.rst:2087 +#: ../../whatsnew/3.11.rst:2119 msgid "Building Python now requires:" msgstr "建置 Python 現在必須要有:" -#: ../../whatsnew/3.11.rst:2089 +#: ../../whatsnew/3.11.rst:2121 msgid "" "A `C11 `_ compiler. `Optional C11 " "features `_ 並非必要。(由 Victor Stinner " "於 :issue:`46656` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2095 +#: ../../whatsnew/3.11.rst:2127 msgid "" "Support for `IEEE 754 `_ floating " "point numbers. (Contributed by Victor Stinner in :issue:`46917`.)" @@ -3993,7 +3977,7 @@ msgstr "" "對 `IEEE 754 `_ 浮點數的支援(由 " "Victor Stinner 於 :issue:`46917` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2099 +#: ../../whatsnew/3.11.rst:2131 msgid "" "Support for `floating point Not-a-Number (NaN) `_, as the :c:macro:`!Py_NO_NAN` macro has been " @@ -4003,7 +3987,7 @@ msgstr "" "NaN#Floating_point>`_,因為 :c:macro:`!Py_NO_NAN` 巨集已被刪除。 (由 Victor " "Stinner 在 :issue:`46656` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2104 +#: ../../whatsnew/3.11.rst:2136 msgid "" "A `C99 `_ ```` header file " "providing the :c:func:`!copysign`, :c:func:`!hypot`, :c:func:`!isfinite`, :c:" @@ -4018,7 +4002,7 @@ msgstr "" "`45440` 中貢獻);和一個 :c:data:`!NAN` 常數或 :c:func:`!__builtin_nan` 函式" "(由 Victor Stinner 在 :issue:`46640` 中貢獻)。" -#: ../../whatsnew/3.11.rst:2112 +#: ../../whatsnew/3.11.rst:2144 msgid "" "The :mod:`tkinter` package now requires `Tcl/Tk `_ " "version 8.5.12 or newer. (Contributed by Serhiy Storchaka in :issue:`46996`.)" @@ -4026,7 +4010,7 @@ msgstr "" ":mod:`tkinter` 套件現在必須要有 `Tcl/Tk `_ 8.5.12 或更新" "的版本。(由 Serhiy Storchaka 於 :issue:`46996` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2116 +#: ../../whatsnew/3.11.rst:2148 msgid "" "Build dependencies, compiler flags, and linker flags for most stdlib " "extension modules are now detected by :program:`configure`. libffi, libnsl, " @@ -4045,7 +4029,7 @@ msgstr "" "和函式庫的開發設定。(由 Christian Heimes 和 Erlend Egeberg Aasland 在 :" "issue:`45847`、:issue:`45747` 和 :issue:`45763` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2126 +#: ../../whatsnew/3.11.rst:2158 msgid "" "libpython is no longer linked against libcrypt. (Contributed by Mike Gilbert " "in :issue:`45433`.)" @@ -4053,7 +4037,7 @@ msgstr "" "libpython 不再鏈接到 libcrypt。 (由 Mike Gilbert 在 :issue:`45433` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:2129 +#: ../../whatsnew/3.11.rst:2161 msgid "" "CPython can now be built with the `ThinLTO `_ option via passing ``thin`` to :option:`--with-lto`, i.e. " @@ -4065,7 +4049,7 @@ msgstr "" "html>`_ 選項建置。(由 Dong-hee Na 與 Brett Holman 於 :issue:`44340` 中所貢" "獻。)" -#: ../../whatsnew/3.11.rst:2134 +#: ../../whatsnew/3.11.rst:2166 msgid "" "Freelists for object structs can now be disabled. A new :program:`configure` " "option :option:`!--without-freelists` can be used to disable all freelists " @@ -4076,7 +4060,7 @@ msgstr "" "—without-freelists` 可用於禁用除空元組單例之外的所有空閒列表。(由 Christian " "Heimes 在 :issue:`45522` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2139 +#: ../../whatsnew/3.11.rst:2171 msgid "" "``Modules/Setup`` and ``Modules/makesetup`` have been improved and tied up. " "Extension modules can now be built through ``makesetup``. All except some " @@ -4089,7 +4073,7 @@ msgstr "" "的二進制文件或函式庫中。(由 Brett Cannon 和 Christian Heimes 在 :issue:" "`45548`、:issue:`45570`、:issue:`45571` 和 :issue:`43974` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2146 +#: ../../whatsnew/3.11.rst:2178 msgid "" "Use the environment variables :envvar:`!TCLTK_CFLAGS` and :envvar:`!" "TCLTK_LIBS` to manually specify the location of Tcl/Tk headers and " @@ -4100,7 +4084,7 @@ msgstr "" "Tk 標頭檔和函式庫的位置。:program:`configure` 選項 :option:`!—with-tcltk-" "includes` 和 :option:`!—with-tcltk-libs` 已被刪除。" -#: ../../whatsnew/3.11.rst:2152 +#: ../../whatsnew/3.11.rst:2184 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 " @@ -4112,7 +4096,7 @@ msgstr "" "pc`` 檔案與如何使用 RHEL 7 和 CentOS 7 的 Tcl/Tk 與 OpenSSL 建置 Python 的指" "示。" -#: ../../whatsnew/3.11.rst:2157 +#: ../../whatsnew/3.11.rst:2189 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 " @@ -4130,11 +4114,11 @@ msgstr "" "此選項可能會在將來的某個時候被刪除。 (由 Mark Dickinson 在 :issue:`45569` 中" "貢獻。)" -#: ../../whatsnew/3.11.rst:2170 +#: ../../whatsnew/3.11.rst:2202 msgid "C API Changes" msgstr "C API 變更" -#: ../../whatsnew/3.11.rst:2177 +#: ../../whatsnew/3.11.rst:2209 msgid "" "Add a new :c:func:`PyType_GetName` function to get type's short name. " "(Contributed by Hai Shi in :issue:`42035`.)" @@ -4142,7 +4126,7 @@ msgstr "" "新增 :c:func:`PyType_GetName` 函式來取得型別的短名。(由 Hai Shi 於 :issue:" "`42035` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2180 +#: ../../whatsnew/3.11.rst:2212 msgid "" "Add a new :c:func:`PyType_GetQualName` function to get type's qualified " "name. (Contributed by Hai Shi in :issue:`42035`.)" @@ -4150,7 +4134,7 @@ msgstr "" "新增 :c:func:`PyType_GetQualName` 函式來取得型別的合格名稱 (qualified name)。" "(由 Hai Shi 於 :issue:`42035` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2183 +#: ../../whatsnew/3.11.rst:2215 msgid "" "Add new :c:func:`PyThreadState_EnterTracing` and :c:func:" "`PyThreadState_LeaveTracing` functions to the limited C API to suspend and " @@ -4161,7 +4145,7 @@ msgstr "" "c:func:`PyThreadState_LeaveTracing` 函式來中止和繼續追蹤 (tracing) 和性能分" "析 (profiling)。(由 Victor Stinner 於 :issue:`43760` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2188 +#: ../../whatsnew/3.11.rst:2220 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:" @@ -4170,61 +4154,61 @@ msgstr "" "添加了 :c:data:`Py_Version` 常數,其值與 :c:macro:`PY_VERSION_HEX` 相同。" "(由 Gabriele N. Tornetta 在 :issue:`43931` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2192 +#: ../../whatsnew/3.11.rst:2224 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:2195 +#: ../../whatsnew/3.11.rst:2227 msgid ":c:func:`PyObject_CheckBuffer`" msgstr ":c:func:`PyObject_CheckBuffer`" -#: ../../whatsnew/3.11.rst:2196 +#: ../../whatsnew/3.11.rst:2228 msgid ":c:func:`PyObject_GetBuffer`" msgstr ":c:func:`PyObject_GetBuffer`" -#: ../../whatsnew/3.11.rst:2197 +#: ../../whatsnew/3.11.rst:2229 msgid ":c:func:`PyBuffer_GetPointer`" msgstr ":c:func:`PyBuffer_GetPointer`" -#: ../../whatsnew/3.11.rst:2198 +#: ../../whatsnew/3.11.rst:2230 msgid ":c:func:`PyBuffer_SizeFromFormat`" msgstr ":c:func:`PyBuffer_SizeFromFormat`" -#: ../../whatsnew/3.11.rst:2199 +#: ../../whatsnew/3.11.rst:2231 msgid ":c:func:`PyBuffer_ToContiguous`" msgstr ":c:func:`PyBuffer_ToContiguous`" -#: ../../whatsnew/3.11.rst:2200 +#: ../../whatsnew/3.11.rst:2232 msgid ":c:func:`PyBuffer_FromContiguous`" msgstr ":c:func:`PyBuffer_FromContiguous`" -#: ../../whatsnew/3.11.rst:2201 +#: ../../whatsnew/3.11.rst:2233 msgid ":c:func:`PyBuffer_CopyData`" msgstr ":c:func:`PyBuffer_CopyData`" -#: ../../whatsnew/3.11.rst:2202 +#: ../../whatsnew/3.11.rst:2234 msgid ":c:func:`PyBuffer_IsContiguous`" msgstr ":c:func:`PyBuffer_IsContiguous`" -#: ../../whatsnew/3.11.rst:2203 +#: ../../whatsnew/3.11.rst:2235 msgid ":c:func:`PyBuffer_FillContiguousStrides`" msgstr ":c:func:`PyBuffer_FillContiguousStrides`" -#: ../../whatsnew/3.11.rst:2204 +#: ../../whatsnew/3.11.rst:2236 msgid ":c:func:`PyBuffer_FillInfo`" msgstr ":c:func:`PyBuffer_FillInfo`" -#: ../../whatsnew/3.11.rst:2205 +#: ../../whatsnew/3.11.rst:2237 msgid ":c:func:`PyBuffer_Release`" msgstr ":c:func:`PyBuffer_Release`" -#: ../../whatsnew/3.11.rst:2206 +#: ../../whatsnew/3.11.rst:2238 msgid ":c:func:`PyMemoryView_FromBuffer`" msgstr ":c:func:`PyMemoryView_FromBuffer`" -#: ../../whatsnew/3.11.rst:2207 +#: ../../whatsnew/3.11.rst:2239 msgid "" ":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." "bf_releasebuffer` type slots" @@ -4232,11 +4216,11 @@ msgstr "" ":c:member:`~PyBufferProcs.bf_getbuffer` 與 :c:member:`~PyBufferProcs." "bf_releasebuffer` 型別插槽 (type slot)" -#: ../../whatsnew/3.11.rst:2210 +#: ../../whatsnew/3.11.rst:2242 msgid "(Contributed by Christian Heimes in :issue:`45459`.)" msgstr "(由 Christian Heimes 於 :issue:`45459` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2212 +#: ../../whatsnew/3.11.rst:2244 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 " @@ -4247,7 +4231,7 @@ msgstr "" "以免這項資訊無法直接被取得(透過 :c:type:`PyCMethod`)。(由 Petr Viktorin " "於 :issue:`46613` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2217 +#: ../../whatsnew/3.11.rst:2249 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:" @@ -4259,7 +4243,7 @@ msgstr "" "`PyFloat_Unpack2` , :c:func:`PyFloat_Unpack4` 和 :c:func:`PyFloat_Unpack8`。" "(由 Victor Stinner 在 :issue:`46906` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2223 +#: ../../whatsnew/3.11.rst:2255 msgid "" "Add new functions to get frame object attributes: :c:func:" "`PyFrame_GetBuiltins`, :c:func:`PyFrame_GetGenerator`, :c:func:" @@ -4269,7 +4253,7 @@ msgstr "" "`PyFrame_GetGenerator`、:c:func:`PyFrame_GetGlobals`、:c:func:" "`PyFrame_GetLasti`。" -#: ../../whatsnew/3.11.rst:2227 +#: ../../whatsnew/3.11.rst:2259 msgid "" "Added two new functions to get and set the active exception instance: :c:" "func:`PyErr_GetHandledException` and :c:func:`PyErr_SetHandledException`. " @@ -4283,7 +4267,7 @@ msgstr "" "例外的遺留三元組表示法一起作用。(由 Irit Katriel 在 :issue:`46343` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:2234 +#: ../../whatsnew/3.11.rst:2266 msgid "" "Added the :c:member:`PyConfig.safe_path` member. (Contributed by Victor " "Stinner in :gh:`57684`.)" @@ -4291,7 +4275,7 @@ msgstr "" "新增 :c:member:`PyConfig.safe_path` 成員。(由 Victor Stinner 於 :gh:`57684` " "中所貢獻。)" -#: ../../whatsnew/3.11.rst:2245 +#: ../../whatsnew/3.11.rst:2277 msgid "" "Some macros have been converted to static inline functions to avoid `macro " "pitfalls `_. The " @@ -4309,7 +4293,7 @@ msgstr "" "要將引數轉換為他們期望的型別。有關更多詳細資訊,請參閱 :pep:`670`。 (由 " "Victor Stinner 和 Erlend E. Aasland 在 :gh:`89653` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2256 +#: ../../whatsnew/3.11.rst:2288 msgid "" ":c:func:`PyErr_SetExcInfo()` no longer uses the ``type`` and ``traceback`` " "arguments, the interpreter now derives those values from the exception " @@ -4320,7 +4304,7 @@ msgstr "" "現在從例外實例(``value`` 引數)中獲得這些值。該函式仍會偷用這三個引數的參" "照。(由 Irit Katriel 在 :issue:`45711` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2262 +#: ../../whatsnew/3.11.rst:2294 msgid "" ":c:func:`PyErr_GetExcInfo()` now derives the ``type`` and ``traceback`` " "fields of the result from the exception instance (the ``value`` field). " @@ -4330,7 +4314,7 @@ msgstr "" "``type`` 和 ``traceback`` 欄位。(由 Irit Katriel 在 :issue:`45711` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:2266 +#: ../../whatsnew/3.11.rst:2298 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 " @@ -4341,7 +4325,7 @@ msgstr "" "件。以前 ``size`` 欄位中的負值是指標,現在只有非負值可用於 ``size``。 (由 " "Kumar Aditya 在 :issue:`46608` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2272 +#: ../../whatsnew/3.11.rst:2304 msgid "" ":c:func:`_PyFrameEvalFunction` now takes ``_PyInterpreterFrame*`` as its " "second parameter, instead of ``PyFrameObject*``. See :pep:`523` for more " @@ -4351,7 +4335,7 @@ msgstr "" "數,而不是 ``PyFrameObject*``。有關如何使用此函式指標型別的更多詳細資訊,請參" "閱 :pep:`523`。" -#: ../../whatsnew/3.11.rst:2276 +#: ../../whatsnew/3.11.rst:2308 msgid "" ":c:func:`PyCode_New` and :c:func:`PyCode_NewWithPosOnlyArgs` now take an " "additional ``exception_table`` argument. Using these functions should be " @@ -4364,7 +4348,7 @@ msgstr "" "碼物件,使用編譯器建立一個程式碼物件,然後使用 ``replace`` 方法來得到修改後的" "版本。" -#: ../../whatsnew/3.11.rst:2282 +#: ../../whatsnew/3.11.rst:2314 msgid "" ":c:type:`PyCodeObject` no longer has the ``co_code``, ``co_varnames``, " "``co_cellvars`` and ``co_freevars`` fields. Instead, use :c:func:" @@ -4379,7 +4363,7 @@ msgstr "" "和 :c:func:`PyCode_GetFreevars` 來存取。(由 Brandt Bucher 在 :issue:" "`46841`、Ken Jin 在 :gh:`92154` 與 :gh:`94936` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2290 +#: ../../whatsnew/3.11.rst:2322 msgid "" "The old trashcan macros (``Py_TRASHCAN_SAFE_BEGIN``/" "``Py_TRASHCAN_SAFE_END``) are now deprecated. They should be replaced by the " @@ -4389,21 +4373,21 @@ msgstr "" "``Py_TRASHCAN_SAFE_END``) 現在已經被棄用,它們應被新的巨集 " "``Py_TRASHCAN_BEGIN`` 和 ``Py_TRASHCAN_END`` 所取代。" -#: ../../whatsnew/3.11.rst:2294 +#: ../../whatsnew/3.11.rst:2326 msgid "A tp_dealloc function that has the old macros, such as::" msgstr "" "一個用到老舊巨集的 tp_dealloc 函式,像是:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2305 +#: ../../whatsnew/3.11.rst:2337 msgid "should migrate to the new macros as follows::" msgstr "" "應該要搬遷到新的巨集,如下所示:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2316 +#: ../../whatsnew/3.11.rst:2348 msgid "" "Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " "deallocation function it is in." @@ -4411,7 +4395,7 @@ msgstr "" "請注意 ``Py_TRASHCAN_BEGIN`` 有第二個引數,它應該是它所在的釋放函數 " "(deallocation function)。" -#: ../../whatsnew/3.11.rst:2319 +#: ../../whatsnew/3.11.rst:2351 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 " @@ -4422,7 +4406,7 @@ msgstr "" "\n" "::" -#: ../../whatsnew/3.11.rst:2331 +#: ../../whatsnew/3.11.rst:2363 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 (:" @@ -4434,7 +4418,7 @@ msgstr "" "`PyType_Ready` 函式現在會引發一個錯誤。(由 Victor Stinner 於 :issue:`44263` " "中貢獻。)" -#: ../../whatsnew/3.11.rst:2336 +#: ../../whatsnew/3.11.rst:2368 msgid "" "Heap types with the :const:`Py_TPFLAGS_IMMUTABLETYPE` flag can now inherit " "the :pep:`590` vectorcall protocol. Previously, this was only possible for :" @@ -4445,7 +4429,7 @@ msgstr "" "向量呼叫協定 (vectorcall protocol)。以前這僅適用於 :ref:`static types " "`。(由 Erlend E. Aasland 在 :issue:`43908` 中貢獻)。" -#: ../../whatsnew/3.11.rst:2341 +#: ../../whatsnew/3.11.rst:2373 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, " @@ -4457,11 +4441,11 @@ msgstr "" "c:func:`Py_SET_TYPE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使用這" "個巨集:" -#: ../../whatsnew/3.11.rst:2353 ../../whatsnew/3.11.rst:2367 +#: ../../whatsnew/3.11.rst:2385 ../../whatsnew/3.11.rst:2399 msgid "(Contributed by Victor Stinner in :issue:`39573`.)" msgstr "(由 Victor Stinner 於 :issue:`39573` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2355 +#: ../../whatsnew/3.11.rst:2387 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, " @@ -4473,7 +4457,7 @@ msgstr "" "`Py_SET_SIZE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使用這個巨" "集:" -#: ../../whatsnew/3.11.rst:2369 +#: ../../whatsnew/3.11.rst:2401 msgid "" "```` no longer includes the header files ````, ````, ```` and ```` when the ``Py_LIMITED_API`` macro is " @@ -4486,7 +4470,7 @@ msgstr "" "和 ````。C 擴充程式應該要清楚的在 ``#include `` 之後引入" "標頭檔案。(由 Victor Stinner 於 :issue:`45434` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2375 +#: ../../whatsnew/3.11.rst:2407 msgid "" "The non-limited API files ``cellobject.h``, ``classobject.h``, ``code.h``, " "``context.h``, ``funcobject.h``, ``genobject.h`` and ``longintrepr.h`` have " @@ -4503,7 +4487,7 @@ msgstr "" "檔案 `。如果它們已被直接引入,請考慮改為引入 ``Python.h``。 " "(由 Victor Stinner 在 :issue:`35134` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2383 +#: ../../whatsnew/3.11.rst:2415 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 " @@ -4514,7 +4498,7 @@ msgstr "" "使用,因為它使用了受限 C API 不提供的內部結構。(由 Victor Stinner 於 :issue:" "`46007` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2388 +#: ../../whatsnew/3.11.rst:2420 msgid "" "The following frame functions and type are now directly available with " "``#include ``, it's no longer needed to add ``#include " @@ -4523,49 +4507,49 @@ msgstr "" "以下用於幀 (frame) 的函式與型別現在可直接透過 ``#include `` 來使" "用,不必再加上 ``#include ``:" -#: ../../whatsnew/3.11.rst:2392 +#: ../../whatsnew/3.11.rst:2424 msgid ":c:func:`PyFrame_Check`" msgstr ":c:func:`PyFrame_Check`" -#: ../../whatsnew/3.11.rst:2393 +#: ../../whatsnew/3.11.rst:2425 msgid ":c:func:`PyFrame_GetBack`" msgstr ":c:func:`PyFrame_GetBack`" -#: ../../whatsnew/3.11.rst:2394 +#: ../../whatsnew/3.11.rst:2426 msgid ":c:func:`PyFrame_GetBuiltins`" msgstr ":c:func:`PyFrame_GetBuiltins`" -#: ../../whatsnew/3.11.rst:2395 +#: ../../whatsnew/3.11.rst:2427 msgid ":c:func:`PyFrame_GetGenerator`" msgstr ":c:func:`PyFrame_GetGenerator`" -#: ../../whatsnew/3.11.rst:2396 +#: ../../whatsnew/3.11.rst:2428 msgid ":c:func:`PyFrame_GetGlobals`" msgstr ":c:func:`PyFrame_GetGlobals`" -#: ../../whatsnew/3.11.rst:2397 +#: ../../whatsnew/3.11.rst:2429 msgid ":c:func:`PyFrame_GetLasti`" msgstr ":c:func:`PyFrame_GetLasti`" -#: ../../whatsnew/3.11.rst:2398 +#: ../../whatsnew/3.11.rst:2430 msgid ":c:func:`PyFrame_GetLocals`" msgstr ":c:func:`PyFrame_GetLocals`" -#: ../../whatsnew/3.11.rst:2399 +#: ../../whatsnew/3.11.rst:2431 msgid ":c:type:`PyFrame_Type`" msgstr ":c:type:`PyFrame_Type`" -#: ../../whatsnew/3.11.rst:2401 +#: ../../whatsnew/3.11.rst:2433 msgid "(Contributed by Victor Stinner in :gh:`93937`.)" msgstr "(由 Victor Stinner 於 :gh:`93937` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2405 +#: ../../whatsnew/3.11.rst:2437 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:2408 +#: ../../whatsnew/3.11.rst:2440 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 " @@ -4574,7 +4558,7 @@ msgstr "" "雖然文件指出 :c:type:`PyFrameObject` 欄位隨時可能發生變化,但它們已經穩定了很" "長時間,並被用於幾個流行的擴充套件中。" -#: ../../whatsnew/3.11.rst:2412 +#: ../../whatsnew/3.11.rst:2444 msgid "" "In Python 3.11, the frame struct was reorganized to allow performance " "optimizations. Some fields were removed entirely, as they were details of " @@ -4583,39 +4567,39 @@ msgstr "" "Python 3.11 中,幀的結構被重新編制來為性能做最佳化,有些作為舊版實作細節的欄" "位被整個移除。" -#: ../../whatsnew/3.11.rst:2416 +#: ../../whatsnew/3.11.rst:2448 msgid ":c:type:`PyFrameObject` fields:" msgstr ":c:type:`PyFrameObject` 欄位:" -#: ../../whatsnew/3.11.rst:2418 +#: ../../whatsnew/3.11.rst:2450 msgid "``f_back``: use :c:func:`PyFrame_GetBack`." msgstr "``f_back``:使用 :c:func:`PyFrame_GetBack`。" -#: ../../whatsnew/3.11.rst:2419 +#: ../../whatsnew/3.11.rst:2451 msgid "``f_blockstack``: removed." msgstr "``f_blockstack``:已移除。" -#: ../../whatsnew/3.11.rst:2420 +#: ../../whatsnew/3.11.rst:2452 msgid "``f_builtins``: use :c:func:`PyFrame_GetBuiltins`." msgstr "``f_builtins``:使用 :c:func:`PyFrame_GetBuiltins`。" -#: ../../whatsnew/3.11.rst:2421 +#: ../../whatsnew/3.11.rst:2453 msgid "``f_code``: use :c:func:`PyFrame_GetCode`." msgstr "``f_code``:使用 :c:func:`PyFrame_GetCode`。" -#: ../../whatsnew/3.11.rst:2422 +#: ../../whatsnew/3.11.rst:2454 msgid "``f_gen``: use :c:func:`PyFrame_GetGenerator`." msgstr "``f_gen``:使用 :c:func:`PyFrame_GetGenerator`。" -#: ../../whatsnew/3.11.rst:2423 +#: ../../whatsnew/3.11.rst:2455 msgid "``f_globals``: use :c:func:`PyFrame_GetGlobals`." msgstr "``f_globals``:使用 :c:func:`PyFrame_GetGlobals`。" -#: ../../whatsnew/3.11.rst:2424 +#: ../../whatsnew/3.11.rst:2456 msgid "``f_iblock``: removed." msgstr "``f_iblock``:已移除。" -#: ../../whatsnew/3.11.rst:2425 +#: ../../whatsnew/3.11.rst:2457 msgid "" "``f_lasti``: use :c:func:`PyFrame_GetLasti`. Code using ``f_lasti`` with " "``PyCode_Addr2Line()`` should use :c:func:`PyFrame_GetLineNumber` instead; " @@ -4625,27 +4609,27 @@ msgstr "" "``PyCode_Addr2Line()`` 同時使用的部分應該改用 :c:func:" "`PyFrame_GetLineNumber`;它可能會更快。" -#: ../../whatsnew/3.11.rst:2428 +#: ../../whatsnew/3.11.rst:2460 msgid "``f_lineno``: use :c:func:`PyFrame_GetLineNumber`" msgstr "``f_lineno``:使用 :c:func:`PyFrame_GetLineNumber`" -#: ../../whatsnew/3.11.rst:2429 +#: ../../whatsnew/3.11.rst:2461 msgid "``f_locals``: use :c:func:`PyFrame_GetLocals`." msgstr "``f_locals``:使用 :c:func:`PyFrame_GetLocals`。" -#: ../../whatsnew/3.11.rst:2430 +#: ../../whatsnew/3.11.rst:2462 msgid "``f_stackdepth``: removed." msgstr "``f_stackdepth``:已移除。" -#: ../../whatsnew/3.11.rst:2431 +#: ../../whatsnew/3.11.rst:2463 msgid "``f_state``: no public API (renamed to ``f_frame.f_state``)." msgstr "``f_state``:無公開 API(重新命名為 ``f_frame.f_state``)。" -#: ../../whatsnew/3.11.rst:2432 +#: ../../whatsnew/3.11.rst:2464 msgid "``f_trace``: no public API." msgstr "``f_trace``:無公開 API。" -#: ../../whatsnew/3.11.rst:2433 +#: ../../whatsnew/3.11.rst:2465 msgid "" "``f_trace_lines``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_lines\")``." @@ -4653,7 +4637,7 @@ msgstr "" "``f_trace_lines``:使用 ``PyObject_GetAttrString((PyObject*)frame, " "“f_trace_lines”)``。" -#: ../../whatsnew/3.11.rst:2434 +#: ../../whatsnew/3.11.rst:2466 msgid "" "``f_trace_opcodes``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_opcodes\")``." @@ -4661,15 +4645,15 @@ msgstr "" "``f_trace_opcodes``:使用 ``PyObject_GetAttrString((PyObject*)frame, " "“f_trace_opcodes”)``。" -#: ../../whatsnew/3.11.rst:2435 +#: ../../whatsnew/3.11.rst:2467 msgid "``f_localsplus``: no public API (renamed to ``f_frame.localsplus``)." msgstr "``f_localsplus``:無公開 API(重新命名為 ``f_frame.localsplus``)。" -#: ../../whatsnew/3.11.rst:2436 +#: ../../whatsnew/3.11.rst:2468 msgid "``f_valuestack``: removed." msgstr "``f_valuestack``:已移除。" -#: ../../whatsnew/3.11.rst:2438 +#: ../../whatsnew/3.11.rst:2470 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 " @@ -4679,7 +4663,7 @@ msgstr "" "Python 幀物件的建立現為惰性的 (lazily),一個副作用是 ``f_back`` 成員不能被直" "接存取,因為其職的計算也是惰性的,要改呼叫 :c:func:`PyFrame_GetBack`。" -#: ../../whatsnew/3.11.rst:2443 +#: ../../whatsnew/3.11.rst:2475 msgid "" "Debuggers that accessed the ``f_locals`` directly *must* call :c:func:" "`PyFrame_GetLocals` instead. They no longer need to call :c:func:" @@ -4692,21 +4676,21 @@ msgstr "" "`PyFrame_FastToLocalsWithError` 或 :c:func:`PyFrame_LocalsToFast`,事實上他們" "不應該呼叫這些函式。框架的必要更新現在由虛擬機管理。" -#: ../../whatsnew/3.11.rst:2449 +#: ../../whatsnew/3.11.rst:2481 msgid "Code defining ``PyFrame_GetCode()`` on Python 3.8 and older::" msgstr "" "``PyFrame_GetCode()`` 在 Python 3.8 以前的程式定義:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2459 +#: ../../whatsnew/3.11.rst:2491 msgid "Code defining ``PyFrame_GetBack()`` on Python 3.8 and older::" msgstr "" "``PyFrame_GetBack()`` 在 Python 3.8 以前的程式定義:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2469 +#: ../../whatsnew/3.11.rst:2501 msgid "" "Or use the `pythoncapi_compat project `__ to get these two functions on older Python versions." @@ -4714,11 +4698,11 @@ msgstr "" "或是使用 `pythoncapi_compat 計畫 `__\\ 來在舊版 Python 中取得它們。" -#: ../../whatsnew/3.11.rst:2473 +#: ../../whatsnew/3.11.rst:2505 msgid "Changes of the :c:type:`PyThreadState` structure members:" msgstr ":c:type:`PyThreadState` 結構成員的改動:" -#: ../../whatsnew/3.11.rst:2475 +#: ../../whatsnew/3.11.rst:2507 msgid "" "``frame``: removed, use :c:func:`PyThreadState_GetFrame` (function added to " "Python 3.9 by :issue:`40429`). Warning: the function returns a :term:`strong " @@ -4728,7 +4712,7 @@ msgstr "" "於 Python 3.9 新增的函式)。警告:會回傳 :term:`strong reference` 的函式必須" "呼叫 :c:func:`Py_XDECREF`。" -#: ../../whatsnew/3.11.rst:2479 +#: ../../whatsnew/3.11.rst:2511 msgid "" "``tracing``: changed, use :c:func:`PyThreadState_EnterTracing` and :c:func:" "`PyThreadState_LeaveTracing` (functions added to Python 3.11 by :issue:" @@ -4738,7 +4722,7 @@ msgstr "" "`PyThreadState_LeaveTracing`\\ (:issue:`43760` 於 Python 3.11 中新增的函" "式)。" -#: ../../whatsnew/3.11.rst:2482 +#: ../../whatsnew/3.11.rst:2514 msgid "" "``recursion_depth``: removed, use ``(tstate->recursion_limit - tstate-" ">recursion_remaining)`` instead." @@ -4746,18 +4730,18 @@ msgstr "" "``recursion_depth``:已移除,請改用 ``(tstate->recursion_limit - tstate-" ">recursion_remaining)``。" -#: ../../whatsnew/3.11.rst:2484 +#: ../../whatsnew/3.11.rst:2516 msgid "``stackcheck_counter``: removed." msgstr "``stackcheck_counter``:已移除。" -#: ../../whatsnew/3.11.rst:2486 +#: ../../whatsnew/3.11.rst:2518 msgid "Code defining ``PyThreadState_GetFrame()`` on Python 3.8 and older::" msgstr "" "``PyThreadState_GetFrame()`` 在 Python 3.8 以前的程式定義:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2496 +#: ../../whatsnew/3.11.rst:2528 msgid "" "Code defining ``PyThreadState_EnterTracing()`` and " "``PyThreadState_LeaveTracing()`` on Python 3.10 and older::" @@ -4767,7 +4751,7 @@ msgstr "" "\n" "::" -#: ../../whatsnew/3.11.rst:2522 +#: ../../whatsnew/3.11.rst:2554 msgid "" "Or use `the pythoncapi_compat project `__ to get these functions on old Python functions." @@ -4775,13 +4759,13 @@ msgstr "" "或是使用 `pythoncapi_compat 計畫 `__\\ 來在舊版 Python 函式中取得它們。" -#: ../../whatsnew/3.11.rst:2526 +#: ../../whatsnew/3.11.rst:2558 msgid "" "Distributors are encouraged to build Python with the optimized Blake2 " "library `libb2`_." msgstr "鼓勵發布者們使用最佳化過的 Blake2 函式庫 `libb2`_ 來建置 Python。" -#: ../../whatsnew/3.11.rst:2529 +#: ../../whatsnew/3.11.rst:2561 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 " @@ -4792,7 +4776,7 @@ msgstr "" "`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須被設為 " "1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` 的值。" -#: ../../whatsnew/3.11.rst:2534 +#: ../../whatsnew/3.11.rst:2566 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 " @@ -4805,60 +4789,60 @@ msgstr "" "初始化並使用 :c:func:`PySys_GetObject` 以取得 :data:`sys.path` 作為 Python 列" "表物件並直接修改它。" -#: ../../whatsnew/3.11.rst:2545 +#: ../../whatsnew/3.11.rst:2577 msgid "" "Deprecate the following functions to configure the Python initialization:" msgstr "棄用以下用來配置 Python 初始化的函式:" -#: ../../whatsnew/3.11.rst:2547 +#: ../../whatsnew/3.11.rst:2579 msgid ":c:func:`PySys_AddWarnOptionUnicode`" msgstr ":c:func:`PySys_AddWarnOptionUnicode`" -#: ../../whatsnew/3.11.rst:2548 +#: ../../whatsnew/3.11.rst:2580 msgid ":c:func:`PySys_AddWarnOption`" msgstr ":c:func:`PySys_AddWarnOption`" -#: ../../whatsnew/3.11.rst:2549 +#: ../../whatsnew/3.11.rst:2581 msgid ":c:func:`PySys_AddXOption`" msgstr ":c:func:`PySys_AddXOption`" -#: ../../whatsnew/3.11.rst:2550 +#: ../../whatsnew/3.11.rst:2582 msgid ":c:func:`PySys_HasWarnOptions`" msgstr ":c:func:`PySys_HasWarnOptions`" -#: ../../whatsnew/3.11.rst:2551 +#: ../../whatsnew/3.11.rst:2583 msgid ":c:func:`PySys_SetArgvEx`" msgstr ":c:func:`PySys_SetArgvEx`" -#: ../../whatsnew/3.11.rst:2552 +#: ../../whatsnew/3.11.rst:2584 msgid ":c:func:`PySys_SetArgv`" msgstr ":c:func:`PySys_SetArgv`" -#: ../../whatsnew/3.11.rst:2553 +#: ../../whatsnew/3.11.rst:2585 msgid ":c:func:`PySys_SetPath`" msgstr ":c:func:`PySys_SetPath`" -#: ../../whatsnew/3.11.rst:2554 +#: ../../whatsnew/3.11.rst:2586 msgid ":c:func:`Py_SetPath`" msgstr ":c:func:`Py_SetPath`" -#: ../../whatsnew/3.11.rst:2555 +#: ../../whatsnew/3.11.rst:2587 msgid ":c:func:`Py_SetProgramName`" msgstr ":c:func:`Py_SetProgramName`" -#: ../../whatsnew/3.11.rst:2556 +#: ../../whatsnew/3.11.rst:2588 msgid ":c:func:`Py_SetPythonHome`" msgstr ":c:func:`Py_SetPythonHome`" -#: ../../whatsnew/3.11.rst:2557 +#: ../../whatsnew/3.11.rst:2589 msgid ":c:func:`Py_SetStandardStreamEncoding`" msgstr ":c:func:`Py_SetStandardStreamEncoding`" -#: ../../whatsnew/3.11.rst:2558 +#: ../../whatsnew/3.11.rst:2590 msgid ":c:func:`_Py_SetProgramFullPath`" msgstr ":c:func:`_Py_SetProgramFullPath`" -#: ../../whatsnew/3.11.rst:2560 +#: ../../whatsnew/3.11.rst:2592 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration ` instead (:pep:`587`). (Contributed by Victor " @@ -4867,7 +4851,7 @@ msgstr "" "請改用 :ref:`Python 初始化配置 `\\ 中新的 :c:type:`PyConfig` " "API。(由 Victor Stinner 於 :gh:`88279` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2564 +#: ../../whatsnew/3.11.rst:2596 msgid "" "Deprecate the ``ob_shash`` member of the :c:type:`PyBytesObject`. Use :c:" "func:`PyObject_Hash` instead. (Contributed by Inada Naoki in :issue:`46864`.)" @@ -4875,77 +4859,77 @@ msgstr "" "棄用 :c:type:`PyBytesObject` 中的 ``ob_shash`` 成員。請改用 :c:func:" "`PyObject_Hash`。(由 Inada Naoki 於 :issue:`46864` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2573 +#: ../../whatsnew/3.11.rst:2605 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:2576 +#: ../../whatsnew/3.11.rst:2608 msgid ":c:func:`PyUnicode_AS_DATA`" msgstr ":c:func:`PyUnicode_AS_DATA`" -#: ../../whatsnew/3.11.rst:2577 +#: ../../whatsnew/3.11.rst:2609 msgid ":c:func:`PyUnicode_AS_UNICODE`" msgstr ":c:func:`PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.11.rst:2578 +#: ../../whatsnew/3.11.rst:2610 msgid ":c:func:`PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.11.rst:2579 +#: ../../whatsnew/3.11.rst:2611 msgid ":c:func:`PyUnicode_AsUnicode`" msgstr ":c:func:`PyUnicode_AsUnicode`" -#: ../../whatsnew/3.11.rst:2580 +#: ../../whatsnew/3.11.rst:2612 msgid ":c:func:`PyUnicode_FromUnicode`" msgstr ":c:func:`PyUnicode_FromUnicode`" -#: ../../whatsnew/3.11.rst:2581 +#: ../../whatsnew/3.11.rst:2613 msgid ":c:func:`PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.11.rst:2582 +#: ../../whatsnew/3.11.rst:2614 msgid ":c:func:`PyUnicode_GET_SIZE`" msgstr ":c:func:`PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.11.rst:2583 +#: ../../whatsnew/3.11.rst:2615 msgid ":c:func:`PyUnicode_GetSize`" msgstr ":c:func:`PyUnicode_GetSize`" -#: ../../whatsnew/3.11.rst:2584 +#: ../../whatsnew/3.11.rst:2616 msgid ":c:func:`PyUnicode_IS_COMPACT`" msgstr ":c:func:`PyUnicode_IS_COMPACT`" -#: ../../whatsnew/3.11.rst:2585 +#: ../../whatsnew/3.11.rst:2617 msgid ":c:func:`PyUnicode_IS_READY`" msgstr ":c:func:`PyUnicode_IS_READY`" -#: ../../whatsnew/3.11.rst:2586 +#: ../../whatsnew/3.11.rst:2618 msgid ":c:func:`PyUnicode_READY`" msgstr ":c:func:`PyUnicode_READY`" -#: ../../whatsnew/3.11.rst:2587 +#: ../../whatsnew/3.11.rst:2619 msgid ":c:func:`Py_UNICODE_WSTR_LENGTH`" msgstr ":c:func:`Py_UNICODE_WSTR_LENGTH`" -#: ../../whatsnew/3.11.rst:2588 +#: ../../whatsnew/3.11.rst:2620 msgid ":c:func:`_PyUnicode_AsUnicode`" msgstr ":c:func:`_PyUnicode_AsUnicode`" -#: ../../whatsnew/3.11.rst:2589 +#: ../../whatsnew/3.11.rst:2621 msgid ":c:macro:`PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.11.rst:2590 +#: ../../whatsnew/3.11.rst:2622 msgid ":c:type:`PyUnicodeObject`" msgstr ":c:type:`PyUnicodeObject`" -#: ../../whatsnew/3.11.rst:2591 +#: ../../whatsnew/3.11.rst:2623 msgid ":c:func:`PyUnicode_InternImmortal()`" msgstr ":c:func:`PyUnicode_InternImmortal()`" -#: ../../whatsnew/3.11.rst:2599 +#: ../../whatsnew/3.11.rst:2631 msgid "" ":c:func:`PyFrame_BlockSetup` and :c:func:`PyFrame_BlockPop` have been " "removed. (Contributed by Mark Shannon in :issue:`40222`.)" @@ -4953,35 +4937,35 @@ msgstr "" "移除 :c:func:`PyFrame_BlockSetup` 和 :c:func:`PyFrame_BlockPop`。(由 Mark " "Shannon 於 :issue:`40222` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2603 +#: ../../whatsnew/3.11.rst:2635 msgid "Remove the following math macros using the ``errno`` variable:" msgstr "移除以下使用到 ``errno`` 變數的數學巨集:" -#: ../../whatsnew/3.11.rst:2605 +#: ../../whatsnew/3.11.rst:2637 msgid "``Py_ADJUST_ERANGE1()``" msgstr "``Py_ADJUST_ERANGE1()``" -#: ../../whatsnew/3.11.rst:2606 +#: ../../whatsnew/3.11.rst:2638 msgid "``Py_ADJUST_ERANGE2()``" msgstr "``Py_ADJUST_ERANGE2()``" -#: ../../whatsnew/3.11.rst:2607 +#: ../../whatsnew/3.11.rst:2639 msgid "``Py_OVERFLOWED()``" msgstr "``Py_OVERFLOWED()``" -#: ../../whatsnew/3.11.rst:2608 +#: ../../whatsnew/3.11.rst:2640 msgid "``Py_SET_ERANGE_IF_OVERFLOW()``" msgstr "``Py_SET_ERANGE_IF_OVERFLOW()``" -#: ../../whatsnew/3.11.rst:2609 +#: ../../whatsnew/3.11.rst:2641 msgid "``Py_SET_ERRNO_ON_MATH_ERROR()``" msgstr "``Py_SET_ERRNO_ON_MATH_ERROR()``" -#: ../../whatsnew/3.11.rst:2611 +#: ../../whatsnew/3.11.rst:2643 msgid "(Contributed by Victor Stinner in :issue:`45412`.)" msgstr "(由 Victor Stinner 於 :issue:`45412` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2613 +#: ../../whatsnew/3.11.rst:2645 msgid "" "Remove ``Py_UNICODE_COPY()`` and ``Py_UNICODE_FILL()`` macros, deprecated " "since Python 3.3. Use ``PyUnicode_CopyCharacters()`` or ``memcpy()`` " @@ -4993,7 +4977,7 @@ msgstr "" "和 ``PyUnicode_Fill()`` 函式。(由 Victor Stinner 於 :issue:`41123` 中所貢" "獻。)" -#: ../../whatsnew/3.11.rst:2618 +#: ../../whatsnew/3.11.rst:2650 msgid "" "Remove the ``pystrhex.h`` header file. It only contains private functions. C " "extensions should only include the main ```` header file. " @@ -5002,7 +4986,7 @@ msgstr "" "移除 ``pystrhex.h`` 標頭檔案。它只有包含私有函式。C 的擴充應該只要引入主要的 " "```` 標頭檔案。(由 Victor Stinner 於 :issue:`45434` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2622 +#: ../../whatsnew/3.11.rst:2654 msgid "" "Remove the ``Py_FORCE_DOUBLE()`` macro. It was used by the " "``Py_IS_INFINITY()`` macro. (Contributed by Victor Stinner in :issue:" @@ -5011,41 +4995,41 @@ msgstr "" "移除 ``Py_FORCE_DOUBLE()`` 巨集。它先前被用於 ``Py_IS_INFINITY()`` 巨集。" "(由 Victor Stinner 於 :issue:`45440` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2626 +#: ../../whatsnew/3.11.rst:2658 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:2629 +#: ../../whatsnew/3.11.rst:2661 msgid ":c:func:`PyMarshal_WriteLongToFile`" msgstr ":c:func:`PyMarshal_WriteLongToFile`" -#: ../../whatsnew/3.11.rst:2630 +#: ../../whatsnew/3.11.rst:2662 msgid ":c:func:`PyMarshal_WriteObjectToFile`" msgstr ":c:func:`PyMarshal_WriteObjectToFile`" -#: ../../whatsnew/3.11.rst:2631 +#: ../../whatsnew/3.11.rst:2663 msgid ":c:func:`PyMarshal_ReadObjectFromString`" msgstr ":c:func:`PyMarshal_ReadObjectFromString`" -#: ../../whatsnew/3.11.rst:2632 +#: ../../whatsnew/3.11.rst:2664 msgid ":c:func:`PyMarshal_WriteObjectToString`" msgstr ":c:func:`PyMarshal_WriteObjectToString`" -#: ../../whatsnew/3.11.rst:2633 +#: ../../whatsnew/3.11.rst:2665 msgid "the ``Py_MARSHAL_VERSION`` macro" msgstr "``Py_MARSHAL_VERSION`` 巨集" -#: ../../whatsnew/3.11.rst:2635 +#: ../../whatsnew/3.11.rst:2667 msgid "These are not part of the :ref:`limited API `." msgstr "這些並非\\ :ref:`受限 API ` 的一部分。" -#: ../../whatsnew/3.11.rst:2637 +#: ../../whatsnew/3.11.rst:2669 msgid "(Contributed by Victor Stinner in :issue:`45474`.)" msgstr "(由 Victor Stinner 於 :issue:`45474` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2639 +#: ../../whatsnew/3.11.rst:2671 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 " @@ -5055,7 +5039,7 @@ msgstr "" "`PyWeakReference` 結構在受限 C API 中過於晦澀而從未運作。(由 Victor Stinner " "於 :issue:`35134` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2644 +#: ../../whatsnew/3.11.rst:2676 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 " @@ -5066,7 +5050,7 @@ msgstr "" "該只能被 Python 內部所使用。請改用 ``PyTypeObject.tp_members``。(由 Victor " "Stinner 於 :issue:`40170` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2649 +#: ../../whatsnew/3.11.rst:2681 msgid "" "Remove the ``HAVE_PY_SET_53BIT_PRECISION`` macro (moved to the internal C " "API). (Contributed by Victor Stinner in :issue:`45412`.)" @@ -5074,7 +5058,7 @@ msgstr "" "移除 ``HAVE_PY_SET_53BIT_PRECISION`` 巨集(移動至內部 C API)。(由 Victor " "Stinner 於 :issue:`45412` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2655 +#: ../../whatsnew/3.11.rst:2687 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 " @@ -5083,66 +5067,281 @@ msgstr "" "移除 :c:type:`Py_UNICODE` 編碼器 API,它們自從 Python 3.3 就被棄用,非常少用" "且和推薦的替代方案已無太大關聯。" -#: ../../whatsnew/3.11.rst:2660 +#: ../../whatsnew/3.11.rst:2692 msgid "The removed functions are:" msgstr "被移除的函式為:" -#: ../../whatsnew/3.11.rst:2662 +#: ../../whatsnew/3.11.rst:2694 msgid ":func:`!PyUnicode_Encode`" msgstr ":func:`!PyUnicode_Encode`" -#: ../../whatsnew/3.11.rst:2663 +#: ../../whatsnew/3.11.rst:2695 msgid ":func:`!PyUnicode_EncodeASCII`" msgstr ":func:`!PyUnicode_EncodeASCII`" -#: ../../whatsnew/3.11.rst:2664 +#: ../../whatsnew/3.11.rst:2696 msgid ":func:`!PyUnicode_EncodeLatin1`" msgstr ":func:`!PyUnicode_EncodeLatin1`" -#: ../../whatsnew/3.11.rst:2665 +#: ../../whatsnew/3.11.rst:2697 msgid ":func:`!PyUnicode_EncodeUTF7`" msgstr ":func:`!PyUnicode_EncodeUTF7`" -#: ../../whatsnew/3.11.rst:2666 +#: ../../whatsnew/3.11.rst:2698 msgid ":func:`!PyUnicode_EncodeUTF8`" msgstr ":func:`!PyUnicode_EncodeUTF8`" -#: ../../whatsnew/3.11.rst:2667 +#: ../../whatsnew/3.11.rst:2699 msgid ":func:`!PyUnicode_EncodeUTF16`" msgstr ":func:`!PyUnicode_EncodeUTF16`" -#: ../../whatsnew/3.11.rst:2668 +#: ../../whatsnew/3.11.rst:2700 msgid ":func:`!PyUnicode_EncodeUTF32`" msgstr ":func:`!PyUnicode_EncodeUTF32`" -#: ../../whatsnew/3.11.rst:2669 +#: ../../whatsnew/3.11.rst:2701 msgid ":func:`!PyUnicode_EncodeUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2670 +#: ../../whatsnew/3.11.rst:2702 msgid ":func:`!PyUnicode_EncodeRawUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeRawUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2671 +#: ../../whatsnew/3.11.rst:2703 msgid ":func:`!PyUnicode_EncodeCharmap`" msgstr ":func:`!PyUnicode_EncodeCharmap`" -#: ../../whatsnew/3.11.rst:2672 +#: ../../whatsnew/3.11.rst:2704 msgid ":func:`!PyUnicode_TranslateCharmap`" msgstr ":func:`!PyUnicode_TranslateCharmap`" -#: ../../whatsnew/3.11.rst:2673 +#: ../../whatsnew/3.11.rst:2705 msgid ":func:`!PyUnicode_EncodeDecimal`" msgstr ":func:`!PyUnicode_EncodeDecimal`" -#: ../../whatsnew/3.11.rst:2674 +#: ../../whatsnew/3.11.rst:2706 msgid ":func:`!PyUnicode_TransformDecimalToASCII`" msgstr ":func:`!PyUnicode_TransformDecimalToASCII`" -#: ../../whatsnew/3.11.rst:2676 +#: ../../whatsnew/3.11.rst:2708 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 "" +#~ "CPython 3.11 is on average `25% faster `_ than CPython 3.10 when measured with the " +#~ "`pyperformance `_ benchmark " +#~ "suite, and compiled with GCC on Ubuntu Linux. Depending on your workload, " +#~ "the speedup could be up to 10-60% faster." +#~ msgstr "" +#~ "當使用基準量測套裝軟體 `pyperformance `_ 量測並以 GCC 於 Ubuntu Linux 上編譯,Python 3.11 平均比 " +#~ "Python 3.10 `快了 25% `_。根據程式工作量可能有所不同,加速程度可能高達 10-60%。" + +#~ msgid "" +#~ "This project focuses on two major areas in Python: faster startup and " +#~ "faster runtime. Other optimizations not under this project are listed in " +#~ "`Optimizations`_." +#~ msgstr "" +#~ "這個計畫著重於 Python 的兩個地方:更快的啟動 (faster startup) 與更快的運行" +#~ "程式 (faster runtime)。其他不在此計畫的最佳化項目列於 `Optimizations`_。" + +#~ msgid "" +#~ "Python caches bytecode in the :ref:`__pycache__` directory " +#~ "to speed up module loading." +#~ msgstr "" +#~ "Python 將位元組碼於 :ref:`__pycache__` 目錄中存為快取來加速模" +#~ "組的載入。" + +#~ msgid "" +#~ "In Python 3.11, the core modules essential for Python startup are " +#~ "\"frozen\". This means that their code objects (and bytecode) are " +#~ "statically allocated by the interpreter. This reduces the steps in module " +#~ "execution process to this:" +#~ msgstr "" +#~ "在 Python 3.11 中,核心模組在 Python 啟動時必須被「凍結」,這意味著它們的" +#~ "程式碼物件(和位元組碼)是由直譯器靜態分配的。這將模組執行過程中的步驟減少" +#~ "為:" + +#~ msgid "" +#~ "(Contributed by Eric Snow, Guido van Rossum and Kumar Aditya in numerous " +#~ "issues.)" +#~ msgstr "" +#~ "(由 Eric Snow、Guido van Rossum 與 Kumar Aditya 於多個 issue 中貢獻。)" + +#~ msgid "" +#~ "Python frames are created whenever Python calls a Python function. This " +#~ "frame holds execution information. The following are new frame " +#~ "optimizations:" +#~ msgstr "" +#~ "每當 Python 呼叫 Python 函數時,就會建立 Python 幀。該幀保存執行資訊。以下" +#~ "是針對幀而做的新最佳化:" + +#~ msgid "" +#~ "Old-style frame objects are now created only when requested by debuggers " +#~ "or by Python introspection functions such as ``sys._getframe`` or " +#~ "``inspect.currentframe``. For most user code, no frame objects are " +#~ "created at all. As a result, nearly all Python functions calls have sped " +#~ "up significantly. We measured a 3-7% speedup in pyperformance." +#~ msgstr "" +#~ "舊式幀物件現在僅在除錯器或 Python 自我檢查函式(例如 ``sys._getframe`` 或 " +#~ "``inspect.currentframe``)請求時才建立。對於大多數使用者程式碼,根本不會建" +#~ "立任何幀物件。結果幾乎所有 Python 函式呼叫都顯著加速。我們以 " +#~ "pyperformance 測得了 3-7% 的加速。" + +#~ msgid "" +#~ "Most Python function calls now consume no C stack space. This speeds up " +#~ "most of such calls. In simple recursive functions like fibonacci or " +#~ "factorial, a 1.7x speedup was observed. This also means recursive " +#~ "functions can recurse significantly deeper (if the user increases the " +#~ "recursion limit). We measured a 1-3% improvement in pyperformance." +#~ msgstr "" +#~ "現在大多數 Python 函式的呼叫不會佔用 C 堆疊空間,這加快了大多數此類呼叫的" +#~ "速度。在斐波那契 (fibonacci) 或階乘等簡單遞迴函式中,觀察到 1.7 倍的加速。" +#~ "這也意味著遞迴函式可以遞迴得更深(如果使用者有增加遞迴限制)。我們在 " +#~ "pyperformance 測得 1-3% 的改進。" + +#~ 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 " +#~ "regions where objects and types rarely change. This concept is known as " +#~ "*type stability*." +#~ msgstr "" +#~ ":pep:`659` 是加速 CPython 專案的關鍵部分之一。一般的想法是,雖然 Python 是" +#~ "一種動態語言,但大多數程式碼都有物件和型別很少去更改的區域。這個概念被稱為" +#~ "\\ *型別穩定 (type stability)*\\ 。" + +#~ 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 more specialized one. This specialized operation uses " +#~ "fast paths available only to those use cases/types, which generally " +#~ "outperform their generic counterparts. This also brings in another " +#~ "concept called *inline caching*, where Python caches the results of " +#~ "expensive operations directly in the bytecode." +#~ msgstr "" +#~ "在運行時間,Python 將嘗試在執行中的程式碼內尋找常用模式和型別穩定,然後 " +#~ "Python 將用更特化的操作替換當前操作。這種特化操作運用了僅適用於那些用例/型" +#~ "別的快速路徑,這通常優於它們的泛用對應 (generic counterparts)。這也引入了" +#~ "另一個稱為\\ *行內快取 (inline caching)*\\ 的概念,其中 Python 將繁重操作" +#~ "的結果直接快取在位元組碼中。" + +#~ msgid "" +#~ "The specializer will also combine certain common instruction pairs into " +#~ "one superinstruction. This reduces the overhead during execution." +#~ msgstr "" +#~ "特化程式 (specializer) 還將某些常用指示 (common instruction) 組合成一個超" +#~ "級指示 (superinstruction),這減少了執行期間的開銷。" + +#~ msgid "" +#~ "Python will only specialize when it sees code that is \"hot\" (executed " +#~ "multiple times). This prevents Python from wasting time for run-once " +#~ "code. Python can also de-specialize when code is too dynamic or when the " +#~ "use changes. Specialization is attempted periodically, and specialization " +#~ "attempts are not too expensive. This allows specialization to adapt to " +#~ "new circumstances." +#~ msgstr "" +#~ "Python 只會在看到「熱」(被多次執行的)程式碼時特化,這可以防止 Python 將" +#~ "時間浪費在只運行一次的程式碼上。當程式碼過於動態或用途發生變化時,Python " +#~ "也可以去特化 (de-specialize)。特化會定期被嘗試執行,而嘗試的成本也不會太" +#~ "高,這讓特化得以適應新的環境。" + +#~ msgid "``x+x; x*x; x-x;``" +#~ msgstr "``x+x; x*x; x-x;``" + +#~ msgid "" +#~ "Binary add, multiply and subtract for common types such as ``int``, " +#~ "``float``, and ``str`` take custom fast paths for their underlying types." +#~ msgstr "" +#~ "常見型別如 ``int``、``float`` 與 ``str`` 的二元加法、乘法與減法,為底層型" +#~ "別採取了特製的快速路徑。" + +#~ msgid "" +#~ "Subscripting container types such as ``list``, ``tuple`` and ``dict`` " +#~ "directly index the underlying data structures." +#~ msgstr "" +#~ "下標容器型別如 ``list``、``tuple`` 和 ``dict`` 直接索引底層的資料結構。" + +#~ msgid "" +#~ "Subscripting custom ``__getitem__`` is also inlined similar to :ref:" +#~ "`inline-calls`." +#~ msgstr "下標自定義 ``__getitem__`` 也是行內的,類似於 :ref:`inline-calls`。" + +#~ msgid "``f(arg)`` ``C(arg)``" +#~ msgstr "``f(arg)`` ``C(arg)``" + +#~ msgid "" +#~ "Calls to common builtin (C) functions and types such as ``len`` and " +#~ "``str`` directly call their underlying C version. This avoids going " +#~ "through the internal calling convention." +#~ msgstr "" +#~ "常見內建 (C) 函式和型別的呼叫,例如 ``len`` 和 ``str``,會直接呼叫它們的 " +#~ "C 版本底層,這避免了通過內部呼叫的慣例。" + +#~ msgid "``print`` ``len``" +#~ msgstr "``print`` ``len``" + +#~ msgid "[1]_" +#~ msgstr "[1]_" + +#~ msgid "[2]_" +#~ msgstr "[2]_" + +#~ msgid "" +#~ "Specialized for common containers such as ``list`` and ``tuple``. Avoids " +#~ "internal calling convention." +#~ msgstr "為像是 ``list`` 和 ``tuple`` 的常見容器所特化,避免了內部呼叫慣例。" + +#~ msgid "" +#~ "A similar optimization already existed since Python 3.8. 3.11 " +#~ "specializes for more forms and reduces some overhead." +#~ msgstr "" +#~ "類似的最佳化自從 Python 3.8 就存在。3.11 特別處理了更多形式並減少效能開銷 " +#~ "(overhead)。" + +#~ msgid "Q: How should I write my code to utilize these speedups?" +#~ msgstr "問:我該如何在程式碼中獲取這些加速?" + +#~ msgid "" +#~ "A: You don't have to change your code. Write Pythonic code that follows " +#~ "common best practices. The Faster CPython project optimizes for common " +#~ "code patterns we observe." +#~ msgstr "" +#~ "答:你不需要改變你的程式碼。撰寫符合 Python 風格 (Pythonic) 且依循常見最佳" +#~ "實踐的程式碼就好。CPython 加速計畫中,我們為所觀察到的常見程式編寫模式來做" +#~ "最佳化。" + +#~ msgid "Q: Will CPython 3.11 use more memory?" +#~ msgstr "問:Python 3.11 會不會使用更多記憶體?" + +#~ msgid "" +#~ "A: Maybe not. We don't expect memory use to exceed 20% more than 3.10. " +#~ "This is offset by memory optimizations for frame objects and object " +#~ "dictionaries as mentioned above." +#~ msgstr "" +#~ "答:也許不會。我們預期不會有超出 3.10 20% 的記憶體使用量。這數字會和上述禎" +#~ "物件與物件字典的記憶體最佳化而有所偏差。" + +#~ msgid "Q: I don't see any speedups in my workload. Why?" +#~ msgstr "問:我在我的程式當中沒感覺到任何加速,為什麼?" + +#~ msgid "" +#~ "A: 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 extension library like numpy, there won't be significant speedup. " +#~ "This project currently benefits pure-Python workloads the most." +#~ msgstr "" +#~ "答:某些程式中不會有顯著的好處。如果你的程式花了大部分的時間在 I/O 操作" +#~ "上,或已經將大部分計算用像是 numpy 的 C 擴充函式庫處理,那就不會有明顯的加" +#~ "速。這個計畫是對純 Python 的工作負荷最有幫助。" + +#~ msgid "Q: Is there a JIT compiler?" +#~ msgstr "問:有用到 JIT 編譯器嗎?" + +#~ msgid "A: No. We're still exploring other optimizations." +#~ msgstr "答:沒有,我們還在探索其他最佳化方式。" From 1e159c253a4450edbfb8cbd06ab2dbd473108080 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 9 Mar 2023 00:20:06 +0000 Subject: [PATCH 05/10] sync with cpython ffb41eaa --- library/zipapp.po | 12 ++++++------ library/zipfile.po | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/library/zipapp.po b/library/zipapp.po index b30a5a31c6..c8e625759f 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: 2018-10-19 17:24+0800\n" +"POT-Creation-Date: 2023-03-09 00:17+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-" @@ -272,11 +272,11 @@ msgstr "" #: ../../library/zipapp.rst:218 msgid "" "To update the file in place, do the replacement in memory using a :class:" -"`BytesIO` object, and then overwrite the source afterwards. Note that there " -"is a risk when overwriting a file in place that an error will result in the " -"loss of the original file. This code does not protect against such errors, " -"but production code should do so. Also, this method will only work if the " -"archive fits in memory::" +"`~io.BytesIO` object, and then overwrite the source afterwards. Note that " +"there is a risk when overwriting a file in place that an error will result " +"in the loss of the original file. This code does not protect against such " +"errors, but production code should do so. Also, this method will only work " +"if the archive fits in memory::" msgstr "" #: ../../library/zipapp.rst:236 diff --git a/library/zipfile.po b/library/zipfile.po index 491c500f49..20dcd4e0d2 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-02-26 00:19+0000\n" +"POT-Creation-Date: 2023-03-09 00:17+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-" @@ -337,8 +337,8 @@ msgid "" "With *mode* ``'r'`` the file-like object (``ZipExtFile``) is read-only and " "provides the following methods: :meth:`~io.BufferedIOBase.read`, :meth:`~io." "IOBase.readline`, :meth:`~io.IOBase.readlines`, :meth:`~io.IOBase.seek`, :" -"meth:`~io.IOBase.tell`, :meth:`__iter__`, :meth:`~iterator.__next__`. These " -"objects can operate independently of the ZipFile." +"meth:`~io.IOBase.tell`, :meth:`~container.__iter__`, :meth:`~iterator." +"__next__`. These objects can operate independently of the ZipFile." msgstr "" #: ../../library/zipfile.rst:294 From ec00e93044e5cadec9c34197cbcea881c8eeea1b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 10 Mar 2023 12:42:26 +0000 Subject: [PATCH 06/10] sync with cpython 495cd2de --- library/threading.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/threading.po b/library/threading.po index 1ffef673c2..7e258f9cbf 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-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-03-10 12:39+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-" @@ -320,7 +320,7 @@ msgstr "" #: ../../library/threading.rst:256 msgid "" "For more details and extensive examples, see the documentation string of " -"the :mod:`_threading_local` module." +"the :mod:`_threading_local` module: :source:`Lib/_threading_local.py`." msgstr "" #: ../../library/threading.rst:263 From 1b5bb6bc5aebd2f567a1773944dcd7beb19c5384 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 13 Mar 2023 00:18:35 +0000 Subject: [PATCH 07/10] sync with cpython 78560261 --- library/subprocess.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/subprocess.po b/library/subprocess.po index 6a3563d183..ee5573fd82 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-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-03-13 00:16+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-" @@ -1799,7 +1799,7 @@ 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 " "available to read. Despite their names, a true value does not indicate that " -"the corresponding function will be used, only that that it may be." +"the corresponding function will be used, only that it may be." msgstr "" #: ../../library/subprocess.rst:1629 From 02994449d6e629f8b69fb0b8dbff8382bc414015 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 14 Mar 2023 00:18:07 +0000 Subject: [PATCH 08/10] sync with cpython 43f8082b --- library/base64.po | 4 +- library/turtle.po | 260 ++++++++++++++++++------------------ reference/compound_stmts.po | 4 +- 3 files changed, 135 insertions(+), 133 deletions(-) diff --git a/library/base64.po b/library/base64.po index 7f43e98b63..1524f2834d 100644 --- a/library/base64.po +++ b/library/base64.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-30 00:19+0000\n" +"POT-Creation-Date: 2023-03-14 00:15+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-" @@ -102,7 +102,7 @@ msgstr "" #: ../../library/base64.rst:61 msgid "" -"May assert or raise a a :exc:`ValueError` if the length of *altchars* is not " +"May assert or raise a :exc:`ValueError` if the length of *altchars* is not " "2. Raises a :exc:`TypeError` if *altchars* is not a :term:`bytes-like " "object`." msgstr "" diff --git a/library/turtle.po b/library/turtle.po index 305a40ae75..5f045947dd 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-02-23 00:17+0000\n" +"POT-Creation-Date: 2023-03-14 00:15+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-" @@ -209,7 +209,7 @@ msgstr ":func:`setheading` | :func:`seth`" msgid ":func:`home`" msgstr ":func:`home`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2463 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2467 msgid ":func:`circle`" msgstr ":func:`circle`" @@ -217,7 +217,7 @@ msgstr ":func:`circle`" msgid ":func:`dot`" msgstr ":func:`dot`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2441 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2445 msgid ":func:`stamp`" msgstr ":func:`stamp`" @@ -417,7 +417,7 @@ msgstr ":func:`get_shapepoly`" msgid "Using events" msgstr "" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2435 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2439 msgid ":func:`onclick`" msgstr ":func:`onclick`" @@ -425,7 +425,7 @@ msgstr ":func:`onclick`" msgid ":func:`onrelease`" msgstr ":func:`onrelease`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2418 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2422 msgid ":func:`ondrag`" msgstr ":func:`ondrag`" @@ -445,7 +445,7 @@ msgstr ":func:`end_poly`" msgid ":func:`get_poly`" msgstr ":func:`get_poly`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2457 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2461 msgid ":func:`clone`" msgstr ":func:`clone`" @@ -1291,7 +1291,7 @@ msgid "" "turtle will be displayed stretched according to its stretchfactors: " "*stretch_wid* is stretchfactor perpendicular to its orientation, " "*stretch_len* is stretchfactor in direction of its orientation, *outline* " -"determines the width of the shapes's outline." +"determines the width of the shape's outline." msgstr "" #: ../../library/turtle.rst:1235 ../../library/turtle.rst:1894 @@ -1474,8 +1474,8 @@ msgstr "" #: ../../library/turtle.rst:1547 msgid "" -"Add as many components to this object as desired, using the :meth:" -"`addcomponent` method." +"Add as many components to this object as desired, using the :meth:`~Shape." +"addcomponent` method." msgstr "" #: ../../library/turtle.rst:1550 @@ -1940,8 +1940,8 @@ msgstr "" #: ../../library/turtle.rst:2128 msgid "" -"Provides screen oriented methods like :func:`setbg` etc. that are described " -"above." +"Provides screen oriented methods like :func:`bgcolor` etc. that are " +"described above." msgstr "" #: ../../library/turtle.rst:2133 @@ -2162,52 +2162,52 @@ msgstr "" #: ../../library/turtle.rst:2318 msgid "" -"The built in configuration would correspond to the following turtle.cfg::" +"The built in configuration would correspond to the following ``turtle.cfg``:" msgstr "" -#: ../../library/turtle.rst:2341 +#: ../../library/turtle.rst:2343 msgid "Short explanation of selected entries:" msgstr "" -#: ../../library/turtle.rst:2343 +#: ../../library/turtle.rst:2345 msgid "" -"The first four lines correspond to the arguments of the :meth:`Screen.setup` " -"method." +"The first four lines correspond to the arguments of the :func:`Screen.setup " +"` method." msgstr "" -#: ../../library/turtle.rst:2345 +#: ../../library/turtle.rst:2347 msgid "" -"Line 5 and 6 correspond to the arguments of the method :meth:`Screen." -"screensize`." +"Line 5 and 6 correspond to the arguments of the method :func:`Screen." +"screensize `." msgstr "" -#: ../../library/turtle.rst:2347 +#: ../../library/turtle.rst:2349 msgid "" "*shape* can be any of the built-in shapes, e.g: arrow, turtle, etc. For " "more info try ``help(shape)``." msgstr "" -#: ../../library/turtle.rst:2349 +#: ../../library/turtle.rst:2351 msgid "" -"If you want to use no fillcolor (i.e. make the turtle transparent), you have " -"to write ``fillcolor = \"\"`` (but all nonempty strings must not have quotes " -"in the cfg-file)." +"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:2352 +#: ../../library/turtle.rst:2354 msgid "" "If you want to reflect the turtle its state, you have to use ``resizemode = " "auto``." msgstr "" -#: ../../library/turtle.rst:2354 +#: ../../library/turtle.rst:2356 msgid "" "If you set e.g. ``language = italian`` the docstringdict :file:" "`turtle_docstringdict_italian.py` will be loaded at import time (if present " "on the import path, e.g. in the same directory as :mod:`turtle`)." msgstr "" -#: ../../library/turtle.rst:2357 +#: ../../library/turtle.rst:2359 msgid "" "The entries *exampleturtle* and *examplescreen* define the names of these " "objects as they occur in the docstrings. The transformation of method-" @@ -2215,360 +2215,362 @@ msgid "" "docstrings." msgstr "" -#: ../../library/turtle.rst:2361 +#: ../../library/turtle.rst:2363 msgid "" "*using_IDLE*: Set this to ``True`` if you regularly work with IDLE and its " "``-n`` switch (\"no subprocess\"). This will prevent :func:`exitonclick` to " "enter the mainloop." msgstr "" -#: ../../library/turtle.rst:2365 +#: ../../library/turtle.rst:2367 msgid "" "There can be a :file:`turtle.cfg` file in the directory where :mod:`turtle` " "is stored and an additional one in the current working directory. The " "latter will override the settings of the first one." msgstr "" -#: ../../library/turtle.rst:2369 +#: ../../library/turtle.rst:2371 msgid "" "The :file:`Lib/turtledemo` directory contains a :file:`turtle.cfg` file. " "You can study it as an example and see its effects when running the demos " "(preferably not from within the demo-viewer)." msgstr "" -#: ../../library/turtle.rst:2375 +#: ../../library/turtle.rst:2377 msgid ":mod:`turtledemo` --- Demo scripts" msgstr "" -#: ../../library/turtle.rst:2380 +#: ../../library/turtle.rst:2382 msgid "" "The :mod:`turtledemo` package includes a set of demo scripts. These scripts " "can be run and viewed using the supplied demo viewer as follows::" msgstr "" -#: ../../library/turtle.rst:2385 +#: ../../library/turtle.rst:2387 msgid "" "Alternatively, you can run the demo scripts individually. For example, ::" msgstr "" -#: ../../library/turtle.rst:2389 +#: ../../library/turtle.rst:2391 msgid "The :mod:`turtledemo` package directory contains:" msgstr "" -#: ../../library/turtle.rst:2391 +#: ../../library/turtle.rst:2393 msgid "" "A demo viewer :file:`__main__.py` which can be used to view the sourcecode " "of the scripts and run them at the same time." msgstr "" -#: ../../library/turtle.rst:2393 +#: ../../library/turtle.rst:2395 msgid "" "Multiple scripts demonstrating different features of the :mod:`turtle` " "module. Examples can be accessed via the Examples menu. They can also be " "run standalone." msgstr "" -#: ../../library/turtle.rst:2396 +#: ../../library/turtle.rst:2398 msgid "" "A :file:`turtle.cfg` file which serves as an example of how to write and use " "such files." msgstr "" -#: ../../library/turtle.rst:2399 +#: ../../library/turtle.rst:2401 msgid "The demo scripts are:" msgstr "" -#: ../../library/turtle.rst:2404 +#: ../../library/turtle.rst:2408 msgid "Name" msgstr "" -#: ../../library/turtle.rst:2404 +#: ../../library/turtle.rst:2408 msgid "Description" msgstr "描述" -#: ../../library/turtle.rst:2404 +#: ../../library/turtle.rst:2408 msgid "Features" msgstr "" -#: ../../library/turtle.rst:2406 +#: ../../library/turtle.rst:2410 msgid "bytedesign" msgstr "" -#: ../../library/turtle.rst:2406 +#: ../../library/turtle.rst:2410 msgid "complex classical turtle graphics pattern" msgstr "" -#: ../../library/turtle.rst:2406 +#: ../../library/turtle.rst:2410 msgid ":func:`tracer`, delay, :func:`update`" msgstr "" -#: ../../library/turtle.rst:2409 +#: ../../library/turtle.rst:2413 msgid "chaos" msgstr "" -#: ../../library/turtle.rst:2409 +#: ../../library/turtle.rst:2413 msgid "" "graphs Verhulst dynamics, shows that computer's computations can generate " "results sometimes against the common sense expectations" msgstr "" -#: ../../library/turtle.rst:2409 +#: ../../library/turtle.rst:2413 msgid "world coordinates" msgstr "" -#: ../../library/turtle.rst:2415 +#: ../../library/turtle.rst:2419 msgid "clock" msgstr "" -#: ../../library/turtle.rst:2415 +#: ../../library/turtle.rst:2419 msgid "analog clock showing time of your computer" msgstr "" -#: ../../library/turtle.rst:2415 +#: ../../library/turtle.rst:2419 msgid "turtles as clock's hands, ontimer" msgstr "" -#: ../../library/turtle.rst:2418 +#: ../../library/turtle.rst:2422 msgid "colormixer" msgstr "" -#: ../../library/turtle.rst:2418 +#: ../../library/turtle.rst:2422 msgid "experiment with r, g, b" msgstr "" -#: ../../library/turtle.rst:2420 +#: ../../library/turtle.rst:2424 msgid "forest" msgstr "" -#: ../../library/turtle.rst:2420 +#: ../../library/turtle.rst:2424 msgid "3 breadth-first trees" msgstr "" -#: ../../library/turtle.rst:2420 +#: ../../library/turtle.rst:2424 msgid "randomization" msgstr "" -#: ../../library/turtle.rst:2422 +#: ../../library/turtle.rst:2426 msgid "fractalcurves" msgstr "" -#: ../../library/turtle.rst:2422 +#: ../../library/turtle.rst:2426 msgid "Hilbert & Koch curves" msgstr "" -#: ../../library/turtle.rst:2422 +#: ../../library/turtle.rst:2426 msgid "recursion" msgstr "" -#: ../../library/turtle.rst:2424 +#: ../../library/turtle.rst:2428 msgid "lindenmayer" msgstr "" -#: ../../library/turtle.rst:2424 +#: ../../library/turtle.rst:2428 msgid "ethnomathematics (indian kolams)" msgstr "" -#: ../../library/turtle.rst:2424 +#: ../../library/turtle.rst:2428 msgid "L-System" msgstr "" -#: ../../library/turtle.rst:2427 +#: ../../library/turtle.rst:2431 msgid "minimal_hanoi" msgstr "minimal_hanoi" -#: ../../library/turtle.rst:2427 +#: ../../library/turtle.rst:2431 msgid "Towers of Hanoi" msgstr "" -#: ../../library/turtle.rst:2427 +#: ../../library/turtle.rst:2431 msgid "Rectangular Turtles as Hanoi discs (shape, shapesize)" msgstr "" -#: ../../library/turtle.rst:2431 +#: ../../library/turtle.rst:2435 msgid "nim" msgstr "" -#: ../../library/turtle.rst:2431 +#: ../../library/turtle.rst:2435 msgid "" "play the classical nim game with three heaps of sticks against the computer." msgstr "" -#: ../../library/turtle.rst:2431 +#: ../../library/turtle.rst:2435 msgid "turtles as nimsticks, event driven (mouse, keyboard)" msgstr "" -#: ../../library/turtle.rst:2435 +#: ../../library/turtle.rst:2439 msgid "paint" msgstr "" -#: ../../library/turtle.rst:2435 +#: ../../library/turtle.rst:2439 msgid "super minimalistic drawing program" msgstr "" -#: ../../library/turtle.rst:2438 +#: ../../library/turtle.rst:2442 msgid "peace" msgstr "" -#: ../../library/turtle.rst:2438 +#: ../../library/turtle.rst:2442 msgid "elementary" msgstr "" -#: ../../library/turtle.rst:2438 +#: ../../library/turtle.rst:2442 msgid "turtle: appearance and animation" msgstr "" -#: ../../library/turtle.rst:2441 +#: ../../library/turtle.rst:2445 msgid "penrose" msgstr "" -#: ../../library/turtle.rst:2441 +#: ../../library/turtle.rst:2445 msgid "aperiodic tiling with kites and darts" msgstr "" -#: ../../library/turtle.rst:2444 +#: ../../library/turtle.rst:2448 msgid "planet_and_moon" msgstr "planet_and_moon" -#: ../../library/turtle.rst:2444 +#: ../../library/turtle.rst:2448 msgid "simulation of gravitational system" msgstr "" -#: ../../library/turtle.rst:2444 +#: ../../library/turtle.rst:2448 msgid "compound shapes, :class:`Vec2D`" msgstr "" -#: ../../library/turtle.rst:2447 +#: ../../library/turtle.rst:2451 msgid "rosette" msgstr "" -#: ../../library/turtle.rst:2447 +#: ../../library/turtle.rst:2451 msgid "a pattern from the wikipedia article on turtle graphics" msgstr "" -#: ../../library/turtle.rst:2447 +#: ../../library/turtle.rst:2451 msgid ":func:`clone`, :func:`undo`" msgstr ":func:`clone`, :func:`undo`" -#: ../../library/turtle.rst:2450 +#: ../../library/turtle.rst:2454 msgid "round_dance" msgstr "round_dance" -#: ../../library/turtle.rst:2450 +#: ../../library/turtle.rst:2454 msgid "dancing turtles rotating pairwise in opposite direction" msgstr "" -#: ../../library/turtle.rst:2450 +#: ../../library/turtle.rst:2454 msgid "compound shapes, clone shapesize, tilt, get_shapepoly, update" msgstr "" -#: ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:2458 msgid "sorting_animate" msgstr "sorting_animate" -#: ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:2458 msgid "visual demonstration of different sorting methods" msgstr "" -#: ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:2458 msgid "simple alignment, randomization" msgstr "" -#: ../../library/turtle.rst:2457 +#: ../../library/turtle.rst:2461 msgid "tree" msgstr "" -#: ../../library/turtle.rst:2457 +#: ../../library/turtle.rst:2461 msgid "a (graphical) breadth first tree (using generators)" msgstr "" -#: ../../library/turtle.rst:2460 +#: ../../library/turtle.rst:2464 msgid "two_canvases" msgstr "two_canvases" -#: ../../library/turtle.rst:2460 +#: ../../library/turtle.rst:2464 msgid "simple design" msgstr "" -#: ../../library/turtle.rst:2460 +#: ../../library/turtle.rst:2464 msgid "turtles on two canvases" msgstr "" -#: ../../library/turtle.rst:2463 +#: ../../library/turtle.rst:2467 msgid "yinyang" msgstr "" -#: ../../library/turtle.rst:2463 +#: ../../library/turtle.rst:2467 msgid "another elementary example" msgstr "" -#: ../../library/turtle.rst:2466 +#: ../../library/turtle.rst:2470 msgid "Have fun!" msgstr "" -#: ../../library/turtle.rst:2470 +#: ../../library/turtle.rst:2474 msgid "Changes since Python 2.6" msgstr "" -#: ../../library/turtle.rst:2472 +#: ../../library/turtle.rst:2476 msgid "" -"The methods :meth:`Turtle.tracer`, :meth:`Turtle.window_width` and :meth:" -"`Turtle.window_height` have been eliminated. Methods with these names and " -"functionality are now available only as methods of :class:`Screen`. The " -"functions derived from these remain available. (In fact already in Python " -"2.6 these methods were merely duplications of the corresponding :class:" -"`TurtleScreen`/:class:`Screen`-methods.)" +"The methods :func:`Turtle.tracer `, :func:`Turtle.window_width " +"` and :func:`Turtle.window_height ` have been " +"eliminated. Methods with these names and functionality are now available " +"only as methods of :class:`Screen`. The functions derived from these remain " +"available. (In fact already in Python 2.6 these methods were merely " +"duplications of the corresponding :class:`TurtleScreen`/:class:`Screen` " +"methods.)" msgstr "" -#: ../../library/turtle.rst:2480 +#: ../../library/turtle.rst:2484 msgid "" -"The method :meth:`Turtle.fill` has been eliminated. The behaviour of :meth:" -"`begin_fill` and :meth:`end_fill` have changed slightly: now every filling-" +"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:2485 +#: ../../library/turtle.rst:2489 msgid "" -"A method :meth:`Turtle.filling` has been added. It returns a boolean value: " -"``True`` if a filling process is under way, ``False`` otherwise. This " -"behaviour corresponds to a ``fill()`` call without arguments in Python 2.6." +"A method :func:`Turtle.filling ` has been added. It returns a " +"boolean value: ``True`` if a filling process is under way, ``False`` " +"otherwise. This behaviour corresponds to a ``fill()`` call without arguments " +"in Python 2.6." msgstr "" -#: ../../library/turtle.rst:2491 +#: ../../library/turtle.rst:2495 msgid "Changes since Python 3.0" msgstr "" -#: ../../library/turtle.rst:2493 +#: ../../library/turtle.rst:2497 msgid "" -"The methods :meth:`Turtle.shearfactor`, :meth:`Turtle.shapetransform` and :" -"meth:`Turtle.get_shapepoly` have been added. Thus the full range of regular " -"linear transforms is now available for transforming turtle shapes. :meth:" -"`Turtle.tiltangle` has been enhanced in functionality: it now can be used to " -"get or set the tiltangle. :meth:`Turtle.settiltangle` has been deprecated." -msgstr "" - -#: ../../library/turtle.rst:2500 -msgid "" -"The method :meth:`Screen.onkeypress` has been added as a complement to :meth:" -"`Screen.onkey` which in fact binds actions to the keyrelease event. " -"Accordingly the latter has got an alias: :meth:`Screen.onkeyrelease`." +"The :class:`Turtle` methods :func:`shearfactor`, :func:`shapetransform` and :" +"func:`get_shapepoly` have been added. Thus the full range of regular linear " +"transforms is now available for transforming turtle shapes. :func:" +"`tiltangle` has been enhanced in functionality: it now can be used to get or " +"set the tilt angle. :func:`settiltangle` has been deprecated." msgstr "" #: ../../library/turtle.rst:2504 msgid "" -"The method :meth:`Screen.mainloop` has been added. So when working only " -"with Screen and Turtle objects one must not additionally import :func:" -"`mainloop` anymore." +"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 msgid "" -"Two input methods has been added :meth:`Screen.textinput` and :meth:`Screen." -"numinput`. These popup input dialogs and return strings and numbers " -"respectively." +"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 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 +msgid "" "Two example scripts :file:`tdemo_nim.py` and :file:`tdemo_round_dance.py` " "have been added to the :file:`Lib/turtledemo` directory." msgstr "" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 7d7fade05d..61ccd55f62 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-02-22 00:16+0000\n" +"POT-Creation-Date: 2023-03-14 00:15+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-" @@ -772,7 +772,7 @@ msgstr "" 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 a ``_``." +"``capture_pattern`` cannot be a ``_``." msgstr "" #: ../../reference/compound_stmts.rst:821 From 461c65ee9641276e46d120e0f5d035e2e657481a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 15 Mar 2023 00:18:58 +0000 Subject: [PATCH 09/10] sync with cpython a166cb41 --- library/__main__.po | 4 +- library/asyncio-task.po | 160 +++++++++--------- library/pdb.po | 4 +- reference/datamodel.po | 365 ++++++++++++++++++++-------------------- tutorial/modules.po | 33 ++-- 5 files changed, 284 insertions(+), 282 deletions(-) diff --git a/library/__main__.po b/library/__main__.po index a4760fda74..9d0de58a78 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: 2022-02-15 00:10+0000\n" +"POT-Creation-Date: 2023-03-15 00:17+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-" @@ -278,7 +278,7 @@ msgstr "" msgid "" "See :mod:`venv` for an example of a package with a minimal ``__main__.py`` " "in the standard library. It doesn't contain a ``if __name__ == '__main__'`` " -"block. You can invoke it with ``python3 -m venv [directory]``." +"block. You can invoke it with ``python -m venv [directory]``." msgstr "" #: ../../library/__main__.rst:264 diff --git a/library/asyncio-task.po b/library/asyncio-task.po index dda93e5b21..7151fa9e38 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-02-09 00:17+0000\n" +"POT-Creation-Date: 2023-03-15 00:17+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-" @@ -241,7 +241,7 @@ msgid "" "tasks, gather them in a collection::" msgstr "" -#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:1009 +#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:1006 msgid "Added the *name* parameter." msgstr "新增 *name* 參數。" @@ -302,7 +302,7 @@ msgstr "" #: ../../library/asyncio-task.rst:333 ../../library/asyncio-task.rst:463 #: ../../library/asyncio-task.rst:591 ../../library/asyncio-task.rst:655 #: ../../library/asyncio-task.rst:681 ../../library/asyncio-task.rst:724 -#: ../../library/asyncio-task.rst:820 +#: ../../library/asyncio-task.rst:817 msgid "Example::" msgstr "" "範例:\n" @@ -393,7 +393,7 @@ msgstr "" #: ../../library/asyncio-task.rst:421 ../../library/asyncio-task.rst:512 #: ../../library/asyncio-task.rst:566 ../../library/asyncio-task.rst:719 #: ../../library/asyncio-task.rst:749 ../../library/asyncio-task.rst:801 -#: ../../library/asyncio-task.rst:817 ../../library/asyncio-task.rst:826 +#: ../../library/asyncio-task.rst:823 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" @@ -777,21 +777,21 @@ msgid "" "Raises :exc:`TimeoutError` if the timeout occurs before all Futures are done." msgstr "" -#: ../../library/asyncio-task.rst:829 +#: ../../library/asyncio-task.rst:826 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:835 +#: ../../library/asyncio-task.rst:832 msgid "Running in Threads" msgstr "" -#: ../../library/asyncio-task.rst:839 +#: ../../library/asyncio-task.rst:836 msgid "Asynchronously run function *func* in a separate thread." msgstr "" -#: ../../library/asyncio-task.rst:841 +#: ../../library/asyncio-task.rst:838 msgid "" "Any \\*args and \\*\\*kwargs supplied for this function are directly passed " "to *func*. Also, the current :class:`contextvars.Context` is propagated, " @@ -799,19 +799,19 @@ msgid "" "separate thread." msgstr "" -#: ../../library/asyncio-task.rst:846 +#: ../../library/asyncio-task.rst:843 msgid "" "Return a coroutine that can be awaited to get the eventual result of *func*." msgstr "" -#: ../../library/asyncio-task.rst:848 +#: ../../library/asyncio-task.rst:845 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:878 +#: ../../library/asyncio-task.rst:875 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. " @@ -819,7 +819,7 @@ msgid "" "thread without blocking the event loop." msgstr "" -#: ../../library/asyncio-task.rst:885 +#: ../../library/asyncio-task.rst:882 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 " @@ -827,81 +827,81 @@ msgid "" "``asyncio.to_thread()`` can also be used for CPU-bound functions." msgstr "" -#: ../../library/asyncio-task.rst:894 +#: ../../library/asyncio-task.rst:891 msgid "Scheduling From Other Threads" msgstr "" -#: ../../library/asyncio-task.rst:898 +#: ../../library/asyncio-task.rst:895 msgid "Submit a coroutine to the given event loop. Thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:900 +#: ../../library/asyncio-task.rst:897 msgid "" "Return a :class:`concurrent.futures.Future` to wait for the result from " "another OS thread." msgstr "" -#: ../../library/asyncio-task.rst:903 +#: ../../library/asyncio-task.rst:900 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:915 +#: ../../library/asyncio-task.rst:912 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:929 +#: ../../library/asyncio-task.rst:926 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-task.rst:932 +#: ../../library/asyncio-task.rst:929 msgid "" "Unlike other asyncio functions this function requires the *loop* argument to " "be passed explicitly." msgstr "" -#: ../../library/asyncio-task.rst:939 +#: ../../library/asyncio-task.rst:936 msgid "Introspection" msgstr "" -#: ../../library/asyncio-task.rst:944 +#: ../../library/asyncio-task.rst:941 msgid "" "Return the currently running :class:`Task` instance, or ``None`` if no task " "is running." msgstr "" -#: ../../library/asyncio-task.rst:947 +#: ../../library/asyncio-task.rst:944 msgid "" "If *loop* is ``None`` :func:`get_running_loop` is used to get the current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:955 +#: ../../library/asyncio-task.rst:952 msgid "Return a set of not yet finished :class:`Task` objects run by the loop." msgstr "" -#: ../../library/asyncio-task.rst:958 +#: ../../library/asyncio-task.rst:955 msgid "" "If *loop* is ``None``, :func:`get_running_loop` is used for getting current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:965 +#: ../../library/asyncio-task.rst:962 msgid "Task Object" msgstr "" -#: ../../library/asyncio-task.rst:969 +#: ../../library/asyncio-task.rst:966 msgid "" "A :class:`Future-like ` object that runs a Python :ref:`coroutine " "`. Not thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:972 +#: ../../library/asyncio-task.rst:969 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 " @@ -909,21 +909,21 @@ msgid "" "wrapped coroutine resumes." msgstr "" -#: ../../library/asyncio-task.rst:978 +#: ../../library/asyncio-task.rst:975 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:983 +#: ../../library/asyncio-task.rst:980 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:988 +#: ../../library/asyncio-task.rst:985 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 " @@ -931,112 +931,112 @@ msgid "" "cancellation, the Future object will be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:993 +#: ../../library/asyncio-task.rst:990 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:998 +#: ../../library/asyncio-task.rst:995 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:1002 +#: ../../library/asyncio-task.rst:999 msgid "" "Tasks support the :mod:`contextvars` module. When a Task is created it " "copies the current context and later runs its coroutine in the copied " "context." msgstr "" -#: ../../library/asyncio-task.rst:1006 +#: ../../library/asyncio-task.rst:1003 msgid "Added support for the :mod:`contextvars` module." msgstr "" -#: ../../library/asyncio-task.rst:1012 +#: ../../library/asyncio-task.rst:1009 msgid "" "Deprecation warning is emitted if *loop* is not specified and there is no " "running event loop." msgstr "" -#: ../../library/asyncio-task.rst:1018 +#: ../../library/asyncio-task.rst:1015 msgid "Return ``True`` if the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1020 +#: ../../library/asyncio-task.rst:1017 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:1025 +#: ../../library/asyncio-task.rst:1022 msgid "Return the result of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1027 +#: ../../library/asyncio-task.rst:1024 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:1031 ../../library/asyncio-task.rst:1045 +#: ../../library/asyncio-task.rst:1028 ../../library/asyncio-task.rst:1042 msgid "" "If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1034 +#: ../../library/asyncio-task.rst:1031 msgid "" "If the Task's result isn't yet available, this method raises a :exc:" "`InvalidStateError` exception." msgstr "" -#: ../../library/asyncio-task.rst:1039 +#: ../../library/asyncio-task.rst:1036 msgid "Return the exception of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1041 +#: ../../library/asyncio-task.rst:1038 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:1048 +#: ../../library/asyncio-task.rst:1045 msgid "" "If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1053 +#: ../../library/asyncio-task.rst:1050 msgid "Add a callback to be run when the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1055 ../../library/asyncio-task.rst:1064 +#: ../../library/asyncio-task.rst:1052 ../../library/asyncio-task.rst:1061 msgid "This method should only be used in low-level callback-based code." msgstr "" -#: ../../library/asyncio-task.rst:1057 +#: ../../library/asyncio-task.rst:1054 msgid "" "See the documentation of :meth:`Future.add_done_callback` for more details." msgstr "" -#: ../../library/asyncio-task.rst:1062 +#: ../../library/asyncio-task.rst:1059 msgid "Remove *callback* from the callbacks list." msgstr "" -#: ../../library/asyncio-task.rst:1066 +#: ../../library/asyncio-task.rst:1063 msgid "" "See the documentation of :meth:`Future.remove_done_callback` for more " "details." msgstr "" -#: ../../library/asyncio-task.rst:1071 +#: ../../library/asyncio-task.rst:1068 msgid "Return the list of stack frames for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1073 +#: ../../library/asyncio-task.rst:1070 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, " @@ -1044,15 +1044,15 @@ msgid "" "this returns the list of traceback frames." msgstr "" -#: ../../library/asyncio-task.rst:1079 +#: ../../library/asyncio-task.rst:1076 msgid "The frames are always ordered from oldest to newest." msgstr "" -#: ../../library/asyncio-task.rst:1081 +#: ../../library/asyncio-task.rst:1078 msgid "Only one stack frame is returned for a suspended coroutine." msgstr "" -#: ../../library/asyncio-task.rst:1083 +#: ../../library/asyncio-task.rst:1080 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 " @@ -1061,66 +1061,66 @@ msgid "" "are returned. (This matches the behavior of the traceback module.)" msgstr "" -#: ../../library/asyncio-task.rst:1092 +#: ../../library/asyncio-task.rst:1089 msgid "Print the stack or traceback for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1094 +#: ../../library/asyncio-task.rst:1091 msgid "" "This produces output similar to that of the traceback module for the frames " "retrieved by :meth:`get_stack`." msgstr "" -#: ../../library/asyncio-task.rst:1097 +#: ../../library/asyncio-task.rst:1094 msgid "The *limit* argument is passed to :meth:`get_stack` directly." msgstr "" -#: ../../library/asyncio-task.rst:1099 +#: ../../library/asyncio-task.rst:1096 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:1104 +#: ../../library/asyncio-task.rst:1101 msgid "Return the coroutine object wrapped by the :class:`Task`." msgstr "" -#: ../../library/asyncio-task.rst:1110 +#: ../../library/asyncio-task.rst:1107 msgid "Return the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1112 +#: ../../library/asyncio-task.rst:1109 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:1120 +#: ../../library/asyncio-task.rst:1117 msgid "Set the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1122 +#: ../../library/asyncio-task.rst:1119 msgid "" "The *value* argument can be any object, which is then converted to a string." msgstr "" -#: ../../library/asyncio-task.rst:1125 +#: ../../library/asyncio-task.rst:1122 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:1132 +#: ../../library/asyncio-task.rst:1129 msgid "Request the Task to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1134 +#: ../../library/asyncio-task.rst:1131 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:1137 +#: ../../library/asyncio-task.rst:1134 msgid "" "The coroutine then has a chance to clean up or even deny the request by " "suppressing the exception with a :keyword:`try` ... ... ``except " @@ -1130,46 +1130,46 @@ msgid "" "is actively discouraged." msgstr "" -#: ../../library/asyncio-task.rst:1145 +#: ../../library/asyncio-task.rst:1142 msgid "Added the *msg* parameter." msgstr "新增 *msg* 參數。" -#: ../../library/asyncio-task.rst:1148 +#: ../../library/asyncio-task.rst:1145 msgid "The ``msg`` parameter is propagated from cancelled task to its awaiter." msgstr "" -#: ../../library/asyncio-task.rst:1153 +#: ../../library/asyncio-task.rst:1150 msgid "" "The following example illustrates how coroutines can intercept the " "cancellation request::" msgstr "" -#: ../../library/asyncio-task.rst:1192 +#: ../../library/asyncio-task.rst:1189 msgid "Return ``True`` if the Task is *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:1194 +#: ../../library/asyncio-task.rst:1191 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:1200 +#: ../../library/asyncio-task.rst:1197 msgid "Decrement the count of cancellation requests to this Task." msgstr "" -#: ../../library/asyncio-task.rst:1202 +#: ../../library/asyncio-task.rst:1199 msgid "Returns the remaining number of cancellation requests." msgstr "" -#: ../../library/asyncio-task.rst:1204 +#: ../../library/asyncio-task.rst:1201 msgid "" "Note that once execution of a cancelled task completed, further calls to :" "meth:`uncancel` are ineffective." msgstr "" -#: ../../library/asyncio-task.rst:1209 +#: ../../library/asyncio-task.rst:1206 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 " @@ -1178,7 +1178,7 @@ msgid "" "respective structured block. For example::" msgstr "" -#: ../../library/asyncio-task.rst:1227 +#: ../../library/asyncio-task.rst:1224 msgid "" "While the block with ``make_request()`` and ``make_another_request()`` might " "get cancelled due to the timeout, ``unrelated_code()`` should continue " @@ -1187,13 +1187,13 @@ msgid "" "similar fashion." msgstr "" -#: ../../library/asyncio-task.rst:1235 +#: ../../library/asyncio-task.rst:1232 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:1239 +#: ../../library/asyncio-task.rst:1236 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 " @@ -1202,7 +1202,7 @@ msgid "" "to zero." msgstr "" -#: ../../library/asyncio-task.rst:1245 +#: ../../library/asyncio-task.rst:1242 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/pdb.po b/library/pdb.po index e17199f150..9bd9d8a958 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-02-05 00:18+0000\n" +"POT-Creation-Date: 2023-03-15 00:17+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-" @@ -100,7 +100,7 @@ msgstr "" #: ../../library/pdb.rst:73 msgid "" ":file:`pdb.py` now accepts a ``-m`` option that execute modules similar to " -"the way ``python3 -m`` does. As with a script, the debugger will pause " +"the way ``python -m`` does. As with a script, the debugger will pause " "execution just before the first line of the module." msgstr "" diff --git a/reference/datamodel.po b/reference/datamodel.po index 649eb6de1f..b141841567 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-02-22 00:16+0000\n" +"POT-Creation-Date: 2023-03-15 00:17+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-" @@ -2319,16 +2319,17 @@ msgstr "" #: ../../reference/datamodel.rst:1947 msgid "" -"Nonempty *__slots__* does not work for classes derived from \"variable-" -"length\" built-in types such as :class:`int`, :class:`bytes` and :class:" +":exc:`TypeError` will be raised if nonempty *__slots__* are defined for a " +"class derived from a :c:member:`\"variable-length\" built-in type " +"` such as :class:`int`, :class:`bytes`, and :class:" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:1950 +#: ../../reference/datamodel.rst:1952 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:1952 +#: ../../reference/datamodel.rst:1954 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 " @@ -2336,13 +2337,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:1957 +#: ../../reference/datamodel.rst:1959 msgid "" ":attr:`~instance.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:1960 +#: ../../reference/datamodel.rst:1962 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -2350,18 +2351,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:1966 +#: ../../reference/datamodel.rst:1968 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:1974 +#: ../../reference/datamodel.rst:1976 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:1976 +#: ../../reference/datamodel.rst:1978 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -2371,14 +2372,14 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:1985 +#: ../../reference/datamodel.rst:1987 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:1989 +#: ../../reference/datamodel.rst:1991 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 " @@ -2386,13 +2387,13 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2003 +#: ../../reference/datamodel.rst:2005 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2008 +#: ../../reference/datamodel.rst:2010 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -2400,41 +2401,41 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2016 +#: ../../reference/datamodel.rst:2018 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:2021 +#: ../../reference/datamodel.rst:2023 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:2027 +#: ../../reference/datamodel.rst:2029 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:2038 +#: ../../reference/datamodel.rst:2040 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`\\ 。" -#: ../../reference/datamodel.rst:2046 +#: ../../reference/datamodel.rst:2048 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2053 +#: ../../reference/datamodel.rst:2055 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:2057 +#: ../../reference/datamodel.rst:2059 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -2442,41 +2443,41 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2071 +#: ../../reference/datamodel.rst:2073 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:2074 +#: ../../reference/datamodel.rst:2076 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2076 +#: ../../reference/datamodel.rst:2078 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2077 +#: ../../reference/datamodel.rst:2079 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2078 +#: ../../reference/datamodel.rst:2080 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2079 +#: ../../reference/datamodel.rst:2081 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2080 +#: ../../reference/datamodel.rst:2082 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2084 +#: ../../reference/datamodel.rst:2086 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2086 +#: ../../reference/datamodel.rst:2088 msgid "" "If a base that appears in class definition is not an instance of :class:" "`type`, then an ``__mro_entries__`` method is searched on it. If found, it " @@ -2485,37 +2486,37 @@ msgid "" "such case the original base is ignored." msgstr "" -#: ../../reference/datamodel.rst:2094 +#: ../../reference/datamodel.rst:2096 msgid ":pep:`560` - Core support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2098 +#: ../../reference/datamodel.rst:2100 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2102 +#: ../../reference/datamodel.rst:2104 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2104 +#: ../../reference/datamodel.rst:2106 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2105 +#: ../../reference/datamodel.rst:2107 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:2107 +#: ../../reference/datamodel.rst:2109 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:2110 +#: ../../reference/datamodel.rst:2112 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2524,11 +2525,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2120 +#: ../../reference/datamodel.rst:2122 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2125 +#: ../../reference/datamodel.rst:2127 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2540,25 +2541,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2134 +#: ../../reference/datamodel.rst:2136 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2139 +#: ../../reference/datamodel.rst:2141 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2140 +#: ../../reference/datamodel.rst:2142 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2144 +#: ../../reference/datamodel.rst:2146 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2149 +#: ../../reference/datamodel.rst:2151 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2567,7 +2568,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2155 +#: ../../reference/datamodel.rst:2157 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. " @@ -2576,11 +2577,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2164 +#: ../../reference/datamodel.rst:2166 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2171 +#: ../../reference/datamodel.rst:2173 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2588,7 +2589,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2176 +#: ../../reference/datamodel.rst:2178 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 " @@ -2599,7 +2600,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2186 +#: ../../reference/datamodel.rst:2188 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 " @@ -2608,39 +2609,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2192 +#: ../../reference/datamodel.rst:2194 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:2196 +#: ../../reference/datamodel.rst:2198 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:2198 +#: ../../reference/datamodel.rst:2200 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2200 +#: ../../reference/datamodel.rst:2202 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:2203 +#: ../../reference/datamodel.rst:2205 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:2207 +#: ../../reference/datamodel.rst:2209 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 " @@ -2648,19 +2649,19 @@ msgid "" "becomes the :attr:`~object.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2214 +#: ../../reference/datamodel.rst:2216 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2215 +#: ../../reference/datamodel.rst:2217 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2219 +#: ../../reference/datamodel.rst:2221 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2221 +#: ../../reference/datamodel.rst:2223 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -2668,17 +2669,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2228 +#: ../../reference/datamodel.rst:2230 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2230 +#: ../../reference/datamodel.rst:2232 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:2233 +#: ../../reference/datamodel.rst:2235 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -2686,21 +2687,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2240 +#: ../../reference/datamodel.rst:2242 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:2247 +#: ../../reference/datamodel.rst:2249 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:2252 +#: ../../reference/datamodel.rst:2254 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 " @@ -2708,11 +2709,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2263 +#: ../../reference/datamodel.rst:2265 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2260 +#: ../../reference/datamodel.rst:2262 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" @@ -2721,11 +2722,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2268 +#: ../../reference/datamodel.rst:2270 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2270 +#: ../../reference/datamodel.rst:2272 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -2733,65 +2734,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2278 +#: ../../reference/datamodel.rst:2280 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2278 +#: ../../reference/datamodel.rst:2280 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2281 +#: ../../reference/datamodel.rst:2283 msgid ":ref:`Generic Alias Types`" msgstr "" -#: ../../reference/datamodel.rst:2281 +#: ../../reference/datamodel.rst:2283 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2284 +#: ../../reference/datamodel.rst:2286 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2284 +#: ../../reference/datamodel.rst:2286 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2287 +#: ../../reference/datamodel.rst:2289 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2292 +#: ../../reference/datamodel.rst:2294 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2295 +#: ../../reference/datamodel.rst:2297 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:2301 +#: ../../reference/datamodel.rst:2303 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2303 +#: ../../reference/datamodel.rst:2305 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:2307 +#: ../../reference/datamodel.rst:2309 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -2800,7 +2801,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2313 +#: ../../reference/datamodel.rst:2315 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -2808,11 +2809,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2323 +#: ../../reference/datamodel.rst:2325 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2325 +#: ../../reference/datamodel.rst:2327 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -2822,14 +2823,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2332 +#: ../../reference/datamodel.rst:2334 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:2360 +#: ../../reference/datamodel.rst:2362 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 " @@ -2839,40 +2840,40 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2379 +#: ../../reference/datamodel.rst:2381 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:2404 +#: ../../reference/datamodel.rst:2406 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2403 +#: ../../reference/datamodel.rst:2405 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:2411 +#: ../../reference/datamodel.rst:2413 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2418 +#: ../../reference/datamodel.rst:2420 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:2425 +#: ../../reference/datamodel.rst:2427 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2427 +#: ../../reference/datamodel.rst:2429 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -2908,7 +2909,7 @@ msgid "" "the values." msgstr "" -#: ../../reference/datamodel.rst:2467 +#: ../../reference/datamodel.rst:2469 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 " @@ -2916,7 +2917,7 @@ msgid "" "zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2474 +#: ../../reference/datamodel.rst:2476 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:" @@ -2925,7 +2926,7 @@ msgid "" "`__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2483 +#: ../../reference/datamodel.rst:2485 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). " @@ -2935,20 +2936,20 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2497 +#: ../../reference/datamodel.rst:2499 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2501 +#: ../../reference/datamodel.rst:2503 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2505 +#: ../../reference/datamodel.rst:2507 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2510 +#: ../../reference/datamodel.rst:2512 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers and slice objects. Note that the " @@ -2961,20 +2962,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2522 +#: ../../reference/datamodel.rst:2524 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:2527 +#: ../../reference/datamodel.rst:2529 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:2535 +#: ../../reference/datamodel.rst:2537 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -2983,7 +2984,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2544 +#: ../../reference/datamodel.rst:2546 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -2992,13 +2993,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2553 +#: ../../reference/datamodel.rst:2555 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:2559 +#: ../../reference/datamodel.rst:2561 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 " @@ -3006,14 +3007,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:2567 +#: ../../reference/datamodel.rst:2569 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:2571 +#: ../../reference/datamodel.rst:2573 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 :" @@ -3022,7 +3023,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2578 +#: ../../reference/datamodel.rst:2580 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3030,14 +3031,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2585 +#: ../../reference/datamodel.rst:2587 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:2589 +#: ../../reference/datamodel.rst:2591 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3045,11 +3046,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2598 +#: ../../reference/datamodel.rst:2600 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2600 +#: ../../reference/datamodel.rst:2602 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3057,7 +3058,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2626 +#: ../../reference/datamodel.rst:2628 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3071,13 +3072,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2637 +#: ../../reference/datamodel.rst:2639 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return ``NotImplemented``." msgstr "" -#: ../../reference/datamodel.rst:2660 +#: ../../reference/datamodel.rst:2662 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3090,13 +3091,13 @@ msgid "" "*NotImplemented*." msgstr "" -#: ../../reference/datamodel.rst:2672 +#: ../../reference/datamodel.rst:2674 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:2677 +#: ../../reference/datamodel.rst:2679 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 " @@ -3105,7 +3106,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:2698 +#: ../../reference/datamodel.rst:2700 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3121,19 +3122,19 @@ msgid "" "fact part of the data model." msgstr "" -#: ../../reference/datamodel.rst:2719 +#: ../../reference/datamodel.rst:2721 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:2732 +#: ../../reference/datamodel.rst:2734 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:2739 +#: ../../reference/datamodel.rst:2741 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3142,14 +3143,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:2745 +#: ../../reference/datamodel.rst:2747 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:2757 +#: ../../reference/datamodel.rst:2759 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3158,21 +3159,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:2763 +#: ../../reference/datamodel.rst:2765 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:2766 +#: ../../reference/datamodel.rst:2768 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:2773 +#: ../../reference/datamodel.rst:2775 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:2775 +#: ../../reference/datamodel.rst:2777 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 " @@ -3182,32 +3183,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:2786 +#: ../../reference/datamodel.rst:2788 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:2789 +#: ../../reference/datamodel.rst:2791 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:2794 +#: ../../reference/datamodel.rst:2796 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:2801 +#: ../../reference/datamodel.rst:2803 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:2805 +#: ../../reference/datamodel.rst:2807 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. " @@ -3215,27 +3216,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:2809 +#: ../../reference/datamodel.rst:2811 msgid "" "Note that :meth:`__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:2816 +#: ../../reference/datamodel.rst:2818 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:2816 +#: ../../reference/datamodel.rst:2818 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:2823 +#: ../../reference/datamodel.rst:2825 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:2825 +#: ../../reference/datamodel.rst:2827 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 " @@ -3243,7 +3244,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:2832 +#: ../../reference/datamodel.rst:2834 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 " @@ -3252,7 +3253,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:2838 +#: ../../reference/datamodel.rst:2840 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3262,19 +3263,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2848 +#: ../../reference/datamodel.rst:2850 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:2849 +#: ../../reference/datamodel.rst:2851 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:2855 +#: ../../reference/datamodel.rst:2857 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:2857 +#: ../../reference/datamodel.rst:2859 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 " @@ -3282,7 +3283,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:2872 +#: ../../reference/datamodel.rst:2874 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3291,21 +3292,21 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:2886 +#: ../../reference/datamodel.rst:2888 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:2895 +#: ../../reference/datamodel.rst:2897 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:2921 +#: ../../reference/datamodel.rst:2923 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3314,36 +3315,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:2932 +#: ../../reference/datamodel.rst:2934 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:2936 +#: ../../reference/datamodel.rst:2938 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:2938 +#: ../../reference/datamodel.rst:2940 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:2944 +#: ../../reference/datamodel.rst:2946 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:2950 +#: ../../reference/datamodel.rst:2952 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:2956 +#: ../../reference/datamodel.rst:2958 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 " @@ -3351,15 +3352,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:2964 +#: ../../reference/datamodel.rst:2966 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:2970 +#: ../../reference/datamodel.rst:2972 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:2972 +#: ../../reference/datamodel.rst:2974 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3370,18 +3371,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:2980 +#: ../../reference/datamodel.rst:2982 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:2984 +#: ../../reference/datamodel.rst:2986 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:2990 +#: ../../reference/datamodel.rst:2992 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -3392,7 +3393,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3001 +#: ../../reference/datamodel.rst:3003 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3403,7 +3404,7 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3012 +#: ../../reference/datamodel.rst:3014 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3413,99 +3414,99 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3020 +#: ../../reference/datamodel.rst:3022 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3026 +#: ../../reference/datamodel.rst:3028 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3028 +#: ../../reference/datamodel.rst:3030 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3031 +#: ../../reference/datamodel.rst:3033 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3035 +#: ../../reference/datamodel.rst:3037 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3039 +#: ../../reference/datamodel.rst:3041 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:3042 +#: ../../reference/datamodel.rst:3044 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3059 +#: ../../reference/datamodel.rst:3061 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:3064 +#: ../../reference/datamodel.rst:3066 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:3072 +#: ../../reference/datamodel.rst:3074 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3074 +#: ../../reference/datamodel.rst:3076 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:3077 +#: ../../reference/datamodel.rst:3079 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3081 +#: ../../reference/datamodel.rst:3083 msgid "" "Semantically similar to :meth:`__enter__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3086 +#: ../../reference/datamodel.rst:3088 msgid "" "Semantically similar to :meth:`__exit__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3089 +#: ../../reference/datamodel.rst:3091 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3102 +#: ../../reference/datamodel.rst:3104 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3103 +#: ../../reference/datamodel.rst:3105 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:3107 +#: ../../reference/datamodel.rst:3109 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, and :meth:`~object.__contains__` methods have special " @@ -3513,7 +3514,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3113 +#: ../../reference/datamodel.rst:3115 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 " @@ -3521,7 +3522,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3119 +#: ../../reference/datamodel.rst:3121 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 " diff --git a/tutorial/modules.po b/tutorial/modules.po index 26591da087..6155a1f739 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -11,7 +11,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-03-15 00:17+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-" @@ -244,8 +244,8 @@ msgid "" "with the ``__name__`` set to ``\"__main__\"``. That means that by adding " "this code at the end of your module::" msgstr "" -"如同使用 import 指令,模組中的程式碼會被執行,但 ``__name__`` 被設為 ``" -"\"__main__\"``\\ 。這意味著,透過在模組的末尾添加以下程式碼:\n" +"如同使用 import 指令,模組中的程式碼會被執行,但 ``__name__`` 被設為 " +"``\"__main__\"``\\ 。這意味著,透過在模組的末尾添加以下程式碼:\n" "\n" "::" @@ -547,12 +547,12 @@ msgid "" "terms of a hierarchical filesystem):" msgstr "" "假設你想設計一個能統一處理音訊檔案及音訊數據的模組集(「套件」)。因為音訊檔" -"案有很多的不同的格式(通常以它們的副檔名來辨識,例如:\\ :file:`.wav`" -"\\ ,\\ :file:`.aiff`\\ ,\\ :file:`.au`\\ ),因此,為了不同檔案格式之間的轉" -"換,你會需要建立和維護一個不斷增長的模組集合。為了要達成對音訊數據的許多不同" -"作業(例如,音訊混合、增加回聲、套用等化器功能、創造人工立體音效),你將編寫" -"一系列無止盡的模組來執行這些作業。以下是你的套件可能的架構(以階層式檔案系統" -"的方式表示):" +"案有很多的不同的格式(通常以它們的副檔名來辨識,例如:\\ :file:`." +"wav`\\ ,\\ :file:`.aiff`\\ ,\\ :file:`.au`\\ ),因此,為了不同檔案格式之間" +"的轉換,你會需要建立和維護一個不斷增長的模組集合。為了要達成對音訊數據的許多" +"不同作業(例如,音訊混合、增加回聲、套用等化器功能、創造人工立體音效),你將" +"編寫一系列無止盡的模組來執行這些作業。以下是你的套件可能的架構(以階層式檔案" +"系統的方式表示):" #: ../../tutorial/modules.rst:436 msgid "" @@ -561,13 +561,14 @@ msgid "" msgstr "Import 套件時,Python 會搜尋 ``sys.path`` 裡的目錄,尋找套件的子目錄。" #: ../../tutorial/modules.rst:439 +#, fuzzy msgid "" "The :file:`__init__.py` files are required to make Python treat directories " "containing the file as packages. This prevents directories with a common " -"name, such as ``string``, unintentionally hiding valid modules that occur " -"later on the module search path. In the simplest case, :file:`__init__.py` " -"can just be an empty file, but it can also execute initialization code for " -"the package or set the ``__all__`` variable, described later." +"name, such as ``string``, from unintentionally hiding valid modules that " +"occur later on the module search path. In the simplest case, :file:`__init__." +"py` can just be an empty file, but it can also execute initialization code " +"for the package or set the ``__all__`` variable, described later." msgstr "" "目錄中必須含有 :file:`__init__.py` 檔案,才會被 Pyhon 當成套件;這樣可以避免" "一些以常用名稱命名(例如 ``string``\\ )的目錄,無意中隱藏了較晚出現在模組搜" @@ -787,9 +788,9 @@ msgid "" "intended for use as the main module of a Python application must always use " "absolute imports." msgstr "" -"請注意,相對 import 的運作是以目前的模組名稱為依據。因為主模組的名稱永遠是 ``" -"\"__main__\"``\\ ,所以如果一個模組預期被用作 Python 應用程式的主模組,那它必" -"須永遠使用絕對 import。" +"請注意,相對 import 的運作是以目前的模組名稱為依據。因為主模組的名稱永遠是 " +"``\"__main__\"``\\ ,所以如果一個模組預期被用作 Python 應用程式的主模組,那它" +"必須永遠使用絕對 import。" #: ../../tutorial/modules.rst:569 msgid "Packages in Multiple Directories" From 946ba221598d871bd1db892aacbda1fd202d6ea4 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Wed, 15 Mar 2023 11:00:12 +0800 Subject: [PATCH 10/10] fix: resolve fuzzy entries --- c-api/code.po | 2 +- sphinx.po | 10 +- tutorial/modules.po | 1 - whatsnew/3.11.po | 307 +++++++++++--------------------------------- 4 files changed, 83 insertions(+), 237 deletions(-) diff --git a/c-api/code.po b/c-api/code.po index 6aad4889d4..90fdce584a 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -20,7 +20,7 @@ msgstr "" #: ../../c-api/code.rst:8 msgid "Code Objects" -msgstr "" +msgstr "程式碼物件" #: ../../c-api/code.rst:12 msgid "" diff --git a/sphinx.po b/sphinx.po index 641c0aac60..e49e4a7841 100644 --- a/sphinx.po +++ b/sphinx.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-03-07 00:18+0000\n" -"PO-Revision-Date: 2022-06-27 11:06+0800\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-" "tw)\n" @@ -19,7 +19,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.1\n" +"X-Generator: Poedit 3.2.2\n" #: ../../tools/templates/customsourcelink.html:3 msgid "This Page" @@ -48,15 +48,15 @@ msgstr "自從版本 {deprecated} 後不推薦使用,已從版本 {removed} #: ../../tools/templates/dummy.html:12 msgid "Return value: Always NULL." -msgstr "" +msgstr "回傳值:總是為 NULL。" #: ../../tools/templates/dummy.html:13 msgid "Return value: New reference." -msgstr "" +msgstr "回傳值:新的參照。" #: ../../tools/templates/dummy.html:14 msgid "Return value: Borrowed reference." -msgstr "" +msgstr "回傳值:借用參照。" #: ../../tools/templates/dummy.html:18 msgid "in development" diff --git a/tutorial/modules.po b/tutorial/modules.po index 6155a1f739..9cb74f0b3e 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -561,7 +561,6 @@ msgid "" msgstr "Import 套件時,Python 會搜尋 ``sys.path`` 裡的目錄,尋找套件的子目錄。" #: ../../tutorial/modules.rst:439 -#, fuzzy msgid "" "The :file:`__init__.py` files are required to make Python treat directories " "containing the file as packages. This prevents directories with a common " diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 316de7f57f..ed81cf3bbd 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-03-08 00:17+0000\n" -"PO-Revision-Date: 2022-12-26 19:43+0800\n" +"PO-Revision-Date: 2023-03-15 11:03+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -2094,6 +2094,10 @@ msgid "" "when compiled with GCC on Ubuntu Linux. Depending on your workload, the " "overall speedup could be 10-60%." msgstr "" +"當使用基準量測套裝軟體 `pyperformance `_ 量測並以 GCC 於 Ubuntu Linux 上編譯,Python 3.11 平均比 " +"Python 3.10 `快了 25% `_。根據程式工作量可能有所不同,整體加速程度可達 10-60%。" #: ../../whatsnew/3.11.rst:1329 msgid "" @@ -2101,6 +2105,9 @@ msgid "" "startup` and :ref:`whatsnew311-faster-runtime`. Optimizations not covered by " "this project are listed separately under :ref:`whatsnew311-optimizations`." msgstr "" +"此計畫專注在 Python 的 :ref:`whatsnew311-faster-startup` 和 :ref:" +"`whatsnew311-faster-runtime`。不在此專案內的最佳化被獨立列出在 :ref:" +"`whatsnew311-optimizations`。" #: ../../whatsnew/3.11.rst:1338 msgid "Faster Startup" @@ -2115,6 +2122,8 @@ msgid "" "Python caches :term:`bytecode` in the :ref:`__pycache__ ` " "directory to speed up module loading." msgstr "" +"Python 將\\ :term:`位元組碼 `\\ 於 :ref:`__pycache__` " +"目錄中存為快取來加速模組的載入。" #: ../../whatsnew/3.11.rst:1348 msgid "Previously in 3.10, Python module execution looked like this:" @@ -2127,6 +2136,9 @@ msgid "" "statically allocated by the interpreter. This reduces the steps in module " "execution process to:" msgstr "" +"在 Python 3.11 中,核心模組在 Python 啟動時必須被「凍結」,這意味著它們的\\ :" +"ref:`程式碼物件 `\\ (和位元組碼)是由直譯器靜態分配的。這將模組" +"執行過程中的步驟減少為:" #: ../../whatsnew/3.11.rst:1363 msgid "" @@ -2140,6 +2152,7 @@ msgstr "" 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:1372 msgid "Faster Runtime" @@ -2154,6 +2167,8 @@ msgid "" "Python frames, holding execution information, are created whenever Python " "calls a Python function. The following are new frame optimizations:" msgstr "" +"每當 Python 呼叫 Python 函數時,就會建立保存執行資訊的 Python 幀。以下是針對" +"幀而做的新最佳化:" #: ../../whatsnew/3.11.rst:1383 msgid "Streamlined the frame creation process." @@ -2181,6 +2196,10 @@ msgid "" "calls have sped up significantly. We measured a 3-7% speedup in " "pyperformance." msgstr "" +"舊式\\ :ref:`幀物件 `\\ 現在僅在除錯器或 Python 自我檢查函式" +"(例如 :func:`sys._getframe` 或 :func:`inspect.currentframe`)請求時才建立。" +"對於大多數使用者程式碼,根本不會建立任何幀物件。結果幾乎所有 Python 函式呼叫" +"都顯著加速。我們以 pyperformance 測得了 3-7% 的加速。" #: ../../whatsnew/3.11.rst:1395 msgid "(Contributed by Mark Shannon in :issue:`44590`.)" @@ -2217,6 +2236,10 @@ msgid "" "deeper (if the user increases the recursion limit with :func:`sys." "setrecursionlimit`). We measured a 1-3% improvement in pyperformance." msgstr "" +"現在大多數 Python 函式的呼叫因為不會佔用 C 堆疊空間而被加速。在斐波那契 " +"(fibonacci) 或階乘等簡單遞迴函式中,觀察到 1.7 倍的加速。這也意味著遞迴函式可" +"以遞迴得更深(如果使用者有增加\\ :func:`遞迴限制 `\\ )。我們在 pyperformance 測得 1-3% 的改進。" #: ../../whatsnew/3.11.rst:1419 msgid "(Contributed by Pablo Galindo and Mark Shannon in :issue:`45256`.)" @@ -2233,6 +2256,9 @@ msgid "" "regions where objects and types rarely change. This concept is known as " "*type stability*." msgstr "" +":pep:`659` 是加速 CPython 專案的關鍵部分之一。一般的想法是,雖然 Python 是一" +"種動態語言,但大多數程式碼都有物件和型別很少去更改的區域。這個概念被稱為\\ *" +"型別穩定 (type stability)*\\ 。" #: ../../whatsnew/3.11.rst:1431 msgid "" @@ -2244,12 +2270,19 @@ msgid "" "where Python caches the results of expensive operations directly in the :" "term:`bytecode`." msgstr "" +"在運行時間,Python 將嘗試在執行中的程式碼內尋找常用模式和型別穩定,然後 " +"Python 將用更特化的操作替換當前操作。這種特化操作運用了僅適用於那些用例/型別" +"的快速路徑,這通常優於它們的泛用對應 (generic counterparts)。這也引入了另一個" +"稱為\\ *行內快取 (inline caching)*\\ 的概念,其中 Python 將繁重操作的結果直接" +"快取在\\ :term:`位元組碼 `\\ 中。" #: ../../whatsnew/3.11.rst:1439 msgid "" "The specializer will also combine certain common instruction pairs into one " "superinstruction, reducing the overhead during execution." msgstr "" +"特化程式 (specializer) 還將某些常用指示 (common instruction) 組合成一個超級指" +"示 (superinstruction),這減少了執行期間的開銷。" #: ../../whatsnew/3.11.rst:1442 msgid "" @@ -2260,6 +2293,10 @@ msgid "" "attempts are not too expensive, allowing specialization to adapt to new " "circumstances." msgstr "" +"Python 只會在看到「熱」(被多次執行的)程式碼時特化,這可以防止 Python 將時間" +"浪費在只運行一次的程式碼上。當程式碼過於動態或用途發生變化時,Python 也可以去" +"特化 (de-specialize)。特化會定期被嘗試執行,而嘗試的成本也不會太高,這讓特化" +"得以適應新的環境。" #: ../../whatsnew/3.11.rst:1449 msgid "" @@ -2297,15 +2334,15 @@ msgstr "二元操作" #: ../../whatsnew/3.11.rst:1460 msgid "``x + x``" -msgstr "" +msgstr "``x + x``" #: ../../whatsnew/3.11.rst:1462 msgid "``x - x``" -msgstr "" +msgstr "``x - x``" #: ../../whatsnew/3.11.rst:1464 msgid "``x * x``" -msgstr "" +msgstr "``x * x``" #: ../../whatsnew/3.11.rst:1460 msgid "" @@ -2313,6 +2350,8 @@ msgid "" "class:`float` and :class:`str` take custom fast paths for their underlying " "types." msgstr "" +"常見型別如 :class:`int`、:class:`float` 與 :class:`str` 的二元加法、乘法與減" +"法,為底層型別採取了特製的快速路徑。" #: ../../whatsnew/3.11.rst:1460 msgid "10%" @@ -2335,12 +2374,16 @@ msgid "" "Subscripting container types such as :class:`list`, :class:`tuple` and :" "class:`dict` directly index the underlying data structures." msgstr "" +"下標容器型別如 :class:`list`、:class:`tuple` 和 :class:`dict` 直接索引底層的" +"資料結構。" #: ../../whatsnew/3.11.rst:1470 msgid "" "Subscripting custom :meth:`~object.__getitem__` is also inlined similar to :" "ref:`inline-calls`." msgstr "" +"下標自定義 :meth:`~object.__getitem__` 也是行內的,類似於 :ref:`inline-" +"calls`。" #: ../../whatsnew/3.11.rst:1466 ../../whatsnew/3.11.rst:1473 msgid "10-25%" @@ -2372,11 +2415,11 @@ msgstr "呼叫" #: ../../whatsnew/3.11.rst:1476 msgid "``f(arg)``" -msgstr "" +msgstr "``f(arg)``" #: ../../whatsnew/3.11.rst:1478 msgid "``C(arg)``" -msgstr "" +msgstr "``C(arg)``" #: ../../whatsnew/3.11.rst:1476 msgid "" @@ -2384,6 +2427,8 @@ msgid "" "class:`str` directly call their underlying C version. This avoids going " "through the internal calling convention." msgstr "" +"常見內建 (C) 函式和型別的呼叫,例如 :func:`len` 和 :class:`str`,會直接呼叫它" +"們的 C 版本底層,這避免了通過內部呼叫的慣例。" #: ../../whatsnew/3.11.rst:1476 msgid "20%" @@ -2399,11 +2444,11 @@ msgstr "載入全域變數" #: ../../whatsnew/3.11.rst:1481 msgid "``print``" -msgstr "" +msgstr "``print``" #: ../../whatsnew/3.11.rst:1483 msgid "``len``" -msgstr "" +msgstr "``len``" #: ../../whatsnew/3.11.rst:1481 msgid "" @@ -2415,7 +2460,7 @@ msgstr "" #: ../../whatsnew/3.11.rst:1481 msgid "[#load-global]_" -msgstr "" +msgstr "[#load-global]_" #: ../../whatsnew/3.11.rst:1481 ../../whatsnew/3.11.rst:1485 #: ../../whatsnew/3.11.rst:1494 @@ -2441,7 +2486,7 @@ msgstr "" #: ../../whatsnew/3.11.rst:1485 msgid "[#load-attr]_" -msgstr "" +msgstr "[#load-attr]_" #: ../../whatsnew/3.11.rst:1490 msgid "Load methods for call" @@ -2496,6 +2541,7 @@ 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:1497 msgid "8%" @@ -2510,6 +2556,8 @@ msgid "" "A similar optimization already existed since Python 3.8. 3.11 specializes " "for more forms and reduces some overhead." msgstr "" +"類似的最佳化自從 Python 3.8 就存在。3.11 特別處理了更多形式並減少效能開銷 " +"(overhead)。" #: ../../whatsnew/3.11.rst:1505 msgid "" @@ -2540,6 +2588,8 @@ msgid "" "`try` statements when no exception is raised. (Contributed by Mark Shannon " "in :issue:`40222`.)" msgstr "" +"實作了「無代價 (Zero-cost)」的例外,消除了在沒有例外被引發時的 :keyword:" +"`try` 陳述式開銷。(由 Mark Shannon 於 :issue:ˋ40222` 貢獻。)" #: ../../whatsnew/3.11.rst:1523 msgid "" @@ -2559,6 +2609,11 @@ msgid "" "html#regex-dna>`_ up to 10% faster than Python 3.10. (Contributed by Brandt " "Bucher in :gh:`91404`.)" msgstr "" +":mod:`re` 的正則表達式比對引擎部分被重構,且現在會有支援的平台上使用 " +"computed gotos(或者「執行緒程式碼 (threaded code)」),因此 Python 3.11 在執" +"行 `pyperformance正則表達式基準量測 `_\\ 的表現上比起 Python 3.10 快了 10%。(由 " +"Brandt Bucher 於 :gh:`91404` 中貢獻。)" #: ../../whatsnew/3.11.rst:1538 msgid "FAQ" @@ -2566,7 +2621,7 @@ msgstr "FAQ" #: ../../whatsnew/3.11.rst:1543 msgid "How should I write my code to utilize these speedups?" -msgstr "" +msgstr "我該如何在程式碼中獲取這些加速?" #: ../../whatsnew/3.11.rst:1545 msgid "" @@ -2574,10 +2629,12 @@ msgid "" "change your code. The Faster CPython project optimizes for common code " "patterns we observe." msgstr "" +"撰寫符合 Python 風格 (Pythonic) 且依循常見最佳實踐的程式碼就好,你不需要改變" +"你的程式碼。CPython 加速計畫中,我們為所觀察到的常見程式編寫模式來做最佳化。" #: ../../whatsnew/3.11.rst:1553 msgid "Will CPython 3.11 use more memory?" -msgstr "" +msgstr "Python 3.11 會不會使用更多記憶體?" #: ../../whatsnew/3.11.rst:1555 msgid "" @@ -2585,10 +2642,12 @@ msgid "" "is offset by memory optimizations for frame objects and object dictionaries " "as mentioned above." msgstr "" +"也許不會。我們預期不會有超出 3.10 20% 的記憶體使用量。這數字會和上述禎物件與" +"物件字典的記憶體最佳化而有所偏差。" #: ../../whatsnew/3.11.rst:1563 msgid "I don't see any speedups in my workload. Why?" -msgstr "" +msgstr "我在我的程式當中沒感覺到任何加速,為什麼?" #: ../../whatsnew/3.11.rst:1565 msgid "" @@ -2597,6 +2656,9 @@ msgid "" "extension library like NumPy, there won't be significant speedups. This " "project currently benefits pure-Python workloads the most." msgstr "" +"某些程式中不會有顯著的好處。如果你的程式花了大部分的時間在 I/O 操作上,或已經" +"將大部分計算用像是 numpy 的 C 擴充函式庫處理,那就不會有明顯的加速。這個計畫" +"是對純 Python 的工作負荷最有幫助。" #: ../../whatsnew/3.11.rst:1570 msgid "" @@ -2609,11 +2671,11 @@ msgstr "" #: ../../whatsnew/3.11.rst:1578 msgid "Is there a JIT compiler?" -msgstr "" +msgstr "有用到 JIT 編譯器嗎?" #: ../../whatsnew/3.11.rst:1580 msgid "No. We're still exploring other optimizations." -msgstr "" +msgstr "沒有,我們還在探索其他最佳化方式。" #: ../../whatsnew/3.11.rst:1586 msgid "About" @@ -5130,218 +5192,3 @@ msgid "" msgstr "" "詳情請見 :pep:`624` 與\\ :pep:`搬遷指南 <624#alternative-apis>`。(由 Inada " "Naoki 於 :issue:`44029` 中所貢獻。)" - -#~ msgid "" -#~ "CPython 3.11 is on average `25% faster `_ than CPython 3.10 when measured with the " -#~ "`pyperformance `_ benchmark " -#~ "suite, and compiled with GCC on Ubuntu Linux. Depending on your workload, " -#~ "the speedup could be up to 10-60% faster." -#~ msgstr "" -#~ "當使用基準量測套裝軟體 `pyperformance `_ 量測並以 GCC 於 Ubuntu Linux 上編譯,Python 3.11 平均比 " -#~ "Python 3.10 `快了 25% `_。根據程式工作量可能有所不同,加速程度可能高達 10-60%。" - -#~ msgid "" -#~ "This project focuses on two major areas in Python: faster startup and " -#~ "faster runtime. Other optimizations not under this project are listed in " -#~ "`Optimizations`_." -#~ msgstr "" -#~ "這個計畫著重於 Python 的兩個地方:更快的啟動 (faster startup) 與更快的運行" -#~ "程式 (faster runtime)。其他不在此計畫的最佳化項目列於 `Optimizations`_。" - -#~ msgid "" -#~ "Python caches bytecode in the :ref:`__pycache__` directory " -#~ "to speed up module loading." -#~ msgstr "" -#~ "Python 將位元組碼於 :ref:`__pycache__` 目錄中存為快取來加速模" -#~ "組的載入。" - -#~ msgid "" -#~ "In Python 3.11, the core modules essential for Python startup are " -#~ "\"frozen\". This means that their code objects (and bytecode) are " -#~ "statically allocated by the interpreter. This reduces the steps in module " -#~ "execution process to this:" -#~ msgstr "" -#~ "在 Python 3.11 中,核心模組在 Python 啟動時必須被「凍結」,這意味著它們的" -#~ "程式碼物件(和位元組碼)是由直譯器靜態分配的。這將模組執行過程中的步驟減少" -#~ "為:" - -#~ msgid "" -#~ "(Contributed by Eric Snow, Guido van Rossum and Kumar Aditya in numerous " -#~ "issues.)" -#~ msgstr "" -#~ "(由 Eric Snow、Guido van Rossum 與 Kumar Aditya 於多個 issue 中貢獻。)" - -#~ msgid "" -#~ "Python frames are created whenever Python calls a Python function. This " -#~ "frame holds execution information. The following are new frame " -#~ "optimizations:" -#~ msgstr "" -#~ "每當 Python 呼叫 Python 函數時,就會建立 Python 幀。該幀保存執行資訊。以下" -#~ "是針對幀而做的新最佳化:" - -#~ msgid "" -#~ "Old-style frame objects are now created only when requested by debuggers " -#~ "or by Python introspection functions such as ``sys._getframe`` or " -#~ "``inspect.currentframe``. For most user code, no frame objects are " -#~ "created at all. As a result, nearly all Python functions calls have sped " -#~ "up significantly. We measured a 3-7% speedup in pyperformance." -#~ msgstr "" -#~ "舊式幀物件現在僅在除錯器或 Python 自我檢查函式(例如 ``sys._getframe`` 或 " -#~ "``inspect.currentframe``)請求時才建立。對於大多數使用者程式碼,根本不會建" -#~ "立任何幀物件。結果幾乎所有 Python 函式呼叫都顯著加速。我們以 " -#~ "pyperformance 測得了 3-7% 的加速。" - -#~ msgid "" -#~ "Most Python function calls now consume no C stack space. This speeds up " -#~ "most of such calls. In simple recursive functions like fibonacci or " -#~ "factorial, a 1.7x speedup was observed. This also means recursive " -#~ "functions can recurse significantly deeper (if the user increases the " -#~ "recursion limit). We measured a 1-3% improvement in pyperformance." -#~ msgstr "" -#~ "現在大多數 Python 函式的呼叫不會佔用 C 堆疊空間,這加快了大多數此類呼叫的" -#~ "速度。在斐波那契 (fibonacci) 或階乘等簡單遞迴函式中,觀察到 1.7 倍的加速。" -#~ "這也意味著遞迴函式可以遞迴得更深(如果使用者有增加遞迴限制)。我們在 " -#~ "pyperformance 測得 1-3% 的改進。" - -#~ 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 " -#~ "regions where objects and types rarely change. This concept is known as " -#~ "*type stability*." -#~ msgstr "" -#~ ":pep:`659` 是加速 CPython 專案的關鍵部分之一。一般的想法是,雖然 Python 是" -#~ "一種動態語言,但大多數程式碼都有物件和型別很少去更改的區域。這個概念被稱為" -#~ "\\ *型別穩定 (type stability)*\\ 。" - -#~ 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 more specialized one. This specialized operation uses " -#~ "fast paths available only to those use cases/types, which generally " -#~ "outperform their generic counterparts. This also brings in another " -#~ "concept called *inline caching*, where Python caches the results of " -#~ "expensive operations directly in the bytecode." -#~ msgstr "" -#~ "在運行時間,Python 將嘗試在執行中的程式碼內尋找常用模式和型別穩定,然後 " -#~ "Python 將用更特化的操作替換當前操作。這種特化操作運用了僅適用於那些用例/型" -#~ "別的快速路徑,這通常優於它們的泛用對應 (generic counterparts)。這也引入了" -#~ "另一個稱為\\ *行內快取 (inline caching)*\\ 的概念,其中 Python 將繁重操作" -#~ "的結果直接快取在位元組碼中。" - -#~ msgid "" -#~ "The specializer will also combine certain common instruction pairs into " -#~ "one superinstruction. This reduces the overhead during execution." -#~ msgstr "" -#~ "特化程式 (specializer) 還將某些常用指示 (common instruction) 組合成一個超" -#~ "級指示 (superinstruction),這減少了執行期間的開銷。" - -#~ msgid "" -#~ "Python will only specialize when it sees code that is \"hot\" (executed " -#~ "multiple times). This prevents Python from wasting time for run-once " -#~ "code. Python can also de-specialize when code is too dynamic or when the " -#~ "use changes. Specialization is attempted periodically, and specialization " -#~ "attempts are not too expensive. This allows specialization to adapt to " -#~ "new circumstances." -#~ msgstr "" -#~ "Python 只會在看到「熱」(被多次執行的)程式碼時特化,這可以防止 Python 將" -#~ "時間浪費在只運行一次的程式碼上。當程式碼過於動態或用途發生變化時,Python " -#~ "也可以去特化 (de-specialize)。特化會定期被嘗試執行,而嘗試的成本也不會太" -#~ "高,這讓特化得以適應新的環境。" - -#~ msgid "``x+x; x*x; x-x;``" -#~ msgstr "``x+x; x*x; x-x;``" - -#~ msgid "" -#~ "Binary add, multiply and subtract for common types such as ``int``, " -#~ "``float``, and ``str`` take custom fast paths for their underlying types." -#~ msgstr "" -#~ "常見型別如 ``int``、``float`` 與 ``str`` 的二元加法、乘法與減法,為底層型" -#~ "別採取了特製的快速路徑。" - -#~ msgid "" -#~ "Subscripting container types such as ``list``, ``tuple`` and ``dict`` " -#~ "directly index the underlying data structures." -#~ msgstr "" -#~ "下標容器型別如 ``list``、``tuple`` 和 ``dict`` 直接索引底層的資料結構。" - -#~ msgid "" -#~ "Subscripting custom ``__getitem__`` is also inlined similar to :ref:" -#~ "`inline-calls`." -#~ msgstr "下標自定義 ``__getitem__`` 也是行內的,類似於 :ref:`inline-calls`。" - -#~ msgid "``f(arg)`` ``C(arg)``" -#~ msgstr "``f(arg)`` ``C(arg)``" - -#~ msgid "" -#~ "Calls to common builtin (C) functions and types such as ``len`` and " -#~ "``str`` directly call their underlying C version. This avoids going " -#~ "through the internal calling convention." -#~ msgstr "" -#~ "常見內建 (C) 函式和型別的呼叫,例如 ``len`` 和 ``str``,會直接呼叫它們的 " -#~ "C 版本底層,這避免了通過內部呼叫的慣例。" - -#~ msgid "``print`` ``len``" -#~ msgstr "``print`` ``len``" - -#~ msgid "[1]_" -#~ msgstr "[1]_" - -#~ msgid "[2]_" -#~ msgstr "[2]_" - -#~ msgid "" -#~ "Specialized for common containers such as ``list`` and ``tuple``. Avoids " -#~ "internal calling convention." -#~ msgstr "為像是 ``list`` 和 ``tuple`` 的常見容器所特化,避免了內部呼叫慣例。" - -#~ msgid "" -#~ "A similar optimization already existed since Python 3.8. 3.11 " -#~ "specializes for more forms and reduces some overhead." -#~ msgstr "" -#~ "類似的最佳化自從 Python 3.8 就存在。3.11 特別處理了更多形式並減少效能開銷 " -#~ "(overhead)。" - -#~ msgid "Q: How should I write my code to utilize these speedups?" -#~ msgstr "問:我該如何在程式碼中獲取這些加速?" - -#~ msgid "" -#~ "A: You don't have to change your code. Write Pythonic code that follows " -#~ "common best practices. The Faster CPython project optimizes for common " -#~ "code patterns we observe." -#~ msgstr "" -#~ "答:你不需要改變你的程式碼。撰寫符合 Python 風格 (Pythonic) 且依循常見最佳" -#~ "實踐的程式碼就好。CPython 加速計畫中,我們為所觀察到的常見程式編寫模式來做" -#~ "最佳化。" - -#~ msgid "Q: Will CPython 3.11 use more memory?" -#~ msgstr "問:Python 3.11 會不會使用更多記憶體?" - -#~ msgid "" -#~ "A: Maybe not. We don't expect memory use to exceed 20% more than 3.10. " -#~ "This is offset by memory optimizations for frame objects and object " -#~ "dictionaries as mentioned above." -#~ msgstr "" -#~ "答:也許不會。我們預期不會有超出 3.10 20% 的記憶體使用量。這數字會和上述禎" -#~ "物件與物件字典的記憶體最佳化而有所偏差。" - -#~ msgid "Q: I don't see any speedups in my workload. Why?" -#~ msgstr "問:我在我的程式當中沒感覺到任何加速,為什麼?" - -#~ msgid "" -#~ "A: 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 extension library like numpy, there won't be significant speedup. " -#~ "This project currently benefits pure-Python workloads the most." -#~ msgstr "" -#~ "答:某些程式中不會有顯著的好處。如果你的程式花了大部分的時間在 I/O 操作" -#~ "上,或已經將大部分計算用像是 numpy 的 C 擴充函式庫處理,那就不會有明顯的加" -#~ "速。這個計畫是對純 Python 的工作負荷最有幫助。" - -#~ msgid "Q: Is there a JIT compiler?" -#~ msgstr "問:有用到 JIT 編譯器嗎?" - -#~ msgid "A: No. We're still exploring other optimizations." -#~ msgstr "答:沒有,我們還在探索其他最佳化方式。"