From c4d64f7948aa3b4f0e4e1706ddcdb4c108a3380e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 9 Nov 2022 09:58:38 +0000 Subject: [PATCH 1/5] sync with cpython cf5dbb47 --- howto/enum.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/howto/enum.po b/howto/enum.po index 79f481f38e..926f9f2cd8 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2022-11-09 09:57+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1136,7 +1136,7 @@ msgstr "" #: ../../howto/enum.rst:1313 msgid "" -"Raises an error if a duplicate member name is found instead of creating an " +"Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" From 7615602121c06e7e95f32a088a2107bff8fb801d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 10 Nov 2022 00:21:02 +0000 Subject: [PATCH 2/5] sync with cpython 7c9c9939 --- library/index.po | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/library/index.po b/library/index.po index e03bf20c6a..1cedfc5b08 100644 --- a/library/index.po +++ b/library/index.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2022-11-10 00:19+0000\n" "PO-Revision-Date: 2021-07-04 22:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -69,9 +69,10 @@ msgstr "" "或全部的可選組件,可能都必須使用該作業系統提供的套件管理工具來安裝。" #: ../../library/index.rst:30 +#, fuzzy msgid "" -"In addition to the standard library, there is a growing collection of " -"several thousand components (from individual programs and modules to " +"In addition to the standard library, there is an active collection of " +"hundreds of thousands of components (from individual programs and modules to " "packages and entire application development frameworks), available from the " "`Python Package Index `_." msgstr "" From 3ac70886a26e088a76a3ebff98bef2b59c268a05 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 11 Nov 2022 00:22:25 +0000 Subject: [PATCH 3/5] sync with cpython 17f1c0ab --- library/stdtypes.po | 1436 ++++++++++++++++++++++--------------------- 1 file changed, 724 insertions(+), 712 deletions(-) diff --git a/library/stdtypes.po b/library/stdtypes.po index 8e24d259b5..84437de297 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: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2022-11-11 00:20+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-" @@ -135,8 +135,8 @@ msgstr "結果" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:275 #: ../../library/stdtypes.rst:414 ../../library/stdtypes.rst:921 -#: ../../library/stdtypes.rst:1126 ../../library/stdtypes.rst:2365 -#: ../../library/stdtypes.rst:3577 +#: ../../library/stdtypes.rst:1126 ../../library/stdtypes.rst:2368 +#: ../../library/stdtypes.rst:3583 msgid "Notes" msgstr "註解" @@ -150,8 +150,8 @@ msgstr "" #: ../../library/stdtypes.rst:87 ../../library/stdtypes.rst:285 #: ../../library/stdtypes.rst:923 ../../library/stdtypes.rst:926 -#: ../../library/stdtypes.rst:1137 ../../library/stdtypes.rst:2371 -#: ../../library/stdtypes.rst:3583 +#: ../../library/stdtypes.rst:1137 ../../library/stdtypes.rst:2374 +#: ../../library/stdtypes.rst:3589 msgid "\\(1)" msgstr "\\(1)" @@ -165,8 +165,8 @@ msgstr "" #: ../../library/stdtypes.rst:90 ../../library/stdtypes.rst:288 #: ../../library/stdtypes.rst:308 ../../library/stdtypes.rst:1165 -#: ../../library/stdtypes.rst:2375 ../../library/stdtypes.rst:2377 -#: ../../library/stdtypes.rst:3587 ../../library/stdtypes.rst:3589 +#: ../../library/stdtypes.rst:2378 ../../library/stdtypes.rst:2380 +#: ../../library/stdtypes.rst:3593 ../../library/stdtypes.rst:3595 msgid "\\(2)" msgstr "\\(2)" @@ -179,18 +179,18 @@ 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:2379 -#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:2383 -#: ../../library/stdtypes.rst:2385 ../../library/stdtypes.rst:3591 -#: ../../library/stdtypes.rst:3593 ../../library/stdtypes.rst:3595 -#: ../../library/stdtypes.rst:3597 +#: ../../library/stdtypes.rst:1168 ../../library/stdtypes.rst:2382 +#: ../../library/stdtypes.rst:2384 ../../library/stdtypes.rst:2386 +#: ../../library/stdtypes.rst:2388 ../../library/stdtypes.rst:3597 +#: ../../library/stdtypes.rst:3599 ../../library/stdtypes.rst:3601 +#: ../../library/stdtypes.rst:3603 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:2411 -#: ../../library/stdtypes.rst:3627 +#: ../../library/stdtypes.rst:1176 ../../library/stdtypes.rst:2414 +#: ../../library/stdtypes.rst:3633 msgid "Notes:" msgstr "註解:" @@ -229,9 +229,9 @@ msgstr "" msgid "This table summarizes the comparison operations:" msgstr "" -#: ../../library/stdtypes.rst:143 ../../library/stdtypes.rst:2342 -#: ../../library/stdtypes.rst:2365 ../../library/stdtypes.rst:3554 -#: ../../library/stdtypes.rst:3577 +#: ../../library/stdtypes.rst:143 ../../library/stdtypes.rst:2345 +#: ../../library/stdtypes.rst:2368 ../../library/stdtypes.rst:3560 +#: ../../library/stdtypes.rst:3583 msgid "Meaning" msgstr "" @@ -514,7 +514,7 @@ msgid "" msgstr "" #: ../../library/stdtypes.rst:301 ../../library/stdtypes.rst:1158 -#: ../../library/stdtypes.rst:2373 ../../library/stdtypes.rst:3614 +#: ../../library/stdtypes.rst:2376 ../../library/stdtypes.rst:3620 msgid "\\(6)" msgstr "\\(6)" @@ -552,9 +552,9 @@ msgstr "" #: ../../library/stdtypes.rst:310 ../../library/stdtypes.rst:312 #: ../../library/stdtypes.rst:1147 ../../library/stdtypes.rst:1150 -#: ../../library/stdtypes.rst:2398 ../../library/stdtypes.rst:2401 -#: ../../library/stdtypes.rst:2404 ../../library/stdtypes.rst:3610 -#: ../../library/stdtypes.rst:3617 +#: ../../library/stdtypes.rst:2401 ../../library/stdtypes.rst:2404 +#: ../../library/stdtypes.rst:2407 ../../library/stdtypes.rst:3616 +#: ../../library/stdtypes.rst:3623 msgid "\\(5)" msgstr "\\(5)" @@ -690,8 +690,8 @@ msgstr "" #: ../../library/stdtypes.rst:416 ../../library/stdtypes.rst:419 #: ../../library/stdtypes.rst:422 ../../library/stdtypes.rst:1171 -#: ../../library/stdtypes.rst:2387 ../../library/stdtypes.rst:2391 -#: ../../library/stdtypes.rst:3599 ../../library/stdtypes.rst:3603 +#: ../../library/stdtypes.rst:2390 ../../library/stdtypes.rst:2394 +#: ../../library/stdtypes.rst:3605 ../../library/stdtypes.rst:3609 msgid "\\(4)" msgstr "\\(4)" @@ -1266,7 +1266,7 @@ msgid "" "before index *j*)" msgstr "" -#: ../../library/stdtypes.rst:948 ../../library/stdtypes.rst:3585 +#: ../../library/stdtypes.rst:948 ../../library/stdtypes.rst:3591 msgid "\\(8)" msgstr "\\(8)" @@ -2108,7 +2108,13 @@ msgid "" "interpreted as in slice notation." msgstr "" -#: ../../library/stdtypes.rst:1623 +#: ../../library/stdtypes.rst:1620 +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 msgid "" "Return an encoded version of the string as a bytes object. Default encoding " "is ``'utf-8'``. *errors* may be given to set a different error handling " @@ -2120,24 +2126,24 @@ msgid "" "encodings`." msgstr "" -#: ../../library/stdtypes.rst:1632 +#: ../../library/stdtypes.rst:1635 msgid "" "By default, the *errors* argument is not checked for best performances, but " "only used at the first encoding error. Enable the :ref:`Python Development " "Mode `, or use a :ref:`debug build ` to check *errors*." msgstr "" -#: ../../library/stdtypes.rst:1637 +#: ../../library/stdtypes.rst:1640 msgid "Support for keyword arguments added." msgstr "" -#: ../../library/stdtypes.rst:1640 ../../library/stdtypes.rst:2773 +#: ../../library/stdtypes.rst:1643 ../../library/stdtypes.rst:2779 msgid "" "The *errors* is now checked in development mode and in :ref:`debug mode " "`." msgstr "" -#: ../../library/stdtypes.rst:1647 +#: ../../library/stdtypes.rst:1650 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. " @@ -2145,7 +2151,7 @@ msgid "" "*end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:1655 +#: ../../library/stdtypes.rst:1658 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 " @@ -2161,21 +2167,21 @@ msgid "" "printed." msgstr "" -#: ../../library/stdtypes.rst:1676 +#: ../../library/stdtypes.rst:1679 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:1682 +#: ../../library/stdtypes.rst:1685 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:1692 +#: ../../library/stdtypes.rst:1695 msgid "" "Perform a string formatting operation. The string on which this method is " "called can contain literal text or replacement fields delimited by braces " @@ -2185,13 +2191,13 @@ msgid "" "the corresponding argument." msgstr "" -#: ../../library/stdtypes.rst:1702 +#: ../../library/stdtypes.rst:1705 msgid "" "See :ref:`formatstrings` for a description of the various formatting options " "that can be specified in format strings." msgstr "" -#: ../../library/stdtypes.rst:1706 +#: ../../library/stdtypes.rst:1709 msgid "" "When formatting a number (:class:`int`, :class:`float`, :class:`complex`, :" "class:`decimal.Decimal` and subclasses) with the ``n`` type (ex: ``'{:n}'." @@ -2202,26 +2208,26 @@ msgid "" "This temporary change affects other threads." msgstr "" -#: ../../library/stdtypes.rst:1715 +#: ../../library/stdtypes.rst:1718 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:1723 +#: ../../library/stdtypes.rst:1726 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:1739 +#: ../../library/stdtypes.rst:1742 msgid "" "Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is " "not found." msgstr "" -#: ../../library/stdtypes.rst:1745 +#: ../../library/stdtypes.rst:1748 msgid "" "Return ``True`` if all characters in the string are alphanumeric and there " "is at least one character, ``False`` otherwise. A character ``c`` is " @@ -2229,7 +2235,7 @@ msgid "" "isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``." msgstr "" -#: ../../library/stdtypes.rst:1753 +#: ../../library/stdtypes.rst:1756 msgid "" "Return ``True`` if all characters in the string are alphabetic and there is " "at least one character, ``False`` otherwise. Alphabetic characters are " @@ -2239,14 +2245,14 @@ msgid "" "property defined in the Unicode Standard." msgstr "" -#: ../../library/stdtypes.rst:1762 +#: ../../library/stdtypes.rst:1765 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:1771 +#: ../../library/stdtypes.rst:1774 msgid "" "Return ``True`` if all characters in the string are decimal characters and " "there is at least one character, ``False`` otherwise. Decimal characters are " @@ -2255,7 +2261,7 @@ msgid "" "General Category \"Nd\"." msgstr "" -#: ../../library/stdtypes.rst:1781 +#: ../../library/stdtypes.rst:1784 msgid "" "Return ``True`` if all characters in the string are digits and there is at " "least one character, ``False`` otherwise. Digits include decimal characters " @@ -2265,32 +2271,32 @@ msgid "" "property value Numeric_Type=Digit or Numeric_Type=Decimal." msgstr "" -#: ../../library/stdtypes.rst:1791 +#: ../../library/stdtypes.rst:1794 msgid "" "Return ``True`` if the string is a valid identifier according to the " "language definition, section :ref:`identifiers`." msgstr "" -#: ../../library/stdtypes.rst:1794 +#: ../../library/stdtypes.rst:1797 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:1797 +#: ../../library/stdtypes.rst:1800 msgid "Example: ::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/stdtypes.rst:1810 +#: ../../library/stdtypes.rst:1813 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:1816 +#: ../../library/stdtypes.rst:1819 msgid "" "Return ``True`` if all characters in the string are numeric characters, and " "there is at least one character, ``False`` otherwise. Numeric characters " @@ -2300,7 +2306,7 @@ msgid "" "Numeric_Type=Decimal or Numeric_Type=Numeric." msgstr "" -#: ../../library/stdtypes.rst:1826 +#: ../../library/stdtypes.rst:1829 msgid "" "Return ``True`` if all characters in the string are printable or the string " "is empty, ``False`` otherwise. Nonprintable characters are those characters " @@ -2311,20 +2317,20 @@ msgid "" "of strings written to :data:`sys.stdout` or :data:`sys.stderr`.)" msgstr "" -#: ../../library/stdtypes.rst:1837 +#: ../../library/stdtypes.rst:1840 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:1840 +#: ../../library/stdtypes.rst:1843 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:1848 +#: ../../library/stdtypes.rst:1851 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 " @@ -2332,13 +2338,13 @@ msgid "" "otherwise." msgstr "" -#: ../../library/stdtypes.rst:1855 +#: ../../library/stdtypes.rst:1858 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:1873 +#: ../../library/stdtypes.rst:1876 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 " @@ -2346,26 +2352,26 @@ msgid "" "elements is the string providing this method." msgstr "" -#: ../../library/stdtypes.rst:1881 +#: ../../library/stdtypes.rst:1884 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:1888 +#: ../../library/stdtypes.rst:1891 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "lowercase." msgstr "" -#: ../../library/stdtypes.rst:1891 +#: ../../library/stdtypes.rst:1894 msgid "" "The lowercasing algorithm used is described in section 3.13 of the Unicode " "Standard." msgstr "" -#: ../../library/stdtypes.rst:1897 +#: ../../library/stdtypes.rst:1900 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 " @@ -2374,19 +2380,19 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:1907 +#: ../../library/stdtypes.rst:1910 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:1918 +#: ../../library/stdtypes.rst:1921 msgid "" "This static method returns a translation table usable for :meth:`str." "translate`." msgstr "" -#: ../../library/stdtypes.rst:1920 +#: ../../library/stdtypes.rst:1923 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, " @@ -2394,7 +2400,7 @@ msgid "" "converted to ordinals." msgstr "" -#: ../../library/stdtypes.rst:1925 +#: ../../library/stdtypes.rst:1928 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 " @@ -2402,7 +2408,7 @@ msgid "" "whose characters will be mapped to ``None`` in the result." msgstr "" -#: ../../library/stdtypes.rst:1933 +#: ../../library/stdtypes.rst:1936 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 " @@ -2410,47 +2416,47 @@ msgid "" "containing the string itself, followed by two empty strings." msgstr "" -#: ../../library/stdtypes.rst:1941 +#: ../../library/stdtypes.rst:1944 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:1955 +#: ../../library/stdtypes.rst:1958 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:1969 +#: ../../library/stdtypes.rst:1972 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:1976 +#: ../../library/stdtypes.rst:1979 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:1983 +#: ../../library/stdtypes.rst:1986 msgid "" "Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is " "not found." msgstr "" -#: ../../library/stdtypes.rst:1989 +#: ../../library/stdtypes.rst:1992 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:1996 +#: ../../library/stdtypes.rst:1999 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 " @@ -2458,7 +2464,7 @@ msgid "" "containing two empty strings, followed by the string itself." msgstr "" -#: ../../library/stdtypes.rst:2004 +#: ../../library/stdtypes.rst:2007 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 " @@ -2467,7 +2473,7 @@ msgid "" "behaves like :meth:`split` which is described in detail below." msgstr "" -#: ../../library/stdtypes.rst:2013 +#: ../../library/stdtypes.rst:2016 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 " @@ -2476,13 +2482,13 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2023 +#: ../../library/stdtypes.rst:2026 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:2033 +#: ../../library/stdtypes.rst:2036 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, " @@ -2491,7 +2497,7 @@ msgid "" "possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:2039 +#: ../../library/stdtypes.rst:2042 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns " @@ -2500,23 +2506,23 @@ msgid "" "Splitting an empty string with a specified separator returns ``['']``." msgstr "" -#: ../../library/stdtypes.rst:2045 ../../library/stdtypes.rst:2061 -#: ../../library/stdtypes.rst:2113 ../../library/stdtypes.rst:2181 -#: ../../library/stdtypes.rst:2248 ../../library/stdtypes.rst:3089 -#: ../../library/stdtypes.rst:3105 ../../library/stdtypes.rst:3196 -#: ../../library/stdtypes.rst:3212 ../../library/stdtypes.rst:3237 -#: ../../library/stdtypes.rst:3251 ../../library/stdtypes.rst:3279 -#: ../../library/stdtypes.rst:3293 ../../library/stdtypes.rst:3311 -#: ../../library/stdtypes.rst:3338 ../../library/stdtypes.rst:3361 -#: ../../library/stdtypes.rst:3388 ../../library/stdtypes.rst:3430 -#: ../../library/stdtypes.rst:3454 +#: ../../library/stdtypes.rst:2048 ../../library/stdtypes.rst:2064 +#: ../../library/stdtypes.rst:2116 ../../library/stdtypes.rst:2184 +#: ../../library/stdtypes.rst:2251 ../../library/stdtypes.rst:3095 +#: ../../library/stdtypes.rst:3111 ../../library/stdtypes.rst:3202 +#: ../../library/stdtypes.rst:3218 ../../library/stdtypes.rst:3243 +#: ../../library/stdtypes.rst:3257 ../../library/stdtypes.rst:3285 +#: ../../library/stdtypes.rst:3299 ../../library/stdtypes.rst:3317 +#: ../../library/stdtypes.rst:3344 ../../library/stdtypes.rst:3367 +#: ../../library/stdtypes.rst:3394 ../../library/stdtypes.rst:3436 +#: ../../library/stdtypes.rst:3460 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/stdtypes.rst:2054 +#: ../../library/stdtypes.rst:2057 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, " @@ -2526,131 +2532,131 @@ msgid "" "returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:2076 +#: ../../library/stdtypes.rst:2079 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:2080 +#: ../../library/stdtypes.rst:2083 msgid "" "This method splits on the following line boundaries. In particular, the " "boundaries are a superset of :term:`universal newlines`." msgstr "" -#: ../../library/stdtypes.rst:2084 +#: ../../library/stdtypes.rst:2087 msgid "Representation" msgstr "" -#: ../../library/stdtypes.rst:2084 +#: ../../library/stdtypes.rst:2087 msgid "Description" msgstr "描述" -#: ../../library/stdtypes.rst:2086 +#: ../../library/stdtypes.rst:2089 msgid "``\\n``" msgstr "``\\n``" -#: ../../library/stdtypes.rst:2086 +#: ../../library/stdtypes.rst:2089 msgid "Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2088 +#: ../../library/stdtypes.rst:2091 msgid "``\\r``" msgstr "``\\r``" -#: ../../library/stdtypes.rst:2088 +#: ../../library/stdtypes.rst:2091 msgid "Carriage Return" msgstr "" -#: ../../library/stdtypes.rst:2090 +#: ../../library/stdtypes.rst:2093 msgid "``\\r\\n``" msgstr "``\\r\\n``" -#: ../../library/stdtypes.rst:2090 +#: ../../library/stdtypes.rst:2093 msgid "Carriage Return + Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2092 +#: ../../library/stdtypes.rst:2095 msgid "``\\v`` or ``\\x0b``" msgstr "``\\v`` 或 ``\\x0b``" -#: ../../library/stdtypes.rst:2092 +#: ../../library/stdtypes.rst:2095 msgid "Line Tabulation" msgstr "" -#: ../../library/stdtypes.rst:2094 +#: ../../library/stdtypes.rst:2097 msgid "``\\f`` or ``\\x0c``" msgstr "``\\f`` 或 ``\\x0c``" -#: ../../library/stdtypes.rst:2094 +#: ../../library/stdtypes.rst:2097 msgid "Form Feed" msgstr "" -#: ../../library/stdtypes.rst:2096 +#: ../../library/stdtypes.rst:2099 msgid "``\\x1c``" msgstr "``\\x1c``" -#: ../../library/stdtypes.rst:2096 +#: ../../library/stdtypes.rst:2099 msgid "File Separator" msgstr "" -#: ../../library/stdtypes.rst:2098 +#: ../../library/stdtypes.rst:2101 msgid "``\\x1d``" msgstr "``\\x1d``" -#: ../../library/stdtypes.rst:2098 +#: ../../library/stdtypes.rst:2101 msgid "Group Separator" msgstr "" -#: ../../library/stdtypes.rst:2100 +#: ../../library/stdtypes.rst:2103 msgid "``\\x1e``" msgstr "``\\x1e``" -#: ../../library/stdtypes.rst:2100 +#: ../../library/stdtypes.rst:2103 msgid "Record Separator" msgstr "" -#: ../../library/stdtypes.rst:2102 +#: ../../library/stdtypes.rst:2105 msgid "``\\x85``" msgstr "``\\x85``" -#: ../../library/stdtypes.rst:2102 +#: ../../library/stdtypes.rst:2105 msgid "Next Line (C1 Control Code)" msgstr "" -#: ../../library/stdtypes.rst:2104 +#: ../../library/stdtypes.rst:2107 msgid "``\\u2028``" msgstr "``\\u2028``" -#: ../../library/stdtypes.rst:2104 +#: ../../library/stdtypes.rst:2107 msgid "Line Separator" msgstr "" -#: ../../library/stdtypes.rst:2106 +#: ../../library/stdtypes.rst:2109 msgid "``\\u2029``" msgstr "``\\u2029``" -#: ../../library/stdtypes.rst:2106 +#: ../../library/stdtypes.rst:2109 msgid "Paragraph Separator" msgstr "" -#: ../../library/stdtypes.rst:2111 +#: ../../library/stdtypes.rst:2114 msgid "``\\v`` and ``\\f`` added to list of line boundaries." msgstr "" -#: ../../library/stdtypes.rst:2120 +#: ../../library/stdtypes.rst:2123 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:2129 +#: ../../library/stdtypes.rst:2132 msgid "For comparison, ``split('\\n')`` gives::" msgstr "" -#: ../../library/stdtypes.rst:2139 +#: ../../library/stdtypes.rst:2142 msgid "" "Return ``True`` if string starts with the *prefix*, otherwise return " "``False``. *prefix* can also be a tuple of prefixes to look for. With " @@ -2658,7 +2664,7 @@ msgid "" "*end*, stop comparing string at that position." msgstr "" -#: ../../library/stdtypes.rst:2147 +#: ../../library/stdtypes.rst:2150 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 " @@ -2667,7 +2673,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2158 +#: ../../library/stdtypes.rst:2161 msgid "" "The outermost leading and trailing *chars* argument values are stripped from " "the string. Characters are removed from the leading end until reaching a " @@ -2675,20 +2681,20 @@ msgid "" "A similar action takes place on the trailing end. For example::" msgstr "" -#: ../../library/stdtypes.rst:2171 +#: ../../library/stdtypes.rst:2174 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:2178 +#: ../../library/stdtypes.rst:2181 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:2186 ../../library/stdtypes.rst:3398 +#: ../../library/stdtypes.rst:2189 ../../library/stdtypes.rst:3404 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 " @@ -2696,19 +2702,19 @@ msgid "" "which may not be the desired result::" msgstr "" -#: ../../library/stdtypes.rst:2194 +#: ../../library/stdtypes.rst:2197 msgid "" "The :func:`string.capwords` function does not have this problem, as it " "splits words on spaces only." msgstr "" -#: ../../library/stdtypes.rst:2197 +#: ../../library/stdtypes.rst:2200 msgid "" "Alternatively, a workaround for apostrophes can be constructed using regular " "expressions::" msgstr "" -#: ../../library/stdtypes.rst:2212 +#: ../../library/stdtypes.rst:2215 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 " @@ -2720,19 +2726,19 @@ msgid "" "exception, to map the character to itself." msgstr "" -#: ../../library/stdtypes.rst:2221 +#: ../../library/stdtypes.rst:2224 msgid "" "You can use :meth:`str.maketrans` to create a translation map from character-" "to-character mappings in different formats." msgstr "" -#: ../../library/stdtypes.rst:2224 +#: ../../library/stdtypes.rst:2227 msgid "" "See also the :mod:`codecs` module for a more flexible approach to custom " "character mappings." msgstr "" -#: ../../library/stdtypes.rst:2230 +#: ../../library/stdtypes.rst:2233 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`` " @@ -2741,13 +2747,13 @@ msgid "" "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:2236 +#: ../../library/stdtypes.rst:2239 msgid "" "The uppercasing algorithm used is described in section 3.13 of the Unicode " "Standard." msgstr "" -#: ../../library/stdtypes.rst:2242 +#: ../../library/stdtypes.rst:2245 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 " @@ -2755,11 +2761,11 @@ msgid "" "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2260 +#: ../../library/stdtypes.rst:2263 msgid "``printf``-style String Formatting" msgstr "" -#: ../../library/stdtypes.rst:2273 +#: ../../library/stdtypes.rst:2276 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 " @@ -2770,7 +2776,7 @@ msgid "" "or extensibility." msgstr "" -#: ../../library/stdtypes.rst:2281 +#: ../../library/stdtypes.rst:2284 msgid "" "String objects have one unique built-in operation: the ``%`` operator " "(modulo). This is also known as the string *formatting* or *interpolation* " @@ -2780,7 +2786,7 @@ msgid "" "in the C language." msgstr "" -#: ../../library/stdtypes.rst:2287 +#: ../../library/stdtypes.rst:2290 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 " @@ -2788,36 +2794,36 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:2297 ../../library/stdtypes.rst:3509 +#: ../../library/stdtypes.rst:2300 ../../library/stdtypes.rst:3515 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: ../../library/stdtypes.rst:2300 ../../library/stdtypes.rst:3512 +#: ../../library/stdtypes.rst:2303 ../../library/stdtypes.rst:3518 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../library/stdtypes.rst:2302 ../../library/stdtypes.rst:3514 +#: ../../library/stdtypes.rst:2305 ../../library/stdtypes.rst:3520 msgid "" "Mapping key (optional), consisting of a parenthesised sequence of characters " "(for example, ``(somename)``)." msgstr "" -#: ../../library/stdtypes.rst:2305 ../../library/stdtypes.rst:3517 +#: ../../library/stdtypes.rst:2308 ../../library/stdtypes.rst:3523 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: ../../library/stdtypes.rst:2308 ../../library/stdtypes.rst:3520 +#: ../../library/stdtypes.rst:2311 ../../library/stdtypes.rst:3526 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:2312 ../../library/stdtypes.rst:3524 +#: ../../library/stdtypes.rst:2315 ../../library/stdtypes.rst:3530 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. " "If specified as ``'*'`` (an asterisk), the actual precision is read from the " @@ -2825,15 +2831,15 @@ msgid "" "the precision." msgstr "" -#: ../../library/stdtypes.rst:2317 ../../library/stdtypes.rst:3529 +#: ../../library/stdtypes.rst:2320 ../../library/stdtypes.rst:3535 msgid "Length modifier (optional)." msgstr "" -#: ../../library/stdtypes.rst:2319 ../../library/stdtypes.rst:3531 +#: ../../library/stdtypes.rst:2322 ../../library/stdtypes.rst:3537 msgid "Conversion type." msgstr "" -#: ../../library/stdtypes.rst:2321 +#: ../../library/stdtypes.rst:2324 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 " @@ -2841,279 +2847,279 @@ msgid "" "selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:2330 ../../library/stdtypes.rst:3542 +#: ../../library/stdtypes.rst:2333 ../../library/stdtypes.rst:3548 msgid "" "In this case no ``*`` specifiers may occur in a format (since they require a " "sequential parameter list)." msgstr "" -#: ../../library/stdtypes.rst:2333 ../../library/stdtypes.rst:3545 +#: ../../library/stdtypes.rst:2336 ../../library/stdtypes.rst:3551 msgid "The conversion flag characters are:" msgstr "" -#: ../../library/stdtypes.rst:2342 ../../library/stdtypes.rst:3554 +#: ../../library/stdtypes.rst:2345 ../../library/stdtypes.rst:3560 msgid "Flag" msgstr "" -#: ../../library/stdtypes.rst:2344 ../../library/stdtypes.rst:3556 +#: ../../library/stdtypes.rst:2347 ../../library/stdtypes.rst:3562 msgid "``'#'``" msgstr "``'#'``" -#: ../../library/stdtypes.rst:2344 ../../library/stdtypes.rst:3556 +#: ../../library/stdtypes.rst:2347 ../../library/stdtypes.rst:3562 msgid "" "The value conversion will use the \"alternate form\" (where defined below)." msgstr "" -#: ../../library/stdtypes.rst:2347 ../../library/stdtypes.rst:3559 +#: ../../library/stdtypes.rst:2350 ../../library/stdtypes.rst:3565 msgid "``'0'``" msgstr "``'0'``" -#: ../../library/stdtypes.rst:2347 ../../library/stdtypes.rst:3559 +#: ../../library/stdtypes.rst:2350 ../../library/stdtypes.rst:3565 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: ../../library/stdtypes.rst:2349 ../../library/stdtypes.rst:3561 +#: ../../library/stdtypes.rst:2352 ../../library/stdtypes.rst:3567 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/stdtypes.rst:2349 ../../library/stdtypes.rst:3561 +#: ../../library/stdtypes.rst:2352 ../../library/stdtypes.rst:3567 msgid "" "The converted value is left adjusted (overrides the ``'0'`` conversion if " "both are given)." msgstr "" -#: ../../library/stdtypes.rst:2352 ../../library/stdtypes.rst:3564 +#: ../../library/stdtypes.rst:2355 ../../library/stdtypes.rst:3570 msgid "``' '``" msgstr "``' '``" -#: ../../library/stdtypes.rst:2352 ../../library/stdtypes.rst:3564 +#: ../../library/stdtypes.rst:2355 ../../library/stdtypes.rst:3570 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." msgstr "" -#: ../../library/stdtypes.rst:2355 ../../library/stdtypes.rst:3567 +#: ../../library/stdtypes.rst:2358 ../../library/stdtypes.rst:3573 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/stdtypes.rst:2355 ../../library/stdtypes.rst:3567 +#: ../../library/stdtypes.rst:2358 ../../library/stdtypes.rst:3573 msgid "" "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides " "a \"space\" flag)." msgstr "" -#: ../../library/stdtypes.rst:2359 ../../library/stdtypes.rst:3571 +#: ../../library/stdtypes.rst:2362 ../../library/stdtypes.rst:3577 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:2362 ../../library/stdtypes.rst:3574 +#: ../../library/stdtypes.rst:2365 ../../library/stdtypes.rst:3580 msgid "The conversion types are:" msgstr "" -#: ../../library/stdtypes.rst:2365 ../../library/stdtypes.rst:3577 +#: ../../library/stdtypes.rst:2368 ../../library/stdtypes.rst:3583 msgid "Conversion" msgstr "" -#: ../../library/stdtypes.rst:2367 ../../library/stdtypes.rst:3579 +#: ../../library/stdtypes.rst:2370 ../../library/stdtypes.rst:3585 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/stdtypes.rst:2367 ../../library/stdtypes.rst:2369 -#: ../../library/stdtypes.rst:3579 ../../library/stdtypes.rst:3581 +#: ../../library/stdtypes.rst:2370 ../../library/stdtypes.rst:2372 +#: ../../library/stdtypes.rst:3585 ../../library/stdtypes.rst:3587 msgid "Signed integer decimal." msgstr "" -#: ../../library/stdtypes.rst:2369 ../../library/stdtypes.rst:3581 +#: ../../library/stdtypes.rst:2372 ../../library/stdtypes.rst:3587 msgid "``'i'``" msgstr "``'i'``" -#: ../../library/stdtypes.rst:2371 ../../library/stdtypes.rst:3583 +#: ../../library/stdtypes.rst:2374 ../../library/stdtypes.rst:3589 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/stdtypes.rst:2371 ../../library/stdtypes.rst:3583 +#: ../../library/stdtypes.rst:2374 ../../library/stdtypes.rst:3589 msgid "Signed octal value." msgstr "" -#: ../../library/stdtypes.rst:2373 ../../library/stdtypes.rst:3585 +#: ../../library/stdtypes.rst:2376 ../../library/stdtypes.rst:3591 msgid "``'u'``" msgstr "``'u'``" -#: ../../library/stdtypes.rst:2373 ../../library/stdtypes.rst:3585 +#: ../../library/stdtypes.rst:2376 ../../library/stdtypes.rst:3591 msgid "Obsolete type -- it is identical to ``'d'``." msgstr "" -#: ../../library/stdtypes.rst:2375 ../../library/stdtypes.rst:3587 +#: ../../library/stdtypes.rst:2378 ../../library/stdtypes.rst:3593 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/stdtypes.rst:2375 ../../library/stdtypes.rst:3587 +#: ../../library/stdtypes.rst:2378 ../../library/stdtypes.rst:3593 msgid "Signed hexadecimal (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2377 ../../library/stdtypes.rst:3589 +#: ../../library/stdtypes.rst:2380 ../../library/stdtypes.rst:3595 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/stdtypes.rst:2377 ../../library/stdtypes.rst:3589 +#: ../../library/stdtypes.rst:2380 ../../library/stdtypes.rst:3595 msgid "Signed hexadecimal (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2379 ../../library/stdtypes.rst:3591 +#: ../../library/stdtypes.rst:2382 ../../library/stdtypes.rst:3597 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/stdtypes.rst:2379 ../../library/stdtypes.rst:3591 +#: ../../library/stdtypes.rst:2382 ../../library/stdtypes.rst:3597 msgid "Floating point exponential format (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:3593 +#: ../../library/stdtypes.rst:2384 ../../library/stdtypes.rst:3599 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:3593 +#: ../../library/stdtypes.rst:2384 ../../library/stdtypes.rst:3599 msgid "Floating point exponential format (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2383 ../../library/stdtypes.rst:3595 +#: ../../library/stdtypes.rst:2386 ../../library/stdtypes.rst:3601 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/stdtypes.rst:2383 ../../library/stdtypes.rst:2385 -#: ../../library/stdtypes.rst:3595 ../../library/stdtypes.rst:3597 +#: ../../library/stdtypes.rst:2386 ../../library/stdtypes.rst:2388 +#: ../../library/stdtypes.rst:3601 ../../library/stdtypes.rst:3603 msgid "Floating point decimal format." msgstr "" -#: ../../library/stdtypes.rst:2385 ../../library/stdtypes.rst:3597 +#: ../../library/stdtypes.rst:2388 ../../library/stdtypes.rst:3603 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/stdtypes.rst:2387 ../../library/stdtypes.rst:3599 +#: ../../library/stdtypes.rst:2390 ../../library/stdtypes.rst:3605 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/stdtypes.rst:2387 ../../library/stdtypes.rst:3599 +#: ../../library/stdtypes.rst:2390 ../../library/stdtypes.rst:3605 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:2391 ../../library/stdtypes.rst:3603 +#: ../../library/stdtypes.rst:2394 ../../library/stdtypes.rst:3609 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/stdtypes.rst:2391 ../../library/stdtypes.rst:3603 +#: ../../library/stdtypes.rst:2394 ../../library/stdtypes.rst:3609 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:2395 ../../library/stdtypes.rst:3607 +#: ../../library/stdtypes.rst:2398 ../../library/stdtypes.rst:3613 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/stdtypes.rst:2395 +#: ../../library/stdtypes.rst:2398 msgid "Single character (accepts integer or single character string)." msgstr "" -#: ../../library/stdtypes.rst:2398 ../../library/stdtypes.rst:3620 +#: ../../library/stdtypes.rst:2401 ../../library/stdtypes.rst:3626 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/stdtypes.rst:2398 +#: ../../library/stdtypes.rst:2401 msgid "String (converts any Python object using :func:`repr`)." msgstr "" -#: ../../library/stdtypes.rst:2401 ../../library/stdtypes.rst:3614 +#: ../../library/stdtypes.rst:2404 ../../library/stdtypes.rst:3620 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/stdtypes.rst:2401 +#: ../../library/stdtypes.rst:2404 msgid "String (converts any Python object using :func:`str`)." msgstr "" -#: ../../library/stdtypes.rst:2404 ../../library/stdtypes.rst:3617 +#: ../../library/stdtypes.rst:2407 ../../library/stdtypes.rst:3623 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/stdtypes.rst:2404 +#: ../../library/stdtypes.rst:2407 msgid "String (converts any Python object using :func:`ascii`)." msgstr "" -#: ../../library/stdtypes.rst:2407 ../../library/stdtypes.rst:3623 +#: ../../library/stdtypes.rst:2410 ../../library/stdtypes.rst:3629 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/stdtypes.rst:2407 ../../library/stdtypes.rst:3623 +#: ../../library/stdtypes.rst:2410 ../../library/stdtypes.rst:3629 msgid "No argument is converted, results in a ``'%'`` character in the result." msgstr "" -#: ../../library/stdtypes.rst:2414 ../../library/stdtypes.rst:3630 +#: ../../library/stdtypes.rst:2417 ../../library/stdtypes.rst:3636 msgid "" "The alternate form causes a leading octal specifier (``'0o'``) to be " "inserted before the first digit." msgstr "" -#: ../../library/stdtypes.rst:2418 ../../library/stdtypes.rst:3634 +#: ../../library/stdtypes.rst:2421 ../../library/stdtypes.rst:3640 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:2422 ../../library/stdtypes.rst:3638 +#: ../../library/stdtypes.rst:2425 ../../library/stdtypes.rst:3644 msgid "" "The alternate form causes the result to always contain a decimal point, even " "if no digits follow it." msgstr "" -#: ../../library/stdtypes.rst:2425 ../../library/stdtypes.rst:3641 +#: ../../library/stdtypes.rst:2428 ../../library/stdtypes.rst:3647 msgid "" "The precision determines the number of digits after the decimal point and " "defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2429 ../../library/stdtypes.rst:3645 +#: ../../library/stdtypes.rst:2432 ../../library/stdtypes.rst:3651 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:2432 ../../library/stdtypes.rst:3648 +#: ../../library/stdtypes.rst:2435 ../../library/stdtypes.rst:3654 msgid "" "The precision determines the number of significant digits before and after " "the decimal point and defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2436 ../../library/stdtypes.rst:3652 +#: ../../library/stdtypes.rst:2439 ../../library/stdtypes.rst:3658 msgid "If precision is ``N``, the output is truncated to ``N`` characters." msgstr "" -#: ../../library/stdtypes.rst:2439 ../../library/stdtypes.rst:3661 +#: ../../library/stdtypes.rst:2442 ../../library/stdtypes.rst:3667 msgid "See :pep:`237`." msgstr "參閱 :pep:`237`\\ 。" -#: ../../library/stdtypes.rst:2441 +#: ../../library/stdtypes.rst:2444 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:2446 +#: ../../library/stdtypes.rst:2449 msgid "" "``%f`` conversions for numbers whose absolute value is over 1e50 are no " "longer replaced by ``%g`` conversions." msgstr "" -#: ../../library/stdtypes.rst:2457 +#: ../../library/stdtypes.rst:2460 msgid "" "Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:" "`memoryview`" msgstr "" -#: ../../library/stdtypes.rst:2465 +#: ../../library/stdtypes.rst:2468 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 :" @@ -3121,17 +3127,17 @@ msgid "" "objects without needing to make a copy." msgstr "" -#: ../../library/stdtypes.rst:2470 +#: ../../library/stdtypes.rst:2473 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:2476 +#: ../../library/stdtypes.rst:2479 msgid "Bytes Objects" msgstr "" -#: ../../library/stdtypes.rst:2480 +#: ../../library/stdtypes.rst:2483 msgid "" "Bytes objects are immutable sequences of single bytes. Since many major " "binary protocols are based on the ASCII text encoding, bytes objects offer " @@ -3139,40 +3145,40 @@ msgid "" "and are closely related to string objects in a variety of other ways." msgstr "" -#: ../../library/stdtypes.rst:2487 +#: ../../library/stdtypes.rst:2490 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:2490 +#: ../../library/stdtypes.rst:2493 msgid "Single quotes: ``b'still allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:2491 +#: ../../library/stdtypes.rst:2494 msgid "Double quotes: ``b\"still allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:2492 +#: ../../library/stdtypes.rst:2495 msgid "" "Triple quoted: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:2494 +#: ../../library/stdtypes.rst:2497 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:2498 +#: ../../library/stdtypes.rst:2501 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:2502 +#: ../../library/stdtypes.rst:2505 msgid "" "While bytes literals and representations are based on ASCII text, bytes " "objects actually behave like immutable sequences of integers, with each " @@ -3185,29 +3191,29 @@ msgid "" "compatible will usually lead to data corruption)." msgstr "" -#: ../../library/stdtypes.rst:2512 +#: ../../library/stdtypes.rst:2515 msgid "" "In addition to the literal forms, bytes objects can be created in a number " "of other ways:" msgstr "" -#: ../../library/stdtypes.rst:2515 +#: ../../library/stdtypes.rst:2518 msgid "A zero-filled bytes object of a specified length: ``bytes(10)``" msgstr "" -#: ../../library/stdtypes.rst:2516 +#: ../../library/stdtypes.rst:2519 msgid "From an iterable of integers: ``bytes(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2517 +#: ../../library/stdtypes.rst:2520 msgid "Copying existing binary data via the buffer protocol: ``bytes(obj)``" msgstr "" -#: ../../library/stdtypes.rst:2519 +#: ../../library/stdtypes.rst:2522 msgid "Also see the :ref:`bytes ` built-in." msgstr "" -#: ../../library/stdtypes.rst:2521 +#: ../../library/stdtypes.rst:2524 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -3215,32 +3221,32 @@ msgid "" "that format:" msgstr "" -#: ../../library/stdtypes.rst:2527 +#: ../../library/stdtypes.rst:2530 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:2534 +#: ../../library/stdtypes.rst:2537 msgid "" ":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just " "spaces." msgstr "" -#: ../../library/stdtypes.rst:2538 +#: ../../library/stdtypes.rst:2541 msgid "" "A reverse conversion function exists to transform a bytes object into its " "hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2543 ../../library/stdtypes.rst:2628 +#: ../../library/stdtypes.rst:2546 ../../library/stdtypes.rst:2631 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." msgstr "" -#: ../../library/stdtypes.rst:2549 +#: ../../library/stdtypes.rst:2552 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, " @@ -3249,13 +3255,13 @@ msgid "" "the separator position from the right, negative values from the left." msgstr "" -#: ../../library/stdtypes.rst:2566 +#: ../../library/stdtypes.rst:2569 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:2570 +#: ../../library/stdtypes.rst:2573 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 " @@ -3263,58 +3269,58 @@ msgid "" "and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2575 +#: ../../library/stdtypes.rst:2578 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:2583 +#: ../../library/stdtypes.rst:2586 msgid "Bytearray Objects" msgstr "" -#: ../../library/stdtypes.rst:2587 +#: ../../library/stdtypes.rst:2590 msgid "" ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` " "objects." msgstr "" -#: ../../library/stdtypes.rst:2592 +#: ../../library/stdtypes.rst:2595 msgid "" "There is no dedicated literal syntax for bytearray objects, instead they are " "always created by calling the constructor:" msgstr "" -#: ../../library/stdtypes.rst:2595 +#: ../../library/stdtypes.rst:2598 msgid "Creating an empty instance: ``bytearray()``" msgstr "" -#: ../../library/stdtypes.rst:2596 +#: ../../library/stdtypes.rst:2599 msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" msgstr "" -#: ../../library/stdtypes.rst:2597 +#: ../../library/stdtypes.rst:2600 msgid "From an iterable of integers: ``bytearray(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2598 +#: ../../library/stdtypes.rst:2601 msgid "" "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" -#: ../../library/stdtypes.rst:2600 +#: ../../library/stdtypes.rst:2603 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:2604 +#: ../../library/stdtypes.rst:2607 msgid "Also see the :ref:`bytearray ` built-in." msgstr "" -#: ../../library/stdtypes.rst:2606 +#: ../../library/stdtypes.rst:2609 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -3322,33 +3328,33 @@ msgid "" "in that format:" msgstr "" -#: ../../library/stdtypes.rst:2612 +#: ../../library/stdtypes.rst:2615 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:2619 +#: ../../library/stdtypes.rst:2622 msgid "" ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not " "just spaces." msgstr "" -#: ../../library/stdtypes.rst:2623 +#: ../../library/stdtypes.rst:2626 msgid "" "A reverse conversion function exists to transform a bytearray object into " "its hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2636 +#: ../../library/stdtypes.rst:2639 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:2641 +#: ../../library/stdtypes.rst:2644 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 " @@ -3356,7 +3362,7 @@ msgid "" "both indexing and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2646 +#: ../../library/stdtypes.rst:2649 msgid "" "The representation of bytearray objects uses the bytes literal format " "(``bytearray(b'...')``) since it is often more useful than e.g. " @@ -3364,11 +3370,11 @@ msgid "" "a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:2655 +#: ../../library/stdtypes.rst:2658 msgid "Bytes and Bytearray Operations" msgstr "" -#: ../../library/stdtypes.rst:2660 +#: ../../library/stdtypes.rst:2663 msgid "" "Both bytes and bytearray objects support the :ref:`common ` " "sequence operations. They interoperate not just with operands of the same " @@ -3377,97 +3383,103 @@ msgid "" "return type of the result may depend on the order of operands." msgstr "" -#: ../../library/stdtypes.rst:2668 +#: ../../library/stdtypes.rst:2671 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:2675 +#: ../../library/stdtypes.rst:2678 msgid "and::" msgstr "" "和:\n" "\n" "::" -#: ../../library/stdtypes.rst:2680 +#: ../../library/stdtypes.rst:2683 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:2685 +#: ../../library/stdtypes.rst:2688 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:2688 +#: ../../library/stdtypes.rst:2691 msgid "" "The following methods on bytes and bytearray objects can be used with " "arbitrary binary data." msgstr "" -#: ../../library/stdtypes.rst:2694 +#: ../../library/stdtypes.rst:2697 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:2698 ../../library/stdtypes.rst:2797 -#: ../../library/stdtypes.rst:2819 ../../library/stdtypes.rst:2885 -#: ../../library/stdtypes.rst:2898 +#: ../../library/stdtypes.rst:2701 ../../library/stdtypes.rst:2803 +#: ../../library/stdtypes.rst:2825 ../../library/stdtypes.rst:2891 +#: ../../library/stdtypes.rst:2904 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:2701 ../../library/stdtypes.rst:2809 -#: ../../library/stdtypes.rst:2822 ../../library/stdtypes.rst:2888 -#: ../../library/stdtypes.rst:2901 +#: ../../library/stdtypes.rst:2704 +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:2707 ../../library/stdtypes.rst:2815 +#: ../../library/stdtypes.rst:2828 ../../library/stdtypes.rst:2894 +#: ../../library/stdtypes.rst:2907 msgid "Also accept an integer in the range 0 to 255 as the subsequence." msgstr "" -#: ../../library/stdtypes.rst:2708 +#: ../../library/stdtypes.rst:2714 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:2717 +#: ../../library/stdtypes.rst:2723 msgid "The *prefix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2721 ../../library/stdtypes.rst:2743 -#: ../../library/stdtypes.rst:2873 ../../library/stdtypes.rst:2966 -#: ../../library/stdtypes.rst:2980 ../../library/stdtypes.rst:3011 -#: ../../library/stdtypes.rst:3025 ../../library/stdtypes.rst:3067 -#: ../../library/stdtypes.rst:3137 ../../library/stdtypes.rst:3155 -#: ../../library/stdtypes.rst:3183 ../../library/stdtypes.rst:3322 -#: ../../library/stdtypes.rst:3377 ../../library/stdtypes.rst:3420 -#: ../../library/stdtypes.rst:3441 ../../library/stdtypes.rst:3463 -#: ../../library/stdtypes.rst:3665 +#: ../../library/stdtypes.rst:2727 ../../library/stdtypes.rst:2749 +#: ../../library/stdtypes.rst:2879 ../../library/stdtypes.rst:2972 +#: ../../library/stdtypes.rst:2986 ../../library/stdtypes.rst:3017 +#: ../../library/stdtypes.rst:3031 ../../library/stdtypes.rst:3073 +#: ../../library/stdtypes.rst:3143 ../../library/stdtypes.rst:3161 +#: ../../library/stdtypes.rst:3189 ../../library/stdtypes.rst:3328 +#: ../../library/stdtypes.rst:3383 ../../library/stdtypes.rst:3426 +#: ../../library/stdtypes.rst:3447 ../../library/stdtypes.rst:3469 +#: ../../library/stdtypes.rst:3671 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:2730 +#: ../../library/stdtypes.rst:2736 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:2739 +#: ../../library/stdtypes.rst:2745 msgid "The *suffix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2752 +#: ../../library/stdtypes.rst:2758 msgid "" "Return a string decoded from the given bytes. Default encoding is " "``'utf-8'``. *errors* may be given to set a different error handling " @@ -3478,25 +3490,25 @@ msgid "" "encodings, see section :ref:`standard-encodings`." msgstr "" -#: ../../library/stdtypes.rst:2760 +#: ../../library/stdtypes.rst:2766 msgid "" "By default, the *errors* argument is not checked for best performances, but " "only used at the first decoding error. Enable the :ref:`Python Development " "Mode `, or use a :ref:`debug build ` to check *errors*." msgstr "" -#: ../../library/stdtypes.rst:2766 +#: ../../library/stdtypes.rst:2772 msgid "" "Passing the *encoding* argument to :class:`str` allows decoding any :term:" "`bytes-like object` directly, without needing to make a temporary bytes or " "bytearray object." msgstr "" -#: ../../library/stdtypes.rst:2770 +#: ../../library/stdtypes.rst:2776 msgid "Added support for keyword arguments." msgstr "新增關鍵字引數的支援。" -#: ../../library/stdtypes.rst:2781 +#: ../../library/stdtypes.rst:2787 msgid "" "Return ``True`` if the binary data ends with the specified *suffix*, " "otherwise return ``False``. *suffix* can also be a tuple of suffixes to " @@ -3504,11 +3516,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2786 +#: ../../library/stdtypes.rst:2792 msgid "The suffix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2792 +#: ../../library/stdtypes.rst:2798 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 " @@ -3516,20 +3528,20 @@ msgid "" "``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2802 +#: ../../library/stdtypes.rst:2808 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:2816 +#: ../../library/stdtypes.rst:2822 msgid "" "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence " "is not found." msgstr "" -#: ../../library/stdtypes.rst:2829 +#: ../../library/stdtypes.rst:2835 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 " @@ -3539,7 +3551,7 @@ msgid "" "method." msgstr "" -#: ../../library/stdtypes.rst:2840 +#: ../../library/stdtypes.rst:2846 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 " @@ -3547,7 +3559,7 @@ msgid "" "objects ` and have the same length." msgstr "" -#: ../../library/stdtypes.rst:2851 +#: ../../library/stdtypes.rst:2857 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 " @@ -3556,24 +3568,24 @@ msgid "" "by two empty bytes or bytearray objects." msgstr "" -#: ../../library/stdtypes.rst:2858 ../../library/stdtypes.rst:2915 +#: ../../library/stdtypes.rst:2864 ../../library/stdtypes.rst:2921 msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2864 +#: ../../library/stdtypes.rst:2870 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:2868 +#: ../../library/stdtypes.rst:2874 msgid "" "The subsequence to search for and its replacement may be any :term:`bytes-" "like object`." msgstr "" -#: ../../library/stdtypes.rst:2880 +#: ../../library/stdtypes.rst:2886 msgid "" "Return the highest index in the sequence where the subsequence *sub* is " "found, such that *sub* is contained within ``s[start:end]``. Optional " @@ -3581,13 +3593,13 @@ msgid "" "``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:2895 +#: ../../library/stdtypes.rst:2901 msgid "" "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence " "*sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2908 +#: ../../library/stdtypes.rst:2914 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 " @@ -3596,7 +3608,7 @@ msgid "" "followed by a copy of the original sequence." msgstr "" -#: ../../library/stdtypes.rst:2921 +#: ../../library/stdtypes.rst:2927 msgid "" "Return ``True`` if the binary data starts with the specified *prefix*, " "otherwise return ``False``. *prefix* can also be a tuple of prefixes to " @@ -3604,11 +3616,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2926 +#: ../../library/stdtypes.rst:2932 msgid "The prefix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2932 +#: ../../library/stdtypes.rst:2938 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 " @@ -3616,22 +3628,22 @@ msgid "" "object of length 256." msgstr "" -#: ../../library/stdtypes.rst:2937 +#: ../../library/stdtypes.rst:2943 msgid "" "You can use the :func:`bytes.maketrans` method to create a translation table." msgstr "" -#: ../../library/stdtypes.rst:2940 +#: ../../library/stdtypes.rst:2946 msgid "" "Set the *table* argument to ``None`` for translations that only delete " "characters::" msgstr "" -#: ../../library/stdtypes.rst:2946 +#: ../../library/stdtypes.rst:2952 msgid "*delete* is now supported as a keyword argument." msgstr "" -#: ../../library/stdtypes.rst:2950 +#: ../../library/stdtypes.rst:2956 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 " @@ -3640,7 +3652,7 @@ msgid "" "instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:2959 +#: ../../library/stdtypes.rst:2965 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). " @@ -3648,7 +3660,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2973 +#: ../../library/stdtypes.rst:2979 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). " @@ -3656,7 +3668,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2987 +#: ../../library/stdtypes.rst:2993 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 " @@ -3666,14 +3678,14 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2999 +#: ../../library/stdtypes.rst:3005 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:3018 +#: ../../library/stdtypes.rst:3024 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). " @@ -3681,7 +3693,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3032 +#: ../../library/stdtypes.rst:3038 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 " @@ -3691,7 +3703,7 @@ msgid "" "described in detail below." msgstr "" -#: ../../library/stdtypes.rst:3043 +#: ../../library/stdtypes.rst:3049 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 " @@ -3701,14 +3713,14 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3055 +#: ../../library/stdtypes.rst:3061 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:3074 +#: ../../library/stdtypes.rst:3080 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 " @@ -3717,7 +3729,7 @@ msgid "" "limit on the number of splits (all possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:3080 +#: ../../library/stdtypes.rst:3086 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',')`` " @@ -3728,7 +3740,7 @@ msgid "" "object being split. The *sep* argument may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3098 +#: ../../library/stdtypes.rst:3104 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 " @@ -3738,7 +3750,7 @@ msgid "" "without a specified separator returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:3119 +#: ../../library/stdtypes.rst:3125 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 " @@ -3748,13 +3760,13 @@ msgid "" "a prefix or suffix; rather, all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3132 +#: ../../library/stdtypes.rst:3138 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`." msgstr "" -#: ../../library/stdtypes.rst:3141 +#: ../../library/stdtypes.rst:3147 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 " @@ -3762,14 +3774,14 @@ msgid "" "operate in place, and instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3149 +#: ../../library/stdtypes.rst:3155 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:3162 +#: ../../library/stdtypes.rst:3168 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 " @@ -3785,7 +3797,7 @@ msgid "" "by one regardless of how the byte value is represented when printed::" msgstr "" -#: ../../library/stdtypes.rst:3190 +#: ../../library/stdtypes.rst:3196 msgid "" "Return ``True`` if all bytes in the sequence are alphabetical ASCII " "characters or ASCII decimal digits and the sequence is not empty, ``False`` " @@ -3794,7 +3806,7 @@ msgid "" "digits are those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:3207 +#: ../../library/stdtypes.rst:3213 msgid "" "Return ``True`` if all bytes in the sequence are alphabetic ASCII characters " "and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII " @@ -3802,35 +3814,35 @@ msgid "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:3223 +#: ../../library/stdtypes.rst:3229 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:3233 +#: ../../library/stdtypes.rst:3239 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:3248 +#: ../../library/stdtypes.rst:3254 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:3258 ../../library/stdtypes.rst:3300 -#: ../../library/stdtypes.rst:3316 ../../library/stdtypes.rst:3366 -#: ../../library/stdtypes.rst:3435 +#: ../../library/stdtypes.rst:3264 ../../library/stdtypes.rst:3306 +#: ../../library/stdtypes.rst:3322 ../../library/stdtypes.rst:3372 +#: ../../library/stdtypes.rst:3441 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:3266 +#: ../../library/stdtypes.rst:3272 msgid "" "Return ``True`` if all bytes in the sequence are ASCII whitespace and the " "sequence is not empty, ``False`` otherwise. ASCII whitespace characters are " @@ -3838,27 +3850,27 @@ msgid "" "newline, carriage return, vertical tab, form feed)." msgstr "" -#: ../../library/stdtypes.rst:3275 +#: ../../library/stdtypes.rst:3281 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:3290 +#: ../../library/stdtypes.rst:3296 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:3308 +#: ../../library/stdtypes.rst:3314 msgid "" "Return a copy of the sequence with all the uppercase ASCII characters " "converted to their corresponding lowercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3333 +#: ../../library/stdtypes.rst:3339 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 " @@ -3866,20 +3878,20 @@ msgid "" "*keepends* is given and true." msgstr "" -#: ../../library/stdtypes.rst:3345 +#: ../../library/stdtypes.rst:3351 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:3358 +#: ../../library/stdtypes.rst:3364 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:3370 +#: ../../library/stdtypes.rst:3376 msgid "" "Unlike :func:`str.swapcase()`, it is always the case that ``bin.swapcase()." "swapcase() == bin`` for the binary versions. Case conversions are " @@ -3887,14 +3899,14 @@ msgid "" "Unicode code points." msgstr "" -#: ../../library/stdtypes.rst:3384 +#: ../../library/stdtypes.rst:3390 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:3393 +#: ../../library/stdtypes.rst:3399 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -3902,18 +3914,18 @@ msgid "" "values are uncased." msgstr "" -#: ../../library/stdtypes.rst:3406 +#: ../../library/stdtypes.rst:3412 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "" -#: ../../library/stdtypes.rst:3427 +#: ../../library/stdtypes.rst:3433 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3448 +#: ../../library/stdtypes.rst:3454 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 " @@ -3922,11 +3934,11 @@ msgid "" "*width* is less than or equal to ``len(seq)``." msgstr "" -#: ../../library/stdtypes.rst:3470 +#: ../../library/stdtypes.rst:3476 msgid "``printf``-style Bytes Formatting" msgstr "" -#: ../../library/stdtypes.rst:3487 +#: ../../library/stdtypes.rst:3493 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 " @@ -3934,7 +3946,7 @@ msgid "" "dictionary, wrap it in a tuple." msgstr "" -#: ../../library/stdtypes.rst:3492 +#: ../../library/stdtypes.rst:3498 msgid "" "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " @@ -3944,7 +3956,7 @@ msgid "" "func:`sprintf` in the C language." msgstr "" -#: ../../library/stdtypes.rst:3499 +#: ../../library/stdtypes.rst:3505 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 " @@ -3952,7 +3964,7 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:3533 +#: ../../library/stdtypes.rst:3539 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 " @@ -3960,73 +3972,73 @@ msgid "" "mapping key selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:3607 +#: ../../library/stdtypes.rst:3613 msgid "Single byte (accepts integer or single byte objects)." msgstr "" -#: ../../library/stdtypes.rst:3610 +#: ../../library/stdtypes.rst:3616 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/stdtypes.rst:3610 +#: ../../library/stdtypes.rst:3616 msgid "" "Bytes (any object that follows the :ref:`buffer protocol ` or " "has :meth:`__bytes__`)." msgstr "" -#: ../../library/stdtypes.rst:3614 +#: ../../library/stdtypes.rst:3620 msgid "" "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3617 +#: ../../library/stdtypes.rst:3623 msgid "" "Bytes (converts any Python object using ``repr(obj).encode('ascii', " "'backslashreplace')``)." msgstr "" -#: ../../library/stdtypes.rst:3620 +#: ../../library/stdtypes.rst:3626 msgid "" "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3620 +#: ../../library/stdtypes.rst:3626 msgid "\\(7)" msgstr "\\(7)" -#: ../../library/stdtypes.rst:3655 +#: ../../library/stdtypes.rst:3661 msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3658 +#: ../../library/stdtypes.rst:3664 msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3670 +#: ../../library/stdtypes.rst:3676 msgid ":pep:`461` - Adding % formatting to bytes and bytearray" msgstr "" -#: ../../library/stdtypes.rst:3677 +#: ../../library/stdtypes.rst:3683 msgid "Memory Views" msgstr "" -#: ../../library/stdtypes.rst:3679 +#: ../../library/stdtypes.rst:3685 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:3685 +#: ../../library/stdtypes.rst:3691 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:3689 +#: ../../library/stdtypes.rst:3695 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 " @@ -4034,7 +4046,7 @@ msgid "" "other types such as :class:`array.array` may have bigger elements." msgstr "" -#: ../../library/stdtypes.rst:3694 +#: ../../library/stdtypes.rst:3700 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 " @@ -4044,13 +4056,13 @@ msgid "" "bytes in a single element." msgstr "" -#: ../../library/stdtypes.rst:3701 +#: ../../library/stdtypes.rst:3707 msgid "" "A :class:`memoryview` supports slicing and indexing to expose its data. One-" "dimensional slicing will result in a subview::" msgstr "" -#: ../../library/stdtypes.rst:3714 +#: ../../library/stdtypes.rst:3720 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 " @@ -4061,82 +4073,82 @@ msgid "" "memoryviews can be indexed with the empty tuple." msgstr "" -#: ../../library/stdtypes.rst:3723 +#: ../../library/stdtypes.rst:3729 msgid "Here is an example with a non-byte format::" msgstr "" -#: ../../library/stdtypes.rst:3735 +#: ../../library/stdtypes.rst:3741 msgid "" "If the underlying object is writable, the memoryview supports one-" "dimensional slice assignment. Resizing is not allowed::" msgstr "" -#: ../../library/stdtypes.rst:3756 +#: ../../library/stdtypes.rst:3762 msgid "" "One-dimensional memoryviews of hashable (read-only) types with formats 'B', " "'b' or 'c' are also hashable. The hash is defined as ``hash(m) == hash(m." "tobytes())``::" msgstr "" -#: ../../library/stdtypes.rst:3768 +#: ../../library/stdtypes.rst:3774 msgid "" "One-dimensional memoryviews can now be sliced. One-dimensional memoryviews " "with formats 'B', 'b' or 'c' are now hashable." msgstr "" -#: ../../library/stdtypes.rst:3772 +#: ../../library/stdtypes.rst:3778 msgid "" "memoryview is now registered automatically with :class:`collections.abc." "Sequence`" msgstr "" -#: ../../library/stdtypes.rst:3776 +#: ../../library/stdtypes.rst:3782 msgid "memoryviews can now be indexed with tuple of integers." msgstr "" -#: ../../library/stdtypes.rst:3779 +#: ../../library/stdtypes.rst:3785 msgid ":class:`memoryview` has several methods:" msgstr "" -#: ../../library/stdtypes.rst:3783 +#: ../../library/stdtypes.rst:3789 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:3787 +#: ../../library/stdtypes.rst:3793 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:3806 +#: ../../library/stdtypes.rst:3812 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:3822 +#: ../../library/stdtypes.rst:3828 msgid "" "Note that, as with floating point numbers, ``v is w`` does *not* imply ``v " "== w`` for memoryview objects." msgstr "" -#: ../../library/stdtypes.rst:3825 +#: ../../library/stdtypes.rst:3831 msgid "" "Previous versions compared the raw memory disregarding the item format and " "the logical array structure." msgstr "" -#: ../../library/stdtypes.rst:3831 +#: ../../library/stdtypes.rst:3837 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:3840 +#: ../../library/stdtypes.rst:3846 msgid "" "For non-contiguous arrays the result is equal to the flattened list " "representation with all elements converted to bytes. :meth:`tobytes` " @@ -4144,7 +4156,7 @@ msgid "" "module syntax." msgstr "" -#: ../../library/stdtypes.rst:3845 +#: ../../library/stdtypes.rst:3851 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' " @@ -4153,36 +4165,36 @@ msgid "" "to C first. *order=None* is the same as *order='C'*." msgstr "" -#: ../../library/stdtypes.rst:3854 +#: ../../library/stdtypes.rst:3860 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the buffer. ::" msgstr "" -#: ../../library/stdtypes.rst:3863 +#: ../../library/stdtypes.rst:3869 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:3870 +#: ../../library/stdtypes.rst:3876 msgid "Return the data in the buffer as a list of elements. ::" msgstr "" -#: ../../library/stdtypes.rst:3880 +#: ../../library/stdtypes.rst:3886 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:3887 +#: ../../library/stdtypes.rst:3893 msgid "" "Return a readonly version of the memoryview object. The original memoryview " "object is unchanged. ::" msgstr "" -#: ../../library/stdtypes.rst:3906 +#: ../../library/stdtypes.rst:3912 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 :" @@ -4191,20 +4203,20 @@ msgid "" "resources) as soon as possible." msgstr "" -#: ../../library/stdtypes.rst:3912 +#: ../../library/stdtypes.rst:3918 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:3923 +#: ../../library/stdtypes.rst:3929 msgid "" "The context management protocol can be used for a similar effect, using the " "``with`` statement::" msgstr "" -#: ../../library/stdtypes.rst:3939 +#: ../../library/stdtypes.rst:3945 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 " @@ -4213,57 +4225,57 @@ msgid "" "contiguous -> 1D." msgstr "" -#: ../../library/stdtypes.rst:3945 +#: ../../library/stdtypes.rst:3951 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:3950 +#: ../../library/stdtypes.rst:3956 msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "" -#: ../../library/stdtypes.rst:3973 +#: ../../library/stdtypes.rst:3979 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "" -#: ../../library/stdtypes.rst:3986 +#: ../../library/stdtypes.rst:3992 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "" -#: ../../library/stdtypes.rst:4012 +#: ../../library/stdtypes.rst:4018 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "" -#: ../../library/stdtypes.rst:4026 +#: ../../library/stdtypes.rst:4032 msgid "The source format is no longer restricted when casting to a byte view." msgstr "" -#: ../../library/stdtypes.rst:4029 +#: ../../library/stdtypes.rst:4035 msgid "There are also several readonly attributes available:" msgstr "" -#: ../../library/stdtypes.rst:4033 +#: ../../library/stdtypes.rst:4039 msgid "The underlying object of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4044 +#: ../../library/stdtypes.rst:4050 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:4063 +#: ../../library/stdtypes.rst:4069 msgid "Multi-dimensional arrays::" msgstr "" -#: ../../library/stdtypes.rst:4080 +#: ../../library/stdtypes.rst:4086 msgid "A bool indicating whether the memory is read only." msgstr "" -#: ../../library/stdtypes.rst:4084 +#: ../../library/stdtypes.rst:4090 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 " @@ -4271,59 +4283,59 @@ msgid "" "restricted to native single element formats." msgstr "" -#: ../../library/stdtypes.rst:4089 +#: ../../library/stdtypes.rst:4095 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:4095 +#: ../../library/stdtypes.rst:4101 msgid "The size in bytes of each element of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4108 +#: ../../library/stdtypes.rst:4114 msgid "" "An integer indicating how many dimensions of a multi-dimensional array the " "memory represents." msgstr "" -#: ../../library/stdtypes.rst:4113 +#: ../../library/stdtypes.rst:4119 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:4116 ../../library/stdtypes.rst:4124 +#: ../../library/stdtypes.rst:4122 ../../library/stdtypes.rst:4130 msgid "An empty tuple instead of ``None`` when ndim = 0." msgstr "" -#: ../../library/stdtypes.rst:4121 +#: ../../library/stdtypes.rst:4127 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:4129 +#: ../../library/stdtypes.rst:4135 msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" -#: ../../library/stdtypes.rst:4133 +#: ../../library/stdtypes.rst:4139 msgid "A bool indicating whether the memory is C-:term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4139 +#: ../../library/stdtypes.rst:4145 msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4145 +#: ../../library/stdtypes.rst:4151 msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4153 +#: ../../library/stdtypes.rst:4159 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "" -#: ../../library/stdtypes.rst:4157 +#: ../../library/stdtypes.rst:4163 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -4333,7 +4345,7 @@ msgid "" "`collections` module.)" msgstr "" -#: ../../library/stdtypes.rst:4164 +#: ../../library/stdtypes.rst:4170 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 " @@ -4341,7 +4353,7 @@ msgid "" "slicing, or other sequence-like behavior." msgstr "" -#: ../../library/stdtypes.rst:4169 +#: ../../library/stdtypes.rst:4175 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -4353,18 +4365,18 @@ msgid "" "of another set." msgstr "" -#: ../../library/stdtypes.rst:4177 +#: ../../library/stdtypes.rst:4183 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:4181 +#: ../../library/stdtypes.rst:4187 msgid "The constructors for both classes work the same:" msgstr "" -#: ../../library/stdtypes.rst:4186 +#: ../../library/stdtypes.rst:4192 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 " @@ -4372,92 +4384,92 @@ msgid "" "*iterable* is not specified, a new empty set is returned." msgstr "" -#: ../../library/stdtypes.rst:4192 +#: ../../library/stdtypes.rst:4198 msgid "Sets can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4194 +#: ../../library/stdtypes.rst:4200 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4195 +#: ../../library/stdtypes.rst:4201 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" -#: ../../library/stdtypes.rst:4196 +#: ../../library/stdtypes.rst:4202 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" msgstr "" -#: ../../library/stdtypes.rst:4198 +#: ../../library/stdtypes.rst:4204 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" msgstr "" -#: ../../library/stdtypes.rst:4203 +#: ../../library/stdtypes.rst:4209 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" -#: ../../library/stdtypes.rst:4207 +#: ../../library/stdtypes.rst:4213 msgid "Test *x* for membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4211 +#: ../../library/stdtypes.rst:4217 msgid "Test *x* for non-membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4215 +#: ../../library/stdtypes.rst:4221 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:4221 +#: ../../library/stdtypes.rst:4227 msgid "Test whether every element in the set is in *other*." msgstr "" -#: ../../library/stdtypes.rst:4225 +#: ../../library/stdtypes.rst:4231 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4231 +#: ../../library/stdtypes.rst:4237 msgid "Test whether every element in *other* is in the set." msgstr "" -#: ../../library/stdtypes.rst:4235 +#: ../../library/stdtypes.rst:4241 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4241 +#: ../../library/stdtypes.rst:4247 msgid "Return a new set with elements from the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4246 +#: ../../library/stdtypes.rst:4252 msgid "Return a new set with elements common to the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4251 +#: ../../library/stdtypes.rst:4257 msgid "Return a new set with elements in the set that are not in the others." msgstr "" -#: ../../library/stdtypes.rst:4256 +#: ../../library/stdtypes.rst:4262 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" -#: ../../library/stdtypes.rst:4260 +#: ../../library/stdtypes.rst:4266 msgid "Return a shallow copy of the set." msgstr "" -#: ../../library/stdtypes.rst:4263 +#: ../../library/stdtypes.rst:4269 msgid "" "Note, the non-operator versions of :meth:`union`, :meth:`intersection`, :" "meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and :meth:" @@ -4467,7 +4479,7 @@ msgid "" "the more readable ``set('abc').intersection('cbs')``." msgstr "" -#: ../../library/stdtypes.rst:4270 +#: ../../library/stdtypes.rst:4276 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 " @@ -4477,14 +4489,14 @@ msgid "" "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -#: ../../library/stdtypes.rst:4277 +#: ../../library/stdtypes.rst:4283 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:4281 +#: ../../library/stdtypes.rst:4287 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 " @@ -4492,71 +4504,71 @@ msgid "" "``ab``." msgstr "" -#: ../../library/stdtypes.rst:4286 +#: ../../library/stdtypes.rst:4292 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:4289 +#: ../../library/stdtypes.rst:4295 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:4291 +#: ../../library/stdtypes.rst:4297 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:4295 +#: ../../library/stdtypes.rst:4301 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" msgstr "" -#: ../../library/stdtypes.rst:4301 +#: ../../library/stdtypes.rst:4307 msgid "Update the set, adding elements from all others." msgstr "" -#: ../../library/stdtypes.rst:4306 +#: ../../library/stdtypes.rst:4312 msgid "Update the set, keeping only elements found in it and all others." msgstr "" -#: ../../library/stdtypes.rst:4311 +#: ../../library/stdtypes.rst:4317 msgid "Update the set, removing elements found in others." msgstr "" -#: ../../library/stdtypes.rst:4316 +#: ../../library/stdtypes.rst:4322 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" -#: ../../library/stdtypes.rst:4320 +#: ../../library/stdtypes.rst:4326 msgid "Add element *elem* to the set." msgstr "" -#: ../../library/stdtypes.rst:4324 +#: ../../library/stdtypes.rst:4330 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." msgstr "" -#: ../../library/stdtypes.rst:4329 +#: ../../library/stdtypes.rst:4335 msgid "Remove element *elem* from the set if it is present." msgstr "" -#: ../../library/stdtypes.rst:4333 +#: ../../library/stdtypes.rst:4339 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." msgstr "" -#: ../../library/stdtypes.rst:4338 +#: ../../library/stdtypes.rst:4344 msgid "Remove all elements from the set." msgstr "" -#: ../../library/stdtypes.rst:4341 +#: ../../library/stdtypes.rst:4347 msgid "" "Note, the non-operator versions of the :meth:`update`, :meth:" "`intersection_update`, :meth:`difference_update`, and :meth:" @@ -4564,18 +4576,18 @@ msgid "" "argument." msgstr "" -#: ../../library/stdtypes.rst:4346 +#: ../../library/stdtypes.rst:4352 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:4354 +#: ../../library/stdtypes.rst:4360 msgid "Mapping Types --- :class:`dict`" msgstr "" -#: ../../library/stdtypes.rst:4364 +#: ../../library/stdtypes.rst:4370 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -4584,7 +4596,7 @@ msgid "" "module.)" msgstr "" -#: ../../library/stdtypes.rst:4370 +#: ../../library/stdtypes.rst:4376 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -4593,33 +4605,33 @@ msgid "" "and ``True``) can be used interchangeably to index the same dictionary entry." msgstr "" -#: ../../library/stdtypes.rst:4381 +#: ../../library/stdtypes.rst:4387 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:4384 +#: ../../library/stdtypes.rst:4390 msgid "Dictionaries can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4386 +#: ../../library/stdtypes.rst:4392 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:4388 +#: ../../library/stdtypes.rst:4394 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" -#: ../../library/stdtypes.rst:4389 +#: ../../library/stdtypes.rst:4395 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" msgstr "" -#: ../../library/stdtypes.rst:4392 +#: ../../library/stdtypes.rst:4398 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 " @@ -4631,7 +4643,7 @@ msgid "" "value for that key becomes the corresponding value in the new dictionary." msgstr "" -#: ../../library/stdtypes.rst:4402 +#: ../../library/stdtypes.rst:4408 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 " @@ -4639,39 +4651,39 @@ msgid "" "the value from the positional argument." msgstr "" -#: ../../library/stdtypes.rst:4407 +#: ../../library/stdtypes.rst:4413 msgid "" "To illustrate, the following examples all return a dictionary equal to " "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -#: ../../library/stdtypes.rst:4419 +#: ../../library/stdtypes.rst:4425 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:4423 +#: ../../library/stdtypes.rst:4429 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -#: ../../library/stdtypes.rst:4428 +#: ../../library/stdtypes.rst:4434 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4432 +#: ../../library/stdtypes.rst:4438 msgid "Return the number of items in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4436 +#: ../../library/stdtypes.rst:4442 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." msgstr "" -#: ../../library/stdtypes.rst:4441 +#: ../../library/stdtypes.rst:4447 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 " @@ -4682,51 +4694,51 @@ msgid "" "an instance variable::" msgstr "" -#: ../../library/stdtypes.rst:4459 +#: ../../library/stdtypes.rst:4465 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:4465 +#: ../../library/stdtypes.rst:4471 msgid "Set ``d[key]`` to *value*." msgstr "" -#: ../../library/stdtypes.rst:4469 +#: ../../library/stdtypes.rst:4475 msgid "" "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the " "map." msgstr "" -#: ../../library/stdtypes.rst:4474 +#: ../../library/stdtypes.rst:4480 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "" -#: ../../library/stdtypes.rst:4478 +#: ../../library/stdtypes.rst:4484 msgid "Equivalent to ``not key in d``." msgstr "" -#: ../../library/stdtypes.rst:4482 +#: ../../library/stdtypes.rst:4488 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4487 +#: ../../library/stdtypes.rst:4493 msgid "Remove all items from the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4491 +#: ../../library/stdtypes.rst:4497 msgid "Return a shallow copy of the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4495 +#: ../../library/stdtypes.rst:4501 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" -#: ../../library/stdtypes.rst:4497 +#: ../../library/stdtypes.rst:4503 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 " @@ -4735,70 +4747,70 @@ msgid "" "` instead." msgstr "" -#: ../../library/stdtypes.rst:4505 +#: ../../library/stdtypes.rst:4511 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:4511 +#: ../../library/stdtypes.rst:4517 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4516 +#: ../../library/stdtypes.rst:4522 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." msgstr "" -#: ../../library/stdtypes.rst:4521 +#: ../../library/stdtypes.rst:4527 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:4527 +#: ../../library/stdtypes.rst:4533 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:4530 +#: ../../library/stdtypes.rst:4536 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:4534 +#: ../../library/stdtypes.rst:4540 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." msgstr "" -#: ../../library/stdtypes.rst:4540 +#: ../../library/stdtypes.rst:4546 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4547 +#: ../../library/stdtypes.rst:4553 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:4553 +#: ../../library/stdtypes.rst:4559 msgid "" "Update the dictionary with the key/value pairs from *other*, overwriting " "existing keys. Return ``None``." msgstr "" -#: ../../library/stdtypes.rst:4556 +#: ../../library/stdtypes.rst:4562 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 " @@ -4806,71 +4818,71 @@ msgid "" "pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:4563 +#: ../../library/stdtypes.rst:4569 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4566 +#: ../../library/stdtypes.rst:4572 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:4576 +#: ../../library/stdtypes.rst:4582 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:4584 +#: ../../library/stdtypes.rst:4590 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:4590 +#: ../../library/stdtypes.rst:4596 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:4594 +#: ../../library/stdtypes.rst:4600 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:4612 +#: ../../library/stdtypes.rst:4618 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:4616 +#: ../../library/stdtypes.rst:4622 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:4628 +#: ../../library/stdtypes.rst:4634 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4633 +#: ../../library/stdtypes.rst:4639 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:4640 +#: ../../library/stdtypes.rst:4646 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:4642 +#: ../../library/stdtypes.rst:4648 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 " @@ -4878,23 +4890,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:4647 +#: ../../library/stdtypes.rst:4653 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:4652 +#: ../../library/stdtypes.rst:4658 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4656 +#: ../../library/stdtypes.rst:4662 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4659 +#: ../../library/stdtypes.rst:4665 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -4902,39 +4914,39 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:4664 +#: ../../library/stdtypes.rst:4670 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:4667 +#: ../../library/stdtypes.rst:4673 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:4672 +#: ../../library/stdtypes.rst:4678 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:4677 +#: ../../library/stdtypes.rst:4683 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:4680 +#: ../../library/stdtypes.rst:4686 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4685 +#: ../../library/stdtypes.rst:4691 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:4690 +#: ../../library/stdtypes.rst:4696 msgid "" "Keys views are set-like since their entries are unique and hashable. If all " "values are hashable, so that ``(key, value)`` pairs are unique and hashable, " @@ -4944,15 +4956,15 @@ msgid "" "abc.Set` are available (for example, ``==``, ``<``, or ``^``)." msgstr "" -#: ../../library/stdtypes.rst:4697 +#: ../../library/stdtypes.rst:4703 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:4738 +#: ../../library/stdtypes.rst:4744 msgid "Context Manager Types" msgstr "" -#: ../../library/stdtypes.rst:4745 +#: ../../library/stdtypes.rst:4751 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 " @@ -4960,7 +4972,7 @@ msgid "" "before the statement body is executed and exited when the statement ends:" msgstr "" -#: ../../library/stdtypes.rst:4753 +#: ../../library/stdtypes.rst:4759 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 " @@ -4968,14 +4980,14 @@ msgid "" "using this context manager." msgstr "" -#: ../../library/stdtypes.rst:4758 +#: ../../library/stdtypes.rst:4764 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:4762 +#: ../../library/stdtypes.rst:4768 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 " @@ -4985,7 +4997,7 @@ msgid "" "the :keyword:`!with` statement." msgstr "" -#: ../../library/stdtypes.rst:4772 +#: ../../library/stdtypes.rst:4778 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -4994,7 +5006,7 @@ msgid "" "arguments are ``None``." msgstr "" -#: ../../library/stdtypes.rst:4777 +#: ../../library/stdtypes.rst:4783 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -5005,7 +5017,7 @@ msgid "" "statement." msgstr "" -#: ../../library/stdtypes.rst:4784 +#: ../../library/stdtypes.rst:4790 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -5014,7 +5026,7 @@ msgid "" "method has actually failed." msgstr "" -#: ../../library/stdtypes.rst:4790 +#: ../../library/stdtypes.rst:4796 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -5023,7 +5035,7 @@ msgid "" "management protocol. See the :mod:`contextlib` module for some examples." msgstr "" -#: ../../library/stdtypes.rst:4796 +#: ../../library/stdtypes.rst:4802 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -5033,7 +5045,7 @@ msgid "" "rather than the iterator produced by an undecorated generator function." msgstr "" -#: ../../library/stdtypes.rst:4803 +#: ../../library/stdtypes.rst:4809 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 " @@ -5042,23 +5054,23 @@ msgid "" "a single class dictionary lookup is negligible." msgstr "" -#: ../../library/stdtypes.rst:4811 +#: ../../library/stdtypes.rst:4817 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" msgstr "" -#: ../../library/stdtypes.rst:4816 +#: ../../library/stdtypes.rst:4822 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." msgstr "" -#: ../../library/stdtypes.rst:4823 +#: ../../library/stdtypes.rst:4829 msgid "Generic Alias Type" msgstr "" -#: ../../library/stdtypes.rst:4829 +#: ../../library/stdtypes.rst:4835 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -5068,19 +5080,19 @@ msgid "" "are intended primarily for use with :term:`type annotations `." msgstr "" -#: ../../library/stdtypes.rst:4839 +#: ../../library/stdtypes.rst:4845 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:4842 +#: ../../library/stdtypes.rst:4848 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." msgstr "" -#: ../../library/stdtypes.rst:4845 +#: ../../library/stdtypes.rst:4851 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 " @@ -5089,7 +5101,7 @@ msgid "" "`bytes`." msgstr "" -#: ../../library/stdtypes.rst:4851 +#: ../../library/stdtypes.rst:4857 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 " @@ -5098,7 +5110,7 @@ msgid "" "the :class:`str` data type and the :class:`bytes` data type:" msgstr "" -#: ../../library/stdtypes.rst:4857 +#: ../../library/stdtypes.rst:4863 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 " @@ -5106,7 +5118,7 @@ msgid "" "annotations with the ``GenericAlias`` ``re.Match[str]``." msgstr "" -#: ../../library/stdtypes.rst:4863 +#: ../../library/stdtypes.rst:4869 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." @@ -5115,21 +5127,21 @@ msgid "" "objects>` objects with ``re.Match[bytes]``." msgstr "" -#: ../../library/stdtypes.rst:4869 +#: ../../library/stdtypes.rst:4875 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:4875 +#: ../../library/stdtypes.rst:4881 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:4883 +#: ../../library/stdtypes.rst:4889 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 " @@ -5137,13 +5149,13 @@ msgid "" "of type :class:`str` and values of type :class:`int`::" msgstr "" -#: ../../library/stdtypes.rst:4891 +#: ../../library/stdtypes.rst:4897 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" msgstr "" -#: ../../library/stdtypes.rst:4899 +#: ../../library/stdtypes.rst:4905 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -5152,331 +5164,331 @@ msgid "" "discouraged, but will run without errors::" msgstr "" -#: ../../library/stdtypes.rst:4909 +#: ../../library/stdtypes.rst:4915 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "" -#: ../../library/stdtypes.rst:4920 +#: ../../library/stdtypes.rst:4926 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "" -#: ../../library/stdtypes.rst:4928 +#: ../../library/stdtypes.rst:4934 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" msgstr "" -#: ../../library/stdtypes.rst:4936 +#: ../../library/stdtypes.rst:4942 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:4947 +#: ../../library/stdtypes.rst:4953 msgid "Standard Generic Classes" msgstr "" -#: ../../library/stdtypes.rst:4949 +#: ../../library/stdtypes.rst:4955 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "" -#: ../../library/stdtypes.rst:4952 +#: ../../library/stdtypes.rst:4958 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:4953 +#: ../../library/stdtypes.rst:4959 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:4954 +#: ../../library/stdtypes.rst:4960 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:4955 +#: ../../library/stdtypes.rst:4961 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:4956 +#: ../../library/stdtypes.rst:4962 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:4957 +#: ../../library/stdtypes.rst:4963 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:4958 +#: ../../library/stdtypes.rst:4964 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:4959 +#: ../../library/stdtypes.rst:4965 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:4960 +#: ../../library/stdtypes.rst:4966 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:4961 +#: ../../library/stdtypes.rst:4967 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:4962 +#: ../../library/stdtypes.rst:4968 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:4963 +#: ../../library/stdtypes.rst:4969 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:4964 +#: ../../library/stdtypes.rst:4970 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:4965 +#: ../../library/stdtypes.rst:4971 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:4966 +#: ../../library/stdtypes.rst:4972 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:4967 +#: ../../library/stdtypes.rst:4973 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:4968 +#: ../../library/stdtypes.rst:4974 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:4969 +#: ../../library/stdtypes.rst:4975 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:4970 +#: ../../library/stdtypes.rst:4976 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:4971 +#: ../../library/stdtypes.rst:4977 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:4972 +#: ../../library/stdtypes.rst:4978 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:4973 +#: ../../library/stdtypes.rst:4979 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:4974 +#: ../../library/stdtypes.rst:4980 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:4975 +#: ../../library/stdtypes.rst:4981 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:4976 +#: ../../library/stdtypes.rst:4982 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:4977 +#: ../../library/stdtypes.rst:4983 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:4978 +#: ../../library/stdtypes.rst:4984 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:4979 +#: ../../library/stdtypes.rst:4985 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:4980 +#: ../../library/stdtypes.rst:4986 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:4981 +#: ../../library/stdtypes.rst:4987 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:4982 +#: ../../library/stdtypes.rst:4988 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:4983 +#: ../../library/stdtypes.rst:4989 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:4984 +#: ../../library/stdtypes.rst:4990 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:4985 +#: ../../library/stdtypes.rst:4991 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:4986 +#: ../../library/stdtypes.rst:4992 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:4987 +#: ../../library/stdtypes.rst:4993 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:4988 +#: ../../library/stdtypes.rst:4994 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:4989 +#: ../../library/stdtypes.rst:4995 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:4990 +#: ../../library/stdtypes.rst:4996 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:4991 +#: ../../library/stdtypes.rst:4997 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:4992 +#: ../../library/stdtypes.rst:4998 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:4993 +#: ../../library/stdtypes.rst:4999 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:4994 +#: ../../library/stdtypes.rst:5000 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:4995 +#: ../../library/stdtypes.rst:5001 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:4996 +#: ../../library/stdtypes.rst:5002 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:4997 +#: ../../library/stdtypes.rst:5003 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:4998 +#: ../../library/stdtypes.rst:5004 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:4999 +#: ../../library/stdtypes.rst:5005 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5000 +#: ../../library/stdtypes.rst:5006 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5001 +#: ../../library/stdtypes.rst:5007 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5002 +#: ../../library/stdtypes.rst:5008 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5003 +#: ../../library/stdtypes.rst:5009 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5004 +#: ../../library/stdtypes.rst:5010 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5005 +#: ../../library/stdtypes.rst:5011 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5010 +#: ../../library/stdtypes.rst:5016 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "" -#: ../../library/stdtypes.rst:5012 +#: ../../library/stdtypes.rst:5018 msgid "All parameterized generics implement special read-only attributes." msgstr "" -#: ../../library/stdtypes.rst:5016 +#: ../../library/stdtypes.rst:5022 msgid "This attribute points at the non-parameterized generic class::" msgstr "" -#: ../../library/stdtypes.rst:5024 +#: ../../library/stdtypes.rst:5030 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:5034 +#: ../../library/stdtypes.rst:5040 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" msgstr "" -#: ../../library/stdtypes.rst:5045 +#: ../../library/stdtypes.rst:5051 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:5052 +#: ../../library/stdtypes.rst:5058 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." msgstr "" -#: ../../library/stdtypes.rst:5061 +#: ../../library/stdtypes.rst:5067 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../library/stdtypes.rst:5061 +#: ../../library/stdtypes.rst:5067 msgid "Introducing Python's framework for type annotations." msgstr "" -#: ../../library/stdtypes.rst:5066 +#: ../../library/stdtypes.rst:5072 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr "" -#: ../../library/stdtypes.rst:5064 +#: ../../library/stdtypes.rst:5070 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:5069 +#: ../../library/stdtypes.rst:5075 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" msgstr "" -#: ../../library/stdtypes.rst:5069 +#: ../../library/stdtypes.rst:5075 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../library/stdtypes.rst:5078 +#: ../../library/stdtypes.rst:5084 msgid "Union Type" msgstr "" -#: ../../library/stdtypes.rst:5084 +#: ../../library/stdtypes.rst:5090 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -5485,7 +5497,7 @@ msgid "" "Union`." msgstr "" -#: ../../library/stdtypes.rst:5091 +#: ../../library/stdtypes.rst:5097 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 " @@ -5493,76 +5505,76 @@ msgid "" "class:`float`::" msgstr "" -#: ../../library/stdtypes.rst:5101 +#: ../../library/stdtypes.rst:5107 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "" -#: ../../library/stdtypes.rst:5103 +#: ../../library/stdtypes.rst:5109 msgid "Unions of unions are flattened::" msgstr "" -#: ../../library/stdtypes.rst:5107 +#: ../../library/stdtypes.rst:5113 msgid "Redundant types are removed::" msgstr "" -#: ../../library/stdtypes.rst:5111 +#: ../../library/stdtypes.rst:5117 msgid "When comparing unions, the order is ignored::" msgstr "" -#: ../../library/stdtypes.rst:5115 +#: ../../library/stdtypes.rst:5121 msgid "It is compatible with :data:`typing.Union`::" msgstr "" -#: ../../library/stdtypes.rst:5119 +#: ../../library/stdtypes.rst:5125 msgid "Optional types can be spelled as a union with ``None``::" msgstr "" -#: ../../library/stdtypes.rst:5126 +#: ../../library/stdtypes.rst:5132 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "" -#: ../../library/stdtypes.rst:5132 +#: ../../library/stdtypes.rst:5138 msgid "" "However, union objects containing :ref:`parameterized generics ` cannot be used::" msgstr "" -#: ../../library/stdtypes.rst:5140 +#: ../../library/stdtypes.rst:5146 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:5153 +#: ../../library/stdtypes.rst:5159 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:5171 +#: ../../library/stdtypes.rst:5177 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr "" -#: ../../library/stdtypes.rst:5179 +#: ../../library/stdtypes.rst:5185 msgid "Other Built-in Types" msgstr "" -#: ../../library/stdtypes.rst:5181 +#: ../../library/stdtypes.rst:5187 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:5188 +#: ../../library/stdtypes.rst:5194 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:5190 +#: ../../library/stdtypes.rst:5196 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 " @@ -5573,7 +5585,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:5197 +#: ../../library/stdtypes.rst:5203 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -5584,32 +5596,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:5205 +#: ../../library/stdtypes.rst:5211 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:5213 +#: ../../library/stdtypes.rst:5219 msgid "Classes and Class Instances" msgstr "" -#: ../../library/stdtypes.rst:5215 +#: ../../library/stdtypes.rst:5221 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "" -#: ../../library/stdtypes.rst:5221 +#: ../../library/stdtypes.rst:5227 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:5223 +#: ../../library/stdtypes.rst:5229 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:5226 +#: ../../library/stdtypes.rst:5232 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -5617,15 +5629,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:5230 +#: ../../library/stdtypes.rst:5236 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`\\ 。" -#: ../../library/stdtypes.rst:5236 +#: ../../library/stdtypes.rst:5242 msgid "Methods" msgstr "" -#: ../../library/stdtypes.rst:5240 +#: ../../library/stdtypes.rst:5246 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 " @@ -5633,7 +5645,7 @@ msgid "" "support them." msgstr "" -#: ../../library/stdtypes.rst:5245 +#: ../../library/stdtypes.rst:5251 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:" @@ -5645,7 +5657,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:5254 +#: ../../library/stdtypes.rst:5260 msgid "" "Like function objects, bound method objects support getting arbitrary " "attributes. However, since method attributes are actually stored on the " @@ -5655,15 +5667,15 @@ msgid "" "attribute, you need to explicitly set it on the underlying function object::" msgstr "" -#: ../../library/stdtypes.rst:5274 ../../library/stdtypes.rst:5305 +#: ../../library/stdtypes.rst:5280 ../../library/stdtypes.rst:5311 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`\\ 。" -#: ../../library/stdtypes.rst:5282 +#: ../../library/stdtypes.rst:5288 msgid "Code Objects" msgstr "" -#: ../../library/stdtypes.rst:5288 +#: ../../library/stdtypes.rst:5294 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -5673,23 +5685,23 @@ msgid "" "`__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:5295 +#: ../../library/stdtypes.rst:5301 msgid "" "Accessing ``__code__`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"__code__\"``." msgstr "" -#: ../../library/stdtypes.rst:5302 +#: ../../library/stdtypes.rst:5308 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:5311 +#: ../../library/stdtypes.rst:5317 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:5317 +#: ../../library/stdtypes.rst:5323 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 " @@ -5697,30 +5709,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:5322 +#: ../../library/stdtypes.rst:5328 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:5328 +#: ../../library/stdtypes.rst:5334 msgid "The Null Object" msgstr "" -#: ../../library/stdtypes.rst:5330 +#: ../../library/stdtypes.rst:5336 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:5334 +#: ../../library/stdtypes.rst:5340 msgid "It is written as ``None``." msgstr "" -#: ../../library/stdtypes.rst:5341 +#: ../../library/stdtypes.rst:5347 msgid "The Ellipsis Object" msgstr "" -#: ../../library/stdtypes.rst:5343 +#: ../../library/stdtypes.rst:5349 msgid "" "This object is commonly used by slicing (see :ref:`slicings`). It supports " "no special operations. There is exactly one ellipsis object, named :const:" @@ -5728,15 +5740,15 @@ msgid "" "`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:5348 +#: ../../library/stdtypes.rst:5354 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "" -#: ../../library/stdtypes.rst:5354 +#: ../../library/stdtypes.rst:5360 msgid "The NotImplemented Object" msgstr "" -#: ../../library/stdtypes.rst:5356 +#: ../../library/stdtypes.rst:5362 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 " @@ -5744,15 +5756,15 @@ msgid "" "``type(NotImplemented)()`` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:5361 +#: ../../library/stdtypes.rst:5367 msgid "It is written as ``NotImplemented``." msgstr "" -#: ../../library/stdtypes.rst:5367 +#: ../../library/stdtypes.rst:5373 msgid "Boolean Values" msgstr "" -#: ../../library/stdtypes.rst:5369 +#: ../../library/stdtypes.rst:5375 msgid "" "Boolean values are the two constant objects ``False`` and ``True``. They " "are used to represent truth values (although other values can also be " @@ -5763,81 +5775,81 @@ msgid "" "(see section :ref:`truth` above)." msgstr "" -#: ../../library/stdtypes.rst:5382 +#: ../../library/stdtypes.rst:5388 msgid "They are written as ``False`` and ``True``, respectively." msgstr "" -#: ../../library/stdtypes.rst:5388 +#: ../../library/stdtypes.rst:5394 msgid "Internal Objects" msgstr "" -#: ../../library/stdtypes.rst:5390 +#: ../../library/stdtypes.rst:5396 msgid "" "See :ref:`types` for this information. It describes stack frame objects, " "traceback objects, and slice objects." msgstr "" -#: ../../library/stdtypes.rst:5397 +#: ../../library/stdtypes.rst:5403 msgid "Special Attributes" msgstr "" -#: ../../library/stdtypes.rst:5399 +#: ../../library/stdtypes.rst:5405 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:5406 +#: ../../library/stdtypes.rst:5412 msgid "" "A dictionary or other mapping object used to store an object's (writable) " "attributes." msgstr "" -#: ../../library/stdtypes.rst:5412 +#: ../../library/stdtypes.rst:5418 msgid "The class to which a class instance belongs." msgstr "" -#: ../../library/stdtypes.rst:5417 +#: ../../library/stdtypes.rst:5423 msgid "The tuple of base classes of a class object." msgstr "" -#: ../../library/stdtypes.rst:5422 +#: ../../library/stdtypes.rst:5428 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:5428 +#: ../../library/stdtypes.rst:5434 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:5436 +#: ../../library/stdtypes.rst:5442 msgid "" "This attribute is a tuple of classes that are considered when looking for " "base classes during method resolution." msgstr "" -#: ../../library/stdtypes.rst:5442 +#: ../../library/stdtypes.rst:5448 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:5449 +#: ../../library/stdtypes.rst:5455 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:5460 +#: ../../library/stdtypes.rst:5466 msgid "Integer string conversion length limitation" msgstr "" -#: ../../library/stdtypes.rst:5462 +#: ../../library/stdtypes.rst:5468 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 " @@ -5845,7 +5857,7 @@ msgid "" "binary conversions are unlimited. The limit can be configured." msgstr "" -#: ../../library/stdtypes.rst:5467 +#: ../../library/stdtypes.rst:5473 msgid "" "The :class:`int` type in CPython is an abitrary length number stored in " "binary form (commonly known as a \"bignum\"). There exists no algorithm that " @@ -5855,25 +5867,25 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:5474 +#: ../../library/stdtypes.rst:5480 msgid "" "Limiting conversion size offers a practical way to avoid `CVE-2020-10735 " "`_." msgstr "" -#: ../../library/stdtypes.rst:5477 +#: ../../library/stdtypes.rst:5483 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:5481 +#: ../../library/stdtypes.rst:5487 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:5503 +#: ../../library/stdtypes.rst:5509 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -5881,94 +5893,94 @@ msgid "" "str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:5508 +#: ../../library/stdtypes.rst:5514 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:5523 +#: ../../library/stdtypes.rst:5529 msgid "Affected APIs" msgstr "" -#: ../../library/stdtypes.rst:5525 +#: ../../library/stdtypes.rst:5531 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" msgstr "" -#: ../../library/stdtypes.rst:5528 +#: ../../library/stdtypes.rst:5534 msgid "``int(string)`` with default base 10." msgstr "" -#: ../../library/stdtypes.rst:5529 +#: ../../library/stdtypes.rst:5535 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "" -#: ../../library/stdtypes.rst:5530 +#: ../../library/stdtypes.rst:5536 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:5531 +#: ../../library/stdtypes.rst:5537 msgid "``repr(integer)``" msgstr "``repr(integer)``" -#: ../../library/stdtypes.rst:5532 +#: ../../library/stdtypes.rst:5538 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, ``" "\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:5535 +#: ../../library/stdtypes.rst:5541 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:5537 +#: ../../library/stdtypes.rst:5543 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "" -#: ../../library/stdtypes.rst:5538 +#: ../../library/stdtypes.rst:5544 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr "" -#: ../../library/stdtypes.rst:5539 +#: ../../library/stdtypes.rst:5545 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr "" -#: ../../library/stdtypes.rst:5540 +#: ../../library/stdtypes.rst:5546 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr "" -#: ../../library/stdtypes.rst:5541 +#: ../../library/stdtypes.rst:5547 msgid ":class:`str` to :class:`float`." msgstr "" -#: ../../library/stdtypes.rst:5542 +#: ../../library/stdtypes.rst:5548 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr "" -#: ../../library/stdtypes.rst:5545 +#: ../../library/stdtypes.rst:5551 msgid "Configuring the limit" msgstr "" -#: ../../library/stdtypes.rst:5547 +#: ../../library/stdtypes.rst:5553 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:5550 +#: ../../library/stdtypes.rst:5556 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:5553 +#: ../../library/stdtypes.rst:5559 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" msgstr "" -#: ../../library/stdtypes.rst:5555 +#: ../../library/stdtypes.rst:5561 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 " @@ -5977,38 +5989,38 @@ msgid "" "int_info.default_max_str_digits` was used during initilization." msgstr "" -#: ../../library/stdtypes.rst:5561 +#: ../../library/stdtypes.rst:5567 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:5564 +#: ../../library/stdtypes.rst:5570 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:5568 +#: ../../library/stdtypes.rst:5574 msgid "" "Information about the default and minimum can be found in :attr:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:5570 +#: ../../library/stdtypes.rst:5576 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:5572 +#: ../../library/stdtypes.rst:5578 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:5579 +#: ../../library/stdtypes.rst:5585 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 " @@ -6020,7 +6032,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:5588 +#: ../../library/stdtypes.rst:5594 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 " @@ -6028,11 +6040,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:5594 +#: ../../library/stdtypes.rst:5600 msgid "Recommended configuration" msgstr "" -#: ../../library/stdtypes.rst:5596 +#: ../../library/stdtypes.rst:5602 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 " @@ -6040,45 +6052,45 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.11." msgstr "" -#: ../../library/stdtypes.rst:5601 +#: ../../library/stdtypes.rst:5607 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/stdtypes.rst:5613 +#: ../../library/stdtypes.rst:5619 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:5617 +#: ../../library/stdtypes.rst:5623 msgid "Footnotes" msgstr "註解" -#: ../../library/stdtypes.rst:5618 +#: ../../library/stdtypes.rst:5624 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:5621 +#: ../../library/stdtypes.rst:5627 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:5624 +#: ../../library/stdtypes.rst:5630 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:5626 +#: ../../library/stdtypes.rst:5632 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:5629 +#: ../../library/stdtypes.rst:5635 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." From 407884c92a8f66c36233c6a59aac4ce349c4e53f Mon Sep 17 00:00:00 2001 From: "Matt.Wang" Date: Sat, 12 Nov 2022 14:44:50 +0800 Subject: [PATCH 4/5] fix: resolve fuzzy entry --- library/index.po | 1 - 1 file changed, 1 deletion(-) diff --git a/library/index.po b/library/index.po index 1cedfc5b08..359ad0f479 100644 --- a/library/index.po +++ b/library/index.po @@ -69,7 +69,6 @@ msgstr "" "或全部的可選組件,可能都必須使用該作業系統提供的套件管理工具來安裝。" #: ../../library/index.rst:30 -#, fuzzy msgid "" "In addition to the standard library, there is an active collection of " "hundreds of thousands of components (from individual programs and modules to " From be6bac3c6f2703094f27e2038e93f223a63a7b78 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 12 Nov 2022 06:59:48 +0000 Subject: [PATCH 5/5] sync with cpython 92b531b8 --- faq/programming.po | 298 ++++++++-------- library/sys.po | 862 +++++++++++++++++++++++---------------------- 2 files changed, 590 insertions(+), 570 deletions(-) diff --git a/faq/programming.po b/faq/programming.po index 674a80b980..a20b3e5d61 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-04 00:20+0000\n" +"POT-Creation-Date: 2022-11-12 06:58+0000\n" "PO-Revision-Date: 2018-05-23 14:35+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1446,37 +1446,45 @@ msgid "" msgstr "" #: ../../faq/programming.rst:1283 -msgid "How do I apply a method to a sequence of objects?" +msgid "How do I apply a method or function to a sequence of objects?" msgstr "" #: ../../faq/programming.rst:1285 -msgid "Use a list comprehension::" +msgid "" +"To call a method or function and accumulate the return values is a list, a :" +"term:`list comprehension` is an elegant solution::" msgstr "" #: ../../faq/programming.rst:1292 msgid "" +"To just run the method or function without saving the return values, a " +"plain :keyword:`for` loop will suffice::" +msgstr "" + +#: ../../faq/programming.rst:1304 +msgid "" "Why does a_tuple[i] += ['item'] raise an exception when the addition works?" msgstr "" -#: ../../faq/programming.rst:1294 +#: ../../faq/programming.rst:1306 msgid "" "This is because of a combination of the fact that augmented assignment " "operators are *assignment* operators, and the difference between mutable and " "immutable objects in Python." msgstr "" -#: ../../faq/programming.rst:1298 +#: ../../faq/programming.rst:1310 msgid "" "This discussion applies in general when augmented assignment operators are " "applied to elements of a tuple that point to mutable objects, but we'll use " "a ``list`` and ``+=`` as our exemplar." msgstr "" -#: ../../faq/programming.rst:1302 +#: ../../faq/programming.rst:1314 msgid "If you wrote::" msgstr "" -#: ../../faq/programming.rst:1310 +#: ../../faq/programming.rst:1322 msgid "" "The reason for the exception should be immediately clear: ``1`` is added to " "the object ``a_tuple[0]`` points to (``1``), producing the result object, " @@ -1485,29 +1493,29 @@ msgid "" "an element of a tuple points to." msgstr "" -#: ../../faq/programming.rst:1316 +#: ../../faq/programming.rst:1328 msgid "" "Under the covers, what this augmented assignment statement is doing is " "approximately this::" msgstr "" -#: ../../faq/programming.rst:1325 +#: ../../faq/programming.rst:1337 msgid "" "It is the assignment part of the operation that produces the error, since a " "tuple is immutable." msgstr "" -#: ../../faq/programming.rst:1328 +#: ../../faq/programming.rst:1340 msgid "When you write something like::" msgstr "" -#: ../../faq/programming.rst:1336 +#: ../../faq/programming.rst:1348 msgid "" "The exception is a bit more surprising, and even more surprising is the fact " "that even though there was an error, the append worked::" msgstr "" -#: ../../faq/programming.rst:1342 +#: ../../faq/programming.rst:1354 msgid "" "To see why this happens, you need to know that (a) if an object implements " "an :meth:`~object.__iadd__` magic method, it gets called when the ``+=`` " @@ -1518,14 +1526,14 @@ msgid "" "extend`::" msgstr "" -#: ../../faq/programming.rst:1355 +#: ../../faq/programming.rst:1367 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../faq/programming.rst:1360 +#: ../../faq/programming.rst:1372 msgid "" "The object pointed to by a_list has been mutated, and the pointer to the " "mutated object is assigned back to ``a_list``. The end result of the " @@ -1533,11 +1541,11 @@ msgid "" "``a_list`` was previously pointing to, but the assignment still happens." msgstr "" -#: ../../faq/programming.rst:1365 +#: ../../faq/programming.rst:1377 msgid "Thus, in our tuple example what is happening is equivalent to::" msgstr "" -#: ../../faq/programming.rst:1373 +#: ../../faq/programming.rst:1385 msgid "" "The :meth:`!__iadd__` succeeds, and thus the list is extended, but even " "though ``result`` points to the same object that ``a_tuple[0]`` already " @@ -1545,13 +1553,13 @@ msgid "" "are immutable." msgstr "" -#: ../../faq/programming.rst:1379 +#: ../../faq/programming.rst:1391 msgid "" "I want to do a complicated sort: can you do a Schwartzian Transform in " "Python?" msgstr "" -#: ../../faq/programming.rst:1381 +#: ../../faq/programming.rst:1393 msgid "" "The technique, attributed to Randal Schwartz of the Perl community, sorts " "the elements of a list by a metric which maps each element to its \"sort " @@ -1559,25 +1567,25 @@ msgid "" "method::" msgstr "" -#: ../../faq/programming.rst:1390 +#: ../../faq/programming.rst:1402 msgid "How can I sort one list by values from another list?" msgstr "" -#: ../../faq/programming.rst:1392 +#: ../../faq/programming.rst:1404 msgid "" "Merge them into an iterator of tuples, sort the resulting list, and then " "pick out the element you want. ::" msgstr "" -#: ../../faq/programming.rst:1407 +#: ../../faq/programming.rst:1419 msgid "Objects" msgstr "" -#: ../../faq/programming.rst:1410 +#: ../../faq/programming.rst:1422 msgid "What is a class?" msgstr "" -#: ../../faq/programming.rst:1412 +#: ../../faq/programming.rst:1424 msgid "" "A class is the particular object type created by executing a class " "statement. Class objects are used as templates to create instance objects, " @@ -1585,7 +1593,7 @@ msgid "" "datatype." msgstr "" -#: ../../faq/programming.rst:1416 +#: ../../faq/programming.rst:1428 msgid "" "A class can be based on one or more other classes, called its base " "class(es). It then inherits the attributes and methods of its base classes. " @@ -1595,22 +1603,22 @@ msgid "" "``OutlookMailbox`` that handle various specific mailbox formats." msgstr "" -#: ../../faq/programming.rst:1425 +#: ../../faq/programming.rst:1437 msgid "What is a method?" msgstr "" -#: ../../faq/programming.rst:1427 +#: ../../faq/programming.rst:1439 msgid "" "A method is a function on some object ``x`` that you normally call as ``x." "name(arguments...)``. Methods are defined as functions inside the class " "definition::" msgstr "" -#: ../../faq/programming.rst:1437 +#: ../../faq/programming.rst:1449 msgid "What is self?" msgstr "" -#: ../../faq/programming.rst:1439 +#: ../../faq/programming.rst:1451 msgid "" "Self is merely a conventional name for the first argument of a method. A " "method defined as ``meth(self, a, b, c)`` should be called as ``x.meth(a, b, " @@ -1618,17 +1626,17 @@ msgid "" "the called method will think it is called as ``meth(x, a, b, c)``." msgstr "" -#: ../../faq/programming.rst:1444 +#: ../../faq/programming.rst:1456 msgid "See also :ref:`why-self`." msgstr "另請參閱 :ref:`why-self`\\ 。" -#: ../../faq/programming.rst:1448 +#: ../../faq/programming.rst:1460 msgid "" "How do I check if an object is an instance of a given class or of a subclass " "of it?" msgstr "" -#: ../../faq/programming.rst:1450 +#: ../../faq/programming.rst:1462 msgid "" "Use the built-in function :func:`isinstance(obj, cls) `. You " "can check if an object is an instance of any of a number of classes by " @@ -1638,7 +1646,7 @@ msgid "" "float, complex))``." msgstr "" -#: ../../faq/programming.rst:1457 +#: ../../faq/programming.rst:1469 msgid "" "Note that :func:`isinstance` also checks for virtual inheritance from an :" "term:`abstract base class`. So, the test will return ``True`` for a " @@ -1646,7 +1654,7 @@ msgid "" "To test for \"true inheritance\", scan the :term:`MRO` of the class:" msgstr "" -#: ../../faq/programming.rst:1492 +#: ../../faq/programming.rst:1504 msgid "" "Note that most programs do not use :func:`isinstance` on user-defined " "classes very often. If you are developing the classes yourself, a more " @@ -1656,17 +1664,17 @@ msgid "" "have a function that does something::" msgstr "" -#: ../../faq/programming.rst:1506 +#: ../../faq/programming.rst:1518 msgid "" "A better approach is to define a ``search()`` method on all the classes and " "just call it::" msgstr "" -#: ../../faq/programming.rst:1521 +#: ../../faq/programming.rst:1533 msgid "What is delegation?" msgstr "" -#: ../../faq/programming.rst:1523 +#: ../../faq/programming.rst:1535 msgid "" "Delegation is an object oriented technique (also called a design pattern). " "Let's say you have an object ``x`` and want to change the behaviour of just " @@ -1675,14 +1683,14 @@ msgid "" "other methods to the corresponding method of ``x``." msgstr "" -#: ../../faq/programming.rst:1529 +#: ../../faq/programming.rst:1541 msgid "" "Python programmers can easily implement delegation. For example, the " "following class implements a class that behaves like a file but converts all " "written data to uppercase::" msgstr "" -#: ../../faq/programming.rst:1544 +#: ../../faq/programming.rst:1556 msgid "" "Here the ``UpperOut`` class redefines the ``write()`` method to convert the " "argument string to uppercase before calling the underlying ``self._outfile." @@ -1692,7 +1700,7 @@ msgid "" "access>` for more information about controlling attribute access." msgstr "" -#: ../../faq/programming.rst:1551 +#: ../../faq/programming.rst:1563 msgid "" "Note that for more general cases delegation can get trickier. When " "attributes must be set as well as retrieved, the class must define a :meth:" @@ -1701,24 +1709,24 @@ msgid "" "following::" msgstr "" -#: ../../faq/programming.rst:1562 +#: ../../faq/programming.rst:1574 msgid "" "Most :meth:`!__setattr__` implementations must modify :meth:`self.__dict__ " "` to store local state for self without causing an infinite " "recursion." msgstr "" -#: ../../faq/programming.rst:1568 +#: ../../faq/programming.rst:1580 msgid "" "How do I call a method defined in a base class from a derived class that " "extends it?" msgstr "" -#: ../../faq/programming.rst:1570 +#: ../../faq/programming.rst:1582 msgid "Use the built-in :func:`super` function::" msgstr "" -#: ../../faq/programming.rst:1576 +#: ../../faq/programming.rst:1588 msgid "" "In the example, :func:`super` will automatically determine the instance from " "which it was called (the ``self`` value), look up the :term:`method " @@ -1726,11 +1734,11 @@ msgid "" "line after ``Derived`` in the MRO: ``Base``." msgstr "" -#: ../../faq/programming.rst:1583 +#: ../../faq/programming.rst:1595 msgid "How can I organize my code to make it easier to change the base class?" msgstr "" -#: ../../faq/programming.rst:1585 +#: ../../faq/programming.rst:1597 msgid "" "You could assign the base class to an alias and derive from the alias. Then " "all you have to change is the value assigned to the alias. Incidentally, " @@ -1738,30 +1746,30 @@ msgid "" "on availability of resources) which base class to use. Example::" msgstr "" -#: ../../faq/programming.rst:1600 +#: ../../faq/programming.rst:1612 msgid "How do I create static class data and static class methods?" msgstr "" -#: ../../faq/programming.rst:1602 +#: ../../faq/programming.rst:1614 msgid "" "Both static data and static methods (in the sense of C++ or Java) are " "supported in Python." msgstr "" -#: ../../faq/programming.rst:1605 +#: ../../faq/programming.rst:1617 msgid "" "For static data, simply define a class attribute. To assign a new value to " "the attribute, you have to explicitly use the class name in the assignment::" msgstr "" -#: ../../faq/programming.rst:1617 +#: ../../faq/programming.rst:1629 msgid "" "``c.count`` also refers to ``C.count`` for any ``c`` such that " "``isinstance(c, C)`` holds, unless overridden by ``c`` itself or by some " "class on the base-class search path from ``c.__class__`` back to ``C``." msgstr "" -#: ../../faq/programming.rst:1621 +#: ../../faq/programming.rst:1633 msgid "" "Caution: within a method of C, an assignment like ``self.count = 42`` " "creates a new and unrelated instance named \"count\" in ``self``'s own " @@ -1769,59 +1777,59 @@ msgid "" "whether inside a method or not::" msgstr "" -#: ../../faq/programming.rst:1628 +#: ../../faq/programming.rst:1640 msgid "Static methods are possible::" msgstr "" -#: ../../faq/programming.rst:1636 +#: ../../faq/programming.rst:1648 msgid "" "However, a far more straightforward way to get the effect of a static method " "is via a simple module-level function::" msgstr "" -#: ../../faq/programming.rst:1642 +#: ../../faq/programming.rst:1654 msgid "" "If your code is structured so as to define one class (or tightly related " "class hierarchy) per module, this supplies the desired encapsulation." msgstr "" -#: ../../faq/programming.rst:1647 +#: ../../faq/programming.rst:1659 msgid "How can I overload constructors (or methods) in Python?" msgstr "" -#: ../../faq/programming.rst:1649 +#: ../../faq/programming.rst:1661 msgid "" "This answer actually applies to all methods, but the question usually comes " "up first in the context of constructors." msgstr "" -#: ../../faq/programming.rst:1652 +#: ../../faq/programming.rst:1664 msgid "In C++ you'd write" msgstr "" -#: ../../faq/programming.rst:1661 +#: ../../faq/programming.rst:1673 msgid "" "In Python you have to write a single constructor that catches all cases " "using default arguments. For example::" msgstr "" -#: ../../faq/programming.rst:1671 +#: ../../faq/programming.rst:1683 msgid "This is not entirely equivalent, but close enough in practice." msgstr "" -#: ../../faq/programming.rst:1673 +#: ../../faq/programming.rst:1685 msgid "You could also try a variable-length argument list, e.g. ::" msgstr "" -#: ../../faq/programming.rst:1678 +#: ../../faq/programming.rst:1690 msgid "The same approach works for all method definitions." msgstr "" -#: ../../faq/programming.rst:1682 +#: ../../faq/programming.rst:1694 msgid "I try to use __spam and I get an error about _SomeClassName__spam." msgstr "" -#: ../../faq/programming.rst:1684 +#: ../../faq/programming.rst:1696 msgid "" "Variable names with double leading underscores are \"mangled\" to provide a " "simple but effective way to define class private variables. Any identifier " @@ -1831,7 +1839,7 @@ msgid "" "stripped." msgstr "" -#: ../../faq/programming.rst:1690 +#: ../../faq/programming.rst:1702 msgid "" "This doesn't guarantee privacy: an outside user can still deliberately " "access the \"_classname__spam\" attribute, and private values are visible in " @@ -1839,22 +1847,22 @@ msgid "" "private variable names at all." msgstr "" -#: ../../faq/programming.rst:1697 +#: ../../faq/programming.rst:1709 msgid "My class defines __del__ but it is not called when I delete the object." msgstr "" -#: ../../faq/programming.rst:1699 +#: ../../faq/programming.rst:1711 msgid "There are several possible reasons for this." msgstr "" -#: ../../faq/programming.rst:1701 +#: ../../faq/programming.rst:1713 msgid "" "The :keyword:`del` statement does not necessarily call :meth:`~object." "__del__` -- it simply decrements the object's reference count, and if this " "reaches zero :meth:`!__del__` is called." msgstr "" -#: ../../faq/programming.rst:1705 +#: ../../faq/programming.rst:1717 msgid "" "If your data structures contain circular links (e.g. a tree where each child " "has a parent reference and each parent has a list of children) the reference " @@ -1868,7 +1876,7 @@ msgid "" "cases where objects will never be collected." msgstr "" -#: ../../faq/programming.rst:1716 +#: ../../faq/programming.rst:1728 msgid "" "Despite the cycle collector, it's still a good idea to define an explicit " "``close()`` method on objects to be called whenever you're done with them. " @@ -1878,7 +1886,7 @@ msgid "" "once for the same object." msgstr "" -#: ../../faq/programming.rst:1723 +#: ../../faq/programming.rst:1735 msgid "" "Another way to avoid cyclical references is to use the :mod:`weakref` " "module, which allows you to point to objects without incrementing their " @@ -1886,28 +1894,28 @@ msgid "" "references for their parent and sibling references (if they need them!)." msgstr "" -#: ../../faq/programming.rst:1736 +#: ../../faq/programming.rst:1748 msgid "" "Finally, if your :meth:`!__del__` method raises an exception, a warning " "message is printed to :data:`sys.stderr`." msgstr "" -#: ../../faq/programming.rst:1741 +#: ../../faq/programming.rst:1753 msgid "How do I get a list of all instances of a given class?" msgstr "" -#: ../../faq/programming.rst:1743 +#: ../../faq/programming.rst:1755 msgid "" "Python does not keep track of all instances of a class (or of a built-in " "type). You can program the class's constructor to keep track of all " "instances by keeping a list of weak references to each instance." msgstr "" -#: ../../faq/programming.rst:1749 +#: ../../faq/programming.rst:1761 msgid "Why does the result of ``id()`` appear to be not unique?" msgstr "" -#: ../../faq/programming.rst:1751 +#: ../../faq/programming.rst:1763 msgid "" "The :func:`id` builtin returns an integer that is guaranteed to be unique " "during the lifetime of the object. Since in CPython, this is the object's " @@ -1916,7 +1924,7 @@ msgid "" "memory. This is illustrated by this example:" msgstr "" -#: ../../faq/programming.rst:1762 +#: ../../faq/programming.rst:1774 msgid "" "The two ids belong to different integer objects that are created before, and " "deleted immediately after execution of the ``id()`` call. To be sure that " @@ -1924,17 +1932,17 @@ msgid "" "reference to the object:" msgstr "" -#: ../../faq/programming.rst:1775 +#: ../../faq/programming.rst:1787 msgid "When can I rely on identity tests with the *is* operator?" msgstr "" -#: ../../faq/programming.rst:1777 +#: ../../faq/programming.rst:1789 msgid "" "The ``is`` operator tests for object identity. The test ``a is b`` is " "equivalent to ``id(a) == id(b)``." msgstr "" -#: ../../faq/programming.rst:1780 +#: ../../faq/programming.rst:1792 msgid "" "The most important property of an identity test is that an object is always " "identical to itself, ``a is a`` always returns ``True``. Identity tests are " @@ -1942,34 +1950,34 @@ msgid "" "tests are guaranteed to return a boolean ``True`` or ``False``." msgstr "" -#: ../../faq/programming.rst:1785 +#: ../../faq/programming.rst:1797 msgid "" "However, identity tests can *only* be substituted for equality tests when " "object identity is assured. Generally, there are three circumstances where " "identity is guaranteed:" msgstr "" -#: ../../faq/programming.rst:1789 +#: ../../faq/programming.rst:1801 msgid "" "1) Assignments create new names but do not change object identity. After " "the assignment ``new = old``, it is guaranteed that ``new is old``." msgstr "" -#: ../../faq/programming.rst:1792 +#: ../../faq/programming.rst:1804 msgid "" "2) Putting an object in a container that stores object references does not " "change object identity. After the list assignment ``s[0] = x``, it is " "guaranteed that ``s[0] is x``." msgstr "" -#: ../../faq/programming.rst:1796 +#: ../../faq/programming.rst:1808 msgid "" "3) If an object is a singleton, it means that only one instance of that " "object can exist. After the assignments ``a = None`` and ``b = None``, it " "is guaranteed that ``a is b`` because ``None`` is a singleton." msgstr "" -#: ../../faq/programming.rst:1800 +#: ../../faq/programming.rst:1812 msgid "" "In most other circumstances, identity tests are inadvisable and equality " "tests are preferred. In particular, identity tests should not be used to " @@ -1977,17 +1985,17 @@ msgid "" "guaranteed to be singletons::" msgstr "" -#: ../../faq/programming.rst:1817 +#: ../../faq/programming.rst:1829 msgid "Likewise, new instances of mutable containers are never identical::" msgstr "" -#: ../../faq/programming.rst:1824 +#: ../../faq/programming.rst:1836 msgid "" "In the standard library code, you will see several common patterns for " "correctly using identity tests:" msgstr "" -#: ../../faq/programming.rst:1827 +#: ../../faq/programming.rst:1839 msgid "" "1) As recommended by :pep:`8`, an identity test is the preferred way to " "check for ``None``. This reads like plain English in code and avoids " @@ -1995,7 +2003,7 @@ msgid "" "false." msgstr "" -#: ../../faq/programming.rst:1831 +#: ../../faq/programming.rst:1843 msgid "" "2) Detecting optional arguments can be tricky when ``None`` is a valid input " "value. In those situations, you can create a singleton sentinel object " @@ -2003,25 +2011,25 @@ msgid "" "implement a method that behaves like :meth:`dict.pop`::" msgstr "" -#: ../../faq/programming.rst:1847 +#: ../../faq/programming.rst:1859 msgid "" "3) Container implementations sometimes need to augment equality tests with " "identity tests. This prevents the code from being confused by objects such " "as ``float('NaN')`` that are not equal to themselves." msgstr "" -#: ../../faq/programming.rst:1851 +#: ../../faq/programming.rst:1863 msgid "" "For example, here is the implementation of :meth:`collections.abc.Sequence." "__contains__`::" msgstr "" -#: ../../faq/programming.rst:1862 +#: ../../faq/programming.rst:1874 msgid "" "How can a subclass control what data is stored in an immutable instance?" msgstr "" -#: ../../faq/programming.rst:1864 +#: ../../faq/programming.rst:1876 msgid "" "When subclassing an immutable type, override the :meth:`~object.__new__` " "method instead of the :meth:`~object.__init__` method. The latter only runs " @@ -2029,35 +2037,35 @@ msgid "" "immutable instance." msgstr "" -#: ../../faq/programming.rst:1869 +#: ../../faq/programming.rst:1881 msgid "" "All of these immutable classes have a different signature than their parent " "class:" msgstr "" -#: ../../faq/programming.rst:1895 +#: ../../faq/programming.rst:1907 msgid "The classes can be used like this:" msgstr "" -#: ../../faq/programming.rst:1912 +#: ../../faq/programming.rst:1924 msgid "How do I cache method calls?" msgstr "" -#: ../../faq/programming.rst:1914 +#: ../../faq/programming.rst:1926 msgid "" "The two principal tools for caching methods are :func:`functools." "cached_property` and :func:`functools.lru_cache`. The former stores results " "at the instance level and the latter at the class level." msgstr "" -#: ../../faq/programming.rst:1919 +#: ../../faq/programming.rst:1931 msgid "" "The *cached_property* approach only works with methods that do not take any " "arguments. It does not create a reference to the instance. The cached " "method result will be kept only as long as the instance is alive." msgstr "" -#: ../../faq/programming.rst:1923 +#: ../../faq/programming.rst:1935 msgid "" "The advantage is that when an instance is no longer used, the cached method " "result will be released right away. The disadvantage is that if instances " @@ -2065,47 +2073,47 @@ msgid "" "without bound." msgstr "" -#: ../../faq/programming.rst:1928 +#: ../../faq/programming.rst:1940 msgid "" "The *lru_cache* approach works with methods that have hashable arguments. " "It creates a reference to the instance unless special efforts are made to " "pass in weak references." msgstr "" -#: ../../faq/programming.rst:1932 +#: ../../faq/programming.rst:1944 msgid "" "The advantage of the least recently used algorithm is that the cache is " "bounded by the specified *maxsize*. The disadvantage is that instances are " "kept alive until they age out of the cache or until the cache is cleared." msgstr "" -#: ../../faq/programming.rst:1937 +#: ../../faq/programming.rst:1949 msgid "This example shows the various techniques::" msgstr "" -#: ../../faq/programming.rst:1961 +#: ../../faq/programming.rst:1973 msgid "" "The above example assumes that the *station_id* never changes. If the " "relevant instance attributes are mutable, the *cached_property* approach " "can't be made to work because it cannot detect changes to the attributes." msgstr "" -#: ../../faq/programming.rst:1966 +#: ../../faq/programming.rst:1978 msgid "" "To make the *lru_cache* approach work when the *station_id* is mutable, the " "class needs to define the :meth:`~object.__eq__` and :meth:`~object." "__hash__` methods so that the cache can detect relevant attribute updates::" msgstr "" -#: ../../faq/programming.rst:1992 +#: ../../faq/programming.rst:2004 msgid "Modules" msgstr "模組" -#: ../../faq/programming.rst:1995 +#: ../../faq/programming.rst:2007 msgid "How do I create a .pyc file?" msgstr "" -#: ../../faq/programming.rst:1997 +#: ../../faq/programming.rst:2009 msgid "" "When a module is imported for the first time (or when the source file has " "changed since the current compiled file was created) a ``.pyc`` file " @@ -2116,7 +2124,7 @@ msgid "" "particular ``python`` binary that created it. (See :pep:`3147` for details.)" msgstr "" -#: ../../faq/programming.rst:2005 +#: ../../faq/programming.rst:2017 msgid "" "One reason that a ``.pyc`` file may not be created is a permissions problem " "with the directory containing the source file, meaning that the " @@ -2125,7 +2133,7 @@ msgid "" "testing with a web server." msgstr "" -#: ../../faq/programming.rst:2010 +#: ../../faq/programming.rst:2022 msgid "" "Unless the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable is set, " "creation of a .pyc file is automatic if you're importing a module and Python " @@ -2134,7 +2142,7 @@ msgid "" "subdirectory." msgstr "" -#: ../../faq/programming.rst:2015 +#: ../../faq/programming.rst:2027 msgid "" "Running Python on a top level script is not considered an import and no ``." "pyc`` will be created. For example, if you have a top-level module ``foo." @@ -2144,27 +2152,27 @@ msgid "" "for ``foo`` since ``foo.py`` isn't being imported." msgstr "" -#: ../../faq/programming.rst:2022 +#: ../../faq/programming.rst:2034 msgid "" "If you need to create a ``.pyc`` file for ``foo`` -- that is, to create a ``." "pyc`` file for a module that is not imported -- you can, using the :mod:" "`py_compile` and :mod:`compileall` modules." msgstr "" -#: ../../faq/programming.rst:2026 +#: ../../faq/programming.rst:2038 msgid "" "The :mod:`py_compile` module can manually compile any module. One way is to " "use the ``compile()`` function in that module interactively::" msgstr "" -#: ../../faq/programming.rst:2032 +#: ../../faq/programming.rst:2044 msgid "" "This will write the ``.pyc`` to a ``__pycache__`` subdirectory in the same " "location as ``foo.py`` (or you can override that with the optional parameter " "``cfile``)." msgstr "" -#: ../../faq/programming.rst:2036 +#: ../../faq/programming.rst:2048 msgid "" "You can also automatically compile all files in a directory or directories " "using the :mod:`compileall` module. You can do it from the shell prompt by " @@ -2172,11 +2180,11 @@ msgid "" "Python files to compile::" msgstr "" -#: ../../faq/programming.rst:2045 +#: ../../faq/programming.rst:2057 msgid "How do I find the current module name?" msgstr "" -#: ../../faq/programming.rst:2047 +#: ../../faq/programming.rst:2059 msgid "" "A module can find out its own module name by looking at the predefined " "global variable ``__name__``. If this has the value ``'__main__'``, the " @@ -2185,85 +2193,85 @@ msgid "" "only execute this code after checking ``__name__``::" msgstr "" -#: ../../faq/programming.rst:2062 +#: ../../faq/programming.rst:2074 msgid "How can I have modules that mutually import each other?" msgstr "" -#: ../../faq/programming.rst:2064 +#: ../../faq/programming.rst:2076 msgid "Suppose you have the following modules:" msgstr "" -#: ../../faq/programming.rst:2066 +#: ../../faq/programming.rst:2078 msgid ":file:`foo.py`::" msgstr "" ":file:`foo.py`:\n" "\n" "::" -#: ../../faq/programming.rst:2071 +#: ../../faq/programming.rst:2083 msgid ":file:`bar.py`::" msgstr "" ":file:`bar.py`:\n" "\n" "::" -#: ../../faq/programming.rst:2076 +#: ../../faq/programming.rst:2088 msgid "The problem is that the interpreter will perform the following steps:" msgstr "" -#: ../../faq/programming.rst:2078 +#: ../../faq/programming.rst:2090 msgid "main imports ``foo``" msgstr "" -#: ../../faq/programming.rst:2079 +#: ../../faq/programming.rst:2091 msgid "Empty globals for ``foo`` are created" msgstr "" -#: ../../faq/programming.rst:2080 +#: ../../faq/programming.rst:2092 msgid "``foo`` is compiled and starts executing" msgstr "" -#: ../../faq/programming.rst:2081 +#: ../../faq/programming.rst:2093 msgid "``foo`` imports ``bar``" msgstr "" -#: ../../faq/programming.rst:2082 +#: ../../faq/programming.rst:2094 msgid "Empty globals for ``bar`` are created" msgstr "" -#: ../../faq/programming.rst:2083 +#: ../../faq/programming.rst:2095 msgid "``bar`` is compiled and starts executing" msgstr "" -#: ../../faq/programming.rst:2084 +#: ../../faq/programming.rst:2096 msgid "" "``bar`` imports ``foo`` (which is a no-op since there already is a module " "named ``foo``)" msgstr "" -#: ../../faq/programming.rst:2085 +#: ../../faq/programming.rst:2097 msgid "" "The import mechanism tries to read ``foo_var`` from ``foo`` globals, to set " "``bar.foo_var = foo.foo_var``" msgstr "" -#: ../../faq/programming.rst:2087 +#: ../../faq/programming.rst:2099 msgid "" "The last step fails, because Python isn't done with interpreting ``foo`` yet " "and the global symbol dictionary for ``foo`` is still empty." msgstr "" -#: ../../faq/programming.rst:2090 +#: ../../faq/programming.rst:2102 msgid "" "The same thing happens when you use ``import foo``, and then try to access " "``foo.foo_var`` in global code." msgstr "" -#: ../../faq/programming.rst:2093 +#: ../../faq/programming.rst:2105 msgid "There are (at least) three possible workarounds for this problem." msgstr "" -#: ../../faq/programming.rst:2095 +#: ../../faq/programming.rst:2107 msgid "" "Guido van Rossum recommends avoiding all uses of ``from import ..." "``, and placing all code inside functions. Initializations of global " @@ -2272,59 +2280,59 @@ msgid "" "``.``." msgstr "" -#: ../../faq/programming.rst:2100 +#: ../../faq/programming.rst:2112 msgid "" "Jim Roskind suggests performing steps in the following order in each module:" msgstr "" -#: ../../faq/programming.rst:2102 +#: ../../faq/programming.rst:2114 msgid "" "exports (globals, functions, and classes that don't need imported base " "classes)" msgstr "" -#: ../../faq/programming.rst:2104 +#: ../../faq/programming.rst:2116 msgid "``import`` statements" msgstr "" -#: ../../faq/programming.rst:2105 +#: ../../faq/programming.rst:2117 msgid "" "active code (including globals that are initialized from imported values)." msgstr "" -#: ../../faq/programming.rst:2107 +#: ../../faq/programming.rst:2119 msgid "" "Van Rossum doesn't like this approach much because the imports appear in a " "strange place, but it does work." msgstr "" -#: ../../faq/programming.rst:2110 +#: ../../faq/programming.rst:2122 msgid "" "Matthias Urlichs recommends restructuring your code so that the recursive " "import is not necessary in the first place." msgstr "" -#: ../../faq/programming.rst:2113 +#: ../../faq/programming.rst:2125 msgid "These solutions are not mutually exclusive." msgstr "" -#: ../../faq/programming.rst:2117 +#: ../../faq/programming.rst:2129 msgid "__import__('x.y.z') returns ; how do I get z?" msgstr "" -#: ../../faq/programming.rst:2119 +#: ../../faq/programming.rst:2131 msgid "" "Consider using the convenience function :func:`~importlib.import_module` " "from :mod:`importlib` instead::" msgstr "" -#: ../../faq/programming.rst:2126 +#: ../../faq/programming.rst:2138 msgid "" "When I edit an imported module and reimport it, the changes don't show up. " "Why does this happen?" msgstr "" -#: ../../faq/programming.rst:2128 +#: ../../faq/programming.rst:2140 msgid "" "For reasons of efficiency as well as consistency, Python only reads the " "module file on the first time a module is imported. If it didn't, in a " @@ -2333,13 +2341,13 @@ msgid "" "re-reading of a changed module, do this::" msgstr "" -#: ../../faq/programming.rst:2138 +#: ../../faq/programming.rst:2150 msgid "" "Warning: this technique is not 100% fool-proof. In particular, modules " "containing statements like ::" msgstr "" -#: ../../faq/programming.rst:2143 +#: ../../faq/programming.rst:2155 msgid "" "will continue to work with the old version of the imported objects. If the " "module contains class definitions, existing class instances will *not* be " @@ -2347,7 +2355,7 @@ msgid "" "paradoxical behaviour::" msgstr "" -#: ../../faq/programming.rst:2156 +#: ../../faq/programming.rst:2168 msgid "" "The nature of the problem is made clear if you print out the \"identity\" of " "the class objects::" diff --git a/library/sys.po b/library/sys.po index 7bb0f03927..1cadd66e8a 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2022-11-12 06:58+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-" @@ -57,13 +57,25 @@ msgid "" "terminate the process entirely." msgstr "" -#: ../../library/sys.rst:11 +#: ../../library/sys.rst:38 +msgid "" +"Note that audit hooks are primarily for collecting information about " +"internal or otherwise unobservable actions, whether by Python or libraries " +"written in Python. They are not suitable for implementing a \"sandbox\". In " +"particular, malicious code can trivially disable or bypass hooks added using " +"this function. At a minimum, any security-sensitive hooks must be added " +"using the C API :c:func:`PySys_AddAuditHook` before initialising the " +"runtime, and any modules allowing arbitrary memory modification (such as :" +"mod:`ctypes`) should be completely removed or closely monitored." +msgstr "" + +#: ../../library/sys.rst:20 msgid "" "Raises an :ref:`auditing event ` ``sys.addaudithook`` with no " "arguments." msgstr "" -#: ../../library/sys.rst:40 +#: ../../library/sys.rst:49 msgid "" "Calling :func:`sys.addaudithook` will itself raise an auditing event named " "``sys.addaudithook`` with no arguments. If any existing hooks raise an " @@ -72,26 +84,26 @@ msgid "" "hook has been added unless they control all existing hooks." msgstr "" -#: ../../library/sys.rst:47 +#: ../../library/sys.rst:56 msgid "" "See the :ref:`audit events table ` for all events raised by " "CPython, and :pep:`578` for the original design discussion." msgstr "" -#: ../../library/sys.rst:54 +#: ../../library/sys.rst:63 msgid "" "Exceptions derived from :class:`Exception` but not :class:`RuntimeError` are " "no longer suppressed." msgstr "" -#: ../../library/sys.rst:59 +#: ../../library/sys.rst:68 msgid "" "When tracing is enabled (see :func:`settrace`), Python hooks are only traced " "if the callable has a ``__cantrace__`` member that is set to a true value. " "Otherwise, trace functions will skip the hook." msgstr "" -#: ../../library/sys.rst:66 +#: ../../library/sys.rst:75 msgid "" "The list of command line arguments passed to a Python script. ``argv[0]`` is " "the script name (it is operating system dependent whether this is a full " @@ -101,17 +113,17 @@ msgid "" "is the empty string." msgstr "" -#: ../../library/sys.rst:72 +#: ../../library/sys.rst:81 msgid "" "To loop over the standard input, or the list of files given on the command " "line, see the :mod:`fileinput` module." msgstr "" -#: ../../library/sys.rst:75 +#: ../../library/sys.rst:84 msgid "See also :data:`sys.orig_argv`." msgstr "另請參閱 :data:`sys.orig_argv`\\ 。" -#: ../../library/sys.rst:78 +#: ../../library/sys.rst:87 msgid "" "On Unix, command line arguments are passed by bytes from OS. Python decodes " "them with filesystem encoding and \"surrogateescape\" error handler. When " @@ -119,7 +131,7 @@ msgid "" "sys.argv]``." msgstr "" -#: ../../library/sys.rst:90 +#: ../../library/sys.rst:99 msgid "" "Raise an auditing event and trigger any active auditing hooks. *event* is a " "string identifying the event, and *args* may contain optional arguments with " @@ -128,13 +140,13 @@ msgid "" "modified between releases." msgstr "" -#: ../../library/sys.rst:96 +#: ../../library/sys.rst:105 msgid "" "For example, one auditing event is named ``os.chdir``. This event has one " "argument called *path* that will contain the requested new working directory." msgstr "" -#: ../../library/sys.rst:100 +#: ../../library/sys.rst:109 msgid "" ":func:`sys.audit` will call the existing auditing hooks, passing the event " "name and arguments, and will re-raise the first exception from any hook. In " @@ -144,25 +156,25 @@ msgid "" "merely log the event or abort the operation by raising an exception." msgstr "" -#: ../../library/sys.rst:108 +#: ../../library/sys.rst:117 msgid "" "Hooks are added using the :func:`sys.addaudithook` or :c:func:" "`PySys_AddAuditHook` functions." msgstr "" -#: ../../library/sys.rst:111 +#: ../../library/sys.rst:120 msgid "" "The native equivalent of this function is :c:func:`PySys_Audit`. Using the " "native function is preferred when possible." msgstr "" -#: ../../library/sys.rst:114 +#: ../../library/sys.rst:123 msgid "" "See the :ref:`audit events table ` for all events raised by " "CPython." msgstr "" -#: ../../library/sys.rst:122 +#: ../../library/sys.rst:131 msgid "" "Set during Python startup, before ``site.py`` is run, to the same value as :" "data:`exec_prefix`. If not running in a :ref:`virtual environment `, " @@ -184,49 +196,49 @@ msgid "" "Python installation (the one which the virtual environment was created from)." msgstr "" -#: ../../library/sys.rst:149 +#: ../../library/sys.rst:158 msgid "" "An indicator of the native byte order. This will have the value ``'big'`` " "on big-endian (most-significant byte first) platforms, and ``'little'`` on " "little-endian (least-significant byte first) platforms." msgstr "" -#: ../../library/sys.rst:156 +#: ../../library/sys.rst:165 msgid "" "A tuple of strings containing the names of all modules that are compiled " "into this Python interpreter. (This information is not available in any " "other way --- ``modules.keys()`` only lists the imported modules.)" msgstr "" -#: ../../library/sys.rst:160 +#: ../../library/sys.rst:169 msgid "See also the :attr:`sys.stdlib_module_names` list." msgstr "另請參閱 :attr:`sys.stdlib_module_names` 清單。" -#: ../../library/sys.rst:165 +#: ../../library/sys.rst:174 msgid "" "Call ``func(*args)``, while tracing is enabled. The tracing state is saved, " "and restored afterwards. This is intended to be called from a debugger from " "a checkpoint, to recursively debug some other code." msgstr "" -#: ../../library/sys.rst:172 +#: ../../library/sys.rst:181 msgid "A string containing the copyright pertaining to the Python interpreter." msgstr "" -#: ../../library/sys.rst:177 +#: ../../library/sys.rst:186 msgid "" "Clear the internal type cache. The type cache is used to speed up attribute " "and method lookups. Use the function *only* to drop unnecessary references " "during reference leak debugging." msgstr "" -#: ../../library/sys.rst:181 ../../library/sys.rst:197 -#: ../../library/sys.rst:210 +#: ../../library/sys.rst:190 ../../library/sys.rst:206 +#: ../../library/sys.rst:219 msgid "" "This function should be used for internal and specialized purposes only." msgstr "" -#: ../../library/sys.rst:186 +#: ../../library/sys.rst:195 msgid "" "Return a dictionary mapping each thread's identifier to the topmost stack " "frame currently active in that thread at the time the function is called. " @@ -234,7 +246,7 @@ msgid "" "given such a frame." msgstr "" -#: ../../library/sys.rst:191 +#: ../../library/sys.rst:200 msgid "" "This is most useful for debugging deadlock: this function does not require " "the deadlocked threads' cooperation, and such threads' call stacks are " @@ -249,7 +261,7 @@ msgid "" "arguments." msgstr "" -#: ../../library/sys.rst:203 +#: ../../library/sys.rst:212 msgid "" "Return a dictionary mapping each thread's identifier to the topmost " "exception currently active in that thread at the time the function is " @@ -257,7 +269,7 @@ msgid "" "included in the result dictionary." msgstr "" -#: ../../library/sys.rst:208 +#: ../../library/sys.rst:217 msgid "This is most useful for statistical profiling." msgstr "" @@ -267,14 +279,14 @@ msgid "" "no arguments." msgstr "" -#: ../../library/sys.rst:216 +#: ../../library/sys.rst:225 msgid "" "This hook function is called by built-in :func:`breakpoint`. By default, it " "drops you into the :mod:`pdb` debugger, but it can be set to any other " "function so that you can choose which debugger gets used." msgstr "" -#: ../../library/sys.rst:220 +#: ../../library/sys.rst:229 msgid "" "The signature of this function is dependent on what it calls. For example, " "the default binding (e.g. ``pdb.set_trace()``) expects no arguments, but you " @@ -284,7 +296,7 @@ msgid "" "returns is returned from ``breakpoint()``." msgstr "" -#: ../../library/sys.rst:227 +#: ../../library/sys.rst:236 msgid "" "The default implementation first consults the environment variable :envvar:" "`PYTHONBREAKPOINT`. If that is set to ``\"0\"`` then this function returns " @@ -298,48 +310,48 @@ msgid "" "breakpointhook()`` returns to the built-in :func:`breakpoint` function." msgstr "" -#: ../../library/sys.rst:239 +#: ../../library/sys.rst:248 msgid "" "Note that if anything goes wrong while importing the callable named by :" "envvar:`PYTHONBREAKPOINT`, a :exc:`RuntimeWarning` is reported and the " "breakpoint is ignored." msgstr "" -#: ../../library/sys.rst:243 +#: ../../library/sys.rst:252 msgid "" "Also note that if ``sys.breakpointhook()`` is overridden programmatically, :" "envvar:`PYTHONBREAKPOINT` is *not* consulted." msgstr "" -#: ../../library/sys.rst:250 +#: ../../library/sys.rst:259 msgid "" "Print low-level information to stderr about the state of CPython's memory " "allocator." msgstr "" -#: ../../library/sys.rst:253 +#: ../../library/sys.rst:262 msgid "" "If Python is :ref:`built in debug mode ` (:option:`configure --" "with-pydebug option <--with-pydebug>`), it also performs some expensive " "internal consistency checks." msgstr "" -#: ../../library/sys.rst:261 +#: ../../library/sys.rst:270 msgid "" "This function is specific to CPython. The exact output format is not " "defined here, and may change." msgstr "" -#: ../../library/sys.rst:267 +#: ../../library/sys.rst:276 msgid "Integer specifying the handle of the Python DLL." msgstr "" -#: ../../library/sys.rst:269 ../../library/sys.rst:865 -#: ../../library/sys.rst:1571 ../../library/sys.rst:1803 +#: ../../library/sys.rst:278 ../../library/sys.rst:874 +#: ../../library/sys.rst:1580 ../../library/sys.rst:1812 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/sys.rst:274 +#: ../../library/sys.rst:283 msgid "" "If *value* is not ``None``, this function prints ``repr(value)`` to ``sys." "stdout``, and saves *value* in ``builtins._``. If ``repr(value)`` is not " @@ -348,7 +360,7 @@ msgid "" "encoding`` with ``'backslashreplace'`` error handler." msgstr "" -#: ../../library/sys.rst:280 +#: ../../library/sys.rst:289 msgid "" "``sys.displayhook`` is called on the result of evaluating an :term:" "`expression` entered in an interactive Python session. The display of these " @@ -356,15 +368,15 @@ msgid "" "displayhook``." msgstr "" -#: ../../library/sys.rst:284 +#: ../../library/sys.rst:293 msgid "Pseudo-code::" msgstr "" -#: ../../library/sys.rst:304 +#: ../../library/sys.rst:313 msgid "Use ``'backslashreplace'`` error handler on :exc:`UnicodeEncodeError`." msgstr "" -#: ../../library/sys.rst:310 +#: ../../library/sys.rst:319 msgid "" "If this is true, Python won't try to write ``.pyc`` files on the import of " "source modules. This value is initially set to ``True`` or ``False`` " @@ -373,64 +385,64 @@ msgid "" "to control bytecode file generation." msgstr "" -#: ../../library/sys.rst:319 +#: ../../library/sys.rst:328 msgid "" "A :term:`named tuple` holding information about the environment on the " "*wasm32-emscripten* platform. The named tuple is provisional and may change " "in the future." msgstr "" -#: ../../library/sys.rst:326 ../../library/sys.rst:1011 -#: ../../library/sys.rst:1686 +#: ../../library/sys.rst:335 ../../library/sys.rst:1020 +#: ../../library/sys.rst:1695 msgid "Attribute" msgstr "屬性" -#: ../../library/sys.rst:326 ../../library/sys.rst:1011 -#: ../../library/sys.rst:1686 +#: ../../library/sys.rst:335 ../../library/sys.rst:1020 +#: ../../library/sys.rst:1695 msgid "Explanation" msgstr "解釋" -#: ../../library/sys.rst:328 +#: ../../library/sys.rst:337 msgid ":const:`emscripten_version`" msgstr ":const:`emscripten_version`" -#: ../../library/sys.rst:328 +#: ../../library/sys.rst:337 msgid "" "Emscripten version as tuple of ints (major, minor, micro), e.g. ``(3, 1, " "8)``." msgstr "" -#: ../../library/sys.rst:331 +#: ../../library/sys.rst:340 msgid ":const:`runtime`" msgstr ":const:`runtime`" -#: ../../library/sys.rst:331 +#: ../../library/sys.rst:340 msgid "" "Runtime string, e.g. browser user agent, ``'Node.js v14.18.2'``, or " "``'UNKNOWN'``." msgstr "" -#: ../../library/sys.rst:334 +#: ../../library/sys.rst:343 msgid ":const:`pthreads`" msgstr ":const:`pthreads`" -#: ../../library/sys.rst:334 +#: ../../library/sys.rst:343 msgid "``True`` if Python is compiled with Emscripten pthreads support." msgstr "" -#: ../../library/sys.rst:337 +#: ../../library/sys.rst:346 msgid ":const:`shared_memory`" msgstr ":const:`shared_memory`" -#: ../../library/sys.rst:337 +#: ../../library/sys.rst:346 msgid "``True`` if Python is compiled with shared memory support." msgstr "" -#: ../../library/sys.rst:342 +#: ../../library/sys.rst:351 msgid ":ref:`Availability `: Emscripten." msgstr ":ref:`適用 `:Emscripten。" -#: ../../library/sys.rst:348 +#: ../../library/sys.rst:357 msgid "" "If this is set (not ``None``), Python will write bytecode-cache ``.pyc`` " "files to (and read them from) a parallel directory tree rooted at this " @@ -441,12 +453,12 @@ msgid "" "with the same pycache prefix (if any) that you will use at runtime." msgstr "" -#: ../../library/sys.rst:356 +#: ../../library/sys.rst:365 msgid "" "A relative path is interpreted relative to the current working directory." msgstr "" -#: ../../library/sys.rst:358 +#: ../../library/sys.rst:367 msgid "" "This value is initially set based on the value of the :option:`-X` " "``pycache_prefix=PATH`` command-line option or the :envvar:" @@ -454,12 +466,12 @@ msgid "" "If neither are set, it is ``None``." msgstr "" -#: ../../library/sys.rst:368 +#: ../../library/sys.rst:377 msgid "" "This function prints out a given traceback and exception to ``sys.stderr``." msgstr "" -#: ../../library/sys.rst:370 +#: ../../library/sys.rst:379 msgid "" "When an exception is raised and uncaught, the interpreter calls ``sys." "excepthook`` with three arguments, the exception class, exception instance, " @@ -476,7 +488,7 @@ msgid "" "``hook``, ``type``, ``value``, ``traceback``." msgstr "" -#: ../../library/sys.rst:379 +#: ../../library/sys.rst:388 msgid "" "Raise an auditing event ``sys.excepthook`` with arguments ``hook``, " "``type``, ``value``, ``traceback`` when an uncaught exception occurs. If no " @@ -486,14 +498,14 @@ msgid "" "excepthook`` will be called." msgstr "" -#: ../../library/sys.rst:388 +#: ../../library/sys.rst:397 msgid "" "The :func:`sys.unraisablehook` function handles unraisable exceptions and " "the :func:`threading.excepthook` function handles exception raised by :func:" "`threading.Thread.run`." msgstr "" -#: ../../library/sys.rst:398 +#: ../../library/sys.rst:407 msgid "" "These objects contain the original values of ``breakpointhook``, " "``displayhook``, ``excepthook``, and ``unraisablehook`` at the start of the " @@ -502,15 +514,15 @@ msgid "" "get replaced with broken or alternative objects." msgstr "" -#: ../../library/sys.rst:404 +#: ../../library/sys.rst:413 msgid "__breakpointhook__" msgstr "__breakpointhook__" -#: ../../library/sys.rst:407 +#: ../../library/sys.rst:416 msgid "__unraisablehook__" msgstr "__unraisablehook__" -#: ../../library/sys.rst:413 +#: ../../library/sys.rst:422 msgid "" "This function, when called while an exception handler is executing (such as " "an ``except`` or ``except*`` clause), returns the exception instance that " @@ -518,11 +530,11 @@ msgid "" "another, only the exception handled by the innermost handler is accessible." msgstr "" -#: ../../library/sys.rst:418 +#: ../../library/sys.rst:427 msgid "If no exception handler is executing, this function returns ``None``." msgstr "" -#: ../../library/sys.rst:425 +#: ../../library/sys.rst:434 msgid "" "This function returns the old-style representation of the handled exception. " "If an exception ``e`` is currently handled (so :func:`exception` would " @@ -533,13 +545,13 @@ msgid "" "stack at the point where the exception last occurred." msgstr "" -#: ../../library/sys.rst:436 +#: ../../library/sys.rst:445 msgid "" "If no exception is being handled anywhere on the stack, this function return " "a tuple containing three ``None`` values." msgstr "" -#: ../../library/sys.rst:439 +#: ../../library/sys.rst:448 msgid "" "The ``type`` and ``traceback`` fields are now derived from the ``value`` " "(the exception instance), so when an exception is modified while it is being " @@ -547,7 +559,7 @@ msgid "" "func:`exc_info`." msgstr "" -#: ../../library/sys.rst:447 +#: ../../library/sys.rst:456 msgid "" "A string giving the site-specific directory prefix where the platform-" "dependent Python files are installed; by default, this is also ``'/usr/" @@ -559,7 +571,7 @@ msgid "" "is the version number of Python, for example ``3.2``." msgstr "" -#: ../../library/sys.rst:458 +#: ../../library/sys.rst:467 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " @@ -567,7 +579,7 @@ msgid "" "`base_exec_prefix`." msgstr "" -#: ../../library/sys.rst:466 +#: ../../library/sys.rst:475 msgid "" "A string giving the absolute path of the executable binary for the Python " "interpreter, on systems where this makes sense. If Python is unable to " @@ -575,13 +587,13 @@ msgid "" "empty string or ``None``." msgstr "" -#: ../../library/sys.rst:474 +#: ../../library/sys.rst:483 msgid "" "Raise a :exc:`SystemExit` exception, signaling an intention to exit the " "interpreter." msgstr "" -#: ../../library/sys.rst:476 +#: ../../library/sys.rst:485 msgid "" "The optional argument *arg* can be an integer giving the exit status " "(defaulting to zero), or another type of object. If it is an integer, zero " @@ -597,7 +609,7 @@ msgid "" "way to exit a program when an error occurs." msgstr "" -#: ../../library/sys.rst:489 +#: ../../library/sys.rst:498 msgid "" "Since :func:`exit` ultimately \"only\" raises an exception, it will only " "exit the process when called from the main thread, and the exception is not " @@ -606,194 +618,194 @@ msgid "" "an outer level." msgstr "" -#: ../../library/sys.rst:494 +#: ../../library/sys.rst:503 msgid "" "If an error occurs in the cleanup after the Python interpreter has caught :" "exc:`SystemExit` (such as an error flushing buffered data in the standard " "streams), the exit status is changed to 120." msgstr "" -#: ../../library/sys.rst:502 +#: ../../library/sys.rst:511 msgid "" "The :term:`named tuple` *flags* exposes the status of command line flags. " "The attributes are read only." msgstr "" -#: ../../library/sys.rst:506 ../../library/sys.rst:563 -#: ../../library/sys.rst:910 +#: ../../library/sys.rst:515 ../../library/sys.rst:572 +#: ../../library/sys.rst:919 msgid "attribute" msgstr "" -#: ../../library/sys.rst:506 +#: ../../library/sys.rst:515 msgid "flag" msgstr "" -#: ../../library/sys.rst:508 +#: ../../library/sys.rst:517 msgid ":const:`debug`" msgstr ":const:`debug`" -#: ../../library/sys.rst:508 +#: ../../library/sys.rst:517 msgid ":option:`-d`" msgstr ":option:`-d`" -#: ../../library/sys.rst:509 +#: ../../library/sys.rst:518 msgid ":const:`inspect`" msgstr ":const:`inspect`" -#: ../../library/sys.rst:509 ../../library/sys.rst:510 +#: ../../library/sys.rst:518 ../../library/sys.rst:519 msgid ":option:`-i`" msgstr ":option:`-i`" -#: ../../library/sys.rst:510 +#: ../../library/sys.rst:519 msgid ":const:`interactive`" msgstr ":const:`interactive`" -#: ../../library/sys.rst:511 +#: ../../library/sys.rst:520 msgid ":const:`isolated`" msgstr ":const:`isolated`" -#: ../../library/sys.rst:511 +#: ../../library/sys.rst:520 msgid ":option:`-I`" msgstr ":option:`-I`" -#: ../../library/sys.rst:512 +#: ../../library/sys.rst:521 msgid ":const:`optimize`" msgstr ":const:`optimize`" -#: ../../library/sys.rst:512 +#: ../../library/sys.rst:521 msgid ":option:`-O` or :option:`-OO`" msgstr ":option:`-O` 或 :option:`-OO`" -#: ../../library/sys.rst:513 +#: ../../library/sys.rst:522 msgid ":const:`dont_write_bytecode`" msgstr ":const:`dont_write_bytecode`" -#: ../../library/sys.rst:513 +#: ../../library/sys.rst:522 msgid ":option:`-B`" msgstr ":option:`-B`" -#: ../../library/sys.rst:514 +#: ../../library/sys.rst:523 msgid ":const:`no_user_site`" msgstr ":const:`no_user_site`" -#: ../../library/sys.rst:514 +#: ../../library/sys.rst:523 msgid ":option:`-s`" msgstr ":option:`-s`" -#: ../../library/sys.rst:515 +#: ../../library/sys.rst:524 msgid ":const:`no_site`" msgstr ":const:`no_site`" -#: ../../library/sys.rst:515 +#: ../../library/sys.rst:524 msgid ":option:`-S`" msgstr ":option:`-S`" -#: ../../library/sys.rst:516 +#: ../../library/sys.rst:525 msgid ":const:`ignore_environment`" msgstr ":const:`ignore_environment`" -#: ../../library/sys.rst:516 +#: ../../library/sys.rst:525 msgid ":option:`-E`" msgstr ":option:`-E`" -#: ../../library/sys.rst:517 +#: ../../library/sys.rst:526 msgid ":const:`verbose`" msgstr ":const:`verbose`" -#: ../../library/sys.rst:517 +#: ../../library/sys.rst:526 msgid ":option:`-v`" msgstr ":option:`-v`" -#: ../../library/sys.rst:518 +#: ../../library/sys.rst:527 msgid ":const:`bytes_warning`" msgstr ":const:`bytes_warning`" -#: ../../library/sys.rst:518 +#: ../../library/sys.rst:527 msgid ":option:`-b`" msgstr ":option:`-b`" -#: ../../library/sys.rst:519 +#: ../../library/sys.rst:528 msgid ":const:`quiet`" msgstr ":const:`quiet`" -#: ../../library/sys.rst:519 +#: ../../library/sys.rst:528 msgid ":option:`-q`" msgstr ":option:`-q`" -#: ../../library/sys.rst:520 +#: ../../library/sys.rst:529 msgid ":const:`hash_randomization`" msgstr ":const:`hash_randomization`" -#: ../../library/sys.rst:520 +#: ../../library/sys.rst:529 msgid ":option:`-R`" msgstr ":option:`-R`" -#: ../../library/sys.rst:521 +#: ../../library/sys.rst:530 msgid ":const:`dev_mode`" msgstr ":const:`dev_mode`" -#: ../../library/sys.rst:521 +#: ../../library/sys.rst:530 msgid ":option:`-X dev <-X>` (:ref:`Python Development Mode `)" msgstr "" -#: ../../library/sys.rst:522 +#: ../../library/sys.rst:531 msgid ":const:`utf8_mode`" msgstr ":const:`utf8_mode`" -#: ../../library/sys.rst:522 +#: ../../library/sys.rst:531 msgid ":option:`-X utf8 <-X>`" msgstr ":option:`-X utf8 <-X>`" -#: ../../library/sys.rst:523 +#: ../../library/sys.rst:532 msgid ":const:`safe_path`" msgstr ":const:`safe_path`" -#: ../../library/sys.rst:523 +#: ../../library/sys.rst:532 msgid ":option:`-P`" msgstr ":option:`-P`" -#: ../../library/sys.rst:524 +#: ../../library/sys.rst:533 msgid ":const:`int_max_str_digits`" msgstr ":const:`int_max_str_digits`" -#: ../../library/sys.rst:524 +#: ../../library/sys.rst:533 msgid "" ":option:`-X int_max_str_digits <-X>` (:ref:`integer string conversion length " "limitation `)" msgstr "" -#: ../../library/sys.rst:527 +#: ../../library/sys.rst:536 msgid "Added ``quiet`` attribute for the new :option:`-q` flag." msgstr "" -#: ../../library/sys.rst:530 +#: ../../library/sys.rst:539 msgid "The ``hash_randomization`` attribute." msgstr "" -#: ../../library/sys.rst:533 +#: ../../library/sys.rst:542 msgid "Removed obsolete ``division_warning`` attribute." msgstr "" -#: ../../library/sys.rst:536 +#: ../../library/sys.rst:545 msgid "Added ``isolated`` attribute for :option:`-I` ``isolated`` flag." msgstr "" -#: ../../library/sys.rst:539 +#: ../../library/sys.rst:548 msgid "" "Added the ``dev_mode`` attribute for the new :ref:`Python Development Mode " "` and the ``utf8_mode`` attribute for the new :option:`-X` " "``utf8`` flag." msgstr "" -#: ../../library/sys.rst:544 +#: ../../library/sys.rst:553 msgid "Added the ``safe_path`` attribute for :option:`-P` option." msgstr "" -#: ../../library/sys.rst:547 +#: ../../library/sys.rst:556 msgid "Added the ``int_max_str_digits`` attribute." msgstr "" -#: ../../library/sys.rst:553 +#: ../../library/sys.rst:562 msgid "" "A :term:`named tuple` holding information about the float type. It contains " "low level information about the precision and internal representation. The " @@ -803,163 +815,163 @@ msgid "" "floating types', for details." msgstr "" -#: ../../library/sys.rst:563 +#: ../../library/sys.rst:572 msgid "float.h macro" msgstr "" -#: ../../library/sys.rst:563 ../../library/sys.rst:910 +#: ../../library/sys.rst:572 ../../library/sys.rst:919 msgid "explanation" msgstr "" -#: ../../library/sys.rst:565 +#: ../../library/sys.rst:574 msgid ":const:`epsilon`" msgstr ":const:`epsilon`" -#: ../../library/sys.rst:565 +#: ../../library/sys.rst:574 msgid "DBL_EPSILON" msgstr "DBL_EPSILON" -#: ../../library/sys.rst:565 +#: ../../library/sys.rst:574 msgid "" "difference between 1.0 and the least value greater than 1.0 that is " "representable as a float" msgstr "" -#: ../../library/sys.rst:568 +#: ../../library/sys.rst:577 msgid "See also :func:`math.ulp`." msgstr "另請參閱 :func:`math.ulp`\\ 。" -#: ../../library/sys.rst:570 +#: ../../library/sys.rst:579 msgid ":const:`dig`" msgstr ":const:`dig`" -#: ../../library/sys.rst:570 +#: ../../library/sys.rst:579 msgid "DBL_DIG" msgstr "DBL_DIG" -#: ../../library/sys.rst:570 +#: ../../library/sys.rst:579 msgid "" "maximum number of decimal digits that can be faithfully represented in a " "float; see below" msgstr "" -#: ../../library/sys.rst:573 +#: ../../library/sys.rst:582 msgid ":const:`mant_dig`" msgstr ":const:`mant_dig`" -#: ../../library/sys.rst:573 +#: ../../library/sys.rst:582 msgid "DBL_MANT_DIG" msgstr "DBL_MANT_DIG" -#: ../../library/sys.rst:573 +#: ../../library/sys.rst:582 msgid "" "float precision: the number of base-``radix`` digits in the significand of a " "float" msgstr "" -#: ../../library/sys.rst:576 +#: ../../library/sys.rst:585 msgid ":const:`max`" msgstr ":const:`max`" -#: ../../library/sys.rst:576 +#: ../../library/sys.rst:585 msgid "DBL_MAX" msgstr "DBL_MAX" -#: ../../library/sys.rst:576 +#: ../../library/sys.rst:585 msgid "maximum representable positive finite float" msgstr "" -#: ../../library/sys.rst:578 +#: ../../library/sys.rst:587 msgid ":const:`max_exp`" msgstr ":const:`max_exp`" -#: ../../library/sys.rst:578 +#: ../../library/sys.rst:587 msgid "DBL_MAX_EXP" msgstr "DBL_MAX_EXP" -#: ../../library/sys.rst:578 +#: ../../library/sys.rst:587 msgid "" "maximum integer *e* such that ``radix**(e-1)`` is a representable finite " "float" msgstr "" -#: ../../library/sys.rst:581 +#: ../../library/sys.rst:590 msgid ":const:`max_10_exp`" msgstr ":const:`max_10_exp`" -#: ../../library/sys.rst:581 +#: ../../library/sys.rst:590 msgid "DBL_MAX_10_EXP" msgstr "DBL_MAX_10_EXP" -#: ../../library/sys.rst:581 +#: ../../library/sys.rst:590 msgid "" "maximum integer *e* such that ``10**e`` is in the range of representable " "finite floats" msgstr "" -#: ../../library/sys.rst:584 +#: ../../library/sys.rst:593 msgid ":const:`min`" msgstr ":const:`min`" -#: ../../library/sys.rst:584 +#: ../../library/sys.rst:593 msgid "DBL_MIN" msgstr "DBL_MIN" -#: ../../library/sys.rst:584 +#: ../../library/sys.rst:593 msgid "minimum representable positive *normalized* float" msgstr "" -#: ../../library/sys.rst:586 +#: ../../library/sys.rst:595 msgid "" "Use :func:`math.ulp(0.0) ` to get the smallest positive " "*denormalized* representable float." msgstr "" -#: ../../library/sys.rst:590 +#: ../../library/sys.rst:599 msgid ":const:`min_exp`" msgstr ":const:`min_exp`" -#: ../../library/sys.rst:590 +#: ../../library/sys.rst:599 msgid "DBL_MIN_EXP" msgstr "DBL_MIN_EXP" -#: ../../library/sys.rst:590 +#: ../../library/sys.rst:599 msgid "minimum integer *e* such that ``radix**(e-1)`` is a normalized float" msgstr "" -#: ../../library/sys.rst:593 +#: ../../library/sys.rst:602 msgid ":const:`min_10_exp`" msgstr ":const:`min_10_exp`" -#: ../../library/sys.rst:593 +#: ../../library/sys.rst:602 msgid "DBL_MIN_10_EXP" msgstr "DBL_MIN_10_EXP" -#: ../../library/sys.rst:593 +#: ../../library/sys.rst:602 msgid "minimum integer *e* such that ``10**e`` is a normalized float" msgstr "" -#: ../../library/sys.rst:596 +#: ../../library/sys.rst:605 msgid ":const:`radix`" msgstr ":const:`radix`" -#: ../../library/sys.rst:596 +#: ../../library/sys.rst:605 msgid "FLT_RADIX" msgstr "FLT_RADIX" -#: ../../library/sys.rst:596 +#: ../../library/sys.rst:605 msgid "radix of exponent representation" msgstr "" -#: ../../library/sys.rst:598 +#: ../../library/sys.rst:607 msgid ":const:`rounds`" msgstr ":const:`rounds`" -#: ../../library/sys.rst:598 +#: ../../library/sys.rst:607 msgid "FLT_ROUNDS" msgstr "FLT_ROUNDS" -#: ../../library/sys.rst:598 +#: ../../library/sys.rst:607 msgid "" "integer constant representing the rounding mode used for arithmetic " "operations. This reflects the value of the system FLT_ROUNDS macro at " @@ -967,7 +979,7 @@ msgid "" "explanation of the possible values and their meanings." msgstr "" -#: ../../library/sys.rst:606 +#: ../../library/sys.rst:615 msgid "" "The attribute :attr:`sys.float_info.dig` needs further explanation. If " "``s`` is any string representing a decimal number with at most :attr:`sys." @@ -975,13 +987,13 @@ msgid "" "back again will recover a string representing the same decimal value::" msgstr "" -#: ../../library/sys.rst:619 +#: ../../library/sys.rst:628 msgid "" "But for strings with more than :attr:`sys.float_info.dig` significant " "digits, this isn't always true::" msgstr "" -#: ../../library/sys.rst:628 +#: ../../library/sys.rst:637 msgid "" "A string indicating how the :func:`repr` function behaves for floats. If " "the string has value ``'short'`` then for a finite float ``x``, ``repr(x)`` " @@ -991,7 +1003,7 @@ msgid "" "same way as it did in versions of Python prior to 3.1." msgstr "" -#: ../../library/sys.rst:641 +#: ../../library/sys.rst:650 msgid "" "Return the number of memory blocks currently allocated by the interpreter, " "regardless of their size. This function is mainly useful for tracking and " @@ -1001,38 +1013,38 @@ msgid "" "results." msgstr "" -#: ../../library/sys.rst:648 +#: ../../library/sys.rst:657 msgid "" "If a Python build or implementation cannot reasonably compute this " "information, :func:`getallocatedblocks()` is allowed to return 0 instead." msgstr "" -#: ../../library/sys.rst:656 +#: ../../library/sys.rst:665 msgid "Return the build time API version of Android as an integer." msgstr "" -#: ../../library/sys.rst:659 +#: ../../library/sys.rst:668 msgid ":ref:`Availability `: Android." msgstr ":ref:`適用 `:Android。" -#: ../../library/sys.rst:665 +#: ../../library/sys.rst:674 msgid "" "Return the name of the current default string encoding used by the Unicode " "implementation." msgstr "" -#: ../../library/sys.rst:671 +#: ../../library/sys.rst:680 msgid "" "Return the current value of the flags that are used for :c:func:`dlopen` " "calls. Symbolic names for the flag values can be found in the :mod:`os` " "module (``RTLD_xxx`` constants, e.g. :data:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:676 ../../library/sys.rst:1332 +#: ../../library/sys.rst:685 ../../library/sys.rst:1341 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/sys.rst:681 +#: ../../library/sys.rst:690 msgid "" "Get the :term:`filesystem encoding `: " "the encoding used with the :term:`filesystem error handler ` is enabled." msgstr "" -#: ../../library/sys.rst:714 +#: ../../library/sys.rst:723 msgid "" "Get the :term:`filesystem error handler `: the error handler used with the :term:`filesystem encoding " @@ -1087,20 +1099,20 @@ msgid "" "func:`getfilesystemencoding`." msgstr "" -#: ../../library/sys.rst:732 +#: ../../library/sys.rst:741 msgid "" "Returns the current value for the :ref:`integer string conversion length " "limitation `. See also :func:`set_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:739 +#: ../../library/sys.rst:748 msgid "" "Return the reference count of the *object*. The count returned is generally " "one higher than you might expect, because it includes the (temporary) " "reference as an argument to :func:`getrefcount`." msgstr "" -#: ../../library/sys.rst:746 +#: ../../library/sys.rst:755 msgid "" "Return the current value of the recursion limit, the maximum depth of the " "Python interpreter stack. This limit prevents infinite recursion from " @@ -1108,46 +1120,46 @@ msgid "" "func:`setrecursionlimit`." msgstr "" -#: ../../library/sys.rst:754 +#: ../../library/sys.rst:763 msgid "" "Return the size of an object in bytes. The object can be any type of object. " "All built-in objects will return correct results, but this does not have to " "hold true for third-party extensions as it is implementation specific." msgstr "" -#: ../../library/sys.rst:759 +#: ../../library/sys.rst:768 msgid "" "Only the memory consumption directly attributed to the object is accounted " "for, not the memory consumption of objects it refers to." msgstr "" -#: ../../library/sys.rst:762 +#: ../../library/sys.rst:771 msgid "" "If given, *default* will be returned if the object does not provide means to " "retrieve the size. Otherwise a :exc:`TypeError` will be raised." msgstr "" -#: ../../library/sys.rst:765 +#: ../../library/sys.rst:774 msgid "" ":func:`getsizeof` calls the object's ``__sizeof__`` method and adds an " "additional garbage collector overhead if the object is managed by the " "garbage collector." msgstr "" -#: ../../library/sys.rst:769 +#: ../../library/sys.rst:778 msgid "" "See `recursive sizeof recipe `_ " "for an example of using :func:`getsizeof` recursively to find the size of " "containers and all their contents." msgstr "" -#: ../../library/sys.rst:775 +#: ../../library/sys.rst:784 msgid "" "Return the interpreter's \"thread switch interval\"; see :func:" "`setswitchinterval`." msgstr "" -#: ../../library/sys.rst:783 +#: ../../library/sys.rst:792 msgid "" "Return a frame object from the call stack. If optional integer *depth* is " "given, return the frame object that many calls below the top of the stack. " @@ -1162,21 +1174,21 @@ msgid "" "``frame``." msgstr "" -#: ../../library/sys.rst:792 +#: ../../library/sys.rst:801 msgid "" "This function should be used for internal and specialized purposes only. It " "is not guaranteed to exist in all implementations of Python." msgstr "" -#: ../../library/sys.rst:802 +#: ../../library/sys.rst:811 msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" -#: ../../library/sys.rst:811 +#: ../../library/sys.rst:820 msgid "Get the trace function as set by :func:`settrace`." msgstr "" -#: ../../library/sys.rst:815 +#: ../../library/sys.rst:824 msgid "" "The :func:`gettrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -1184,7 +1196,7 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:823 +#: ../../library/sys.rst:832 msgid "" "Return a named tuple describing the Windows version currently running. The " "named elements are *major*, *minor*, *build*, *platform*, *service_pack*, " @@ -1196,54 +1208,54 @@ msgid "" "first 5 elements are retrievable by indexing." msgstr "" -#: ../../library/sys.rst:834 +#: ../../library/sys.rst:843 msgid "*platform* will be :const:`2 (VER_PLATFORM_WIN32_NT)`." msgstr "" -#: ../../library/sys.rst:836 +#: ../../library/sys.rst:845 msgid "*product_type* may be one of the following values:" msgstr "" -#: ../../library/sys.rst:839 +#: ../../library/sys.rst:848 msgid "Constant" msgstr "" -#: ../../library/sys.rst:839 +#: ../../library/sys.rst:848 msgid "Meaning" msgstr "" -#: ../../library/sys.rst:841 +#: ../../library/sys.rst:850 msgid ":const:`1 (VER_NT_WORKSTATION)`" msgstr ":const:`1 (VER_NT_WORKSTATION)`" -#: ../../library/sys.rst:841 +#: ../../library/sys.rst:850 msgid "The system is a workstation." msgstr "" -#: ../../library/sys.rst:843 +#: ../../library/sys.rst:852 msgid ":const:`2 (VER_NT_DOMAIN_CONTROLLER)`" msgstr ":const:`2 (VER_NT_DOMAIN_CONTROLLER)`" -#: ../../library/sys.rst:843 +#: ../../library/sys.rst:852 msgid "The system is a domain controller." msgstr "" -#: ../../library/sys.rst:846 +#: ../../library/sys.rst:855 msgid ":const:`3 (VER_NT_SERVER)`" msgstr ":const:`3 (VER_NT_SERVER)`" -#: ../../library/sys.rst:846 +#: ../../library/sys.rst:855 msgid "The system is a server, but not a domain controller." msgstr "" -#: ../../library/sys.rst:850 +#: ../../library/sys.rst:859 msgid "" "This function wraps the Win32 :c:func:`GetVersionEx` function; see the " "Microsoft documentation on :c:func:`OSVERSIONINFOEX` for more information " "about these fields." msgstr "" -#: ../../library/sys.rst:854 +#: ../../library/sys.rst:863 msgid "" "*platform_version* returns the major version, minor version and build number " "of the current operating system, rather than the version that is being " @@ -1251,24 +1263,24 @@ msgid "" "feature detection." msgstr "" -#: ../../library/sys.rst:860 +#: ../../library/sys.rst:869 msgid "" "*platform_version* derives the version from kernel32.dll which can be of a " "different version than the OS version. Please use :mod:`platform` module for " "achieving accurate OS version." msgstr "" -#: ../../library/sys.rst:866 +#: ../../library/sys.rst:875 msgid "" "Changed to a named tuple and added *service_pack_minor*, " "*service_pack_major*, *suite_mask*, and *product_type*." msgstr "" -#: ../../library/sys.rst:870 +#: ../../library/sys.rst:879 msgid "Added *platform_version*" msgstr "新增 *platform_version*" -#: ../../library/sys.rst:876 +#: ../../library/sys.rst:885 msgid "" "Returns an *asyncgen_hooks* object, which is similar to a :class:" "`~collections.namedtuple` of the form ``(firstiter, finalizer)``, where " @@ -1278,103 +1290,103 @@ msgid "" "loop." msgstr "" -#: ../../library/sys.rst:883 +#: ../../library/sys.rst:892 msgid "See :pep:`525` for more details." msgstr "更多細節請見 :pep:`525`\\ 。" -#: ../../library/sys.rst:887 ../../library/sys.rst:1534 +#: ../../library/sys.rst:896 ../../library/sys.rst:1543 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" msgstr "" -#: ../../library/sys.rst:893 +#: ../../library/sys.rst:902 msgid "" "Get the current coroutine origin tracking depth, as set by :func:" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:899 ../../library/sys.rst:1555 +#: ../../library/sys.rst:908 ../../library/sys.rst:1564 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.) Use it only for debugging purposes." msgstr "" -#: ../../library/sys.rst:905 +#: ../../library/sys.rst:914 msgid "" "A :term:`named tuple` giving parameters of the numeric hash implementation. " "For more details about hashing of numeric types, see :ref:`numeric-hash`." msgstr "" -#: ../../library/sys.rst:912 +#: ../../library/sys.rst:921 msgid ":const:`width`" msgstr ":const:`width`" -#: ../../library/sys.rst:912 +#: ../../library/sys.rst:921 msgid "width in bits used for hash values" msgstr "" -#: ../../library/sys.rst:914 +#: ../../library/sys.rst:923 msgid ":const:`modulus`" msgstr ":const:`modulus`" -#: ../../library/sys.rst:914 +#: ../../library/sys.rst:923 msgid "prime modulus P used for numeric hash scheme" msgstr "" -#: ../../library/sys.rst:916 +#: ../../library/sys.rst:925 msgid ":const:`inf`" msgstr ":const:`inf`" -#: ../../library/sys.rst:916 +#: ../../library/sys.rst:925 msgid "hash value returned for a positive infinity" msgstr "" -#: ../../library/sys.rst:918 +#: ../../library/sys.rst:927 msgid ":const:`nan`" msgstr ":const:`nan`" -#: ../../library/sys.rst:918 +#: ../../library/sys.rst:927 msgid "(this attribute is no longer used)" msgstr "" -#: ../../library/sys.rst:920 +#: ../../library/sys.rst:929 msgid ":const:`imag`" msgstr ":const:`imag`" -#: ../../library/sys.rst:920 +#: ../../library/sys.rst:929 msgid "multiplier used for the imaginary part of a complex number" msgstr "" -#: ../../library/sys.rst:923 +#: ../../library/sys.rst:932 msgid ":const:`algorithm`" msgstr ":const:`algorithm`" -#: ../../library/sys.rst:923 +#: ../../library/sys.rst:932 msgid "name of the algorithm for hashing of str, bytes, and memoryview" msgstr "" -#: ../../library/sys.rst:926 +#: ../../library/sys.rst:935 msgid ":const:`hash_bits`" msgstr ":const:`hash_bits`" -#: ../../library/sys.rst:926 +#: ../../library/sys.rst:935 msgid "internal output size of the hash algorithm" msgstr "" -#: ../../library/sys.rst:928 +#: ../../library/sys.rst:937 msgid ":const:`seed_bits`" msgstr ":const:`seed_bits`" -#: ../../library/sys.rst:928 +#: ../../library/sys.rst:937 msgid "size of the seed key of the hash algorithm" msgstr "" -#: ../../library/sys.rst:934 +#: ../../library/sys.rst:943 msgid "Added *algorithm*, *hash_bits* and *seed_bits*" msgstr "新增 *algorithm*\\ 、\\ *hash_bits* 與 *seed_bits*" -#: ../../library/sys.rst:940 +#: ../../library/sys.rst:949 msgid "" "The version number encoded as a single integer. This is guaranteed to " "increase with each version, including proper support for non-production " @@ -1382,7 +1394,7 @@ msgid "" "version 1.5.2, use::" msgstr "" -#: ../../library/sys.rst:951 +#: ../../library/sys.rst:960 msgid "" "This is called ``hexversion`` since it only really looks meaningful when " "viewed as the result of passing it to the built-in :func:`hex` function. " @@ -1390,25 +1402,25 @@ msgid "" "human-friendly encoding of the same information." msgstr "" -#: ../../library/sys.rst:956 +#: ../../library/sys.rst:965 msgid "More details of ``hexversion`` can be found at :ref:`apiabiversion`." msgstr "" -#: ../../library/sys.rst:961 +#: ../../library/sys.rst:970 msgid "" "An object containing information about the implementation of the currently " "running Python interpreter. The following attributes are required to exist " "in all Python implementations." msgstr "" -#: ../../library/sys.rst:965 +#: ../../library/sys.rst:974 msgid "" "*name* is the implementation's identifier, e.g. ``'cpython'``. The actual " "string is defined by the Python implementation, but it is guaranteed to be " "lower case." msgstr "" -#: ../../library/sys.rst:969 +#: ../../library/sys.rst:978 msgid "" "*version* is a named tuple, in the same format as :data:`sys.version_info`. " "It represents the version of the Python *implementation*. This has a " @@ -1420,13 +1432,13 @@ msgid "" "the same value, since it is the reference implementation." msgstr "" -#: ../../library/sys.rst:979 +#: ../../library/sys.rst:988 msgid "" "*hexversion* is the implementation version in hexadecimal format, like :data:" "`sys.hexversion`." msgstr "" -#: ../../library/sys.rst:982 +#: ../../library/sys.rst:991 msgid "" "*cache_tag* is the tag used by the import machinery in the filenames of " "cached modules. By convention, it would be a composite of the " @@ -1435,7 +1447,7 @@ msgid "" "set to ``None``, it indicates that module caching should be disabled." msgstr "" -#: ../../library/sys.rst:989 +#: ../../library/sys.rst:998 msgid "" ":data:`sys.implementation` may contain additional attributes specific to the " "Python implementation. These non-standard attributes must start with an " @@ -1445,61 +1457,61 @@ msgid "" "versions, however.) See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1000 +#: ../../library/sys.rst:1009 msgid "" "The addition of new required attributes must go through the normal PEP " "process. See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1005 +#: ../../library/sys.rst:1014 msgid "" "A :term:`named tuple` that holds information about Python's internal " "representation of integers. The attributes are read only." msgstr "" -#: ../../library/sys.rst:1013 +#: ../../library/sys.rst:1022 msgid ":const:`bits_per_digit`" msgstr ":const:`bits_per_digit`" -#: ../../library/sys.rst:1013 +#: ../../library/sys.rst:1022 msgid "" "number of bits held in each digit. Python integers are stored internally in " "base ``2**int_info.bits_per_digit``" msgstr "" -#: ../../library/sys.rst:1017 +#: ../../library/sys.rst:1026 msgid ":const:`sizeof_digit`" msgstr ":const:`sizeof_digit`" -#: ../../library/sys.rst:1017 +#: ../../library/sys.rst:1026 msgid "size in bytes of the C type used to represent a digit" msgstr "" -#: ../../library/sys.rst:1020 +#: ../../library/sys.rst:1029 msgid ":const:`default_max_str_digits`" msgstr ":const:`default_max_str_digits`" -#: ../../library/sys.rst:1020 +#: ../../library/sys.rst:1029 msgid "" "default value for :func:`sys.get_int_max_str_digits` when it is not " "otherwise explicitly configured." msgstr "" -#: ../../library/sys.rst:1024 +#: ../../library/sys.rst:1033 msgid ":const:`str_digits_check_threshold`" msgstr ":const:`str_digits_check_threshold`" -#: ../../library/sys.rst:1024 +#: ../../library/sys.rst:1033 msgid "" "minimum non-zero value for :func:`sys.set_int_max_str_digits`, :envvar:" "`PYTHONINTMAXSTRDIGITS`, or :option:`-X int_max_str_digits <-X>`." msgstr "" -#: ../../library/sys.rst:1032 +#: ../../library/sys.rst:1041 msgid "Added ``default_max_str_digits`` and ``str_digits_check_threshold``." msgstr "新增 ``default_max_str_digits`` 和 ``str_digits_check_threshold``。" -#: ../../library/sys.rst:1038 +#: ../../library/sys.rst:1047 msgid "" "When this attribute exists, its value is automatically called (with no " "arguments) when the interpreter is launched in :ref:`interactive mode ` ``cpython.run_interactivehook`` " "with the hook object as the argument when the hook is called on startup." msgstr "" -#: ../../library/sys.rst:1055 +#: ../../library/sys.rst:1064 msgid "" "Enter *string* in the table of \"interned\" strings and return the interned " "string -- which is *string* itself or a copy. Interning strings is useful to " @@ -1532,19 +1544,19 @@ msgid "" "attributes have interned keys." msgstr "" -#: ../../library/sys.rst:1063 +#: ../../library/sys.rst:1072 msgid "" "Interned strings are not immortal; you must keep a reference to the return " "value of :func:`intern` around to benefit from it." msgstr "" -#: ../../library/sys.rst:1069 +#: ../../library/sys.rst:1078 msgid "" "Return :const:`True` if the Python interpreter is :term:`shutting down " "`, :const:`False` otherwise." msgstr "" -#: ../../library/sys.rst:1079 +#: ../../library/sys.rst:1088 msgid "" "These three variables are not always defined; they are set when an exception " "is not handled and the interpreter prints an error message and a stack " @@ -1555,33 +1567,33 @@ msgid "" "information.)" msgstr "" -#: ../../library/sys.rst:1087 +#: ../../library/sys.rst:1096 msgid "" "The meaning of the variables is the same as that of the return values from :" "func:`exc_info` above." msgstr "" -#: ../../library/sys.rst:1093 +#: ../../library/sys.rst:1102 msgid "" "An integer giving the maximum value a variable of type :c:type:`Py_ssize_t` " "can take. It's usually ``2**31 - 1`` on a 32-bit platform and ``2**63 - 1`` " "on a 64-bit platform." msgstr "" -#: ../../library/sys.rst:1100 +#: ../../library/sys.rst:1109 msgid "" "An integer giving the value of the largest Unicode code point, i.e. " "``1114111`` (``0x10FFFF`` in hexadecimal)." msgstr "" -#: ../../library/sys.rst:1103 +#: ../../library/sys.rst:1112 msgid "" "Before :pep:`393`, ``sys.maxunicode`` used to be either ``0xFFFF`` or " "``0x10FFFF``, depending on the configuration option that specified whether " "Unicode characters were stored as UCS-2 or UCS-4." msgstr "" -#: ../../library/sys.rst:1111 +#: ../../library/sys.rst:1120 msgid "" "A list of :term:`meta path finder` objects that have their :meth:`~importlib." "abc.MetaPathFinder.find_spec` methods called to see if one of the objects " @@ -1594,27 +1606,27 @@ msgid "" "if the module cannot be found." msgstr "" -#: ../../library/sys.rst:1124 +#: ../../library/sys.rst:1133 msgid ":class:`importlib.abc.MetaPathFinder`" msgstr ":class:`importlib.abc.MetaPathFinder`" -#: ../../library/sys.rst:1124 +#: ../../library/sys.rst:1133 msgid "" "The abstract base class defining the interface of finder objects on :data:" "`meta_path`." msgstr "" -#: ../../library/sys.rst:1128 +#: ../../library/sys.rst:1137 msgid ":class:`importlib.machinery.ModuleSpec`" msgstr ":class:`importlib.machinery.ModuleSpec`" -#: ../../library/sys.rst:1127 +#: ../../library/sys.rst:1136 msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" -#: ../../library/sys.rst:1133 +#: ../../library/sys.rst:1142 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" "`451`. Earlier versions of Python looked for a method called :meth:" @@ -1623,7 +1635,7 @@ msgid "" "MetaPathFinder.find_spec` method." msgstr "" -#: ../../library/sys.rst:1141 +#: ../../library/sys.rst:1150 msgid "" "This is a dictionary that maps module names to modules which have already " "been loaded. This can be manipulated to force reloading of modules and " @@ -1635,78 +1647,78 @@ msgid "" "other threads." msgstr "" -#: ../../library/sys.rst:1153 +#: ../../library/sys.rst:1162 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -#: ../../library/sys.rst:1156 +#: ../../library/sys.rst:1165 msgid "See also :data:`sys.argv`." msgstr "另請參閱 :data:`sys.argv`\\ 。" -#: ../../library/sys.rst:1165 +#: ../../library/sys.rst:1174 msgid "" "A list of strings that specifies the search path for modules. Initialized " "from the environment variable :envvar:`PYTHONPATH`, plus an installation-" "dependent default." msgstr "" -#: ../../library/sys.rst:1169 +#: ../../library/sys.rst:1178 msgid "" "By default, as initialized upon program startup, a potentially unsafe path " "is prepended to :data:`sys.path` (*before* the entries inserted as a result " "of :envvar:`PYTHONPATH`):" msgstr "" -#: ../../library/sys.rst:1173 +#: ../../library/sys.rst:1182 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" -#: ../../library/sys.rst:1175 +#: ../../library/sys.rst:1184 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" -#: ../../library/sys.rst:1177 +#: ../../library/sys.rst:1186 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -#: ../../library/sys.rst:1180 +#: ../../library/sys.rst:1189 msgid "" "To not prepend this potentially unsafe path, use the :option:`-P` command " "line option or the :envvar:`PYTHONSAFEPATH` environment variable." msgstr "" -#: ../../library/sys.rst:1183 +#: ../../library/sys.rst:1192 msgid "" "A program is free to modify this list for its own purposes. Only strings " "should be added to :data:`sys.path`; all other data types are ignored during " "import." msgstr "" -#: ../../library/sys.rst:1189 +#: ../../library/sys.rst:1198 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" -#: ../../library/sys.rst:1194 +#: ../../library/sys.rst:1203 msgid "" "A list of callables that take a path argument to try to create a :term:" "`finder` for the path. If a finder can be created, it is to be returned by " "the callable, else raise :exc:`ImportError`." msgstr "" -#: ../../library/sys.rst:1198 ../../library/sys.rst:1209 +#: ../../library/sys.rst:1207 ../../library/sys.rst:1218 msgid "Originally specified in :pep:`302`." msgstr "" -#: ../../library/sys.rst:1203 +#: ../../library/sys.rst:1212 msgid "" "A dictionary acting as a cache for :term:`finder` objects. The keys are " "paths that have been passed to :data:`sys.path_hooks` and the values are the " @@ -1714,19 +1726,19 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: ../../library/sys.rst:1211 +#: ../../library/sys.rst:1220 msgid "" "``None`` is stored instead of :class:`imp.NullImporter` when no finder is " "found." msgstr "" -#: ../../library/sys.rst:1218 +#: ../../library/sys.rst:1227 msgid "" "This string contains a platform identifier that can be used to append " "platform-specific components to :data:`sys.path`, for instance." msgstr "" -#: ../../library/sys.rst:1221 +#: ../../library/sys.rst:1230 msgid "" "For Unix systems, except on Linux and AIX, this is the lowercased OS name as " "returned by ``uname -s`` with the first part of the version as returned by " @@ -1735,75 +1747,75 @@ msgid "" "version, it is therefore recommended to use the following idiom::" msgstr "" -#: ../../library/sys.rst:1234 +#: ../../library/sys.rst:1243 msgid "For other systems, the values are:" msgstr "" -#: ../../library/sys.rst:1237 +#: ../../library/sys.rst:1246 msgid "System" msgstr "" -#: ../../library/sys.rst:1237 +#: ../../library/sys.rst:1246 msgid "``platform`` value" msgstr "" -#: ../../library/sys.rst:1239 +#: ../../library/sys.rst:1248 msgid "AIX" msgstr "AIX" -#: ../../library/sys.rst:1239 +#: ../../library/sys.rst:1248 msgid "``'aix'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1240 +#: ../../library/sys.rst:1249 msgid "Emscripten" msgstr "Emscripten" -#: ../../library/sys.rst:1240 +#: ../../library/sys.rst:1249 msgid "``'emscripten'``" msgstr "``'emscripten'``" -#: ../../library/sys.rst:1241 +#: ../../library/sys.rst:1250 msgid "Linux" msgstr "Linux" -#: ../../library/sys.rst:1241 +#: ../../library/sys.rst:1250 msgid "``'linux'``" msgstr "``'linux'``" -#: ../../library/sys.rst:1242 +#: ../../library/sys.rst:1251 msgid "WASI" msgstr "" -#: ../../library/sys.rst:1242 +#: ../../library/sys.rst:1251 msgid "``'wasi'``" msgstr "``'wasi'``" -#: ../../library/sys.rst:1243 +#: ../../library/sys.rst:1252 msgid "Windows" msgstr "Windows" -#: ../../library/sys.rst:1243 +#: ../../library/sys.rst:1252 msgid "``'win32'``" msgstr "``'win32'``" -#: ../../library/sys.rst:1244 +#: ../../library/sys.rst:1253 msgid "Windows/Cygwin" msgstr "Windows/Cygwin" -#: ../../library/sys.rst:1244 +#: ../../library/sys.rst:1253 msgid "``'cygwin'``" msgstr "``'cygwin'``" -#: ../../library/sys.rst:1245 +#: ../../library/sys.rst:1254 msgid "macOS" msgstr "macOS" -#: ../../library/sys.rst:1245 +#: ../../library/sys.rst:1254 msgid "``'darwin'``" msgstr "``'darwin'``" -#: ../../library/sys.rst:1248 +#: ../../library/sys.rst:1257 msgid "" "On Linux, :attr:`sys.platform` doesn't contain the major version anymore. It " "is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``. Since older " @@ -1811,7 +1823,7 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1254 +#: ../../library/sys.rst:1263 msgid "" "On AIX, :attr:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``. Since older " @@ -1819,57 +1831,57 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1262 +#: ../../library/sys.rst:1271 msgid "" ":attr:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: ../../library/sys.rst:1265 +#: ../../library/sys.rst:1274 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: ../../library/sys.rst:1271 +#: ../../library/sys.rst:1280 msgid "" "Name of the platform-specific library directory. It is used to build the " "path of standard library and the paths of installed extension modules." msgstr "" -#: ../../library/sys.rst:1274 +#: ../../library/sys.rst:1283 msgid "" "It is equal to ``\"lib\"`` on most platforms. On Fedora and SuSE, it is " "equal to ``\"lib64\"`` on 64-bit platforms which gives the following ``sys." "path`` paths (where ``X.Y`` is the Python ``major.minor`` version):" msgstr "" -#: ../../library/sys.rst:1278 +#: ../../library/sys.rst:1287 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: ../../library/sys.rst:1280 +#: ../../library/sys.rst:1289 msgid "" "``/usr/lib64/pythonX.Y/lib-dynload/``: C extension modules of the standard " "library (like the :mod:`errno` module, the exact filename is platform " "specific)" msgstr "" -#: ../../library/sys.rst:1283 +#: ../../library/sys.rst:1292 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" -#: ../../library/sys.rst:1285 +#: ../../library/sys.rst:1294 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: ../../library/sys.rst:1293 +#: ../../library/sys.rst:1302 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; on Unix, the default is ``'/usr/" @@ -1878,14 +1890,14 @@ msgid "" "paths." msgstr "" -#: ../../library/sys.rst:1299 +#: ../../library/sys.rst:1308 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " "the Python installation will still be available, via :data:`base_prefix`." msgstr "" -#: ../../library/sys.rst:1314 +#: ../../library/sys.rst:1323 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -1895,7 +1907,7 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: ../../library/sys.rst:1324 +#: ../../library/sys.rst:1333 msgid "" "Set the flags used by the interpreter for :c:func:`dlopen` calls, such as " "when the interpreter loads extension modules. Among other things, this will " @@ -1906,14 +1918,14 @@ msgid "" "data:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:1336 +#: ../../library/sys.rst:1345 msgid "" "Set the :ref:`integer string conversion length limitation " "` used by this interpreter. See also :func:" "`get_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:1348 +#: ../../library/sys.rst:1357 msgid "" "Set the system's profile function, which allows you to implement a Python " "source code profiler in Python. See chapter :ref:`profile` for more " @@ -1928,7 +1940,7 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: ../../library/sys.rst:1359 +#: ../../library/sys.rst:1368 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1942,65 +1954,65 @@ msgid "" "arguments." msgstr "" -#: ../../library/sys.rst:1366 ../../library/sys.rst:1447 +#: ../../library/sys.rst:1375 ../../library/sys.rst:1456 msgid "The events have the following meaning:" msgstr "" -#: ../../library/sys.rst:1370 ../../library/sys.rst:1452 +#: ../../library/sys.rst:1379 ../../library/sys.rst:1461 msgid "``'call'``" msgstr "``'call'``" -#: ../../library/sys.rst:1369 +#: ../../library/sys.rst:1378 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1375 ../../library/sys.rst:1467 +#: ../../library/sys.rst:1384 ../../library/sys.rst:1476 msgid "``'return'``" msgstr "``'return'``" -#: ../../library/sys.rst:1373 +#: ../../library/sys.rst:1382 msgid "" "A function (or other code block) is about to return. The profile function " "is called; *arg* is the value that will be returned, or ``None`` if the " "event is caused by an exception being raised." msgstr "" -#: ../../library/sys.rst:1379 +#: ../../library/sys.rst:1388 msgid "``'c_call'``" msgstr "``'c_call'``" -#: ../../library/sys.rst:1378 +#: ../../library/sys.rst:1387 msgid "" "A C function is about to be called. This may be an extension function or a " "built-in. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1382 +#: ../../library/sys.rst:1391 msgid "``'c_return'``" msgstr "``'c_return'``" -#: ../../library/sys.rst:1382 +#: ../../library/sys.rst:1391 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1384 +#: ../../library/sys.rst:1393 msgid "``'c_exception'``" msgstr "``'c_exception'``" -#: ../../library/sys.rst:1385 +#: ../../library/sys.rst:1394 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1389 +#: ../../library/sys.rst:1398 msgid "" "Set the maximum depth of the Python interpreter stack to *limit*. This " "limit prevents infinite recursion from causing an overflow of the C stack " "and crashing Python." msgstr "" -#: ../../library/sys.rst:1393 +#: ../../library/sys.rst:1402 msgid "" "The highest possible limit is platform-dependent. A user may need to set " "the limit higher when they have a program that requires deep recursion and a " @@ -2008,19 +2020,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: ../../library/sys.rst:1398 +#: ../../library/sys.rst:1407 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -#: ../../library/sys.rst:1401 +#: ../../library/sys.rst:1410 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: ../../library/sys.rst:1408 +#: ../../library/sys.rst:1417 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -2031,7 +2043,7 @@ msgid "" "scheduler." msgstr "" -#: ../../library/sys.rst:1425 +#: ../../library/sys.rst:1434 msgid "" "Set the system's trace function, which allows you to implement a Python " "source code debugger in Python. The function is thread-specific; for a " @@ -2040,7 +2052,7 @@ msgid "" "`threading.settrace`." msgstr "" -#: ../../library/sys.rst:1430 +#: ../../library/sys.rst:1439 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -2048,7 +2060,7 @@ msgid "" "the event type." msgstr "" -#: ../../library/sys.rst:1435 +#: ../../library/sys.rst:1444 msgid "" "The trace function is invoked (with *event* set to ``'call'``) whenever a " "new local scope is entered; it should return a reference to a local trace " @@ -2056,31 +2068,31 @@ msgid "" "traced." msgstr "" -#: ../../library/sys.rst:1440 +#: ../../library/sys.rst:1449 msgid "" "The local trace function should return a reference to itself (or to another " "function for further tracing in that scope), or ``None`` to turn off tracing " "in that scope." msgstr "" -#: ../../library/sys.rst:1444 +#: ../../library/sys.rst:1453 msgid "" "If there is any error occurred in the trace function, it will be unset, just " "like ``settrace(None)`` is called." msgstr "" -#: ../../library/sys.rst:1450 +#: ../../library/sys.rst:1459 msgid "" "A function is called (or some other code block entered). The global trace " "function is called; *arg* is ``None``; the return value specifies the local " "trace function." msgstr "" -#: ../../library/sys.rst:1461 +#: ../../library/sys.rst:1470 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/sys.rst:1455 +#: ../../library/sys.rst:1464 msgid "" "The interpreter is about to execute a new line of code or re-execute the " "condition of a loop. The local trace function is called; *arg* is ``None``; " @@ -2090,7 +2102,7 @@ msgid "" "const:`False` on that frame." msgstr "" -#: ../../library/sys.rst:1464 +#: ../../library/sys.rst:1473 msgid "" "A function (or other code block) is about to return. The local trace " "function is called; *arg* is the value that will be returned, or ``None`` if " @@ -2098,22 +2110,22 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1472 +#: ../../library/sys.rst:1481 msgid "``'exception'``" msgstr "``'exception'``" -#: ../../library/sys.rst:1470 +#: ../../library/sys.rst:1479 msgid "" "An exception has occurred. The local trace function is called; *arg* is a " "tuple ``(exception, value, traceback)``; the return value specifies the new " "local trace function." msgstr "" -#: ../../library/sys.rst:1480 +#: ../../library/sys.rst:1489 msgid "``'opcode'``" msgstr "``'opcode'``" -#: ../../library/sys.rst:1475 +#: ../../library/sys.rst:1484 msgid "" "The interpreter is about to execute a new opcode (see :mod:`dis` for opcode " "details). The local trace function is called; *arg* is ``None``; the return " @@ -2122,13 +2134,13 @@ msgid "" "`f_trace_opcodes` to :const:`True` on the frame." msgstr "" -#: ../../library/sys.rst:1482 +#: ../../library/sys.rst:1491 msgid "" "Note that as an exception is propagated down the chain of callers, an " "``'exception'`` event is generated at each level." msgstr "" -#: ../../library/sys.rst:1485 +#: ../../library/sys.rst:1494 msgid "" "For more fine-grained usage, it's possible to set a trace function by " "assigning ``frame.f_trace = tracefunc`` explicitly, rather than relying on " @@ -2142,7 +2154,7 @@ msgid "" "on each frame)." msgstr "" -#: ../../library/sys.rst:1496 +#: ../../library/sys.rst:1505 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" @@ -2152,7 +2164,7 @@ msgid "" "arguments." msgstr "" -#: ../../library/sys.rst:1502 +#: ../../library/sys.rst:1511 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2160,13 +2172,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1509 +#: ../../library/sys.rst:1518 msgid "" "``'opcode'`` event type added; :attr:`f_trace_lines` and :attr:" "`f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1514 +#: ../../library/sys.rst:1523 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -2187,20 +2199,20 @@ msgid "" "set_asyncgen_hooks_finalizer`` with no arguments." msgstr "" -#: ../../library/sys.rst:1524 +#: ../../library/sys.rst:1533 msgid "" "Two auditing events are raised because the underlying API consists of two " "calls, each of which must raise its own event." msgstr "" -#: ../../library/sys.rst:1527 +#: ../../library/sys.rst:1536 msgid "" "See :pep:`525` for more details, and for a reference example of a " "*finalizer* method see the implementation of ``asyncio.Loop." "shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`" msgstr "" -#: ../../library/sys.rst:1539 +#: ../../library/sys.rst:1548 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2209,74 +2221,74 @@ msgid "" "disabled, ``cr_origin`` will be None." msgstr "" -#: ../../library/sys.rst:1546 +#: ../../library/sys.rst:1555 msgid "" "To enable, pass a *depth* value greater than zero; this sets the number of " "frames whose information will be captured. To disable, pass set *depth* to " "zero." msgstr "" -#: ../../library/sys.rst:1550 +#: ../../library/sys.rst:1559 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1560 +#: ../../library/sys.rst:1569 msgid "" "Changes the :term:`filesystem encoding and error handler` to 'mbcs' and " "'replace' respectively, for consistency with versions of Python prior to 3.6." msgstr "" -#: ../../library/sys.rst:1564 +#: ../../library/sys.rst:1573 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1567 +#: ../../library/sys.rst:1576 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" -#: ../../library/sys.rst:1572 +#: ../../library/sys.rst:1581 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`\\ 。" -#: ../../library/sys.rst:1579 +#: ../../library/sys.rst:1588 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:1582 +#: ../../library/sys.rst:1591 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: ../../library/sys.rst:1584 +#: ../../library/sys.rst:1593 msgid "" "``stdout`` is used for the output of :func:`print` and :term:`expression` " "statements and for the prompts of :func:`input`;" msgstr "" -#: ../../library/sys.rst:1586 +#: ../../library/sys.rst:1595 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:1588 +#: ../../library/sys.rst:1597 msgid "" "These streams are regular :term:`text files ` like those returned " "by the :func:`open` function. Their parameters are chosen as follows:" msgstr "" -#: ../../library/sys.rst:1592 +#: ../../library/sys.rst:1601 msgid "" "The encoding and error handling are is initialized from :c:member:`PyConfig." "stdio_encoding` and :c:member:`PyConfig.stdio_errors`." msgstr "" -#: ../../library/sys.rst:1595 +#: ../../library/sys.rst:1604 msgid "" "On Windows, UTF-8 is used for the console device. Non-character devices " "such as disk files and pipes use the system locale encoding (i.e. the ANSI " @@ -2287,14 +2299,14 @@ msgid "" "initially attached to a console." msgstr "" -#: ../../library/sys.rst:1604 +#: ../../library/sys.rst:1613 msgid "" "The special behaviour of the console can be overridden by setting the " "environment variable PYTHONLEGACYWINDOWSSTDIO before starting Python. In " "that case, the console codepages are used as for any other character device." msgstr "" -#: ../../library/sys.rst:1609 +#: ../../library/sys.rst:1618 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2303,7 +2315,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:1616 +#: ../../library/sys.rst:1625 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2312,19 +2324,19 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:1622 +#: ../../library/sys.rst:1631 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:1628 +#: ../../library/sys.rst:1637 msgid "" "To write or read binary data from/to the standard streams, use the " "underlying binary :data:`~io.TextIOBase.buffer` object. For example, to " "write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``." msgstr "" -#: ../../library/sys.rst:1632 +#: ../../library/sys.rst:1641 msgid "" "However, if you are writing a library (and do not control in which context " "its code will be executed), be aware that the standard streams may be " @@ -2332,7 +2344,7 @@ msgid "" "support the :attr:`~io.BufferedIOBase.buffer` attribute." msgstr "" -#: ../../library/sys.rst:1642 +#: ../../library/sys.rst:1651 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2340,7 +2352,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:1647 +#: ../../library/sys.rst:1656 msgid "" "It can also be used to restore the actual files to known working file " "objects in case they have been overwritten with a broken object. However, " @@ -2348,7 +2360,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:1653 +#: ../../library/sys.rst:1662 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2356,12 +2368,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:1661 +#: ../../library/sys.rst:1670 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: ../../library/sys.rst:1663 +#: ../../library/sys.rst:1672 msgid "" "It is the same on all platforms. Modules which are not available on some " "platforms and modules disabled at Python build are also listed. All module " @@ -2369,7 +2381,7 @@ msgid "" "modules are excluded." msgstr "" -#: ../../library/sys.rst:1668 +#: ../../library/sys.rst:1677 msgid "" "For packages, only the main package is listed: sub-packages and sub-modules " "are not listed. For example, the ``email`` package is listed, but the " @@ -2377,72 +2389,72 @@ msgid "" "listed." msgstr "" -#: ../../library/sys.rst:1673 +#: ../../library/sys.rst:1682 msgid "See also the :attr:`sys.builtin_module_names` list." msgstr "另請參閱 :attr:`sys.builtin_module_names` 清單。" -#: ../../library/sys.rst:1680 +#: ../../library/sys.rst:1689 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:1688 +#: ../../library/sys.rst:1697 msgid ":const:`name`" msgstr ":const:`name`" -#: ../../library/sys.rst:1688 +#: ../../library/sys.rst:1697 msgid "Name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:1690 +#: ../../library/sys.rst:1699 msgid "``'nt'``: Windows threads" msgstr "" -#: ../../library/sys.rst:1691 +#: ../../library/sys.rst:1700 msgid "``'pthread'``: POSIX threads" msgstr "" -#: ../../library/sys.rst:1692 +#: ../../library/sys.rst:1701 msgid "" "``'pthread-stubs'``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: ../../library/sys.rst:1694 +#: ../../library/sys.rst:1703 msgid "``'solaris'``: Solaris threads" msgstr "" -#: ../../library/sys.rst:1696 +#: ../../library/sys.rst:1705 msgid ":const:`lock`" msgstr ":const:`lock`" -#: ../../library/sys.rst:1696 +#: ../../library/sys.rst:1705 msgid "Name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:1698 +#: ../../library/sys.rst:1707 msgid "``'semaphore'``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:1699 +#: ../../library/sys.rst:1708 msgid "``'mutex+cond'``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:1701 +#: ../../library/sys.rst:1710 msgid "``None`` if this information is unknown" msgstr "" -#: ../../library/sys.rst:1703 +#: ../../library/sys.rst:1712 msgid ":const:`version`" msgstr ":const:`version`" -#: ../../library/sys.rst:1703 +#: ../../library/sys.rst:1712 msgid "" "Name and version of the thread library. It is a string, or ``None`` if this " "information is unknown." msgstr "" -#: ../../library/sys.rst:1712 +#: ../../library/sys.rst:1721 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2451,68 +2463,68 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:1720 +#: ../../library/sys.rst:1729 msgid "Handle an unraisable exception." msgstr "" -#: ../../library/sys.rst:1722 +#: ../../library/sys.rst:1731 msgid "" "Called when an exception has occurred but there is no way for Python to " "handle it. For example, when a destructor raises an exception or during " "garbage collection (:func:`gc.collect`)." msgstr "" -#: ../../library/sys.rst:1726 +#: ../../library/sys.rst:1735 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: ../../library/sys.rst:1728 +#: ../../library/sys.rst:1737 msgid "*exc_type*: Exception type." msgstr "" -#: ../../library/sys.rst:1729 +#: ../../library/sys.rst:1738 msgid "*exc_value*: Exception value, can be ``None``." msgstr "" -#: ../../library/sys.rst:1730 +#: ../../library/sys.rst:1739 msgid "*exc_traceback*: Exception traceback, can be ``None``." msgstr "" -#: ../../library/sys.rst:1731 +#: ../../library/sys.rst:1740 msgid "*err_msg*: Error message, can be ``None``." msgstr "" -#: ../../library/sys.rst:1732 +#: ../../library/sys.rst:1741 msgid "*object*: Object causing the exception, can be ``None``." msgstr "" -#: ../../library/sys.rst:1734 +#: ../../library/sys.rst:1743 msgid "" "The default hook formats *err_msg* and *object* as: ``f'{err_msg}: {object!" "r}'``; use \"Exception ignored in\" error message if *err_msg* is ``None``." msgstr "" -#: ../../library/sys.rst:1738 +#: ../../library/sys.rst:1747 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:1741 +#: ../../library/sys.rst:1750 msgid "" "Storing *exc_value* using a custom hook can create a reference cycle. It " "should be cleared explicitly to break the reference cycle when the exception " "is no longer needed." msgstr "" -#: ../../library/sys.rst:1745 +#: ../../library/sys.rst:1754 msgid "" "Storing *object* using a custom hook can resurrect it if it is set to an " "object which is being finalized. Avoid storing *object* after the custom " "hook completes to avoid resurrecting objects." msgstr "" -#: ../../library/sys.rst:1749 +#: ../../library/sys.rst:1758 msgid "See also :func:`excepthook` which handles uncaught exceptions." msgstr "" @@ -2522,7 +2534,7 @@ msgid "" "arguments ``hook``, ``unraisable``." msgstr "" -#: ../../library/sys.rst:1753 +#: ../../library/sys.rst:1762 msgid "" "Raise an auditing event ``sys.unraisablehook`` with arguments ``hook``, " "``unraisable`` when an exception that cannot be handled occurs. The " @@ -2530,7 +2542,7 @@ msgid "" "hook has been set, ``hook`` may be ``None``." msgstr "" -#: ../../library/sys.rst:1762 +#: ../../library/sys.rst:1771 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2539,13 +2551,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:1771 +#: ../../library/sys.rst:1780 msgid "" "The C API version for this interpreter. Programmers may find this useful " "when debugging version conflicts between Python and extension modules." msgstr "" -#: ../../library/sys.rst:1777 +#: ../../library/sys.rst:1786 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2556,18 +2568,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:1785 +#: ../../library/sys.rst:1794 msgid "Added named component attributes." msgstr "" -#: ../../library/sys.rst:1790 +#: ../../library/sys.rst:1799 msgid "" "This is an implementation detail of the warnings framework; do not modify " "this value. Refer to the :mod:`warnings` module for more information on the " "warnings framework." msgstr "" -#: ../../library/sys.rst:1797 +#: ../../library/sys.rst:1806 msgid "" "The version number used to form registry keys on Windows platforms. This is " "stored as string resource 1000 in the Python DLL. The value is normally the " @@ -2576,25 +2588,25 @@ msgid "" "on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:1808 +#: ../../library/sys.rst:1817 msgid "" "A dictionary of the various implementation-specific flags passed through " "the :option:`-X` command-line option. Option names are either mapped to " "their values, if given explicitly, or to :const:`True`. Example:" msgstr "" -#: ../../library/sys.rst:1824 +#: ../../library/sys.rst:1833 msgid "" "This is a CPython-specific way of accessing options passed through :option:`-" "X`. Other implementations may export them through other means, or not at " "all." msgstr "" -#: ../../library/sys.rst:1832 +#: ../../library/sys.rst:1841 msgid "Citations" msgstr "" -#: ../../library/sys.rst:1833 +#: ../../library/sys.rst:1842 msgid "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" A public draft of this " "standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/"