diff --git a/library/stdtypes.po b/library/stdtypes.po index c2a29248ec..470d81e969 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-23 16:50+0800\n" +"POT-Creation-Date: 2024-04-26 16:28+0800\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-" @@ -58,7 +58,7 @@ msgid "" msgstr "" "某些操作已被多種物件型別支援;特別是實務上所有物件都已經可以做相等性比較、真" "值檢測及被轉換為字串(使用 :func:`repr` 函式或稍有差異的 :func:`str` 函式)," -"後者為當物件傳入 :func:`print` 函式印出時在背後被調用的函式。" +"後者為當物件傳入 :func:`print` 函式印出時在背後被呼叫的函式。" #: ../../library/stdtypes.rst:32 msgid "Truth Value Testing" @@ -75,33 +75,33 @@ msgstr "" #: ../../library/stdtypes.rst:46 msgid "" "By default, an object is considered true unless its class defines either a :" -"meth:`__bool__` method that returns ``False`` or a :meth:`__len__` method " -"that returns zero, when called with the object. [1]_ Here are most of the " -"built-in objects considered false:" +"meth:`~object.__bool__` method that returns ``False`` or a :meth:`~object." +"__len__` method that returns zero, when called with the object. [1]_ Here " +"are most of the built-in objects considered false:" msgstr "" "預設情況下,一個物件會被視為真值,除非它的 class 定義了會回傳 ``False`` 的 :" -"meth:`__bool__` method 或是定義了會回傳零的 :meth:`__len__` method。[1]_ 以下" -"列出了大部分會被視為 false 的內建物件:" +"meth:`~object.__bool__` method 或是定義了會回傳零的 :meth:`~object.__len__` " +"method。[1]_ 以下列出了大部分會被視為 false 的內建物件:" -#: ../../library/stdtypes.rst:55 +#: ../../library/stdtypes.rst:56 msgid "constants defined to be false: ``None`` and ``False``" msgstr "定義為 false 之常數:``None`` 與 ``False``" -#: ../../library/stdtypes.rst:57 +#: ../../library/stdtypes.rst:58 msgid "" "zero of any numeric type: ``0``, ``0.0``, ``0j``, ``Decimal(0)``, " "``Fraction(0, 1)``" msgstr "" "任何數值型別的零:``0``、``0.0``、``0j``、``Decimal(0)``、``Fraction(0, 1)``" -#: ../../library/stdtypes.rst:60 +#: ../../library/stdtypes.rst:61 msgid "" "empty sequences and collections: ``''``, ``()``, ``[]``, ``{}``, ``set()``, " "``range(0)``" msgstr "" "空的序列和集合:``''``、``()``、``[]``、``{}``、``set()``、``range(0)``" -#: ../../library/stdtypes.rst:69 +#: ../../library/stdtypes.rst:70 msgid "" "Operations and built-in functions that have a Boolean result always return " "``0`` or ``False`` for false and ``1`` or ``True`` for true, unless " @@ -112,117 +112,115 @@ msgstr "" "``False`` 作為假值、``1`` 或 ``True`` 作為真值。(重要例外: boolean 運算 " "``or`` 和 ``and`` 回傳的是其中一個運算元。)" -#: ../../library/stdtypes.rst:78 +#: ../../library/stdtypes.rst:79 msgid "Boolean Operations --- :keyword:`!and`, :keyword:`!or`, :keyword:`!not`" -msgstr "Boolean(布林)運算 --- :keyword:`!and`, :keyword:`!or`, :keyword:`!not`" +msgstr "" +"Boolean(布林)運算 --- :keyword:`!and`, :keyword:`!or`, :keyword:`!not`" -#: ../../library/stdtypes.rst:82 +#: ../../library/stdtypes.rst:83 msgid "These are the Boolean operations, ordered by ascending priority:" msgstr "下方為 Boolean 運算,按優先順序排序:" -#: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:143 -#: ../../library/stdtypes.rst:275 ../../library/stdtypes.rst:363 -#: ../../library/stdtypes.rst:413 ../../library/stdtypes.rst:961 -#: ../../library/stdtypes.rst:1166 +#: ../../library/stdtypes.rst:86 ../../library/stdtypes.rst:144 +#: ../../library/stdtypes.rst:276 ../../library/stdtypes.rst:366 +#: ../../library/stdtypes.rst:416 ../../library/stdtypes.rst:965 +#: ../../library/stdtypes.rst:1170 msgid "Operation" msgstr "運算" -#: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:275 -#: ../../library/stdtypes.rst:363 ../../library/stdtypes.rst:413 -#: ../../library/stdtypes.rst:961 ../../library/stdtypes.rst:1166 +#: ../../library/stdtypes.rst:86 ../../library/stdtypes.rst:276 +#: ../../library/stdtypes.rst:366 ../../library/stdtypes.rst:416 +#: ../../library/stdtypes.rst:965 ../../library/stdtypes.rst:1170 msgid "Result" msgstr "結果" -#: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:275 -#: ../../library/stdtypes.rst:413 ../../library/stdtypes.rst:961 -#: ../../library/stdtypes.rst:1166 ../../library/stdtypes.rst:2416 -#: ../../library/stdtypes.rst:3634 +#: ../../library/stdtypes.rst:86 ../../library/stdtypes.rst:276 +#: ../../library/stdtypes.rst:416 ../../library/stdtypes.rst:965 +#: ../../library/stdtypes.rst:1170 ../../library/stdtypes.rst:2419 +#: ../../library/stdtypes.rst:3637 msgid "Notes" msgstr "註解" -#: ../../library/stdtypes.rst:87 +#: ../../library/stdtypes.rst:88 msgid "``x or y``" msgstr "``x or y``" -#: ../../library/stdtypes.rst:87 +#: ../../library/stdtypes.rst:88 msgid "if *x* is true, then *x*, else *y*" msgstr "假如 *x* 為真,則 *x*,否則 *y*" -#: ../../library/stdtypes.rst:87 ../../library/stdtypes.rst:285 -#: ../../library/stdtypes.rst:963 ../../library/stdtypes.rst:966 -#: ../../library/stdtypes.rst:1177 ../../library/stdtypes.rst:2422 -#: ../../library/stdtypes.rst:3640 +#: ../../library/stdtypes.rst:88 ../../library/stdtypes.rst:967 +#: ../../library/stdtypes.rst:970 ../../library/stdtypes.rst:1181 +#: ../../library/stdtypes.rst:2425 ../../library/stdtypes.rst:3643 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/stdtypes.rst:90 +#: ../../library/stdtypes.rst:91 msgid "``x and y``" msgstr "``x and y``" -#: ../../library/stdtypes.rst:90 +#: ../../library/stdtypes.rst:91 msgid "if *x* is false, then *x*, else *y*" msgstr "假如 *x* 為假,則 *x*,否則 *y*" -#: ../../library/stdtypes.rst:90 ../../library/stdtypes.rst:288 -#: ../../library/stdtypes.rst:308 ../../library/stdtypes.rst:1205 -#: ../../library/stdtypes.rst:2426 ../../library/stdtypes.rst:2428 -#: ../../library/stdtypes.rst:3644 ../../library/stdtypes.rst:3646 +#: ../../library/stdtypes.rst:91 ../../library/stdtypes.rst:289 +#: ../../library/stdtypes.rst:309 ../../library/stdtypes.rst:1209 +#: ../../library/stdtypes.rst:2429 ../../library/stdtypes.rst:2431 +#: ../../library/stdtypes.rst:3647 ../../library/stdtypes.rst:3649 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/stdtypes.rst:93 +#: ../../library/stdtypes.rst:94 msgid "``not x``" msgstr "``not x``" -#: ../../library/stdtypes.rst:93 +#: ../../library/stdtypes.rst:94 msgid "if *x* is false, then ``True``, else ``False``" msgstr "假如 *x* 為假,則 ``True``,否則 ``False``" -#: ../../library/stdtypes.rst:93 ../../library/stdtypes.rst:975 -#: ../../library/stdtypes.rst:1208 ../../library/stdtypes.rst:2430 -#: ../../library/stdtypes.rst:2432 ../../library/stdtypes.rst:2434 -#: ../../library/stdtypes.rst:2436 ../../library/stdtypes.rst:3648 -#: ../../library/stdtypes.rst:3650 ../../library/stdtypes.rst:3652 -#: ../../library/stdtypes.rst:3654 +#: ../../library/stdtypes.rst:94 ../../library/stdtypes.rst:979 +#: ../../library/stdtypes.rst:1212 ../../library/stdtypes.rst:2433 +#: ../../library/stdtypes.rst:2435 ../../library/stdtypes.rst:2437 +#: ../../library/stdtypes.rst:2439 ../../library/stdtypes.rst:3651 +#: ../../library/stdtypes.rst:3653 ../../library/stdtypes.rst:3655 +#: ../../library/stdtypes.rst:3657 msgid "\\(3)" msgstr "\\(3)" -#: ../../library/stdtypes.rst:102 ../../library/stdtypes.rst:319 -#: ../../library/stdtypes.rst:431 ../../library/stdtypes.rst:1012 -#: ../../library/stdtypes.rst:1216 ../../library/stdtypes.rst:2462 -#: ../../library/stdtypes.rst:3684 +#: ../../library/stdtypes.rst:103 ../../library/stdtypes.rst:320 +#: ../../library/stdtypes.rst:434 ../../library/stdtypes.rst:1016 +#: ../../library/stdtypes.rst:1220 ../../library/stdtypes.rst:2465 +#: ../../library/stdtypes.rst:3687 msgid "Notes:" msgstr "註解:" -#: ../../library/stdtypes.rst:105 +#: ../../library/stdtypes.rst:106 msgid "" "This is a short-circuit operator, so it only evaluates the second argument " "if the first one is false." msgstr "" -"這是一個短路運算子,所以他只有在第一個變數為假時," -"才會對第二個變數求值。" +"這是一個短路運算子,所以他只有在第一個引數為假時,才會對第二個引數求值。" -#: ../../library/stdtypes.rst:109 +#: ../../library/stdtypes.rst:110 msgid "" "This is a short-circuit operator, so it only evaluates the second argument " "if the first one is true." msgstr "" -"這是一個短路運算子,所以他只有在第一個變數為真時," -"才會對第二個變數求值。" +"這是一個短路運算子,所以他只有在第一個引數為真時,才會對第二個引數求值。" -#: ../../library/stdtypes.rst:113 +#: ../../library/stdtypes.rst:114 msgid "" "``not`` has a lower priority than non-Boolean operators, so ``not a == b`` " "is interpreted as ``not (a == b)``, and ``a == not b`` is a syntax error." msgstr "" -"``not`` 比非 Boolean 運算子有較低的優先權,因此 ``not a == b`` " -"可直譯為 ``not (a == b)``,而 ``a == not b`` 會導致語法錯誤。" +"``not`` 比非 Boolean 運算子有較低的優先權,因此 ``not a == b`` 可直譯為 " +"``not (a == b)``,而 ``a == not b`` 會導致語法錯誤。" -#: ../../library/stdtypes.rst:120 +#: ../../library/stdtypes.rst:121 msgid "Comparisons" msgstr "比較運算" -#: ../../library/stdtypes.rst:134 +#: ../../library/stdtypes.rst:135 msgid "" "There are eight comparison operations in Python. They all have the same " "priority (which is higher than that of the Boolean operations). Comparisons " @@ -230,87 +228,86 @@ msgid "" "< y and y <= z``, except that *y* is evaluated only once (but in both cases " "*z* is not evaluated at all when ``x < y`` is found to be false)." msgstr "" -"在 Python 裡共有 8 種比較運算。他們的優先順序都相同" -"(皆優先於 Boolean 運算)。比較運算" -"可以任意的串連;例如,``x < y <= z`` 等同於 " -"``x < y and y <= z``,差異只在於前者的 *y* 只有被求值一次(但在這兩個例子" -"中,當 ``x < y`` 為假時,*z* 皆不會被求值)。" +"在 Python 裡共有 8 種比較運算。他們的優先順序都相同(皆優先於 Boolean 運" +"算)。比較運算可以任意的串連;例如,``x < y <= z`` 等同於 ``x < y and y <= " +"z``,差異只在於前者的 *y* 只有被求值一次(但在這兩個例子中,當 ``x < y`` 為假" +"時,*z* 皆不會被求值)。" -#: ../../library/stdtypes.rst:140 +#: ../../library/stdtypes.rst:141 msgid "This table summarizes the comparison operations:" msgstr "這個表格統整所有比較運算:" -#: ../../library/stdtypes.rst:143 ../../library/stdtypes.rst:2393 -#: ../../library/stdtypes.rst:2416 ../../library/stdtypes.rst:3611 -#: ../../library/stdtypes.rst:3634 +#: ../../library/stdtypes.rst:144 ../../library/stdtypes.rst:2396 +#: ../../library/stdtypes.rst:2419 ../../library/stdtypes.rst:3614 +#: ../../library/stdtypes.rst:3637 msgid "Meaning" msgstr "含義" -#: ../../library/stdtypes.rst:145 +#: ../../library/stdtypes.rst:146 msgid "``<``" msgstr "``<``" -#: ../../library/stdtypes.rst:145 +#: ../../library/stdtypes.rst:146 msgid "strictly less than" msgstr "小於" -#: ../../library/stdtypes.rst:147 +#: ../../library/stdtypes.rst:148 msgid "``<=``" msgstr "``<=``" -#: ../../library/stdtypes.rst:147 +#: ../../library/stdtypes.rst:148 msgid "less than or equal" msgstr "小於等於" -#: ../../library/stdtypes.rst:149 +#: ../../library/stdtypes.rst:150 msgid "``>``" msgstr "``>``" -#: ../../library/stdtypes.rst:149 +#: ../../library/stdtypes.rst:150 msgid "strictly greater than" msgstr "大於" -#: ../../library/stdtypes.rst:151 +#: ../../library/stdtypes.rst:152 msgid "``>=``" msgstr "``>=``" -#: ../../library/stdtypes.rst:151 +#: ../../library/stdtypes.rst:152 msgid "greater than or equal" msgstr "大於等於" -#: ../../library/stdtypes.rst:153 +#: ../../library/stdtypes.rst:154 msgid "``==``" msgstr "``==``" -#: ../../library/stdtypes.rst:153 +#: ../../library/stdtypes.rst:154 msgid "equal" msgstr "等於" -#: ../../library/stdtypes.rst:155 +#: ../../library/stdtypes.rst:156 msgid "``!=``" msgstr "``!=``" -#: ../../library/stdtypes.rst:155 +#: ../../library/stdtypes.rst:156 msgid "not equal" msgstr "不等於" -#: ../../library/stdtypes.rst:157 +#: ../../library/stdtypes.rst:158 msgid "``is``" msgstr "``is``" -#: ../../library/stdtypes.rst:157 +#: ../../library/stdtypes.rst:158 msgid "object identity" msgstr "物件識別性" -#: ../../library/stdtypes.rst:159 +#: ../../library/stdtypes.rst:160 msgid "``is not``" msgstr "``is not``" -#: ../../library/stdtypes.rst:159 +#: ../../library/stdtypes.rst:160 msgid "negated object identity" msgstr "否定的物件識別性" -#: ../../library/stdtypes.rst:166 +#: ../../library/stdtypes.rst:167 msgid "" "Objects of different types, except different numeric types, never compare " "equal. The ``==`` operator is always defined but for some object types (for " @@ -319,22 +316,20 @@ msgid "" "example, they raise a :exc:`TypeError` exception when one of the arguments " "is a complex number." msgstr "" -"除了不同的數字型別外,不同型別的物件不能進行相等比較。" -"運算子 ``==`` 總有定義,但在某些物件類型(例如, " -"class 物件)時,運算子會等同於 :keyword:`is`。 其他運算子 ``<``、``<=``、" -"``>`` 及 ``>=`` 皆僅在有意義的部分有所定義;例如," -"當其中一個引數為複數時," -"將引發一個 :exc:`TypeError` 的例外。" +"除了不同的數值型別外,不同型別的物件不能進行相等比較。運算子 ``==`` 總有定" +"義,但在某些物件型別(例如,class 物件)時,運算子會等同於 :keyword:`is`。其" +"他運算子 ``<``、``<=``、``>`` 及 ``>=`` 皆僅在有意義的部分有所定義;例如,當" +"其中一個引數為複數時,將引發一個 :exc:`TypeError` 的例外。" -#: ../../library/stdtypes.rst:180 +#: ../../library/stdtypes.rst:181 msgid "" "Non-identical instances of a class normally compare as non-equal unless the " "class defines the :meth:`~object.__eq__` method." msgstr "" -"一個 class 的非相同實例通常會比較為不相等,除非 " -"class 有定義 :meth:`~object.__eq__` method。" +"一個 class 的非相同實例通常會比較為不相等,除非 class 有定義 :meth:`~object." +"__eq__` method。" -#: ../../library/stdtypes.rst:183 +#: ../../library/stdtypes.rst:184 msgid "" "Instances of a class cannot be ordered with respect to other instances of " "the same class, or other types of object, unless the class defines enough of " @@ -343,38 +338,36 @@ msgid "" "meth:`~object.__eq__` are sufficient, if you want the conventional meanings " "of the comparison operators)." msgstr "" -"一個 class 的實例不可以與其他相同 class 的實例" -"或其他物件的類別進行排序,除非 class 定義足夠的" -" method ,包含 :meth:`~object.__lt__`、:meth:`~object.__le__`、:meth:`~object." -"__gt__` 及 :meth:`~object.__ge__`\\ (一般來說,使用 :meth:`~object.__lt__` 及 :" -"meth:`~object.__eq__` 就可以滿足" -"常規意義上的比較運算子)。" +"一個 class 的實例不可以與其他相同 class 的實例或其他物件型別進行排序,除非 " +"class 定義足夠的 method ,包含 :meth:`~object.__lt__`、:meth:`~object." +"__le__`、:meth:`~object.__gt__` 及 :meth:`~object.__ge__`\\ (一般來說,使" +"用 :meth:`~object.__lt__` 及 :meth:`~object.__eq__` 就可以滿足常規意義上的比" +"較運算子)。" -#: ../../library/stdtypes.rst:190 +#: ../../library/stdtypes.rst:191 msgid "" "The behavior of the :keyword:`is` and :keyword:`is not` operators cannot be " "customized; also they can be applied to any two objects and never raise an " "exception." msgstr "" -"無法自定義 :keyword:`is` 與 :keyword:`is not` 運算子的行為" -";這兩個運算子也可以運用在任意兩個物件且不會導致" -"例外。" +"無法自定義 :keyword:`is` 與 :keyword:`is not` 運算子的行為;這兩個運算子也可" +"以運用在任意兩個物件且不會引發例外。" -#: ../../library/stdtypes.rst:198 +#: ../../library/stdtypes.rst:199 msgid "" "Two more operations with the same syntactic priority, :keyword:`in` and :" "keyword:`not in`, are supported by types that are :term:`iterable` or " -"implement the :meth:`__contains__` method." +"implement the :meth:`~object.__contains__` method." msgstr "" -"此外,擁有相同的語法優先序的 :keyword:`in` 及 :keyword:`not in` 兩種運算" -"皆被是 :term:`iterable` 或者" -"有實作 :meth:`__contains__` method 的型別所支援。" +"此外,擁有相同的語法優先序的 :keyword:`in` 及 :keyword:`not in` 兩種運算皆被" +"\\ :term:`可疊代物件 `\\ 或者有實作 :meth:`~object.__contains__` " +"method 的型別所支援。" -#: ../../library/stdtypes.rst:205 +#: ../../library/stdtypes.rst:206 msgid "Numeric Types --- :class:`int`, :class:`float`, :class:`complex`" -msgstr "" +msgstr "數值型別 --- :class:`int`、:class:`float`、:class:`complex`" -#: ../../library/stdtypes.rst:215 +#: ../../library/stdtypes.rst:216 msgid "" "There are three distinct numeric types: :dfn:`integers`, :dfn:`floating " "point numbers`, and :dfn:`complex numbers`. In addition, Booleans are a " @@ -388,8 +381,15 @@ msgid "" "numeric types :mod:`fractions.Fraction`, for rationals, and :mod:`decimal." "Decimal`, for floating-point numbers with user-definable precision.)" msgstr "" +"數值型別共有三種::dfn:`整數`、:dfn:`浮點數` 及 :dfn:`複數`。此外,Boolean 為" +"整數中的一個子型別。整數有無限的精度。浮點數通常使用 C 裡面的 :c:expr:" +"`double` 實作。關於在你程式所運作的機器上之浮點數的精度及內部表示法可以在 :" +"data:`sys.float_info` 進行查找。複數包含實數及虛數的部分,這兩部分各自是一個" +"浮點數。若要從一個複數 *z* 提取這兩部分,需使用 ``z.real`` 及 ``z.imag``。" +"(標準函式庫包含額外的數值型別,像是 :mod:`fractions.Fraction` 表示有理數," +"而 :mod:`decimal.Decimal` 表示可由使用者制定精度的浮點數。)" -#: ../../library/stdtypes.rst:237 +#: ../../library/stdtypes.rst:238 msgid "" "Numbers are created by numeric literals or as the result of built-in " "functions and operators. Unadorned integer literals (including hex, octal " @@ -399,8 +399,12 @@ msgid "" "with a zero real part) which you can add to an integer or float to get a " "complex number with real and imaginary parts." msgstr "" +"數字是由字面數值或內建公式及運算子的結果所產生的。未經修飾的字面數值(含十六" +"進位、八進位及二進位數值)會 yield 整數。包含小數點或指數符號的字面數值會 " +"yield 浮點數。在數值後面加上 ``'j'`` 或是 ``'J'`` 會 yield 一個虛數(意即一個" +"實數為 0 的複數)。你也可以將整數與浮點數相加以得到一個有實部與虛部的複數。" -#: ../../library/stdtypes.rst:262 +#: ../../library/stdtypes.rst:263 msgid "" "Python fully supports mixed arithmetic: when a binary arithmetic operator " "has operands of different numeric types, the operand with the \"narrower\" " @@ -409,412 +413,450 @@ msgid "" "of different types behaves as though the exact values of those numbers were " "being compared. [2]_" msgstr "" +"Python 完全支援混和運算:當一個二元運算子的運算元有不同數值型別時,「較窄」型" +"別的運算元會被拓寬到另一個型別的運算元;在此處,整數窄於浮點數,浮點數又窄於" +"複數。不同型別的數字間的比較等同於這些數字的精確值進行比較。[2]_" -#: ../../library/stdtypes.rst:268 +#: ../../library/stdtypes.rst:269 msgid "" "The constructors :func:`int`, :func:`float`, and :func:`complex` can be used " "to produce numbers of a specific type." msgstr "" +"建構函式: :func:`int`、:func:`float` 及 :func:`complex` 可以用來產生特定型別" +"的數字。" -#: ../../library/stdtypes.rst:271 +#: ../../library/stdtypes.rst:272 msgid "" "All numeric types (except complex) support the following operations (for " "priorities of the operations, see :ref:`operator-summary`):" msgstr "" +"所有數值型別(除複數外)皆支援以下的運算(有關運算的先後順序,詳見 :ref:" +"`operator-summary`):" -#: ../../library/stdtypes.rst:275 +#: ../../library/stdtypes.rst:276 msgid "Full documentation" -msgstr "" +msgstr "完整文件" -#: ../../library/stdtypes.rst:277 +#: ../../library/stdtypes.rst:278 msgid "``x + y``" msgstr "``x + y``" -#: ../../library/stdtypes.rst:277 +#: ../../library/stdtypes.rst:278 msgid "sum of *x* and *y*" -msgstr "" +msgstr "*x* 及 *y* 的加總" -#: ../../library/stdtypes.rst:279 +#: ../../library/stdtypes.rst:280 msgid "``x - y``" msgstr "``x - y``" -#: ../../library/stdtypes.rst:279 +#: ../../library/stdtypes.rst:280 msgid "difference of *x* and *y*" -msgstr "" +msgstr "*x* 及 *y* 的相減" -#: ../../library/stdtypes.rst:281 +#: ../../library/stdtypes.rst:282 msgid "``x * y``" msgstr "``x * y``" -#: ../../library/stdtypes.rst:281 +#: ../../library/stdtypes.rst:282 msgid "product of *x* and *y*" -msgstr "" +msgstr "*x* 及 *y* 的相乘" -#: ../../library/stdtypes.rst:283 +#: ../../library/stdtypes.rst:284 msgid "``x / y``" msgstr "``x / y``" -#: ../../library/stdtypes.rst:283 +#: ../../library/stdtypes.rst:284 msgid "quotient of *x* and *y*" -msgstr "" +msgstr "*x* 及 *y* 相除之商" -#: ../../library/stdtypes.rst:285 +#: ../../library/stdtypes.rst:286 msgid "``x // y``" msgstr "``x // y``" -#: ../../library/stdtypes.rst:285 +#: ../../library/stdtypes.rst:286 msgid "floored quotient of *x* and *y*" -msgstr "" +msgstr "*x* 及 *y* 的整數除法" + +#: ../../library/stdtypes.rst:286 +msgid "\\(1)\\(2)" +msgstr "\\(1)\\(2)" -#: ../../library/stdtypes.rst:288 +#: ../../library/stdtypes.rst:289 msgid "``x % y``" msgstr "``x % y``" -#: ../../library/stdtypes.rst:288 +#: ../../library/stdtypes.rst:289 msgid "remainder of ``x / y``" -msgstr "" +msgstr "``x / y`` 的餘數" -#: ../../library/stdtypes.rst:290 +#: ../../library/stdtypes.rst:291 msgid "``-x``" msgstr "``-x``" -#: ../../library/stdtypes.rst:290 +#: ../../library/stdtypes.rst:291 msgid "*x* negated" -msgstr "" +msgstr "*x* 的負數" -#: ../../library/stdtypes.rst:292 +#: ../../library/stdtypes.rst:293 msgid "``+x``" msgstr "``+x``" -#: ../../library/stdtypes.rst:292 +#: ../../library/stdtypes.rst:293 msgid "*x* unchanged" -msgstr "" +msgstr "*x* 不變" -#: ../../library/stdtypes.rst:294 +#: ../../library/stdtypes.rst:295 msgid "``abs(x)``" msgstr "``abs(x)``" -#: ../../library/stdtypes.rst:294 +#: ../../library/stdtypes.rst:295 msgid "absolute value or magnitude of *x*" -msgstr "" +msgstr "*x* 的絕對值或量 (magnitude)" -#: ../../library/stdtypes.rst:294 +#: ../../library/stdtypes.rst:295 msgid ":func:`abs`" msgstr ":func:`abs`" -#: ../../library/stdtypes.rst:297 +#: ../../library/stdtypes.rst:298 msgid "``int(x)``" msgstr "``int(x)``" -#: ../../library/stdtypes.rst:297 +#: ../../library/stdtypes.rst:298 msgid "*x* converted to integer" -msgstr "" +msgstr "將 *x* 轉為整數" -#: ../../library/stdtypes.rst:297 +#: ../../library/stdtypes.rst:298 msgid "\\(3)\\(6)" msgstr "\\(3)\\(6)" -#: ../../library/stdtypes.rst:297 +#: ../../library/stdtypes.rst:298 msgid ":func:`int`" msgstr ":func:`int`" -#: ../../library/stdtypes.rst:299 +#: ../../library/stdtypes.rst:300 msgid "``float(x)``" msgstr "``float(x)``" -#: ../../library/stdtypes.rst:299 +#: ../../library/stdtypes.rst:300 msgid "*x* converted to floating point" -msgstr "" +msgstr "將 *x* 轉為浮點數" -#: ../../library/stdtypes.rst:299 +#: ../../library/stdtypes.rst:300 msgid "\\(4)\\(6)" msgstr "\\(4)\\(6)" -#: ../../library/stdtypes.rst:299 +#: ../../library/stdtypes.rst:300 msgid ":func:`float`" msgstr ":func:`float`" -#: ../../library/stdtypes.rst:301 +#: ../../library/stdtypes.rst:302 msgid "``complex(re, im)``" msgstr "``complex(re, im)``" -#: ../../library/stdtypes.rst:301 +#: ../../library/stdtypes.rst:302 msgid "" "a complex number with real part *re*, imaginary part *im*. *im* defaults to " "zero." -msgstr "" +msgstr "一個複數,其實部為 *re*,虛部為 *im*。*im* 預設為零。" -#: ../../library/stdtypes.rst:301 ../../library/stdtypes.rst:1198 -#: ../../library/stdtypes.rst:2424 ../../library/stdtypes.rst:3671 +#: ../../library/stdtypes.rst:302 ../../library/stdtypes.rst:1202 +#: ../../library/stdtypes.rst:2427 ../../library/stdtypes.rst:3674 msgid "\\(6)" msgstr "\\(6)" -#: ../../library/stdtypes.rst:301 +#: ../../library/stdtypes.rst:302 msgid ":func:`complex`" msgstr ":func:`complex`" -#: ../../library/stdtypes.rst:305 +#: ../../library/stdtypes.rst:306 msgid "``c.conjugate()``" msgstr "``c.conjugate()``" -#: ../../library/stdtypes.rst:305 +#: ../../library/stdtypes.rst:306 msgid "conjugate of the complex number *c*" -msgstr "" +msgstr "為複數 *c* 的共軛複數" -#: ../../library/stdtypes.rst:308 +#: ../../library/stdtypes.rst:309 msgid "``divmod(x, y)``" msgstr "``divmod(x, y)``" -#: ../../library/stdtypes.rst:308 +#: ../../library/stdtypes.rst:309 msgid "the pair ``(x // y, x % y)``" -msgstr "" +msgstr "一對 ``(x // y, x % y)``" -#: ../../library/stdtypes.rst:308 +#: ../../library/stdtypes.rst:309 msgid ":func:`divmod`" msgstr ":func:`divmod`" -#: ../../library/stdtypes.rst:310 +#: ../../library/stdtypes.rst:311 msgid "``pow(x, y)``" msgstr "``pow(x, y)``" -#: ../../library/stdtypes.rst:310 ../../library/stdtypes.rst:312 +#: ../../library/stdtypes.rst:311 ../../library/stdtypes.rst:313 msgid "*x* to the power *y*" -msgstr "" +msgstr "*x* 的 *y* 次方" -#: ../../library/stdtypes.rst:310 ../../library/stdtypes.rst:312 -#: ../../library/stdtypes.rst:1187 ../../library/stdtypes.rst:1190 -#: ../../library/stdtypes.rst:2449 ../../library/stdtypes.rst:2452 -#: ../../library/stdtypes.rst:2455 ../../library/stdtypes.rst:3667 -#: ../../library/stdtypes.rst:3674 +#: ../../library/stdtypes.rst:311 ../../library/stdtypes.rst:313 +#: ../../library/stdtypes.rst:1191 ../../library/stdtypes.rst:1194 +#: ../../library/stdtypes.rst:2452 ../../library/stdtypes.rst:2455 +#: ../../library/stdtypes.rst:2458 ../../library/stdtypes.rst:3670 +#: ../../library/stdtypes.rst:3677 msgid "\\(5)" msgstr "\\(5)" -#: ../../library/stdtypes.rst:310 +#: ../../library/stdtypes.rst:311 msgid ":func:`pow`" msgstr ":func:`pow`" -#: ../../library/stdtypes.rst:312 +#: ../../library/stdtypes.rst:313 msgid "``x ** y``" msgstr "``x ** y``" -#: ../../library/stdtypes.rst:322 +#: ../../library/stdtypes.rst:323 msgid "" -"Also referred to as integer division. The resultant value is a whole " -"integer, though the result's type is not necessarily int. The result is " +"Also referred to as integer division. For operands of type :class:`int`, " +"the result has type :class:`int`. For operands of type :class:`float`, the " +"result has type :class:`float`. In general, the result is a whole integer, " +"though the result's type is not necessarily :class:`int`. The result is " "always rounded towards minus infinity: ``1//2`` is ``0``, ``(-1)//2`` is " "``-1``, ``1//(-2)`` is ``-1``, and ``(-1)//(-2)`` is ``0``." msgstr "" +"也被稱為整數除法。對於型別為 :class:`int` 的運算元來說,結果之型別會是 :" +"class:`int`。對於型別為 :class:`float` 的運算元來說,結果之型別會是 :class:" +"`float`。一般來說,結果會是一個整數,但其型別不一定會是 :class:`int`。結果總" +"是會往負無窮大的方向取整數值: ``1//2`` 為 ``0``、``(-1)//2`` 為 ``-1``、" +"``1//(-2)`` 為 ``-1`` 及 ``(-1)//(-2)`` 為 ``0``。" -#: ../../library/stdtypes.rst:328 +#: ../../library/stdtypes.rst:331 msgid "" "Not for complex numbers. Instead convert to floats using :func:`abs` if " "appropriate." -msgstr "" +msgstr "不可用於複數。在適當情形下,可使用 :func:`abs` 轉換為浮點數。" -#: ../../library/stdtypes.rst:339 +#: ../../library/stdtypes.rst:342 msgid "" "Conversion from :class:`float` to :class:`int` truncates, discarding the " "fractional part. See functions :func:`math.floor` and :func:`math.ceil` for " "alternative conversions." msgstr "" +"從 :class:`float` 轉換為 :class:`int` 會導致截斷並排除小數部分。詳見 :func:" +"`math.floor` 及 :func:`math.ceil` 以了解更多轉換方式。" -#: ../../library/stdtypes.rst:344 +#: ../../library/stdtypes.rst:347 msgid "" "float also accepts the strings \"nan\" and \"inf\" with an optional prefix " "\"+\" or \"-\" for Not a Number (NaN) and positive or negative infinity." msgstr "" +"浮點數也接受帶有可選的前綴 \"+\" 及 \"-\" 的 \"nan\" 及 \"inf\" 字串,其分別" +"代表非數字(NaN)及正負無窮。" -#: ../../library/stdtypes.rst:348 +#: ../../library/stdtypes.rst:351 msgid "" "Python defines ``pow(0, 0)`` and ``0 ** 0`` to be ``1``, as is common for " "programming languages." msgstr "" +"Python 將 ``pow(0, 0)`` 及 ``0 ** 0`` 定義為 ``1`` 這是程式語言的普遍做法。" -#: ../../library/stdtypes.rst:352 +#: ../../library/stdtypes.rst:355 msgid "" "The numeric literals accepted include the digits ``0`` to ``9`` or any " "Unicode equivalent (code points with the ``Nd`` property)." msgstr "" +"字面數值接受包含數字 ``0`` 到 ``9`` 或任何等效的 Unicode 字元(具有 ``Nd`` 屬" +"性的 code points(碼位))。" -#: ../../library/stdtypes.rst:355 +#: ../../library/stdtypes.rst:358 msgid "" "See `the Unicode Standard `_ for a complete list of code points with the ``Nd`` " "property." msgstr "" +"請參閱 `Unicode 標準 `_\\ 以了解具有 ``Nd`` 屬性的 code points 完整列表。" -#: ../../library/stdtypes.rst:359 +#: ../../library/stdtypes.rst:362 msgid "" "All :class:`numbers.Real` types (:class:`int` and :class:`float`) also " "include the following operations:" msgstr "" +"所有 :class:`numbers.Real` 型別(:class:`int` 及 :class:`float`)也適用下列運" +"算:" -#: ../../library/stdtypes.rst:365 +#: ../../library/stdtypes.rst:368 msgid ":func:`math.trunc(\\ x) `" msgstr ":func:`math.trunc(\\ x) `" -#: ../../library/stdtypes.rst:365 +#: ../../library/stdtypes.rst:368 msgid "*x* truncated to :class:`~numbers.Integral`" -msgstr "" +msgstr "*x* 截斷為 :class:`~numbers.Integral`" -#: ../../library/stdtypes.rst:368 +#: ../../library/stdtypes.rst:371 msgid ":func:`round(x[, n]) `" msgstr ":func:`round(x[, n]) `" -#: ../../library/stdtypes.rst:368 +#: ../../library/stdtypes.rst:371 msgid "" "*x* rounded to *n* digits, rounding half to even. If *n* is omitted, it " "defaults to 0." -msgstr "" +msgstr "*x* 進位至小數點後第 *n* 位,使用偶數捨入法。若省略 *n* ,則預設為 0。" -#: ../../library/stdtypes.rst:372 +#: ../../library/stdtypes.rst:375 msgid ":func:`math.floor(\\ x) `" msgstr ":func:`math.floor(\\ x) `" -#: ../../library/stdtypes.rst:372 +#: ../../library/stdtypes.rst:375 msgid "the greatest :class:`~numbers.Integral` <= *x*" -msgstr "" +msgstr "小於等於 *x* 的最大 :class:`~numbers.Integral`" -#: ../../library/stdtypes.rst:375 +#: ../../library/stdtypes.rst:378 msgid ":func:`math.ceil(x) `" msgstr ":func:`math.ceil(x) `" -#: ../../library/stdtypes.rst:375 +#: ../../library/stdtypes.rst:378 msgid "the least :class:`~numbers.Integral` >= *x*" -msgstr "" +msgstr "大於等於 *x* 的最小 :class:`~numbers.Integral`" -#: ../../library/stdtypes.rst:379 +#: ../../library/stdtypes.rst:382 msgid "" "For additional numeric operations see the :mod:`math` and :mod:`cmath` " "modules." -msgstr "" +msgstr "關於其他數值運算請詳見 :mod:`math` 及 :mod:`cmath` modules(模組)。" -#: ../../library/stdtypes.rst:388 +#: ../../library/stdtypes.rst:391 msgid "Bitwise Operations on Integer Types" -msgstr "" +msgstr "整數型別的位元運算" -#: ../../library/stdtypes.rst:402 +#: ../../library/stdtypes.rst:405 msgid "" "Bitwise operations only make sense for integers. The result of bitwise " "operations is calculated as though carried out in two's complement with an " "infinite number of sign bits." msgstr "" +"位元運算只對整數有意義。位元運算的計算結果就如同對二的補數執行無窮多個符號位" +"元。" -#: ../../library/stdtypes.rst:406 +#: ../../library/stdtypes.rst:409 msgid "" "The priorities of the binary bitwise operations are all lower than the " "numeric operations and higher than the comparisons; the unary operation " "``~`` has the same priority as the other unary numeric operations (``+`` and " "``-``)." msgstr "" +"二元位元運算的優先順序皆低於數字運算,但高於比較運算;一元運算 ``~`` 與其他一" +"元數值運算有一致的優先順序(``+`` 及 ``-``)。" -#: ../../library/stdtypes.rst:410 +#: ../../library/stdtypes.rst:413 msgid "This table lists the bitwise operations sorted in ascending priority:" -msgstr "" +msgstr "這個表格列出所有位元運算並以優先順序由先至後排序。" -#: ../../library/stdtypes.rst:415 +#: ../../library/stdtypes.rst:418 msgid "``x | y``" msgstr "``x | y``" -#: ../../library/stdtypes.rst:415 +#: ../../library/stdtypes.rst:418 msgid "bitwise :dfn:`or` of *x* and *y*" -msgstr "" +msgstr "*x* 及 *y* 的位元 :dfn:`或`" -#: ../../library/stdtypes.rst:415 ../../library/stdtypes.rst:418 -#: ../../library/stdtypes.rst:421 ../../library/stdtypes.rst:1211 -#: ../../library/stdtypes.rst:2438 ../../library/stdtypes.rst:2442 -#: ../../library/stdtypes.rst:3656 ../../library/stdtypes.rst:3660 +#: ../../library/stdtypes.rst:418 ../../library/stdtypes.rst:421 +#: ../../library/stdtypes.rst:424 ../../library/stdtypes.rst:1215 +#: ../../library/stdtypes.rst:2441 ../../library/stdtypes.rst:2445 +#: ../../library/stdtypes.rst:3659 ../../library/stdtypes.rst:3663 msgid "\\(4)" msgstr "\\(4)" -#: ../../library/stdtypes.rst:418 +#: ../../library/stdtypes.rst:421 msgid "``x ^ y``" msgstr "``x ^ y``" -#: ../../library/stdtypes.rst:418 +#: ../../library/stdtypes.rst:421 msgid "bitwise :dfn:`exclusive or` of *x* and *y*" -msgstr "" +msgstr "*x* 及 *y* 的位元 :dfn:`邏輯互斥或`" -#: ../../library/stdtypes.rst:421 +#: ../../library/stdtypes.rst:424 msgid "``x & y``" msgstr "``x & y``" -#: ../../library/stdtypes.rst:421 +#: ../../library/stdtypes.rst:424 msgid "bitwise :dfn:`and` of *x* and *y*" -msgstr "" +msgstr "*x* 及 *y* 的位元 :dfn:`與`" -#: ../../library/stdtypes.rst:424 +#: ../../library/stdtypes.rst:427 msgid "``x << n``" msgstr "``x << n``" -#: ../../library/stdtypes.rst:424 +#: ../../library/stdtypes.rst:427 msgid "*x* shifted left by *n* bits" -msgstr "" +msgstr "*x* 往左移動 *n* 個位元" -#: ../../library/stdtypes.rst:424 +#: ../../library/stdtypes.rst:427 msgid "(1)(2)" msgstr "(1)(2)" -#: ../../library/stdtypes.rst:426 +#: ../../library/stdtypes.rst:429 msgid "``x >> n``" msgstr "``x >> n``" -#: ../../library/stdtypes.rst:426 +#: ../../library/stdtypes.rst:429 msgid "*x* shifted right by *n* bits" -msgstr "" +msgstr "*x* 往右移動 *n* 個位元" -#: ../../library/stdtypes.rst:426 +#: ../../library/stdtypes.rst:429 msgid "(1)(3)" msgstr "(1)(3)" -#: ../../library/stdtypes.rst:428 +#: ../../library/stdtypes.rst:431 msgid "``~x``" msgstr "``~x``" -#: ../../library/stdtypes.rst:428 +#: ../../library/stdtypes.rst:431 msgid "the bits of *x* inverted" -msgstr "" +msgstr "反轉 *x* 的位元" -#: ../../library/stdtypes.rst:434 +#: ../../library/stdtypes.rst:437 msgid "" "Negative shift counts are illegal and cause a :exc:`ValueError` to be raised." -msgstr "" +msgstr "負數位移是不被允許並會引發 :exc:`ValueError` 的錯誤。" -#: ../../library/stdtypes.rst:437 +#: ../../library/stdtypes.rst:440 msgid "" "A left shift by *n* bits is equivalent to multiplication by ``pow(2, n)``." -msgstr "" +msgstr "向左移動 *n* 個位元等同於乘以 ``pow(2, n)``。" -#: ../../library/stdtypes.rst:440 +#: ../../library/stdtypes.rst:443 msgid "" "A right shift by *n* bits is equivalent to floor division by ``pow(2, n)``." -msgstr "" +msgstr "向右移動 *n* 個位元等同於向下除法除以 ``pow(2, n)``。" -#: ../../library/stdtypes.rst:443 +#: ../../library/stdtypes.rst:446 msgid "" "Performing these calculations with at least one extra sign extension bit in " "a finite two's complement representation (a working bit-width of ``1 + max(x." "bit_length(), y.bit_length())`` or more) is sufficient to get the same " "result as if there were an infinite number of sign bits." msgstr "" +"在有限的二的補數表示法中執行這些計算(一個有效位元寬度為 ``1 + max(x." +"bit_length(), y.bit_length())`` 或以上)並至少有一個額外的符號擴展位元,便足" +"以得到與無窮多個符號位元相同的結果。" -#: ../../library/stdtypes.rst:450 +#: ../../library/stdtypes.rst:453 msgid "Additional Methods on Integer Types" -msgstr "" +msgstr "整數型別的附加 methods" -#: ../../library/stdtypes.rst:452 +#: ../../library/stdtypes.rst:455 msgid "" "The int type implements the :class:`numbers.Integral` :term:`abstract base " "class`. In addition, it provides a few more methods:" msgstr "" +"整數型別實作了 :class:`numbers.Integral` :term:`抽象基底類別 `。此外,它提供了一些 methods:" -#: ../../library/stdtypes.rst:457 +#: ../../library/stdtypes.rst:460 msgid "" "Return the number of bits necessary to represent an integer in binary, " "excluding the sign and leading zeros::" -msgstr "" +msgstr "回傳以二進位表示一個整數所需要的位元數,不包括符號及首位的零: ::" -#: ../../library/stdtypes.rst:466 +#: ../../library/stdtypes.rst:469 msgid "" "More precisely, if ``x`` is nonzero, then ``x.bit_length()`` is the unique " "positive integer ``k`` such that ``2**(k-1) <= abs(x) < 2**k``. " @@ -822,75 +864,91 @@ msgid "" "logarithm, then ``k = 1 + int(log(abs(x), 2))``. If ``x`` is zero, then ``x." "bit_length()`` returns ``0``." msgstr "" +"更準確來說,若 ``x`` 非為零,則 ``x.bit_length()`` 會得出滿足 ``2**(k-1) <= " +"abs(x) < 2**k`` 的單一正整數 ``k``。同樣地,當 ``abs(x)`` 足夠小到能正確地取" +"得捨入的對數,則 ``k = 1 + int(log(abs(x), 2))``。若 ``x`` 為零,則 ``x." +"bit_length()`` 會回傳 ``0``。" -#: ../../library/stdtypes.rst:472 ../../library/stdtypes.rst:495 -#: ../../library/stdtypes.rst:540 ../../library/stdtypes.rst:584 +#: ../../library/stdtypes.rst:475 ../../library/stdtypes.rst:498 +#: ../../library/stdtypes.rst:543 ../../library/stdtypes.rst:587 msgid "Equivalent to::" msgstr "" -"等價於:\n" +"等同於:\n" "\n" "::" -#: ../../library/stdtypes.rst:483 +#: ../../library/stdtypes.rst:486 msgid "" "Return the number of ones in the binary representation of the absolute value " "of the integer. This is also known as the population count. Example::" -msgstr "" +msgstr "回傳在絕對值表示的二進位中 1 的個數。這也被稱作母體計數。舉例來說: ::" -#: ../../library/stdtypes.rst:504 +#: ../../library/stdtypes.rst:507 msgid "Return an array of bytes representing an integer." -msgstr "" +msgstr "回傳表示一個整數的一列位元組。" -#: ../../library/stdtypes.rst:516 +#: ../../library/stdtypes.rst:519 msgid "" "The integer is represented using *length* bytes, and defaults to 1. An :exc:" "`OverflowError` is raised if the integer is not representable with the given " "number of bytes." msgstr "" +"此整數會使用 *length* 位元組表示,並且預設為 1。如果該整數無法用給定的位元組" +"數來表示,則會引發 :exc:`OverflowError`。" -#: ../../library/stdtypes.rst:520 +#: ../../library/stdtypes.rst:523 msgid "" "The *byteorder* argument determines the byte order used to represent the " "integer, and defaults to ``\"big\"``. If *byteorder* is ``\"big\"``, the " "most significant byte is at the beginning of the byte array. If *byteorder* " "is ``\"little\"``, the most significant byte is at the end of the byte array." msgstr "" +"*byteorder* 引數決定了用來表示整數的位元組順序並且預設為 ``\"big\"``。如果 " +"byteorder 是 ``\"big\"``,最重要的位元組位於位元組陣列的開頭。如果 byteorder " +"是 ``\"little\"``,最重要的位元組位於位元組陣列的結尾。" -#: ../../library/stdtypes.rst:526 +#: ../../library/stdtypes.rst:529 msgid "" "The *signed* argument determines whether two's complement is used to " "represent the integer. If *signed* is ``False`` and a negative integer is " "given, an :exc:`OverflowError` is raised. The default value for *signed* is " "``False``." msgstr "" +"*signed* 引數決定是否使用二的補數來表示整數。如果 *signed* 是 ``False`` 並且" +"給定了一個負整數,則會引發 :exc:`OverflowError`。*signed* 的預設值是 " +"``False``。" -#: ../../library/stdtypes.rst:531 +#: ../../library/stdtypes.rst:534 msgid "" "The default values can be used to conveniently turn an integer into a single " "byte object::" -msgstr "" +msgstr "預設值可以方便地將一個整數轉換為單一位元組物件: ::" -#: ../../library/stdtypes.rst:537 +#: ../../library/stdtypes.rst:540 msgid "" "However, when using the default arguments, don't try to convert a value " "greater than 255 or you'll get an :exc:`OverflowError`." msgstr "" +"然而,使用預設引數時,不要嘗試轉換大於 255 的值,否則你將會得到一個 :exc:" +"`OverflowError`。" -#: ../../library/stdtypes.rst:553 +#: ../../library/stdtypes.rst:556 msgid "Added default argument values for ``length`` and ``byteorder``." -msgstr "" +msgstr "為 ``length`` 和 ``byteorder`` 添加了預設引數值。" -#: ../../library/stdtypes.rst:558 +#: ../../library/stdtypes.rst:561 msgid "Return the integer represented by the given array of bytes." -msgstr "" +msgstr "回傳由給定的位元組陣列表示的整數。" -#: ../../library/stdtypes.rst:571 +#: ../../library/stdtypes.rst:574 msgid "" "The argument *bytes* must either be a :term:`bytes-like object` or an " "iterable producing bytes." msgstr "" +"引數 *bytes* 必須是一個\\ :term:`類位元組物件 `\\ 或是一個" +"產生位元組的可疊代物件。" -#: ../../library/stdtypes.rst:574 +#: ../../library/stdtypes.rst:577 msgid "" "The *byteorder* argument determines the byte order used to represent the " "integer, and defaults to ``\"big\"``. If *byteorder* is ``\"big\"``, the " @@ -899,54 +957,66 @@ msgid "" "array. To request the native byte order of the host system, use :data:`sys." "byteorder` as the byte order value." msgstr "" +"*byteorder* 引數決定了用來表示整數的位元組順序並且預設為 ``\"big\"``。如果 " +"*byteorder* 是 ``\"big\"``,最重要的位元組位於位元組陣列的開頭。如果 " +"*byteorder* 是 ``\"little\"``,最重要的位元組位於位元組陣列的結尾。若要請求主" +"機系統的本機位元組順序,請使用 :data:`sys.byteorder` 作為位元組順序值。" -#: ../../library/stdtypes.rst:581 +#: ../../library/stdtypes.rst:584 msgid "" "The *signed* argument indicates whether two's complement is used to " "represent the integer." -msgstr "" +msgstr "*signed* 引數指示是否使用二的補數來表示整數。" -#: ../../library/stdtypes.rst:601 +#: ../../library/stdtypes.rst:604 msgid "Added default argument value for ``byteorder``." -msgstr "" +msgstr "為 ``byteorder`` 添加了預設引數值。" -#: ../../library/stdtypes.rst:606 +#: ../../library/stdtypes.rst:609 msgid "" "Return a pair of integers whose ratio is equal to the original integer and " "has a positive denominator. The integer ratio of integers (whole numbers) " "is always the integer as the numerator and ``1`` as the denominator." msgstr "" +"回傳一對整數,其比率等於原始整數並且有一個正分母。整數(整個數值)的整數比率" +"總是整數作為分子,並且 ``1`` 作為分母。" -#: ../../library/stdtypes.rst:615 +#: ../../library/stdtypes.rst:618 msgid "" "Returns ``True``. Exists for duck type compatibility with :meth:`float." "is_integer`." -msgstr "" +msgstr "回傳 ``True``。為了與 :meth:`float.is_integer` 的鴨子型別相容而存在。" -#: ../../library/stdtypes.rst:620 +#: ../../library/stdtypes.rst:623 msgid "Additional Methods on Float" -msgstr "" +msgstr "浮點數的附加 methods" -#: ../../library/stdtypes.rst:622 +#: ../../library/stdtypes.rst:625 msgid "" "The float type implements the :class:`numbers.Real` :term:`abstract base " "class`. float also has the following additional methods." msgstr "" +"浮點數型別實作了 :class:`numbers.Real` :term:`抽象基底類別 `。浮點數也有下列附加 methods。" -#: ../../library/stdtypes.rst:627 +#: ../../library/stdtypes.rst:630 msgid "" "Return a pair of integers whose ratio is exactly equal to the original " "float. The ratio is in lowest terms and has a positive denominator. Raises :" "exc:`OverflowError` on infinities and a :exc:`ValueError` on NaNs." msgstr "" +"回傳一對整數,其比率完全等於原始浮點數。比率是在最低條件下並且有一個正分母。" +"在無窮大時引發 :exc:`OverflowError`,在 NaN 時引發 :exc:`ValueError`。" -#: ../../library/stdtypes.rst:634 +#: ../../library/stdtypes.rst:637 msgid "" "Return ``True`` if the float instance is finite with integral value, and " "``False`` otherwise::" msgstr "" +"如果浮點數實例是有限的並且具有整數值,則回傳 ``True``,否則回傳 " +"``False``: ::" -#: ../../library/stdtypes.rst:642 +#: ../../library/stdtypes.rst:645 msgid "" "Two methods support conversion to and from hexadecimal strings. Since " "Python's floats are stored internally as binary numbers, converting a float " @@ -955,31 +1025,40 @@ msgid "" "of floating-point numbers. This can be useful when debugging, and in " "numerical work." msgstr "" +"兩個 methods 皆支援十六進位字串之間的轉換。由於 Python 的浮點數內部以二進位數" +"值儲存,將浮點數轉換為或從 *十進位* 字串通常涉及一個小的四捨五入誤差。相反" +"地,十六進位字串允許精確表示和指定浮點數。這在除錯和數值工作中可能會有用。" -#: ../../library/stdtypes.rst:653 +#: ../../library/stdtypes.rst:656 msgid "" "Return a representation of a floating-point number as a hexadecimal string. " "For finite floating-point numbers, this representation will always include a " "leading ``0x`` and a trailing ``p`` and exponent." msgstr "" +"回傳浮點數的十六進位字串表示。對於有限浮點數,此表示方式總是包含一個前導 " +"``0x`` 及一個尾部 ``p`` 和指數。" -#: ../../library/stdtypes.rst:661 +#: ../../library/stdtypes.rst:664 msgid "" "Class method to return the float represented by a hexadecimal string *s*. " "The string *s* may have leading and trailing whitespace." msgstr "" +"Class method 回傳由十六進位字串 *s* 表示的浮點數。字串 *s* 可能有前導及尾部的" +"空白。" -#: ../../library/stdtypes.rst:666 +#: ../../library/stdtypes.rst:669 msgid "" "Note that :meth:`float.hex` is an instance method, while :meth:`float." "fromhex` is a class method." msgstr "" +"請注意 :meth:`float.hex` 是一個實例 method,而 :meth:`float.fromhex` 是一個 " +"class method。" -#: ../../library/stdtypes.rst:669 +#: ../../library/stdtypes.rst:672 msgid "A hexadecimal string takes the form::" -msgstr "" +msgstr "一個十六進位字串的形式如下: ::" -#: ../../library/stdtypes.rst:673 +#: ../../library/stdtypes.rst:676 msgid "" "where the optional ``sign`` may by either ``+`` or ``-``, ``integer`` and " "``fraction`` are strings of hexadecimal digits, and ``exponent`` is a " @@ -992,26 +1071,37 @@ msgid "" "by C's ``%a`` format character or Java's ``Double.toHexString`` are accepted " "by :meth:`float.fromhex`." msgstr "" +"其中可選的 ``sign`` 可以是 ``+`` 或 ``-``,``integer`` 和 ``fraction`` 是十六" +"進位數字的字串,而 ``exponent`` 是一個十進位整數並且有一個可選的前導符號。大" +"小寫不重要,並且整數或小數部分至少有一個十六進位數字。這個語法與 C99 標準的" +"第 6.4.4.2 節指定的語法相似,也與 Java 1.5 以後的語法相似。特別是 :meth:" +"`float.hex` 的輸出可用作 C 或 Java 程式碼中的十六進位浮點數文字,並且 C 的 " +"``%a`` 格式字元或 Java 的 ``Double.toHexString`` 產生的十六進位字串可被 :" +"meth:`float.fromhex` 接受。" -#: ../../library/stdtypes.rst:686 +#: ../../library/stdtypes.rst:689 msgid "" "Note that the exponent is written in decimal rather than hexadecimal, and " "that it gives the power of 2 by which to multiply the coefficient. For " "example, the hexadecimal string ``0x3.a7p10`` represents the floating-point " "number ``(3 + 10./16 + 7./16**2) * 2.0**10``, or ``3740.0``::" msgstr "" +"請注意指數是以十進位而非十六進位寫入,並且它給出了乘以係數的 2 的次方。例如," +"十六進位字串 ``0x3.a7p10`` 表示浮點數 ``(3 + 10./16 + 7./16**2) * 2.0**10``," +"或 ``3740.0``: ::" -#: ../../library/stdtypes.rst:696 +#: ../../library/stdtypes.rst:699 msgid "" "Applying the reverse conversion to ``3740.0`` gives a different hexadecimal " "string representing the same number::" msgstr "" +"對 ``3740.0`` 應用反向轉換會給出一個不同的十六進位字串,它表示相同的數字: ::" -#: ../../library/stdtypes.rst:706 +#: ../../library/stdtypes.rst:709 msgid "Hashing of numeric types" -msgstr "" +msgstr "數值型別的雜湊" -#: ../../library/stdtypes.rst:708 +#: ../../library/stdtypes.rst:711 msgid "" "For numbers ``x`` and ``y``, possibly of different types, it's a requirement " "that ``hash(x) == hash(y)`` whenever ``x == y`` (see the :meth:`~object." @@ -1023,49 +1113,70 @@ msgid "" "instances of :class:`int` and :class:`fractions.Fraction`, and all finite " "instances of :class:`float` and :class:`decimal.Decimal`. Essentially, this " "function is given by reduction modulo ``P`` for a fixed prime ``P``. The " -"value of ``P`` is made available to Python as the :attr:`modulus` attribute " -"of :data:`sys.hash_info`." -msgstr "" +"value of ``P`` is made available to Python as the :attr:`~sys.hash_info." +"modulus` attribute of :data:`sys.hash_info`." +msgstr "" +"對於數字 ``x`` 和 ``y``,可能是不同型別,當 ``x == y`` 時,``hash(x) == " +"hash(y)`` 是一個要求( 詳見 :meth:`~object.__hash__` method 的文件以獲得更多" +"細節)。為了實作的便利性和效率跨越各種數值型別(包括 :class:`int`、:class:" +"`float`、:class:`decimal.Decimal` 和 :class:`fractions.Fraction`)Python 的數" +"值型別的雜湊是基於一個數學函式,它對於任何有理數都是定義的,因此適用於所有 :" +"class:`int` 和 :class:`fractions.Fraction` 的實例,以及所有有限的 :class:" +"`float` 和 :class:`decimal.Decimal` 的實例。基本上,這個函式是由簡化的 modulo" +"(模數) ``P`` 給出的一個固定的質數 ``P``。``P`` 的值作為 :data:`sys." +"hash_info` 的 :attr:`~sys.hash_info.modulus` 屬性提供給 Python。" -#: ../../library/stdtypes.rst:723 +#: ../../library/stdtypes.rst:726 msgid "" "Currently, the prime used is ``P = 2**31 - 1`` on machines with 32-bit C " "longs and ``P = 2**61 - 1`` on machines with 64-bit C longs." msgstr "" +"目前在具有 32 位元 C longs 的機器上所使用的質數是 ``P = 2**31 - 1``,而在具" +"有 64 位元 C longs 的機器上為 ``P = 2**61 - 1`` 。" -#: ../../library/stdtypes.rst:726 +#: ../../library/stdtypes.rst:729 msgid "Here are the rules in detail:" -msgstr "" +msgstr "以下是詳細的規則:" -#: ../../library/stdtypes.rst:728 +#: ../../library/stdtypes.rst:731 msgid "" "If ``x = m / n`` is a nonnegative rational number and ``n`` is not divisible " "by ``P``, define ``hash(x)`` as ``m * invmod(n, P) % P``, where ``invmod(n, " "P)`` gives the inverse of ``n`` modulo ``P``." msgstr "" +"如果 ``x = m / n`` 是一個非負的有理數,並且 ``n`` 不可被 ``P`` 整除,則將 " +"``hash(x)`` 定義為 ``m * invmod(n, P) % P``。其中 ``invmod(n, P)`` 為 ``n`` " +"對模數 ``P`` 的倒數。" -#: ../../library/stdtypes.rst:732 +#: ../../library/stdtypes.rst:735 msgid "" "If ``x = m / n`` is a nonnegative rational number and ``n`` is divisible by " "``P`` (but ``m`` is not) then ``n`` has no inverse modulo ``P`` and the rule " "above doesn't apply; in this case define ``hash(x)`` to be the constant " "value ``sys.hash_info.inf``." msgstr "" +"如果 ``x = m / n`` 是一個非負的有理數,並且 ``n`` 可被 ``P`` 整除(但 ``m`` " +"不行),則 ``n`` 沒有 inverse modulo(模倒數) ``P`` ,並且不適用於上述規則;" +"在這種情況下,將 ``hash(x)`` 定義為常數值 ``sys.hash_info.inf``。" -#: ../../library/stdtypes.rst:737 +#: ../../library/stdtypes.rst:740 msgid "" "If ``x = m / n`` is a negative rational number define ``hash(x)`` as ``-" "hash(-x)``. If the resulting hash is ``-1``, replace it with ``-2``." msgstr "" +"如果 ``x = m / n`` 是一個負的有理數,則將 ``hash(x)`` 定義為 ``-hash(-x)``。" +"如果結果的雜湊是 ``-1``,則將其替換為 ``-2``。" -#: ../../library/stdtypes.rst:741 +#: ../../library/stdtypes.rst:744 msgid "" "The particular values ``sys.hash_info.inf`` and ``-sys.hash_info.inf`` are " "used as hash values for positive infinity or negative infinity " "(respectively)." msgstr "" +"特定值 ``sys.hash_info.inf`` 和 ``-sys.hash_info.inf`` (分別)被用作正無窮大" +"或負無窮大的雜湊值。" -#: ../../library/stdtypes.rst:745 +#: ../../library/stdtypes.rst:748 msgid "" "For a :class:`complex` number ``z``, the hash values of the real and " "imaginary parts are combined by computing ``hash(z.real) + sys.hash_info." @@ -1073,31 +1184,41 @@ msgid "" "lies in ``range(-2**(sys.hash_info.width - 1), 2**(sys.hash_info.width - " "1))``. Again, if the result is ``-1``, it's replaced with ``-2``." msgstr "" +"對於一個 :class:`complex` 值 ``z``,實部和虛部的雜湊值藉由 ``hash(z.real) + " +"sys.hash_info.imag * hash(z.imag)`` 的計算進行組合,對 ``2**sys.hash_info." +"width`` 取模數使其介於 ``range(-2**(sys.hash_info.width - 1), 2**(sys." +"hash_info.width - 1))``。同樣地,如果結果是 ``-1``,則將其替換為 ``-2``。" -#: ../../library/stdtypes.rst:753 +#: ../../library/stdtypes.rst:756 msgid "" "To clarify the above rules, here's some example Python code, equivalent to " "the built-in hash, for computing the hash of a rational number, :class:" "`float`, or :class:`complex`::" msgstr "" +"為了闡明上述規則,這裡有一些 Python 程式碼範例,等同於內建的雜湊,用於計算有" +"理數、:class:`float` 或 :class:`complex` 的雜湊: ::" -#: ../../library/stdtypes.rst:808 +#: ../../library/stdtypes.rst:812 msgid "Boolean Type - :class:`bool`" -msgstr "" +msgstr "Boolean 型別 - :class:`bool`" -#: ../../library/stdtypes.rst:810 +#: ../../library/stdtypes.rst:814 msgid "" "Booleans represent truth values. The :class:`bool` type has exactly two " "constant instances: ``True`` and ``False``." msgstr "" +"Boolean 值代表 truth values(真值)。:class:`bool` 型別有兩個常數實例:" +"``True`` 和 ``False``。" -#: ../../library/stdtypes.rst:818 +#: ../../library/stdtypes.rst:822 msgid "" "The built-in function :func:`bool` converts any value to a boolean, if the " "value can be interpreted as a truth value (see section :ref:`truth` above)." msgstr "" +"內建函式 :func:`bool` 將任何值轉換為 boolean 值,如果該值可以被直譯為一個 " +"truth value(真值)(見上面的\\ :ref:`truth`\\ 章節)。" -#: ../../library/stdtypes.rst:821 +#: ../../library/stdtypes.rst:825 msgid "" "For logical operations, use the :ref:`boolean operators ` ``and``, " "``or`` and ``not``. When applying the bitwise operators ``&``, ``|``, ``^`` " @@ -1105,40 +1226,51 @@ msgid "" "\"and\", \"or\", \"xor\". However, the logical operators ``and``, ``or`` and " "``!=`` should be preferred over ``&``, ``|`` and ``^``." msgstr "" +"對於邏輯運算,使用 :ref:`boolean 運算子 ` ``and``、``or`` 和 " +"``not``。當將位元運算子 ``&``、``|``、``^`` 應用於兩個 boolean 值時,它們會回" +"傳一個等同於邏輯運算 \"and\"、\"or\"、\"xor\" 的 boolean 值。然而,應該優先使" +"用邏輯運算子 ``and``、``or`` 和 ``!=`` 而不是 ``&``、``|`` 和 ``^``。" -#: ../../library/stdtypes.rst:830 +#: ../../library/stdtypes.rst:834 msgid "" "The use of the bitwise inversion operator ``~`` is deprecated and will raise " "an error in Python 3.14." -msgstr "" +msgstr "位元反轉運算子 ``~`` 的使用已被棄用並且將在 Python 3.14 中引發錯誤。" -#: ../../library/stdtypes.rst:833 +#: ../../library/stdtypes.rst:837 msgid "" ":class:`bool` is a subclass of :class:`int` (see :ref:`typesnumeric`). In " "many numeric contexts, ``False`` and ``True`` behave like the integers 0 and " "1, respectively. However, relying on this is discouraged; explicitly convert " "using :func:`int` instead." msgstr "" +":class:`bool` 是 :class:`int` 的子類別(見\\ :ref:`typesnumeric`)。在許多數" +"值情境中,``False`` 和 ``True`` 分別像整數 0 和 1 一樣。然而,不鼓勵依賴這一" +"點;請使用 :func:`int` 進行顯式轉換。" -#: ../../library/stdtypes.rst:841 +#: ../../library/stdtypes.rst:845 msgid "Iterator Types" -msgstr "" +msgstr "疊代器型別" -#: ../../library/stdtypes.rst:849 +#: ../../library/stdtypes.rst:853 msgid "" "Python supports a concept of iteration over containers. This is implemented " "using two distinct methods; these are used to allow user-defined classes to " "support iteration. Sequences, described below in more detail, always " "support the iteration methods." msgstr "" +"Python 支援對容器的疊代概念。這是實作兩種不同的 methods;這些方法被用於允許使" +"用者自定義的 classes 以支援疊代。序列則總是支援這些疊代 methods,在下方有更詳" +"細的描述。" -#: ../../library/stdtypes.rst:854 +#: ../../library/stdtypes.rst:858 msgid "" "One method needs to be defined for container objects to provide :term:" "`iterable` support:" msgstr "" +"需要為容器物件定義一個 method 來提供\\ :term:`可疊代物件 `\\ 支援:" -#: ../../library/stdtypes.rst:861 +#: ../../library/stdtypes.rst:865 msgid "" "Return an :term:`iterator` object. The object is required to support the " "iterator protocol described below. If a container supports different types " @@ -1149,63 +1281,80 @@ msgid "" "member:`~PyTypeObject.tp_iter` slot of the type structure for Python objects " "in the Python/C API." msgstr "" +"回傳一個\\ :term:`疊代器 `\\ 物件。該物件需要支援下述的疊代器協定。" +"如果一個容器支援不同型別的疊代,則可以提供額外的 methods 來專門請求這些疊代型" +"別的疊代器。(支援多種形式疊代的物件的一個例子是支援廣度優先和深度優先遍歷的" +"樹結構。)此 method 對應 Python/C API 中 Python 物件的型別結構的 :c:member:" +"`~PyTypeObject.tp_iter` 插槽。" -#: ../../library/stdtypes.rst:870 +#: ../../library/stdtypes.rst:874 msgid "" "The iterator objects themselves are required to support the following two " "methods, which together form the :dfn:`iterator protocol`:" msgstr "" +"疊代器物件本身需要支援下列兩個 methods,他們一起形成了 :dfn:`疊代器協定`:" -#: ../../library/stdtypes.rst:876 +#: ../../library/stdtypes.rst:880 msgid "" "Return the :term:`iterator` object itself. This is required to allow both " "containers and iterators to be used with the :keyword:`for` and :keyword:" "`in` statements. This method corresponds to the :c:member:`~PyTypeObject." "tp_iter` slot of the type structure for Python objects in the Python/C API." msgstr "" +"回傳\\ :term:`疊代器 `\\ 物件本身。這是為了允許容器和疊代器都可以" +"與 :keyword:`for` 和 :keyword:`in` 在陳述式中使用。此 method 對應於 Python/C " +"API 中 Python 物件的型別結構的 :c:member:`~PyTypeObject.tp_iter` 插槽。" -#: ../../library/stdtypes.rst:885 +#: ../../library/stdtypes.rst:889 msgid "" "Return the next item from the :term:`iterator`. If there are no further " "items, raise the :exc:`StopIteration` exception. This method corresponds to " "the :c:member:`~PyTypeObject.tp_iternext` slot of the type structure for " "Python objects in the Python/C API." msgstr "" +"從\\ :term:`疊代器 `\\ 回傳下一個項目。如果沒有更多項目,則引發 :" +"exc:`StopIteration` 例外。此 method 對應於 Python/C API 中Python 物件的型別結" +"構的 :c:member:`~PyTypeObject.tp_iternext` 插槽。" -#: ../../library/stdtypes.rst:890 +#: ../../library/stdtypes.rst:894 msgid "" "Python defines several iterator objects to support iteration over general " "and specific sequence types, dictionaries, and other more specialized " "forms. The specific types are not important beyond their implementation of " "the iterator protocol." msgstr "" +"Python 定義了幾個疊代器物件來支援對一般和特定序列型別、字典和其他更專門的形式" +"的疊代。這些特定型別除了實作疊代器協定外並不重要。" -#: ../../library/stdtypes.rst:895 +#: ../../library/stdtypes.rst:899 msgid "" "Once an iterator's :meth:`~iterator.__next__` method raises :exc:" "`StopIteration`, it must continue to do so on subsequent calls. " "Implementations that do not obey this property are deemed broken." msgstr "" +"一旦疊代器的 :meth:`~iterator.__next__` method 引發 :exc:`StopIteration`,則" +"它必須在後續呼叫中繼續這樣做。不遵守此屬性的實作被認為是有問題的。" -#: ../../library/stdtypes.rst:903 +#: ../../library/stdtypes.rst:907 msgid "Generator Types" msgstr "" -#: ../../library/stdtypes.rst:905 +#: ../../library/stdtypes.rst:909 msgid "" "Python's :term:`generator`\\s provide a convenient way to implement the " -"iterator protocol. If a container object's :meth:`__iter__` method is " -"implemented as a generator, it will automatically return an iterator object " -"(technically, a generator object) supplying the :meth:`__iter__` and :meth:" -"`~generator.__next__` methods. More information about generators can be " -"found in :ref:`the documentation for the yield expression `." +"iterator protocol. If a container object's :meth:`~iterator.__iter__` " +"method is implemented as a generator, it will automatically return an " +"iterator object (technically, a generator object) supplying the :meth:`!" +"__iter__` and :meth:`~generator.__next__` methods. More information about " +"generators can be found in :ref:`the documentation for the yield expression " +"`." msgstr "" -#: ../../library/stdtypes.rst:917 +#: ../../library/stdtypes.rst:921 msgid "Sequence Types --- :class:`list`, :class:`tuple`, :class:`range`" msgstr "" -#: ../../library/stdtypes.rst:919 +#: ../../library/stdtypes.rst:923 msgid "" "There are three basic sequence types: lists, tuples, and range objects. " "Additional sequence types tailored for processing of :ref:`binary data " @@ -1213,11 +1362,11 @@ msgid "" "sections." msgstr "" -#: ../../library/stdtypes.rst:928 +#: ../../library/stdtypes.rst:932 msgid "Common Sequence Operations" msgstr "" -#: ../../library/stdtypes.rst:932 +#: ../../library/stdtypes.rst:936 msgid "" "The operations in the following table are supported by most sequence types, " "both mutable and immutable. The :class:`collections.abc.Sequence` ABC is " @@ -1225,7 +1374,7 @@ msgid "" "sequence types." msgstr "" -#: ../../library/stdtypes.rst:937 +#: ../../library/stdtypes.rst:941 msgid "" "This table lists the sequence operations sorted in ascending priority. In " "the table, *s* and *t* are sequences of the same type, *n*, *i*, *j* and *k* " @@ -1233,7 +1382,7 @@ msgid "" "restrictions imposed by *s*." msgstr "" -#: ../../library/stdtypes.rst:942 +#: ../../library/stdtypes.rst:946 msgid "" "The ``in`` and ``not in`` operations have the same priorities as the " "comparison operations. The ``+`` (concatenation) and ``*`` (repetition) " @@ -1241,125 +1390,125 @@ msgid "" "[3]_" msgstr "" -#: ../../library/stdtypes.rst:963 +#: ../../library/stdtypes.rst:967 msgid "``x in s``" msgstr "``x in s``" -#: ../../library/stdtypes.rst:963 +#: ../../library/stdtypes.rst:967 msgid "``True`` if an item of *s* is equal to *x*, else ``False``" msgstr "" -#: ../../library/stdtypes.rst:966 +#: ../../library/stdtypes.rst:970 msgid "``x not in s``" msgstr "``x not in s``" -#: ../../library/stdtypes.rst:966 +#: ../../library/stdtypes.rst:970 msgid "``False`` if an item of *s* is equal to *x*, else ``True``" msgstr "" -#: ../../library/stdtypes.rst:969 +#: ../../library/stdtypes.rst:973 msgid "``s + t``" msgstr "``s + t``" -#: ../../library/stdtypes.rst:969 +#: ../../library/stdtypes.rst:973 msgid "the concatenation of *s* and *t*" msgstr "" -#: ../../library/stdtypes.rst:969 +#: ../../library/stdtypes.rst:973 msgid "(6)(7)" msgstr "(6)(7)" -#: ../../library/stdtypes.rst:972 +#: ../../library/stdtypes.rst:976 msgid "``s * n`` or ``n * s``" msgstr "``s * n`` 或 ``n * s``" -#: ../../library/stdtypes.rst:972 +#: ../../library/stdtypes.rst:976 msgid "equivalent to adding *s* to itself *n* times" msgstr "" -#: ../../library/stdtypes.rst:972 +#: ../../library/stdtypes.rst:976 msgid "(2)(7)" msgstr "(2)(7)" -#: ../../library/stdtypes.rst:975 +#: ../../library/stdtypes.rst:979 msgid "``s[i]``" msgstr "``s[i]``" -#: ../../library/stdtypes.rst:975 +#: ../../library/stdtypes.rst:979 msgid "*i*\\ th item of *s*, origin 0" msgstr "" -#: ../../library/stdtypes.rst:977 +#: ../../library/stdtypes.rst:981 msgid "``s[i:j]``" msgstr "``s[i:j]``" -#: ../../library/stdtypes.rst:977 +#: ../../library/stdtypes.rst:981 msgid "slice of *s* from *i* to *j*" msgstr "" -#: ../../library/stdtypes.rst:977 +#: ../../library/stdtypes.rst:981 msgid "(3)(4)" msgstr "(3)(4)" -#: ../../library/stdtypes.rst:979 +#: ../../library/stdtypes.rst:983 msgid "``s[i:j:k]``" msgstr "``s[i:j:k]``" -#: ../../library/stdtypes.rst:979 +#: ../../library/stdtypes.rst:983 msgid "slice of *s* from *i* to *j* with step *k*" msgstr "" -#: ../../library/stdtypes.rst:979 +#: ../../library/stdtypes.rst:983 msgid "(3)(5)" msgstr "(3)(5)" -#: ../../library/stdtypes.rst:982 +#: ../../library/stdtypes.rst:986 msgid "``len(s)``" msgstr "``len(s)``" -#: ../../library/stdtypes.rst:982 +#: ../../library/stdtypes.rst:986 msgid "length of *s*" msgstr "" -#: ../../library/stdtypes.rst:984 +#: ../../library/stdtypes.rst:988 msgid "``min(s)``" msgstr "``min(s)``" -#: ../../library/stdtypes.rst:984 +#: ../../library/stdtypes.rst:988 msgid "smallest item of *s*" msgstr "" -#: ../../library/stdtypes.rst:986 +#: ../../library/stdtypes.rst:990 msgid "``max(s)``" msgstr "``max(s)``" -#: ../../library/stdtypes.rst:986 +#: ../../library/stdtypes.rst:990 msgid "largest item of *s*" msgstr "" -#: ../../library/stdtypes.rst:988 +#: ../../library/stdtypes.rst:992 msgid "``s.index(x[, i[, j]])``" msgstr "``s.index(x[, i[, j]])``" -#: ../../library/stdtypes.rst:988 +#: ../../library/stdtypes.rst:992 msgid "" "index of the first occurrence of *x* in *s* (at or after index *i* and " "before index *j*)" msgstr "" -#: ../../library/stdtypes.rst:988 ../../library/stdtypes.rst:3642 +#: ../../library/stdtypes.rst:992 ../../library/stdtypes.rst:3645 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/stdtypes.rst:992 +#: ../../library/stdtypes.rst:996 msgid "``s.count(x)``" msgstr "``s.count(x)``" -#: ../../library/stdtypes.rst:992 +#: ../../library/stdtypes.rst:996 msgid "total number of occurrences of *x* in *s*" msgstr "" -#: ../../library/stdtypes.rst:996 +#: ../../library/stdtypes.rst:1000 msgid "" "Sequences of the same type also support comparisons. In particular, tuples " "and lists are compared lexicographically by comparing corresponding " @@ -1368,7 +1517,7 @@ msgid "" "(For full details see :ref:`comparisons` in the language reference.)" msgstr "" -#: ../../library/stdtypes.rst:1006 +#: ../../library/stdtypes.rst:1010 msgid "" "Forward and reversed iterators over mutable sequences access values using an " "index. That index will continue to march forward (or backward) even if the " @@ -1377,7 +1526,7 @@ msgid "" "drops below zero)." msgstr "" -#: ../../library/stdtypes.rst:1015 +#: ../../library/stdtypes.rst:1019 msgid "" "While the ``in`` and ``not in`` operations are used only for simple " "containment testing in the general case, some specialised sequences (such " @@ -1385,7 +1534,7 @@ msgid "" "subsequence testing::" msgstr "" -#: ../../library/stdtypes.rst:1024 +#: ../../library/stdtypes.rst:1028 msgid "" "Values of *n* less than ``0`` are treated as ``0`` (which yields an empty " "sequence of the same type as *s*). Note that items in the sequence *s* are " @@ -1393,7 +1542,7 @@ msgid "" "Python programmers; consider::" msgstr "" -#: ../../library/stdtypes.rst:1036 +#: ../../library/stdtypes.rst:1040 msgid "" "What has happened is that ``[[]]`` is a one-element list containing an empty " "list, so all three elements of ``[[]] * 3`` are references to this single " @@ -1401,20 +1550,20 @@ msgid "" "list. You can create a list of different lists this way::" msgstr "" -#: ../../library/stdtypes.rst:1048 +#: ../../library/stdtypes.rst:1052 msgid "" "Further explanation is available in the FAQ entry :ref:`faq-multidimensional-" "list`." msgstr "" -#: ../../library/stdtypes.rst:1052 +#: ../../library/stdtypes.rst:1056 msgid "" "If *i* or *j* is negative, the index is relative to the end of sequence *s*: " "``len(s) + i`` or ``len(s) + j`` is substituted. But note that ``-0`` is " "still ``0``." msgstr "" -#: ../../library/stdtypes.rst:1057 +#: ../../library/stdtypes.rst:1061 msgid "" "The slice of *s* from *i* to *j* is defined as the sequence of items with " "index *k* such that ``i <= k < j``. If *i* or *j* is greater than " @@ -1423,7 +1572,7 @@ msgid "" "to *j*, the slice is empty." msgstr "" -#: ../../library/stdtypes.rst:1064 +#: ../../library/stdtypes.rst:1068 msgid "" "The slice of *s* from *i* to *j* with step *k* is defined as the sequence of " "items with index ``x = i + n*k`` such that ``0 <= n < (j-i)/k``. In other " @@ -1436,7 +1585,7 @@ msgid "" "``None``, it is treated like ``1``." msgstr "" -#: ../../library/stdtypes.rst:1075 +#: ../../library/stdtypes.rst:1079 msgid "" "Concatenating immutable sequences always results in a new object. This " "means that building up a sequence by repeated concatenation will have a " @@ -1444,14 +1593,14 @@ msgid "" "runtime cost, you must switch to one of the alternatives below:" msgstr "" -#: ../../library/stdtypes.rst:1080 +#: ../../library/stdtypes.rst:1084 msgid "" "if concatenating :class:`str` objects, you can build a list and use :meth:" "`str.join` at the end or else write to an :class:`io.StringIO` instance and " "retrieve its value when complete" msgstr "" -#: ../../library/stdtypes.rst:1084 +#: ../../library/stdtypes.rst:1088 msgid "" "if concatenating :class:`bytes` objects, you can similarly use :meth:`bytes." "join` or :class:`io.BytesIO`, or you can do in-place concatenation with a :" @@ -1459,22 +1608,22 @@ msgid "" "an efficient overallocation mechanism" msgstr "" -#: ../../library/stdtypes.rst:1089 +#: ../../library/stdtypes.rst:1093 msgid "if concatenating :class:`tuple` objects, extend a :class:`list` instead" msgstr "" -#: ../../library/stdtypes.rst:1091 +#: ../../library/stdtypes.rst:1095 msgid "for other types, investigate the relevant class documentation" msgstr "" -#: ../../library/stdtypes.rst:1095 +#: ../../library/stdtypes.rst:1099 msgid "" "Some sequence types (such as :class:`range`) only support item sequences " "that follow specific patterns, and hence don't support sequence " "concatenation or repetition." msgstr "" -#: ../../library/stdtypes.rst:1100 +#: ../../library/stdtypes.rst:1104 msgid "" "``index`` raises :exc:`ValueError` when *x* is not found in *s*. Not all " "implementations support passing the additional arguments *i* and *j*. These " @@ -1484,42 +1633,42 @@ msgid "" "start of the sequence rather than the start of the slice." msgstr "" -#: ../../library/stdtypes.rst:1111 +#: ../../library/stdtypes.rst:1115 msgid "Immutable Sequence Types" msgstr "" -#: ../../library/stdtypes.rst:1118 +#: ../../library/stdtypes.rst:1122 msgid "" "The only operation that immutable sequence types generally implement that is " "not also implemented by mutable sequence types is support for the :func:" "`hash` built-in." msgstr "" -#: ../../library/stdtypes.rst:1122 +#: ../../library/stdtypes.rst:1126 msgid "" "This support allows immutable sequences, such as :class:`tuple` instances, " "to be used as :class:`dict` keys and stored in :class:`set` and :class:" "`frozenset` instances." msgstr "" -#: ../../library/stdtypes.rst:1126 +#: ../../library/stdtypes.rst:1130 msgid "" "Attempting to hash an immutable sequence that contains unhashable values " "will result in :exc:`TypeError`." msgstr "" -#: ../../library/stdtypes.rst:1133 +#: ../../library/stdtypes.rst:1137 msgid "Mutable Sequence Types" msgstr "" -#: ../../library/stdtypes.rst:1140 +#: ../../library/stdtypes.rst:1144 msgid "" "The operations in the following table are defined on mutable sequence types. " "The :class:`collections.abc.MutableSequence` ABC is provided to make it " "easier to correctly implement these operations on custom sequence types." msgstr "" -#: ../../library/stdtypes.rst:1144 +#: ../../library/stdtypes.rst:1148 msgid "" "In the table *s* is an instance of a mutable sequence type, *t* is any " "iterable object and *x* is an arbitrary object that meets any type and value " @@ -1527,145 +1676,145 @@ msgid "" "integers that meet the value restriction ``0 <= x <= 255``)." msgstr "" -#: ../../library/stdtypes.rst:1168 +#: ../../library/stdtypes.rst:1172 msgid "``s[i] = x``" msgstr "``s[i] = x``" -#: ../../library/stdtypes.rst:1168 +#: ../../library/stdtypes.rst:1172 msgid "item *i* of *s* is replaced by *x*" msgstr "" -#: ../../library/stdtypes.rst:1171 +#: ../../library/stdtypes.rst:1175 msgid "``s[i:j] = t``" msgstr "``s[i:j] = t``" -#: ../../library/stdtypes.rst:1171 +#: ../../library/stdtypes.rst:1175 msgid "" "slice of *s* from *i* to *j* is replaced by the contents of the iterable *t*" msgstr "" -#: ../../library/stdtypes.rst:1175 +#: ../../library/stdtypes.rst:1179 msgid "``del s[i:j]``" msgstr "``del s[i:j]``" -#: ../../library/stdtypes.rst:1175 +#: ../../library/stdtypes.rst:1179 msgid "same as ``s[i:j] = []``" msgstr "" -#: ../../library/stdtypes.rst:1177 +#: ../../library/stdtypes.rst:1181 msgid "``s[i:j:k] = t``" msgstr "``s[i:j:k] = t``" -#: ../../library/stdtypes.rst:1177 +#: ../../library/stdtypes.rst:1181 msgid "the elements of ``s[i:j:k]`` are replaced by those of *t*" msgstr "" -#: ../../library/stdtypes.rst:1180 +#: ../../library/stdtypes.rst:1184 msgid "``del s[i:j:k]``" msgstr "``del s[i:j:k]``" -#: ../../library/stdtypes.rst:1180 +#: ../../library/stdtypes.rst:1184 msgid "removes the elements of ``s[i:j:k]`` from the list" msgstr "" -#: ../../library/stdtypes.rst:1183 +#: ../../library/stdtypes.rst:1187 msgid "``s.append(x)``" msgstr "``s.append(x)``" -#: ../../library/stdtypes.rst:1183 +#: ../../library/stdtypes.rst:1187 msgid "" "appends *x* to the end of the sequence (same as ``s[len(s):len(s)] = [x]``)" msgstr "" -#: ../../library/stdtypes.rst:1187 +#: ../../library/stdtypes.rst:1191 msgid "``s.clear()``" msgstr "``s.clear()``" -#: ../../library/stdtypes.rst:1187 +#: ../../library/stdtypes.rst:1191 msgid "removes all items from *s* (same as ``del s[:]``)" msgstr "" -#: ../../library/stdtypes.rst:1190 +#: ../../library/stdtypes.rst:1194 msgid "``s.copy()``" msgstr "``s.copy()``" -#: ../../library/stdtypes.rst:1190 +#: ../../library/stdtypes.rst:1194 msgid "creates a shallow copy of *s* (same as ``s[:]``)" msgstr "" -#: ../../library/stdtypes.rst:1193 +#: ../../library/stdtypes.rst:1197 msgid "``s.extend(t)`` or ``s += t``" msgstr "``s.extend(t)`` 或 ``s += t``" -#: ../../library/stdtypes.rst:1193 +#: ../../library/stdtypes.rst:1197 msgid "" "extends *s* with the contents of *t* (for the most part the same as " "``s[len(s):len(s)] = t``)" msgstr "" -#: ../../library/stdtypes.rst:1198 +#: ../../library/stdtypes.rst:1202 msgid "``s *= n``" msgstr "``s *= n``" -#: ../../library/stdtypes.rst:1198 +#: ../../library/stdtypes.rst:1202 msgid "updates *s* with its contents repeated *n* times" msgstr "" -#: ../../library/stdtypes.rst:1201 +#: ../../library/stdtypes.rst:1205 msgid "``s.insert(i, x)``" msgstr "``s.insert(i, x)``" -#: ../../library/stdtypes.rst:1201 +#: ../../library/stdtypes.rst:1205 msgid "" "inserts *x* into *s* at the index given by *i* (same as ``s[i:i] = [x]``)" msgstr "" -#: ../../library/stdtypes.rst:1205 +#: ../../library/stdtypes.rst:1209 msgid "``s.pop()`` or ``s.pop(i)``" msgstr "``s.pop()`` 或 ``s.pop(i)``" -#: ../../library/stdtypes.rst:1205 +#: ../../library/stdtypes.rst:1209 msgid "retrieves the item at *i* and also removes it from *s*" msgstr "" -#: ../../library/stdtypes.rst:1208 +#: ../../library/stdtypes.rst:1212 msgid "``s.remove(x)``" msgstr "``s.remove(x)``" -#: ../../library/stdtypes.rst:1208 +#: ../../library/stdtypes.rst:1212 msgid "remove the first item from *s* where ``s[i]`` is equal to *x*" msgstr "" -#: ../../library/stdtypes.rst:1211 +#: ../../library/stdtypes.rst:1215 msgid "``s.reverse()``" msgstr "``s.reverse()``" -#: ../../library/stdtypes.rst:1211 +#: ../../library/stdtypes.rst:1215 msgid "reverses the items of *s* in place" msgstr "" -#: ../../library/stdtypes.rst:1219 +#: ../../library/stdtypes.rst:1223 msgid "*t* must have the same length as the slice it is replacing." msgstr "" -#: ../../library/stdtypes.rst:1222 +#: ../../library/stdtypes.rst:1226 msgid "" "The optional argument *i* defaults to ``-1``, so that by default the last " "item is removed and returned." msgstr "" -#: ../../library/stdtypes.rst:1226 +#: ../../library/stdtypes.rst:1230 msgid ":meth:`remove` raises :exc:`ValueError` when *x* is not found in *s*." msgstr "" -#: ../../library/stdtypes.rst:1229 +#: ../../library/stdtypes.rst:1233 msgid "" "The :meth:`reverse` method modifies the sequence in place for economy of " "space when reversing a large sequence. To remind users that it operates by " "side effect, it does not return the reversed sequence." msgstr "" -#: ../../library/stdtypes.rst:1234 +#: ../../library/stdtypes.rst:1238 msgid "" ":meth:`clear` and :meth:`!copy` are included for consistency with the " "interfaces of mutable containers that don't support slicing operations (such " @@ -1674,11 +1823,11 @@ msgid "" "classes provide it." msgstr "" -#: ../../library/stdtypes.rst:1240 +#: ../../library/stdtypes.rst:1244 msgid ":meth:`clear` and :meth:`!copy` methods." msgstr "" -#: ../../library/stdtypes.rst:1244 +#: ../../library/stdtypes.rst:1248 msgid "" "The value *n* is an integer, or an object implementing :meth:`~object." "__index__`. Zero and negative values of *n* clear the sequence. Items in " @@ -1686,39 +1835,39 @@ msgid "" "explained for ``s * n`` under :ref:`typesseq-common`." msgstr "" -#: ../../library/stdtypes.rst:1253 +#: ../../library/stdtypes.rst:1257 msgid "Lists" msgstr "List(串列)" -#: ../../library/stdtypes.rst:1257 +#: ../../library/stdtypes.rst:1261 msgid "" "Lists are mutable sequences, typically used to store collections of " "homogeneous items (where the precise degree of similarity will vary by " "application)." msgstr "" -#: ../../library/stdtypes.rst:1263 +#: ../../library/stdtypes.rst:1267 msgid "Lists may be constructed in several ways:" msgstr "" -#: ../../library/stdtypes.rst:1265 +#: ../../library/stdtypes.rst:1269 msgid "Using a pair of square brackets to denote the empty list: ``[]``" msgstr "" -#: ../../library/stdtypes.rst:1266 +#: ../../library/stdtypes.rst:1270 msgid "" "Using square brackets, separating items with commas: ``[a]``, ``[a, b, c]``" msgstr "" -#: ../../library/stdtypes.rst:1267 +#: ../../library/stdtypes.rst:1271 msgid "Using a list comprehension: ``[x for x in iterable]``" msgstr "" -#: ../../library/stdtypes.rst:1268 +#: ../../library/stdtypes.rst:1272 msgid "Using the type constructor: ``list()`` or ``list(iterable)``" msgstr "" -#: ../../library/stdtypes.rst:1270 +#: ../../library/stdtypes.rst:1274 msgid "" "The constructor builds a list whose items are the same and in the same order " "as *iterable*'s items. *iterable* may be either a sequence, a container " @@ -1729,20 +1878,20 @@ msgid "" "new empty list, ``[]``." msgstr "" -#: ../../library/stdtypes.rst:1279 +#: ../../library/stdtypes.rst:1283 msgid "" "Many other operations also produce lists, including the :func:`sorted` built-" "in." msgstr "" -#: ../../library/stdtypes.rst:1282 +#: ../../library/stdtypes.rst:1286 msgid "" "Lists implement all of the :ref:`common ` and :ref:`mutable " "` sequence operations. Lists also provide the following " "additional method:" msgstr "" -#: ../../library/stdtypes.rst:1288 +#: ../../library/stdtypes.rst:1292 msgid "" "This method sorts the list in place, using only ``<`` comparisons between " "items. Exceptions are not suppressed - if any comparison operations fail, " @@ -1750,13 +1899,13 @@ msgid "" "partially modified state)." msgstr "" -#: ../../library/stdtypes.rst:1293 +#: ../../library/stdtypes.rst:1297 msgid "" ":meth:`sort` accepts two arguments that can only be passed by keyword (:ref:" "`keyword-only arguments `):" msgstr "" -#: ../../library/stdtypes.rst:1296 +#: ../../library/stdtypes.rst:1300 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each list element (for example, ``key=str.lower``). The " @@ -1765,19 +1914,19 @@ msgid "" "list items are sorted directly without calculating a separate key value." msgstr "" -#: ../../library/stdtypes.rst:1303 +#: ../../library/stdtypes.rst:1307 msgid "" "The :func:`functools.cmp_to_key` utility is available to convert a 2.x style " "*cmp* function to a *key* function." msgstr "" -#: ../../library/stdtypes.rst:1306 +#: ../../library/stdtypes.rst:1310 msgid "" "*reverse* is a boolean value. If set to ``True``, then the list elements " "are sorted as if each comparison were reversed." msgstr "" -#: ../../library/stdtypes.rst:1309 +#: ../../library/stdtypes.rst:1313 msgid "" "This method modifies the sequence in place for economy of space when sorting " "a large sequence. To remind users that it operates by side effect, it does " @@ -1785,7 +1934,7 @@ msgid "" "new sorted list instance)." msgstr "" -#: ../../library/stdtypes.rst:1314 +#: ../../library/stdtypes.rst:1318 msgid "" "The :meth:`sort` method is guaranteed to be stable. A sort is stable if it " "guarantees not to change the relative order of elements that compare equal " @@ -1793,12 +1942,12 @@ msgid "" "department, then by salary grade)." msgstr "" -#: ../../library/stdtypes.rst:1319 +#: ../../library/stdtypes.rst:1323 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/stdtypes.rst:1323 +#: ../../library/stdtypes.rst:1327 msgid "" "While a list is being sorted, the effect of attempting to mutate, or even " "inspect, the list is undefined. The C implementation of Python makes the " @@ -1806,11 +1955,11 @@ msgid "" "detect that the list has been mutated during a sort." msgstr "" -#: ../../library/stdtypes.rst:1332 +#: ../../library/stdtypes.rst:1336 msgid "Tuples" msgstr "" -#: ../../library/stdtypes.rst:1336 +#: ../../library/stdtypes.rst:1340 msgid "" "Tuples are immutable sequences, typically used to store collections of " "heterogeneous data (such as the 2-tuples produced by the :func:`enumerate` " @@ -1819,27 +1968,27 @@ msgid "" "class:`dict` instance)." msgstr "" -#: ../../library/stdtypes.rst:1344 +#: ../../library/stdtypes.rst:1348 msgid "Tuples may be constructed in a number of ways:" msgstr "" -#: ../../library/stdtypes.rst:1346 +#: ../../library/stdtypes.rst:1350 msgid "Using a pair of parentheses to denote the empty tuple: ``()``" msgstr "" -#: ../../library/stdtypes.rst:1347 +#: ../../library/stdtypes.rst:1351 msgid "Using a trailing comma for a singleton tuple: ``a,`` or ``(a,)``" msgstr "" -#: ../../library/stdtypes.rst:1348 +#: ../../library/stdtypes.rst:1352 msgid "Separating items with commas: ``a, b, c`` or ``(a, b, c)``" msgstr "" -#: ../../library/stdtypes.rst:1349 +#: ../../library/stdtypes.rst:1353 msgid "Using the :func:`tuple` built-in: ``tuple()`` or ``tuple(iterable)``" msgstr "" -#: ../../library/stdtypes.rst:1351 +#: ../../library/stdtypes.rst:1355 msgid "" "The constructor builds a tuple whose items are the same and in the same " "order as *iterable*'s items. *iterable* may be either a sequence, a " @@ -1850,7 +1999,7 @@ msgid "" "``()``." msgstr "" -#: ../../library/stdtypes.rst:1359 +#: ../../library/stdtypes.rst:1363 msgid "" "Note that it is actually the comma which makes a tuple, not the parentheses. " "The parentheses are optional, except in the empty tuple case, or when they " @@ -1859,30 +2008,30 @@ msgid "" "call with a 3-tuple as the sole argument." msgstr "" -#: ../../library/stdtypes.rst:1365 +#: ../../library/stdtypes.rst:1369 msgid "" "Tuples implement all of the :ref:`common ` sequence " "operations." msgstr "" -#: ../../library/stdtypes.rst:1368 +#: ../../library/stdtypes.rst:1372 msgid "" "For heterogeneous collections of data where access by name is clearer than " "access by index, :func:`collections.namedtuple` may be a more appropriate " "choice than a simple tuple object." msgstr "" -#: ../../library/stdtypes.rst:1376 +#: ../../library/stdtypes.rst:1380 msgid "Ranges" msgstr "" -#: ../../library/stdtypes.rst:1380 +#: ../../library/stdtypes.rst:1384 msgid "" "The :class:`range` type represents an immutable sequence of numbers and is " "commonly used for looping a specific number of times in :keyword:`for` loops." msgstr "" -#: ../../library/stdtypes.rst:1387 +#: ../../library/stdtypes.rst:1391 msgid "" "The arguments to the range constructor must be integers (either built-in :" "class:`int` or any object that implements the :meth:`~object.__index__` " @@ -1891,38 +2040,38 @@ msgid "" "zero, :exc:`ValueError` is raised." msgstr "" -#: ../../library/stdtypes.rst:1393 +#: ../../library/stdtypes.rst:1397 msgid "" "For a positive *step*, the contents of a range ``r`` are determined by the " "formula ``r[i] = start + step*i`` where ``i >= 0`` and ``r[i] < stop``." msgstr "" -#: ../../library/stdtypes.rst:1397 +#: ../../library/stdtypes.rst:1401 msgid "" "For a negative *step*, the contents of the range are still determined by the " "formula ``r[i] = start + step*i``, but the constraints are ``i >= 0`` and " "``r[i] > stop``." msgstr "" -#: ../../library/stdtypes.rst:1401 +#: ../../library/stdtypes.rst:1405 msgid "" "A range object will be empty if ``r[0]`` does not meet the value constraint. " "Ranges do support negative indices, but these are interpreted as indexing " "from the end of the sequence determined by the positive indices." msgstr "" -#: ../../library/stdtypes.rst:1406 +#: ../../library/stdtypes.rst:1410 msgid "" "Ranges containing absolute values larger than :data:`sys.maxsize` are " "permitted but some features (such as :func:`len`) may raise :exc:" "`OverflowError`." msgstr "" -#: ../../library/stdtypes.rst:1410 +#: ../../library/stdtypes.rst:1414 msgid "Range examples::" msgstr "" -#: ../../library/stdtypes.rst:1427 +#: ../../library/stdtypes.rst:1431 msgid "" "Ranges implement all of the :ref:`common ` sequence " "operations except concatenation and repetition (due to the fact that range " @@ -1930,23 +2079,23 @@ msgid "" "repetition and concatenation will usually violate that pattern)." msgstr "" -#: ../../library/stdtypes.rst:1434 +#: ../../library/stdtypes.rst:1438 msgid "" "The value of the *start* parameter (or ``0`` if the parameter was not " "supplied)" msgstr "" -#: ../../library/stdtypes.rst:1439 +#: ../../library/stdtypes.rst:1443 msgid "The value of the *stop* parameter" msgstr "" -#: ../../library/stdtypes.rst:1443 +#: ../../library/stdtypes.rst:1447 msgid "" "The value of the *step* parameter (or ``1`` if the parameter was not " "supplied)" msgstr "" -#: ../../library/stdtypes.rst:1446 +#: ../../library/stdtypes.rst:1450 msgid "" "The advantage of the :class:`range` type over a regular :class:`list` or :" "class:`tuple` is that a :class:`range` object will always take the same " @@ -1955,14 +2104,14 @@ msgid "" "individual items and subranges as needed)." msgstr "" -#: ../../library/stdtypes.rst:1452 +#: ../../library/stdtypes.rst:1456 msgid "" "Range objects implement the :class:`collections.abc.Sequence` ABC, and " "provide features such as containment tests, element index lookup, slicing " "and support for negative indices (see :ref:`typesseq`):" msgstr "" -#: ../../library/stdtypes.rst:1472 +#: ../../library/stdtypes.rst:1476 msgid "" "Testing range objects for equality with ``==`` and ``!=`` compares them as " "sequences. That is, two range objects are considered equal if they " @@ -1972,111 +2121,111 @@ msgid "" "3)`` or ``range(0, 3, 2) == range(0, 4, 2)``.)" msgstr "" -#: ../../library/stdtypes.rst:1479 +#: ../../library/stdtypes.rst:1483 msgid "" "Implement the Sequence ABC. Support slicing and negative indices. Test :" "class:`int` objects for membership in constant time instead of iterating " "through all items." msgstr "" -#: ../../library/stdtypes.rst:1485 +#: ../../library/stdtypes.rst:1489 msgid "" "Define '==' and '!=' to compare range objects based on the sequence of " "values they define (instead of comparing based on object identity)." msgstr "" -#: ../../library/stdtypes.rst:1490 +#: ../../library/stdtypes.rst:1494 msgid "" -"The :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step` " +"Added the :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step` " "attributes." msgstr "" -#: ../../library/stdtypes.rst:1496 +#: ../../library/stdtypes.rst:1499 msgid "" "The `linspace recipe `_ shows " "how to implement a lazy version of range suitable for floating point " "applications." msgstr "" -#: ../../library/stdtypes.rst:1508 +#: ../../library/stdtypes.rst:1511 msgid "Text Sequence Type --- :class:`str`" msgstr "" -#: ../../library/stdtypes.rst:1510 +#: ../../library/stdtypes.rst:1513 msgid "" "Textual data in Python is handled with :class:`str` objects, or :dfn:" "`strings`. Strings are immutable :ref:`sequences ` of Unicode code " "points. String literals are written in a variety of ways:" msgstr "" -#: ../../library/stdtypes.rst:1515 +#: ../../library/stdtypes.rst:1518 msgid "Single quotes: ``'allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:1516 +#: ../../library/stdtypes.rst:1519 msgid "Double quotes: ``\"allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:1517 +#: ../../library/stdtypes.rst:1520 msgid "" "Triple quoted: ``'''Three single quotes'''``, ``\"\"\"Three double " "quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:1519 +#: ../../library/stdtypes.rst:1522 msgid "" "Triple quoted strings may span multiple lines - all associated whitespace " "will be included in the string literal." msgstr "" -#: ../../library/stdtypes.rst:1522 +#: ../../library/stdtypes.rst:1525 msgid "" "String literals that are part of a single expression and have only " "whitespace between them will be implicitly converted to a single string " "literal. That is, ``(\"spam \" \"eggs\") == \"spam eggs\"``." msgstr "" -#: ../../library/stdtypes.rst:1526 +#: ../../library/stdtypes.rst:1529 msgid "" "See :ref:`strings` for more about the various forms of string literal, " -"including supported escape sequences, and the ``r`` (\"raw\") prefix that " -"disables most escape sequence processing." +"including supported :ref:`escape sequences `, and the " +"``r`` (\"raw\") prefix that disables most escape sequence processing." msgstr "" -#: ../../library/stdtypes.rst:1530 +#: ../../library/stdtypes.rst:1533 msgid "" "Strings may also be created from other objects using the :class:`str` " "constructor." msgstr "" -#: ../../library/stdtypes.rst:1533 +#: ../../library/stdtypes.rst:1536 msgid "" "Since there is no separate \"character\" type, indexing a string produces " "strings of length 1. That is, for a non-empty string *s*, ``s[0] == s[0:1]``." msgstr "" -#: ../../library/stdtypes.rst:1539 +#: ../../library/stdtypes.rst:1542 msgid "" "There is also no mutable string type, but :meth:`str.join` or :class:`io." "StringIO` can be used to efficiently construct strings from multiple " "fragments." msgstr "" -#: ../../library/stdtypes.rst:1543 +#: ../../library/stdtypes.rst:1546 msgid "" "For backwards compatibility with the Python 2 series, the ``u`` prefix is " "once again permitted on string literals. It has no effect on the meaning of " "string literals and cannot be combined with the ``r`` prefix." msgstr "" -#: ../../library/stdtypes.rst:1555 +#: ../../library/stdtypes.rst:1558 msgid "" "Return a :ref:`string ` version of *object*. If *object* is not " "provided, returns the empty string. Otherwise, the behavior of ``str()`` " "depends on whether *encoding* or *errors* is given, as follows." msgstr "" -#: ../../library/stdtypes.rst:1559 +#: ../../library/stdtypes.rst:1562 msgid "" "If neither *encoding* nor *errors* is given, ``str(object)`` returns :meth:" "`type(object).__str__(object) `, which is the \"informal\" " @@ -2086,7 +2235,7 @@ msgid "" "`repr(object) `." msgstr "" -#: ../../library/stdtypes.rst:1571 +#: ../../library/stdtypes.rst:1574 msgid "" "If at least one of *encoding* or *errors* is given, *object* should be a :" "term:`bytes-like object` (e.g. :class:`bytes` or :class:`bytearray`). In " @@ -2098,7 +2247,7 @@ msgid "" "buffer objects." msgstr "" -#: ../../library/stdtypes.rst:1580 +#: ../../library/stdtypes.rst:1583 msgid "" "Passing a :class:`bytes` object to :func:`str` without the *encoding* or " "*errors* arguments falls under the first case of returning the informal " @@ -2106,7 +2255,7 @@ msgid "" "Python). For example::" msgstr "" -#: ../../library/stdtypes.rst:1588 +#: ../../library/stdtypes.rst:1591 msgid "" "For more information on the ``str`` class and its methods, see :ref:" "`textseq` and the :ref:`string-methods` section below. To output formatted " @@ -2114,17 +2263,17 @@ msgid "" "addition, see the :ref:`stringservices` section." msgstr "" -#: ../../library/stdtypes.rst:1600 +#: ../../library/stdtypes.rst:1603 msgid "String Methods" msgstr "" -#: ../../library/stdtypes.rst:1605 +#: ../../library/stdtypes.rst:1608 msgid "" "Strings implement all of the :ref:`common ` sequence " "operations, along with the additional methods described below." msgstr "" -#: ../../library/stdtypes.rst:1608 +#: ../../library/stdtypes.rst:1611 msgid "" "Strings also support two styles of string formatting, one providing a large " "degree of flexibility and customization (see :meth:`str.format`, :ref:" @@ -2134,33 +2283,33 @@ msgid "" "handle (:ref:`old-string-formatting`)." msgstr "" -#: ../../library/stdtypes.rst:1615 +#: ../../library/stdtypes.rst:1618 msgid "" "The :ref:`textservices` section of the standard library covers a number of " "other modules that provide various text related utilities (including regular " "expression support in the :mod:`re` module)." msgstr "" -#: ../../library/stdtypes.rst:1621 +#: ../../library/stdtypes.rst:1624 msgid "" "Return a copy of the string with its first character capitalized and the " "rest lowercased." msgstr "" -#: ../../library/stdtypes.rst:1624 +#: ../../library/stdtypes.rst:1627 msgid "" "The first character is now put into titlecase rather than uppercase. This " "means that characters like digraphs will only have their first letter " "capitalized, instead of the full character." msgstr "" -#: ../../library/stdtypes.rst:1631 +#: ../../library/stdtypes.rst:1634 msgid "" "Return a casefolded copy of the string. Casefolded strings may be used for " "caseless matching." msgstr "" -#: ../../library/stdtypes.rst:1634 +#: ../../library/stdtypes.rst:1637 msgid "" "Casefolding is similar to lowercasing but more aggressive because it is " "intended to remove all case distinctions in a string. For example, the " @@ -2169,44 +2318,44 @@ msgid "" "`casefold` converts it to ``\"ss\"``." msgstr "" -#: ../../library/stdtypes.rst:1640 +#: ../../library/stdtypes.rst:1643 msgid "" "The casefolding algorithm is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." msgstr "" -#: ../../library/stdtypes.rst:1649 +#: ../../library/stdtypes.rst:1652 msgid "" "Return centered in a string of length *width*. Padding is done using the " "specified *fillchar* (default is an ASCII space). The original string is " "returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:1657 +#: ../../library/stdtypes.rst:1660 msgid "" "Return the number of non-overlapping occurrences of substring *sub* in the " "range [*start*, *end*]. Optional arguments *start* and *end* are " "interpreted as in slice notation." msgstr "" -#: ../../library/stdtypes.rst:1661 +#: ../../library/stdtypes.rst:1664 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:1667 +#: ../../library/stdtypes.rst:1670 msgid "Return the string encoded to :class:`bytes`." msgstr "" -#: ../../library/stdtypes.rst:1669 ../../library/stdtypes.rst:2808 +#: ../../library/stdtypes.rst:1672 ../../library/stdtypes.rst:2811 msgid "" "*encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for " "possible values." msgstr "" -#: ../../library/stdtypes.rst:1672 +#: ../../library/stdtypes.rst:1675 msgid "" "*errors* controls how encoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -2215,24 +2364,24 @@ msgid "" "register_error`. See :ref:`error-handlers` for details." msgstr "" -#: ../../library/stdtypes.rst:1679 +#: ../../library/stdtypes.rst:1682 msgid "" "For performance reasons, the value of *errors* is not checked for validity " "unless an encoding error actually occurs, :ref:`devmode` is enabled or a :" "ref:`debug build ` is used." msgstr "" -#: ../../library/stdtypes.rst:1684 ../../library/stdtypes.rst:2827 +#: ../../library/stdtypes.rst:1687 ../../library/stdtypes.rst:2830 msgid "Added support for keyword arguments." msgstr "新增關鍵字引數的支援。" -#: ../../library/stdtypes.rst:1687 ../../library/stdtypes.rst:2830 +#: ../../library/stdtypes.rst:1690 ../../library/stdtypes.rst:2833 msgid "" "The value of the *errors* argument is now checked in :ref:`devmode` and in :" "ref:`debug mode `." msgstr "" -#: ../../library/stdtypes.rst:1694 +#: ../../library/stdtypes.rst:1697 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. " @@ -2240,7 +2389,7 @@ msgid "" "*end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:1702 +#: ../../library/stdtypes.rst:1705 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 " @@ -2256,21 +2405,21 @@ msgid "" "printed." msgstr "" -#: ../../library/stdtypes.rst:1723 +#: ../../library/stdtypes.rst:1726 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:1729 +#: ../../library/stdtypes.rst:1732 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:1739 +#: ../../library/stdtypes.rst:1742 msgid "" "Perform a string formatting operation. The string on which this method is " "called can contain literal text or replacement fields delimited by braces " @@ -2280,13 +2429,13 @@ msgid "" "the corresponding argument." msgstr "" -#: ../../library/stdtypes.rst:1749 +#: ../../library/stdtypes.rst:1752 msgid "" "See :ref:`formatstrings` for a description of the various formatting options " "that can be specified in format strings." msgstr "" -#: ../../library/stdtypes.rst:1753 +#: ../../library/stdtypes.rst:1756 msgid "" "When formatting a number (:class:`int`, :class:`float`, :class:`complex`, :" "class:`decimal.Decimal` and subclasses) with the ``n`` type (ex: ``'{:n}'." @@ -2297,26 +2446,26 @@ msgid "" "This temporary change affects other threads." msgstr "" -#: ../../library/stdtypes.rst:1762 +#: ../../library/stdtypes.rst:1765 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:1770 +#: ../../library/stdtypes.rst:1773 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:1786 +#: ../../library/stdtypes.rst:1789 msgid "" "Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is " "not found." msgstr "" -#: ../../library/stdtypes.rst:1792 +#: ../../library/stdtypes.rst:1795 msgid "" "Return ``True`` if all characters in the string are alphanumeric and there " "is at least one character, ``False`` otherwise. A character ``c`` is " @@ -2324,7 +2473,7 @@ msgid "" "isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``." msgstr "" -#: ../../library/stdtypes.rst:1800 +#: ../../library/stdtypes.rst:1803 msgid "" "Return ``True`` if all characters in the string are alphabetic and there is " "at least one character, ``False`` otherwise. Alphabetic characters are " @@ -2336,14 +2485,14 @@ msgid "" "pdf>`_." msgstr "" -#: ../../library/stdtypes.rst:1811 +#: ../../library/stdtypes.rst:1814 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:1820 +#: ../../library/stdtypes.rst:1823 msgid "" "Return ``True`` if all characters in the string are decimal characters and " "there is at least one character, ``False`` otherwise. Decimal characters are " @@ -2352,7 +2501,7 @@ msgid "" "General Category \"Nd\"." msgstr "" -#: ../../library/stdtypes.rst:1830 +#: ../../library/stdtypes.rst:1833 msgid "" "Return ``True`` if all characters in the string are digits and there is at " "least one character, ``False`` otherwise. Digits include decimal characters " @@ -2362,32 +2511,32 @@ msgid "" "property value Numeric_Type=Digit or Numeric_Type=Decimal." msgstr "" -#: ../../library/stdtypes.rst:1840 +#: ../../library/stdtypes.rst:1843 msgid "" "Return ``True`` if the string is a valid identifier according to the " "language definition, section :ref:`identifiers`." msgstr "" -#: ../../library/stdtypes.rst:1843 +#: ../../library/stdtypes.rst:1846 msgid "" ":func:`keyword.iskeyword` can be used to test whether string ``s`` is a " "reserved identifier, such as :keyword:`def` and :keyword:`class`." msgstr "" -#: ../../library/stdtypes.rst:1846 +#: ../../library/stdtypes.rst:1849 msgid "Example: ::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/stdtypes.rst:1859 +#: ../../library/stdtypes.rst:1862 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:1865 +#: ../../library/stdtypes.rst:1868 msgid "" "Return ``True`` if all characters in the string are numeric characters, and " "there is at least one character, ``False`` otherwise. Numeric characters " @@ -2397,7 +2546,7 @@ msgid "" "Numeric_Type=Decimal or Numeric_Type=Numeric." msgstr "" -#: ../../library/stdtypes.rst:1875 +#: ../../library/stdtypes.rst:1878 msgid "" "Return ``True`` if all characters in the string are printable or the string " "is empty, ``False`` otherwise. Nonprintable characters are those characters " @@ -2408,20 +2557,20 @@ msgid "" "of strings written to :data:`sys.stdout` or :data:`sys.stderr`.)" msgstr "" -#: ../../library/stdtypes.rst:1886 +#: ../../library/stdtypes.rst:1889 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:1889 +#: ../../library/stdtypes.rst:1892 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:1897 +#: ../../library/stdtypes.rst:1900 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 " @@ -2429,13 +2578,13 @@ msgid "" "otherwise." msgstr "" -#: ../../library/stdtypes.rst:1904 +#: ../../library/stdtypes.rst:1907 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:1922 +#: ../../library/stdtypes.rst:1925 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 " @@ -2443,27 +2592,27 @@ msgid "" "elements is the string providing this method." msgstr "" -#: ../../library/stdtypes.rst:1930 +#: ../../library/stdtypes.rst:1933 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:1937 +#: ../../library/stdtypes.rst:1940 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "lowercase." msgstr "" -#: ../../library/stdtypes.rst:1940 +#: ../../library/stdtypes.rst:1943 msgid "" "The lowercasing algorithm used is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." msgstr "" -#: ../../library/stdtypes.rst:1947 +#: ../../library/stdtypes.rst:1950 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 " @@ -2472,19 +2621,19 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:1957 +#: ../../library/stdtypes.rst:1960 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:1968 +#: ../../library/stdtypes.rst:1971 msgid "" "This static method returns a translation table usable for :meth:`str." "translate`." msgstr "" -#: ../../library/stdtypes.rst:1970 +#: ../../library/stdtypes.rst:1973 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, " @@ -2492,7 +2641,7 @@ msgid "" "converted to ordinals." msgstr "" -#: ../../library/stdtypes.rst:1975 +#: ../../library/stdtypes.rst:1978 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 " @@ -2500,7 +2649,7 @@ msgid "" "whose characters will be mapped to ``None`` in the result." msgstr "" -#: ../../library/stdtypes.rst:1983 +#: ../../library/stdtypes.rst:1986 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 " @@ -2508,47 +2657,47 @@ msgid "" "containing the string itself, followed by two empty strings." msgstr "" -#: ../../library/stdtypes.rst:1991 +#: ../../library/stdtypes.rst:1994 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:2005 +#: ../../library/stdtypes.rst:2008 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:2019 +#: ../../library/stdtypes.rst:2022 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:2026 +#: ../../library/stdtypes.rst:2029 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:2033 +#: ../../library/stdtypes.rst:2036 msgid "" "Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is " "not found." msgstr "" -#: ../../library/stdtypes.rst:2039 +#: ../../library/stdtypes.rst:2042 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:2046 +#: ../../library/stdtypes.rst:2049 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 " @@ -2556,7 +2705,7 @@ msgid "" "containing two empty strings, followed by the string itself." msgstr "" -#: ../../library/stdtypes.rst:2054 +#: ../../library/stdtypes.rst:2057 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 " @@ -2565,7 +2714,7 @@ msgid "" "behaves like :meth:`split` which is described in detail below." msgstr "" -#: ../../library/stdtypes.rst:2063 +#: ../../library/stdtypes.rst:2066 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 " @@ -2574,13 +2723,13 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2073 +#: ../../library/stdtypes.rst:2076 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:2083 +#: ../../library/stdtypes.rst:2086 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, " @@ -2589,7 +2738,7 @@ msgid "" "possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:2089 +#: ../../library/stdtypes.rst:2092 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns " @@ -2598,23 +2747,23 @@ msgid "" "Splitting an empty string with a specified separator returns ``['']``." msgstr "" -#: ../../library/stdtypes.rst:2095 ../../library/stdtypes.rst:2111 -#: ../../library/stdtypes.rst:2163 ../../library/stdtypes.rst:2231 -#: ../../library/stdtypes.rst:2299 ../../library/stdtypes.rst:3146 -#: ../../library/stdtypes.rst:3162 ../../library/stdtypes.rst:3253 -#: ../../library/stdtypes.rst:3269 ../../library/stdtypes.rst:3294 -#: ../../library/stdtypes.rst:3308 ../../library/stdtypes.rst:3336 -#: ../../library/stdtypes.rst:3350 ../../library/stdtypes.rst:3368 -#: ../../library/stdtypes.rst:3395 ../../library/stdtypes.rst:3418 -#: ../../library/stdtypes.rst:3445 ../../library/stdtypes.rst:3487 -#: ../../library/stdtypes.rst:3511 +#: ../../library/stdtypes.rst:2098 ../../library/stdtypes.rst:2114 +#: ../../library/stdtypes.rst:2166 ../../library/stdtypes.rst:2234 +#: ../../library/stdtypes.rst:2302 ../../library/stdtypes.rst:3149 +#: ../../library/stdtypes.rst:3165 ../../library/stdtypes.rst:3256 +#: ../../library/stdtypes.rst:3272 ../../library/stdtypes.rst:3297 +#: ../../library/stdtypes.rst:3311 ../../library/stdtypes.rst:3339 +#: ../../library/stdtypes.rst:3353 ../../library/stdtypes.rst:3371 +#: ../../library/stdtypes.rst:3398 ../../library/stdtypes.rst:3421 +#: ../../library/stdtypes.rst:3448 ../../library/stdtypes.rst:3490 +#: ../../library/stdtypes.rst:3514 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/stdtypes.rst:2104 +#: ../../library/stdtypes.rst:2107 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, " @@ -2624,131 +2773,131 @@ msgid "" "returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:2126 +#: ../../library/stdtypes.rst:2129 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:2130 +#: ../../library/stdtypes.rst:2133 msgid "" "This method splits on the following line boundaries. In particular, the " "boundaries are a superset of :term:`universal newlines`." msgstr "" -#: ../../library/stdtypes.rst:2134 +#: ../../library/stdtypes.rst:2137 msgid "Representation" msgstr "" -#: ../../library/stdtypes.rst:2134 +#: ../../library/stdtypes.rst:2137 msgid "Description" msgstr "描述" -#: ../../library/stdtypes.rst:2136 +#: ../../library/stdtypes.rst:2139 msgid "``\\n``" msgstr "``\\n``" -#: ../../library/stdtypes.rst:2136 +#: ../../library/stdtypes.rst:2139 msgid "Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2138 +#: ../../library/stdtypes.rst:2141 msgid "``\\r``" msgstr "``\\r``" -#: ../../library/stdtypes.rst:2138 +#: ../../library/stdtypes.rst:2141 msgid "Carriage Return" msgstr "" -#: ../../library/stdtypes.rst:2140 +#: ../../library/stdtypes.rst:2143 msgid "``\\r\\n``" msgstr "``\\r\\n``" -#: ../../library/stdtypes.rst:2140 +#: ../../library/stdtypes.rst:2143 msgid "Carriage Return + Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2142 +#: ../../library/stdtypes.rst:2145 msgid "``\\v`` or ``\\x0b``" msgstr "``\\v`` 或 ``\\x0b``" -#: ../../library/stdtypes.rst:2142 +#: ../../library/stdtypes.rst:2145 msgid "Line Tabulation" msgstr "" -#: ../../library/stdtypes.rst:2144 +#: ../../library/stdtypes.rst:2147 msgid "``\\f`` or ``\\x0c``" msgstr "``\\f`` 或 ``\\x0c``" -#: ../../library/stdtypes.rst:2144 +#: ../../library/stdtypes.rst:2147 msgid "Form Feed" msgstr "" -#: ../../library/stdtypes.rst:2146 +#: ../../library/stdtypes.rst:2149 msgid "``\\x1c``" msgstr "``\\x1c``" -#: ../../library/stdtypes.rst:2146 +#: ../../library/stdtypes.rst:2149 msgid "File Separator" msgstr "" -#: ../../library/stdtypes.rst:2148 +#: ../../library/stdtypes.rst:2151 msgid "``\\x1d``" msgstr "``\\x1d``" -#: ../../library/stdtypes.rst:2148 +#: ../../library/stdtypes.rst:2151 msgid "Group Separator" msgstr "" -#: ../../library/stdtypes.rst:2150 +#: ../../library/stdtypes.rst:2153 msgid "``\\x1e``" msgstr "``\\x1e``" -#: ../../library/stdtypes.rst:2150 +#: ../../library/stdtypes.rst:2153 msgid "Record Separator" msgstr "" -#: ../../library/stdtypes.rst:2152 +#: ../../library/stdtypes.rst:2155 msgid "``\\x85``" msgstr "``\\x85``" -#: ../../library/stdtypes.rst:2152 +#: ../../library/stdtypes.rst:2155 msgid "Next Line (C1 Control Code)" msgstr "" -#: ../../library/stdtypes.rst:2154 +#: ../../library/stdtypes.rst:2157 msgid "``\\u2028``" msgstr "``\\u2028``" -#: ../../library/stdtypes.rst:2154 +#: ../../library/stdtypes.rst:2157 msgid "Line Separator" msgstr "" -#: ../../library/stdtypes.rst:2156 +#: ../../library/stdtypes.rst:2159 msgid "``\\u2029``" msgstr "``\\u2029``" -#: ../../library/stdtypes.rst:2156 +#: ../../library/stdtypes.rst:2159 msgid "Paragraph Separator" msgstr "" -#: ../../library/stdtypes.rst:2161 +#: ../../library/stdtypes.rst:2164 msgid "``\\v`` and ``\\f`` added to list of line boundaries." msgstr "" -#: ../../library/stdtypes.rst:2170 +#: ../../library/stdtypes.rst:2173 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:2179 +#: ../../library/stdtypes.rst:2182 msgid "For comparison, ``split('\\n')`` gives::" msgstr "" -#: ../../library/stdtypes.rst:2189 +#: ../../library/stdtypes.rst:2192 msgid "" "Return ``True`` if string starts with the *prefix*, otherwise return " "``False``. *prefix* can also be a tuple of prefixes to look for. With " @@ -2756,7 +2905,7 @@ msgid "" "*end*, stop comparing string at that position." msgstr "" -#: ../../library/stdtypes.rst:2197 +#: ../../library/stdtypes.rst:2200 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 " @@ -2765,7 +2914,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2208 +#: ../../library/stdtypes.rst:2211 msgid "" "The outermost leading and trailing *chars* argument values are stripped from " "the string. Characters are removed from the leading end until reaching a " @@ -2773,20 +2922,20 @@ msgid "" "A similar action takes place on the trailing end. For example::" msgstr "" -#: ../../library/stdtypes.rst:2221 +#: ../../library/stdtypes.rst:2224 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:2228 +#: ../../library/stdtypes.rst:2231 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:2236 ../../library/stdtypes.rst:3455 +#: ../../library/stdtypes.rst:2239 ../../library/stdtypes.rst:3458 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 " @@ -2794,43 +2943,43 @@ msgid "" "which may not be the desired result::" msgstr "" -#: ../../library/stdtypes.rst:2244 +#: ../../library/stdtypes.rst:2247 msgid "" "The :func:`string.capwords` function does not have this problem, as it " "splits words on spaces only." msgstr "" -#: ../../library/stdtypes.rst:2247 +#: ../../library/stdtypes.rst:2250 msgid "" "Alternatively, a workaround for apostrophes can be constructed using regular " "expressions::" msgstr "" -#: ../../library/stdtypes.rst:2262 +#: ../../library/stdtypes.rst:2265 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 " -"indexing via :meth:`__getitem__`, typically a :term:`mapping` or :term:" -"`sequence`. When indexed by a Unicode ordinal (an integer), the table " +"indexing via :meth:`~object.__getitem__`, typically a :term:`mapping` or :" +"term:`sequence`. When indexed by a Unicode ordinal (an integer), the table " "object can do any of the following: return a Unicode ordinal or a string, to " "map the character to one or more other characters; return ``None``, to " "delete the character from the return string; or raise a :exc:`LookupError` " "exception, to map the character to itself." msgstr "" -#: ../../library/stdtypes.rst:2271 +#: ../../library/stdtypes.rst:2274 msgid "" "You can use :meth:`str.maketrans` to create a translation map from character-" "to-character mappings in different formats." msgstr "" -#: ../../library/stdtypes.rst:2274 +#: ../../library/stdtypes.rst:2277 msgid "" "See also the :mod:`codecs` module for a more flexible approach to custom " "character mappings." msgstr "" -#: ../../library/stdtypes.rst:2280 +#: ../../library/stdtypes.rst:2283 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`` " @@ -2839,14 +2988,14 @@ msgid "" "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:2286 +#: ../../library/stdtypes.rst:2289 msgid "" "The uppercasing algorithm used is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." msgstr "" -#: ../../library/stdtypes.rst:2293 +#: ../../library/stdtypes.rst:2296 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 " @@ -2854,11 +3003,11 @@ msgid "" "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2311 +#: ../../library/stdtypes.rst:2314 msgid "``printf``-style String Formatting" msgstr "" -#: ../../library/stdtypes.rst:2324 +#: ../../library/stdtypes.rst:2327 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 " @@ -2869,7 +3018,7 @@ msgid "" "or extensibility." msgstr "" -#: ../../library/stdtypes.rst:2332 +#: ../../library/stdtypes.rst:2335 msgid "" "String objects have one unique built-in operation: the ``%`` operator " "(modulo). This is also known as the string *formatting* or *interpolation* " @@ -2879,7 +3028,7 @@ msgid "" "in the C language." msgstr "" -#: ../../library/stdtypes.rst:2338 +#: ../../library/stdtypes.rst:2341 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 " @@ -2887,36 +3036,36 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:2348 ../../library/stdtypes.rst:3566 +#: ../../library/stdtypes.rst:2351 ../../library/stdtypes.rst:3569 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: ../../library/stdtypes.rst:2351 ../../library/stdtypes.rst:3569 +#: ../../library/stdtypes.rst:2354 ../../library/stdtypes.rst:3572 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../library/stdtypes.rst:2353 ../../library/stdtypes.rst:3571 +#: ../../library/stdtypes.rst:2356 ../../library/stdtypes.rst:3574 msgid "" "Mapping key (optional), consisting of a parenthesised sequence of characters " "(for example, ``(somename)``)." msgstr "" -#: ../../library/stdtypes.rst:2356 ../../library/stdtypes.rst:3574 +#: ../../library/stdtypes.rst:2359 ../../library/stdtypes.rst:3577 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: ../../library/stdtypes.rst:2359 ../../library/stdtypes.rst:3577 +#: ../../library/stdtypes.rst:2362 ../../library/stdtypes.rst:3580 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:2363 ../../library/stdtypes.rst:3581 +#: ../../library/stdtypes.rst:2366 ../../library/stdtypes.rst:3584 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. " "If specified as ``'*'`` (an asterisk), the actual precision is read from the " @@ -2924,15 +3073,15 @@ msgid "" "the precision." msgstr "" -#: ../../library/stdtypes.rst:2368 ../../library/stdtypes.rst:3586 +#: ../../library/stdtypes.rst:2371 ../../library/stdtypes.rst:3589 msgid "Length modifier (optional)." msgstr "" -#: ../../library/stdtypes.rst:2370 ../../library/stdtypes.rst:3588 +#: ../../library/stdtypes.rst:2373 ../../library/stdtypes.rst:3591 msgid "Conversion type." msgstr "" -#: ../../library/stdtypes.rst:2372 +#: ../../library/stdtypes.rst:2375 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 " @@ -2940,279 +3089,279 @@ msgid "" "selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:3599 +#: ../../library/stdtypes.rst:2384 ../../library/stdtypes.rst:3602 msgid "" "In this case no ``*`` specifiers may occur in a format (since they require a " "sequential parameter list)." msgstr "" -#: ../../library/stdtypes.rst:2384 ../../library/stdtypes.rst:3602 +#: ../../library/stdtypes.rst:2387 ../../library/stdtypes.rst:3605 msgid "The conversion flag characters are:" msgstr "" -#: ../../library/stdtypes.rst:2393 ../../library/stdtypes.rst:3611 +#: ../../library/stdtypes.rst:2396 ../../library/stdtypes.rst:3614 msgid "Flag" msgstr "" -#: ../../library/stdtypes.rst:2395 ../../library/stdtypes.rst:3613 +#: ../../library/stdtypes.rst:2398 ../../library/stdtypes.rst:3616 msgid "``'#'``" msgstr "``'#'``" -#: ../../library/stdtypes.rst:2395 ../../library/stdtypes.rst:3613 +#: ../../library/stdtypes.rst:2398 ../../library/stdtypes.rst:3616 msgid "" "The value conversion will use the \"alternate form\" (where defined below)." msgstr "" -#: ../../library/stdtypes.rst:2398 ../../library/stdtypes.rst:3616 +#: ../../library/stdtypes.rst:2401 ../../library/stdtypes.rst:3619 msgid "``'0'``" msgstr "``'0'``" -#: ../../library/stdtypes.rst:2398 ../../library/stdtypes.rst:3616 +#: ../../library/stdtypes.rst:2401 ../../library/stdtypes.rst:3619 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: ../../library/stdtypes.rst:2400 ../../library/stdtypes.rst:3618 +#: ../../library/stdtypes.rst:2403 ../../library/stdtypes.rst:3621 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/stdtypes.rst:2400 ../../library/stdtypes.rst:3618 +#: ../../library/stdtypes.rst:2403 ../../library/stdtypes.rst:3621 msgid "" "The converted value is left adjusted (overrides the ``'0'`` conversion if " "both are given)." msgstr "" -#: ../../library/stdtypes.rst:2403 ../../library/stdtypes.rst:3621 +#: ../../library/stdtypes.rst:2406 ../../library/stdtypes.rst:3624 msgid "``' '``" msgstr "``' '``" -#: ../../library/stdtypes.rst:2403 ../../library/stdtypes.rst:3621 +#: ../../library/stdtypes.rst:2406 ../../library/stdtypes.rst:3624 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." msgstr "" -#: ../../library/stdtypes.rst:2406 ../../library/stdtypes.rst:3624 +#: ../../library/stdtypes.rst:2409 ../../library/stdtypes.rst:3627 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/stdtypes.rst:2406 ../../library/stdtypes.rst:3624 +#: ../../library/stdtypes.rst:2409 ../../library/stdtypes.rst:3627 msgid "" "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides " "a \"space\" flag)." msgstr "" -#: ../../library/stdtypes.rst:2410 ../../library/stdtypes.rst:3628 +#: ../../library/stdtypes.rst:2413 ../../library/stdtypes.rst:3631 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:2413 ../../library/stdtypes.rst:3631 +#: ../../library/stdtypes.rst:2416 ../../library/stdtypes.rst:3634 msgid "The conversion types are:" msgstr "" -#: ../../library/stdtypes.rst:2416 ../../library/stdtypes.rst:3634 +#: ../../library/stdtypes.rst:2419 ../../library/stdtypes.rst:3637 msgid "Conversion" msgstr "" -#: ../../library/stdtypes.rst:2418 ../../library/stdtypes.rst:3636 +#: ../../library/stdtypes.rst:2421 ../../library/stdtypes.rst:3639 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/stdtypes.rst:2418 ../../library/stdtypes.rst:2420 -#: ../../library/stdtypes.rst:3636 ../../library/stdtypes.rst:3638 +#: ../../library/stdtypes.rst:2421 ../../library/stdtypes.rst:2423 +#: ../../library/stdtypes.rst:3639 ../../library/stdtypes.rst:3641 msgid "Signed integer decimal." msgstr "" -#: ../../library/stdtypes.rst:2420 ../../library/stdtypes.rst:3638 +#: ../../library/stdtypes.rst:2423 ../../library/stdtypes.rst:3641 msgid "``'i'``" msgstr "``'i'``" -#: ../../library/stdtypes.rst:2422 ../../library/stdtypes.rst:3640 +#: ../../library/stdtypes.rst:2425 ../../library/stdtypes.rst:3643 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/stdtypes.rst:2422 ../../library/stdtypes.rst:3640 +#: ../../library/stdtypes.rst:2425 ../../library/stdtypes.rst:3643 msgid "Signed octal value." msgstr "" -#: ../../library/stdtypes.rst:2424 ../../library/stdtypes.rst:3642 +#: ../../library/stdtypes.rst:2427 ../../library/stdtypes.rst:3645 msgid "``'u'``" msgstr "``'u'``" -#: ../../library/stdtypes.rst:2424 ../../library/stdtypes.rst:3642 +#: ../../library/stdtypes.rst:2427 ../../library/stdtypes.rst:3645 msgid "Obsolete type -- it is identical to ``'d'``." msgstr "" -#: ../../library/stdtypes.rst:2426 ../../library/stdtypes.rst:3644 +#: ../../library/stdtypes.rst:2429 ../../library/stdtypes.rst:3647 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/stdtypes.rst:2426 ../../library/stdtypes.rst:3644 +#: ../../library/stdtypes.rst:2429 ../../library/stdtypes.rst:3647 msgid "Signed hexadecimal (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2428 ../../library/stdtypes.rst:3646 +#: ../../library/stdtypes.rst:2431 ../../library/stdtypes.rst:3649 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/stdtypes.rst:2428 ../../library/stdtypes.rst:3646 +#: ../../library/stdtypes.rst:2431 ../../library/stdtypes.rst:3649 msgid "Signed hexadecimal (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2430 ../../library/stdtypes.rst:3648 +#: ../../library/stdtypes.rst:2433 ../../library/stdtypes.rst:3651 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/stdtypes.rst:2430 ../../library/stdtypes.rst:3648 +#: ../../library/stdtypes.rst:2433 ../../library/stdtypes.rst:3651 msgid "Floating point exponential format (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2432 ../../library/stdtypes.rst:3650 +#: ../../library/stdtypes.rst:2435 ../../library/stdtypes.rst:3653 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/stdtypes.rst:2432 ../../library/stdtypes.rst:3650 +#: ../../library/stdtypes.rst:2435 ../../library/stdtypes.rst:3653 msgid "Floating point exponential format (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2434 ../../library/stdtypes.rst:3652 +#: ../../library/stdtypes.rst:2437 ../../library/stdtypes.rst:3655 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/stdtypes.rst:2434 ../../library/stdtypes.rst:2436 -#: ../../library/stdtypes.rst:3652 ../../library/stdtypes.rst:3654 +#: ../../library/stdtypes.rst:2437 ../../library/stdtypes.rst:2439 +#: ../../library/stdtypes.rst:3655 ../../library/stdtypes.rst:3657 msgid "Floating point decimal format." msgstr "" -#: ../../library/stdtypes.rst:2436 ../../library/stdtypes.rst:3654 +#: ../../library/stdtypes.rst:2439 ../../library/stdtypes.rst:3657 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/stdtypes.rst:2438 ../../library/stdtypes.rst:3656 +#: ../../library/stdtypes.rst:2441 ../../library/stdtypes.rst:3659 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/stdtypes.rst:2438 ../../library/stdtypes.rst:3656 +#: ../../library/stdtypes.rst:2441 ../../library/stdtypes.rst:3659 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:2442 ../../library/stdtypes.rst:3660 +#: ../../library/stdtypes.rst:2445 ../../library/stdtypes.rst:3663 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/stdtypes.rst:2442 ../../library/stdtypes.rst:3660 +#: ../../library/stdtypes.rst:2445 ../../library/stdtypes.rst:3663 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:2446 ../../library/stdtypes.rst:3664 +#: ../../library/stdtypes.rst:2449 ../../library/stdtypes.rst:3667 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/stdtypes.rst:2446 +#: ../../library/stdtypes.rst:2449 msgid "Single character (accepts integer or single character string)." msgstr "" -#: ../../library/stdtypes.rst:2449 ../../library/stdtypes.rst:3677 +#: ../../library/stdtypes.rst:2452 ../../library/stdtypes.rst:3680 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/stdtypes.rst:2449 +#: ../../library/stdtypes.rst:2452 msgid "String (converts any Python object using :func:`repr`)." msgstr "" -#: ../../library/stdtypes.rst:2452 ../../library/stdtypes.rst:3671 +#: ../../library/stdtypes.rst:2455 ../../library/stdtypes.rst:3674 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/stdtypes.rst:2452 +#: ../../library/stdtypes.rst:2455 msgid "String (converts any Python object using :func:`str`)." msgstr "" -#: ../../library/stdtypes.rst:2455 ../../library/stdtypes.rst:3674 +#: ../../library/stdtypes.rst:2458 ../../library/stdtypes.rst:3677 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/stdtypes.rst:2455 +#: ../../library/stdtypes.rst:2458 msgid "String (converts any Python object using :func:`ascii`)." msgstr "" -#: ../../library/stdtypes.rst:2458 ../../library/stdtypes.rst:3680 +#: ../../library/stdtypes.rst:2461 ../../library/stdtypes.rst:3683 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/stdtypes.rst:2458 ../../library/stdtypes.rst:3680 +#: ../../library/stdtypes.rst:2461 ../../library/stdtypes.rst:3683 msgid "No argument is converted, results in a ``'%'`` character in the result." msgstr "" -#: ../../library/stdtypes.rst:2465 ../../library/stdtypes.rst:3687 +#: ../../library/stdtypes.rst:2468 ../../library/stdtypes.rst:3690 msgid "" "The alternate form causes a leading octal specifier (``'0o'``) to be " "inserted before the first digit." msgstr "" -#: ../../library/stdtypes.rst:2469 ../../library/stdtypes.rst:3691 +#: ../../library/stdtypes.rst:2472 ../../library/stdtypes.rst:3694 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:2473 ../../library/stdtypes.rst:3695 +#: ../../library/stdtypes.rst:2476 ../../library/stdtypes.rst:3698 msgid "" "The alternate form causes the result to always contain a decimal point, even " "if no digits follow it." msgstr "" -#: ../../library/stdtypes.rst:2476 ../../library/stdtypes.rst:3698 +#: ../../library/stdtypes.rst:2479 ../../library/stdtypes.rst:3701 msgid "" "The precision determines the number of digits after the decimal point and " "defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2480 ../../library/stdtypes.rst:3702 +#: ../../library/stdtypes.rst:2483 ../../library/stdtypes.rst:3705 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:2483 ../../library/stdtypes.rst:3705 +#: ../../library/stdtypes.rst:2486 ../../library/stdtypes.rst:3708 msgid "" "The precision determines the number of significant digits before and after " "the decimal point and defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2487 ../../library/stdtypes.rst:3709 +#: ../../library/stdtypes.rst:2490 ../../library/stdtypes.rst:3712 msgid "If precision is ``N``, the output is truncated to ``N`` characters." msgstr "" -#: ../../library/stdtypes.rst:2490 ../../library/stdtypes.rst:3718 +#: ../../library/stdtypes.rst:2493 ../../library/stdtypes.rst:3721 msgid "See :pep:`237`." -msgstr "參閱 :pep:`237`\\ 。" +msgstr "參閱 :pep:`237`。" -#: ../../library/stdtypes.rst:2492 +#: ../../library/stdtypes.rst:2495 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:2497 +#: ../../library/stdtypes.rst:2500 msgid "" "``%f`` conversions for numbers whose absolute value is over 1e50 are no " "longer replaced by ``%g`` conversions." msgstr "" -#: ../../library/stdtypes.rst:2508 +#: ../../library/stdtypes.rst:2511 msgid "" "Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:" "`memoryview`" msgstr "" -#: ../../library/stdtypes.rst:2516 +#: ../../library/stdtypes.rst:2519 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 :" @@ -3220,17 +3369,17 @@ msgid "" "objects without needing to make a copy." msgstr "" -#: ../../library/stdtypes.rst:2521 +#: ../../library/stdtypes.rst:2524 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:2527 +#: ../../library/stdtypes.rst:2530 msgid "Bytes Objects" msgstr "" -#: ../../library/stdtypes.rst:2531 +#: ../../library/stdtypes.rst:2534 msgid "" "Bytes objects are immutable sequences of single bytes. Since many major " "binary protocols are based on the ASCII text encoding, bytes objects offer " @@ -3238,40 +3387,40 @@ msgid "" "and are closely related to string objects in a variety of other ways." msgstr "" -#: ../../library/stdtypes.rst:2538 +#: ../../library/stdtypes.rst:2541 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:2541 +#: ../../library/stdtypes.rst:2544 msgid "Single quotes: ``b'still allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:2542 +#: ../../library/stdtypes.rst:2545 msgid "Double quotes: ``b\"still allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:2543 +#: ../../library/stdtypes.rst:2546 msgid "" "Triple quoted: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:2545 +#: ../../library/stdtypes.rst:2548 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:2549 +#: ../../library/stdtypes.rst:2552 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:2553 +#: ../../library/stdtypes.rst:2556 msgid "" "While bytes literals and representations are based on ASCII text, bytes " "objects actually behave like immutable sequences of integers, with each " @@ -3284,29 +3433,29 @@ msgid "" "compatible will usually lead to data corruption)." msgstr "" -#: ../../library/stdtypes.rst:2563 +#: ../../library/stdtypes.rst:2566 msgid "" "In addition to the literal forms, bytes objects can be created in a number " "of other ways:" msgstr "" -#: ../../library/stdtypes.rst:2566 +#: ../../library/stdtypes.rst:2569 msgid "A zero-filled bytes object of a specified length: ``bytes(10)``" msgstr "" -#: ../../library/stdtypes.rst:2567 +#: ../../library/stdtypes.rst:2570 msgid "From an iterable of integers: ``bytes(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2568 +#: ../../library/stdtypes.rst:2571 msgid "Copying existing binary data via the buffer protocol: ``bytes(obj)``" msgstr "" -#: ../../library/stdtypes.rst:2570 +#: ../../library/stdtypes.rst:2573 msgid "Also see the :ref:`bytes ` built-in." msgstr "" -#: ../../library/stdtypes.rst:2572 +#: ../../library/stdtypes.rst:2575 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -3314,32 +3463,32 @@ msgid "" "that format:" msgstr "" -#: ../../library/stdtypes.rst:2578 +#: ../../library/stdtypes.rst:2581 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:2585 +#: ../../library/stdtypes.rst:2588 msgid "" ":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just " "spaces." msgstr "" -#: ../../library/stdtypes.rst:2589 +#: ../../library/stdtypes.rst:2592 msgid "" "A reverse conversion function exists to transform a bytes object into its " "hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2594 ../../library/stdtypes.rst:2679 +#: ../../library/stdtypes.rst:2597 ../../library/stdtypes.rst:2682 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." msgstr "" -#: ../../library/stdtypes.rst:2600 +#: ../../library/stdtypes.rst:2603 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, " @@ -3348,13 +3497,13 @@ msgid "" "the separator position from the right, negative values from the left." msgstr "" -#: ../../library/stdtypes.rst:2617 +#: ../../library/stdtypes.rst:2620 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:2621 +#: ../../library/stdtypes.rst:2624 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 " @@ -3362,58 +3511,58 @@ msgid "" "and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2626 +#: ../../library/stdtypes.rst:2629 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:2634 +#: ../../library/stdtypes.rst:2637 msgid "Bytearray Objects" msgstr "" -#: ../../library/stdtypes.rst:2638 +#: ../../library/stdtypes.rst:2641 msgid "" ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` " "objects." msgstr "" -#: ../../library/stdtypes.rst:2643 +#: ../../library/stdtypes.rst:2646 msgid "" "There is no dedicated literal syntax for bytearray objects, instead they are " "always created by calling the constructor:" msgstr "" -#: ../../library/stdtypes.rst:2646 +#: ../../library/stdtypes.rst:2649 msgid "Creating an empty instance: ``bytearray()``" msgstr "" -#: ../../library/stdtypes.rst:2647 +#: ../../library/stdtypes.rst:2650 msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" msgstr "" -#: ../../library/stdtypes.rst:2648 +#: ../../library/stdtypes.rst:2651 msgid "From an iterable of integers: ``bytearray(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2649 +#: ../../library/stdtypes.rst:2652 msgid "" "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" -#: ../../library/stdtypes.rst:2651 +#: ../../library/stdtypes.rst:2654 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:2655 +#: ../../library/stdtypes.rst:2658 msgid "Also see the :ref:`bytearray ` built-in." msgstr "" -#: ../../library/stdtypes.rst:2657 +#: ../../library/stdtypes.rst:2660 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -3421,33 +3570,33 @@ msgid "" "in that format:" msgstr "" -#: ../../library/stdtypes.rst:2663 +#: ../../library/stdtypes.rst:2666 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:2670 +#: ../../library/stdtypes.rst:2673 msgid "" ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not " "just spaces." msgstr "" -#: ../../library/stdtypes.rst:2674 +#: ../../library/stdtypes.rst:2677 msgid "" "A reverse conversion function exists to transform a bytearray object into " "its hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2687 +#: ../../library/stdtypes.rst:2690 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:2692 +#: ../../library/stdtypes.rst:2695 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 " @@ -3455,7 +3604,7 @@ msgid "" "both indexing and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2697 +#: ../../library/stdtypes.rst:2700 msgid "" "The representation of bytearray objects uses the bytes literal format " "(``bytearray(b'...')``) since it is often more useful than e.g. " @@ -3463,11 +3612,11 @@ msgid "" "a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:2706 +#: ../../library/stdtypes.rst:2709 msgid "Bytes and Bytearray Operations" msgstr "" -#: ../../library/stdtypes.rst:2711 +#: ../../library/stdtypes.rst:2714 msgid "" "Both bytes and bytearray objects support the :ref:`common ` " "sequence operations. They interoperate not just with operands of the same " @@ -3476,107 +3625,107 @@ msgid "" "return type of the result may depend on the order of operands." msgstr "" -#: ../../library/stdtypes.rst:2719 +#: ../../library/stdtypes.rst:2722 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:2726 +#: ../../library/stdtypes.rst:2729 msgid "and::" msgstr "" "和:\n" "\n" "::" -#: ../../library/stdtypes.rst:2731 +#: ../../library/stdtypes.rst:2734 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:2736 +#: ../../library/stdtypes.rst:2739 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:2739 +#: ../../library/stdtypes.rst:2742 msgid "" "The following methods on bytes and bytearray objects can be used with " "arbitrary binary data." msgstr "" -#: ../../library/stdtypes.rst:2745 +#: ../../library/stdtypes.rst:2748 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:2749 ../../library/stdtypes.rst:2854 -#: ../../library/stdtypes.rst:2876 ../../library/stdtypes.rst:2942 -#: ../../library/stdtypes.rst:2955 +#: ../../library/stdtypes.rst:2752 ../../library/stdtypes.rst:2857 +#: ../../library/stdtypes.rst:2879 ../../library/stdtypes.rst:2945 +#: ../../library/stdtypes.rst:2958 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:2752 +#: ../../library/stdtypes.rst:2755 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:2755 ../../library/stdtypes.rst:2866 -#: ../../library/stdtypes.rst:2879 ../../library/stdtypes.rst:2945 -#: ../../library/stdtypes.rst:2958 +#: ../../library/stdtypes.rst:2758 ../../library/stdtypes.rst:2869 +#: ../../library/stdtypes.rst:2882 ../../library/stdtypes.rst:2948 +#: ../../library/stdtypes.rst:2961 msgid "Also accept an integer in the range 0 to 255 as the subsequence." msgstr "" -#: ../../library/stdtypes.rst:2762 +#: ../../library/stdtypes.rst:2765 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:2771 +#: ../../library/stdtypes.rst:2774 msgid "The *prefix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2775 ../../library/stdtypes.rst:2797 -#: ../../library/stdtypes.rst:2930 ../../library/stdtypes.rst:3023 -#: ../../library/stdtypes.rst:3037 ../../library/stdtypes.rst:3068 -#: ../../library/stdtypes.rst:3082 ../../library/stdtypes.rst:3124 -#: ../../library/stdtypes.rst:3194 ../../library/stdtypes.rst:3212 -#: ../../library/stdtypes.rst:3240 ../../library/stdtypes.rst:3379 -#: ../../library/stdtypes.rst:3434 ../../library/stdtypes.rst:3477 -#: ../../library/stdtypes.rst:3498 ../../library/stdtypes.rst:3520 -#: ../../library/stdtypes.rst:3722 +#: ../../library/stdtypes.rst:2778 ../../library/stdtypes.rst:2800 +#: ../../library/stdtypes.rst:2933 ../../library/stdtypes.rst:3026 +#: ../../library/stdtypes.rst:3040 ../../library/stdtypes.rst:3071 +#: ../../library/stdtypes.rst:3085 ../../library/stdtypes.rst:3127 +#: ../../library/stdtypes.rst:3197 ../../library/stdtypes.rst:3215 +#: ../../library/stdtypes.rst:3243 ../../library/stdtypes.rst:3382 +#: ../../library/stdtypes.rst:3437 ../../library/stdtypes.rst:3480 +#: ../../library/stdtypes.rst:3501 ../../library/stdtypes.rst:3523 +#: ../../library/stdtypes.rst:3725 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:2784 +#: ../../library/stdtypes.rst:2787 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:2793 +#: ../../library/stdtypes.rst:2796 msgid "The *suffix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2806 +#: ../../library/stdtypes.rst:2809 msgid "Return the bytes decoded to a :class:`str`." msgstr "" -#: ../../library/stdtypes.rst:2811 +#: ../../library/stdtypes.rst:2814 msgid "" "*errors* controls how decoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -3584,21 +3733,21 @@ msgid "" "`codecs.register_error`. See :ref:`error-handlers` for details." msgstr "" -#: ../../library/stdtypes.rst:2817 +#: ../../library/stdtypes.rst:2820 msgid "" "For performance reasons, the value of *errors* is not checked for validity " "unless a decoding error actually occurs, :ref:`devmode` is enabled or a :ref:" "`debug build ` is used." msgstr "" -#: ../../library/stdtypes.rst:2823 +#: ../../library/stdtypes.rst:2826 msgid "" "Passing the *encoding* argument to :class:`str` allows decoding any :term:" "`bytes-like object` directly, without needing to make a temporary :class:`!" "bytes` or :class:`!bytearray` object." msgstr "" -#: ../../library/stdtypes.rst:2838 +#: ../../library/stdtypes.rst:2841 msgid "" "Return ``True`` if the binary data ends with the specified *suffix*, " "otherwise return ``False``. *suffix* can also be a tuple of suffixes to " @@ -3606,11 +3755,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2843 +#: ../../library/stdtypes.rst:2846 msgid "The suffix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2849 +#: ../../library/stdtypes.rst:2852 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 " @@ -3618,20 +3767,20 @@ msgid "" "``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2859 +#: ../../library/stdtypes.rst:2862 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:2873 +#: ../../library/stdtypes.rst:2876 msgid "" "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence " "is not found." msgstr "" -#: ../../library/stdtypes.rst:2886 +#: ../../library/stdtypes.rst:2889 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 " @@ -3641,7 +3790,7 @@ msgid "" "method." msgstr "" -#: ../../library/stdtypes.rst:2897 +#: ../../library/stdtypes.rst:2900 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 " @@ -3649,7 +3798,7 @@ msgid "" "objects ` and have the same length." msgstr "" -#: ../../library/stdtypes.rst:2908 +#: ../../library/stdtypes.rst:2911 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 " @@ -3658,24 +3807,24 @@ msgid "" "by two empty bytes or bytearray objects." msgstr "" -#: ../../library/stdtypes.rst:2915 ../../library/stdtypes.rst:2972 +#: ../../library/stdtypes.rst:2918 ../../library/stdtypes.rst:2975 msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2921 +#: ../../library/stdtypes.rst:2924 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:2925 +#: ../../library/stdtypes.rst:2928 msgid "" "The subsequence to search for and its replacement may be any :term:`bytes-" "like object`." msgstr "" -#: ../../library/stdtypes.rst:2937 +#: ../../library/stdtypes.rst:2940 msgid "" "Return the highest index in the sequence where the subsequence *sub* is " "found, such that *sub* is contained within ``s[start:end]``. Optional " @@ -3683,13 +3832,13 @@ msgid "" "``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:2952 +#: ../../library/stdtypes.rst:2955 msgid "" "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence " "*sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2965 +#: ../../library/stdtypes.rst:2968 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 " @@ -3698,7 +3847,7 @@ msgid "" "followed by a copy of the original sequence." msgstr "" -#: ../../library/stdtypes.rst:2978 +#: ../../library/stdtypes.rst:2981 msgid "" "Return ``True`` if the binary data starts with the specified *prefix*, " "otherwise return ``False``. *prefix* can also be a tuple of prefixes to " @@ -3706,11 +3855,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2983 +#: ../../library/stdtypes.rst:2986 msgid "The prefix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2989 +#: ../../library/stdtypes.rst:2992 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 " @@ -3718,22 +3867,22 @@ msgid "" "object of length 256." msgstr "" -#: ../../library/stdtypes.rst:2994 +#: ../../library/stdtypes.rst:2997 msgid "" "You can use the :func:`bytes.maketrans` method to create a translation table." msgstr "" -#: ../../library/stdtypes.rst:2997 +#: ../../library/stdtypes.rst:3000 msgid "" "Set the *table* argument to ``None`` for translations that only delete " "characters::" msgstr "" -#: ../../library/stdtypes.rst:3003 +#: ../../library/stdtypes.rst:3006 msgid "*delete* is now supported as a keyword argument." msgstr "" -#: ../../library/stdtypes.rst:3007 +#: ../../library/stdtypes.rst:3010 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 " @@ -3742,7 +3891,7 @@ msgid "" "instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3016 +#: ../../library/stdtypes.rst:3019 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). " @@ -3750,7 +3899,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3030 +#: ../../library/stdtypes.rst:3033 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). " @@ -3758,7 +3907,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3044 +#: ../../library/stdtypes.rst:3047 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 " @@ -3768,14 +3917,14 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3056 +#: ../../library/stdtypes.rst:3059 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:3075 +#: ../../library/stdtypes.rst:3078 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). " @@ -3783,7 +3932,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3089 +#: ../../library/stdtypes.rst:3092 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 " @@ -3793,7 +3942,7 @@ msgid "" "described in detail below." msgstr "" -#: ../../library/stdtypes.rst:3100 +#: ../../library/stdtypes.rst:3103 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 " @@ -3803,14 +3952,14 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3112 +#: ../../library/stdtypes.rst:3115 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:3131 +#: ../../library/stdtypes.rst:3134 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 " @@ -3819,7 +3968,7 @@ msgid "" "limit on the number of splits (all possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:3137 +#: ../../library/stdtypes.rst:3140 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',')`` " @@ -3830,7 +3979,7 @@ msgid "" "object being split. The *sep* argument may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3155 +#: ../../library/stdtypes.rst:3158 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 " @@ -3840,7 +3989,7 @@ msgid "" "without a specified separator returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:3176 +#: ../../library/stdtypes.rst:3179 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 " @@ -3850,13 +3999,13 @@ msgid "" "a prefix or suffix; rather, all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3189 +#: ../../library/stdtypes.rst:3192 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`." msgstr "" -#: ../../library/stdtypes.rst:3198 +#: ../../library/stdtypes.rst:3201 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 " @@ -3864,14 +4013,14 @@ msgid "" "operate in place, and instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3206 +#: ../../library/stdtypes.rst:3209 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:3219 +#: ../../library/stdtypes.rst:3222 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 " @@ -3887,7 +4036,7 @@ msgid "" "by one regardless of how the byte value is represented when printed::" msgstr "" -#: ../../library/stdtypes.rst:3247 +#: ../../library/stdtypes.rst:3250 msgid "" "Return ``True`` if all bytes in the sequence are alphabetical ASCII " "characters or ASCII decimal digits and the sequence is not empty, ``False`` " @@ -3896,7 +4045,7 @@ msgid "" "digits are those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:3264 +#: ../../library/stdtypes.rst:3267 msgid "" "Return ``True`` if all bytes in the sequence are alphabetic ASCII characters " "and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII " @@ -3904,35 +4053,35 @@ msgid "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:3280 +#: ../../library/stdtypes.rst:3283 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:3290 +#: ../../library/stdtypes.rst:3293 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:3305 +#: ../../library/stdtypes.rst:3308 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:3315 ../../library/stdtypes.rst:3357 -#: ../../library/stdtypes.rst:3373 ../../library/stdtypes.rst:3423 -#: ../../library/stdtypes.rst:3492 +#: ../../library/stdtypes.rst:3318 ../../library/stdtypes.rst:3360 +#: ../../library/stdtypes.rst:3376 ../../library/stdtypes.rst:3426 +#: ../../library/stdtypes.rst:3495 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:3323 +#: ../../library/stdtypes.rst:3326 msgid "" "Return ``True`` if all bytes in the sequence are ASCII whitespace and the " "sequence is not empty, ``False`` otherwise. ASCII whitespace characters are " @@ -3940,27 +4089,27 @@ msgid "" "newline, carriage return, vertical tab, form feed)." msgstr "" -#: ../../library/stdtypes.rst:3332 +#: ../../library/stdtypes.rst:3335 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:3347 +#: ../../library/stdtypes.rst:3350 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:3365 +#: ../../library/stdtypes.rst:3368 msgid "" "Return a copy of the sequence with all the uppercase ASCII characters " "converted to their corresponding lowercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3390 +#: ../../library/stdtypes.rst:3393 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 " @@ -3968,20 +4117,20 @@ msgid "" "*keepends* is given and true." msgstr "" -#: ../../library/stdtypes.rst:3402 +#: ../../library/stdtypes.rst:3405 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:3415 +#: ../../library/stdtypes.rst:3418 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:3427 +#: ../../library/stdtypes.rst:3430 msgid "" "Unlike :func:`str.swapcase()`, it is always the case that ``bin.swapcase()." "swapcase() == bin`` for the binary versions. Case conversions are " @@ -3989,14 +4138,14 @@ msgid "" "Unicode code points." msgstr "" -#: ../../library/stdtypes.rst:3441 +#: ../../library/stdtypes.rst:3444 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:3450 +#: ../../library/stdtypes.rst:3453 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -4004,18 +4153,18 @@ msgid "" "values are uncased." msgstr "" -#: ../../library/stdtypes.rst:3463 +#: ../../library/stdtypes.rst:3466 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "" -#: ../../library/stdtypes.rst:3484 +#: ../../library/stdtypes.rst:3487 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3505 +#: ../../library/stdtypes.rst:3508 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 " @@ -4024,11 +4173,11 @@ msgid "" "*width* is less than or equal to ``len(seq)``." msgstr "" -#: ../../library/stdtypes.rst:3527 +#: ../../library/stdtypes.rst:3530 msgid "``printf``-style Bytes Formatting" msgstr "" -#: ../../library/stdtypes.rst:3544 +#: ../../library/stdtypes.rst:3547 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 " @@ -4036,7 +4185,7 @@ msgid "" "dictionary, wrap it in a tuple." msgstr "" -#: ../../library/stdtypes.rst:3549 +#: ../../library/stdtypes.rst:3552 msgid "" "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " @@ -4046,7 +4195,7 @@ msgid "" "func:`sprintf` in the C language." msgstr "" -#: ../../library/stdtypes.rst:3556 +#: ../../library/stdtypes.rst:3559 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 " @@ -4054,7 +4203,7 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:3590 +#: ../../library/stdtypes.rst:3593 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 " @@ -4062,73 +4211,73 @@ msgid "" "mapping key selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:3664 +#: ../../library/stdtypes.rst:3667 msgid "Single byte (accepts integer or single byte objects)." msgstr "" -#: ../../library/stdtypes.rst:3667 +#: ../../library/stdtypes.rst:3670 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/stdtypes.rst:3667 +#: ../../library/stdtypes.rst:3670 msgid "" "Bytes (any object that follows the :ref:`buffer protocol ` or " -"has :meth:`__bytes__`)." +"has :meth:`~object.__bytes__`)." msgstr "" -#: ../../library/stdtypes.rst:3671 +#: ../../library/stdtypes.rst:3674 msgid "" "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3674 +#: ../../library/stdtypes.rst:3677 msgid "" "Bytes (converts any Python object using ``repr(obj).encode('ascii', " "'backslashreplace')``)." msgstr "" -#: ../../library/stdtypes.rst:3677 +#: ../../library/stdtypes.rst:3680 msgid "" "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3677 +#: ../../library/stdtypes.rst:3680 msgid "\\(7)" msgstr "\\(7)" -#: ../../library/stdtypes.rst:3712 +#: ../../library/stdtypes.rst:3715 msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3715 +#: ../../library/stdtypes.rst:3718 msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3727 +#: ../../library/stdtypes.rst:3730 msgid ":pep:`461` - Adding % formatting to bytes and bytearray" msgstr "" -#: ../../library/stdtypes.rst:3734 +#: ../../library/stdtypes.rst:3737 msgid "Memory Views" msgstr "" -#: ../../library/stdtypes.rst:3736 +#: ../../library/stdtypes.rst:3739 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:3742 +#: ../../library/stdtypes.rst:3745 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:3746 +#: ../../library/stdtypes.rst:3749 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 " @@ -4136,32 +4285,32 @@ msgid "" "other types such as :class:`array.array` may have bigger elements." msgstr "" -#: ../../library/stdtypes.rst:3751 +#: ../../library/stdtypes.rst:3754 msgid "" "``len(view)`` is equal to the length of :class:`~memoryview.tolist`, which " "is the nested list representation of the view. If ``view.ndim = 1``, this is " "equal to the number of elements in the view." msgstr "" -#: ../../library/stdtypes.rst:3755 +#: ../../library/stdtypes.rst:3758 msgid "" "If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of " "returning 1." msgstr "" -#: ../../library/stdtypes.rst:3758 +#: ../../library/stdtypes.rst:3761 msgid "" "The :class:`~memoryview.itemsize` attribute will give you the number of " "bytes in a single element." msgstr "" -#: ../../library/stdtypes.rst:3761 +#: ../../library/stdtypes.rst:3764 msgid "" "A :class:`memoryview` supports slicing and indexing to expose its data. One-" "dimensional slicing will result in a subview::" msgstr "" -#: ../../library/stdtypes.rst:3774 +#: ../../library/stdtypes.rst:3777 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 " @@ -4172,82 +4321,82 @@ msgid "" "memoryviews can be indexed with the empty tuple." msgstr "" -#: ../../library/stdtypes.rst:3783 +#: ../../library/stdtypes.rst:3786 msgid "Here is an example with a non-byte format::" msgstr "" -#: ../../library/stdtypes.rst:3795 +#: ../../library/stdtypes.rst:3798 msgid "" "If the underlying object is writable, the memoryview supports one-" "dimensional slice assignment. Resizing is not allowed::" msgstr "" -#: ../../library/stdtypes.rst:3816 +#: ../../library/stdtypes.rst:3819 msgid "" "One-dimensional memoryviews of :term:`hashable` (read-only) types with " "formats 'B', 'b' or 'c' are also hashable. The hash is defined as ``hash(m) " "== hash(m.tobytes())``::" msgstr "" -#: ../../library/stdtypes.rst:3828 +#: ../../library/stdtypes.rst:3831 msgid "" "One-dimensional memoryviews can now be sliced. One-dimensional memoryviews " "with formats 'B', 'b' or 'c' are now :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:3832 +#: ../../library/stdtypes.rst:3835 msgid "" "memoryview is now registered automatically with :class:`collections.abc." "Sequence`" msgstr "" -#: ../../library/stdtypes.rst:3836 +#: ../../library/stdtypes.rst:3839 msgid "memoryviews can now be indexed with tuple of integers." msgstr "" -#: ../../library/stdtypes.rst:3839 +#: ../../library/stdtypes.rst:3842 msgid ":class:`memoryview` has several methods:" msgstr "" -#: ../../library/stdtypes.rst:3843 +#: ../../library/stdtypes.rst:3846 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:3847 +#: ../../library/stdtypes.rst:3850 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:3866 +#: ../../library/stdtypes.rst:3869 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:3882 +#: ../../library/stdtypes.rst:3885 msgid "" "Note that, as with floating point numbers, ``v is w`` does *not* imply ``v " "== w`` for memoryview objects." msgstr "" -#: ../../library/stdtypes.rst:3885 +#: ../../library/stdtypes.rst:3888 msgid "" "Previous versions compared the raw memory disregarding the item format and " "the logical array structure." msgstr "" -#: ../../library/stdtypes.rst:3891 +#: ../../library/stdtypes.rst:3894 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:3900 +#: ../../library/stdtypes.rst:3903 msgid "" "For non-contiguous arrays the result is equal to the flattened list " "representation with all elements converted to bytes. :meth:`tobytes` " @@ -4255,7 +4404,7 @@ msgid "" "module syntax." msgstr "" -#: ../../library/stdtypes.rst:3905 +#: ../../library/stdtypes.rst:3908 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' " @@ -4264,36 +4413,36 @@ msgid "" "to C first. *order=None* is the same as *order='C'*." msgstr "" -#: ../../library/stdtypes.rst:3914 +#: ../../library/stdtypes.rst:3917 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the buffer. ::" msgstr "" -#: ../../library/stdtypes.rst:3923 +#: ../../library/stdtypes.rst:3926 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:3930 +#: ../../library/stdtypes.rst:3933 msgid "Return the data in the buffer as a list of elements. ::" msgstr "" -#: ../../library/stdtypes.rst:3940 +#: ../../library/stdtypes.rst:3943 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:3947 +#: ../../library/stdtypes.rst:3950 msgid "" "Return a readonly version of the memoryview object. The original memoryview " "object is unchanged. ::" msgstr "" -#: ../../library/stdtypes.rst:3966 +#: ../../library/stdtypes.rst:3969 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 :" @@ -4302,20 +4451,20 @@ msgid "" "resources) as soon as possible." msgstr "" -#: ../../library/stdtypes.rst:3972 +#: ../../library/stdtypes.rst:3975 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:3983 +#: ../../library/stdtypes.rst:3986 msgid "" "The context management protocol can be used for a similar effect, using the " "``with`` statement::" msgstr "" -#: ../../library/stdtypes.rst:3999 +#: ../../library/stdtypes.rst:4002 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 " @@ -4324,7 +4473,7 @@ msgid "" "contiguous -> 1D." msgstr "" -#: ../../library/stdtypes.rst:4005 +#: ../../library/stdtypes.rst:4008 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 " @@ -4332,50 +4481,50 @@ msgid "" "Note that all byte lengths may depend on the operating system." msgstr "" -#: ../../library/stdtypes.rst:3963 +#: ../../library/stdtypes.rst:4014 msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "" -#: ../../library/stdtypes.rst:3986 +#: ../../library/stdtypes.rst:4037 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "" -#: ../../library/stdtypes.rst:3999 +#: ../../library/stdtypes.rst:4050 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "" -#: ../../library/stdtypes.rst:4025 +#: ../../library/stdtypes.rst:4076 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "" -#: ../../library/stdtypes.rst:4039 +#: ../../library/stdtypes.rst:4090 msgid "The source format is no longer restricted when casting to a byte view." msgstr "" -#: ../../library/stdtypes.rst:4042 +#: ../../library/stdtypes.rst:4093 msgid "There are also several readonly attributes available:" msgstr "" -#: ../../library/stdtypes.rst:4046 +#: ../../library/stdtypes.rst:4097 msgid "The underlying object of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4057 +#: ../../library/stdtypes.rst:4108 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:4076 +#: ../../library/stdtypes.rst:4127 msgid "Multi-dimensional arrays::" msgstr "" -#: ../../library/stdtypes.rst:4093 +#: ../../library/stdtypes.rst:4144 msgid "A bool indicating whether the memory is read only." msgstr "" -#: ../../library/stdtypes.rst:4097 +#: ../../library/stdtypes.rst:4148 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 " @@ -4383,59 +4532,59 @@ msgid "" "restricted to native single element formats." msgstr "" -#: ../../library/stdtypes.rst:4102 +#: ../../library/stdtypes.rst:4153 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:4108 +#: ../../library/stdtypes.rst:4159 msgid "The size in bytes of each element of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4121 +#: ../../library/stdtypes.rst:4172 msgid "" "An integer indicating how many dimensions of a multi-dimensional array the " "memory represents." msgstr "" -#: ../../library/stdtypes.rst:4126 +#: ../../library/stdtypes.rst:4177 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:4129 ../../library/stdtypes.rst:4137 +#: ../../library/stdtypes.rst:4180 ../../library/stdtypes.rst:4188 msgid "An empty tuple instead of ``None`` when ndim = 0." msgstr "" -#: ../../library/stdtypes.rst:4134 +#: ../../library/stdtypes.rst:4185 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:4142 +#: ../../library/stdtypes.rst:4193 msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" -#: ../../library/stdtypes.rst:4146 +#: ../../library/stdtypes.rst:4197 msgid "A bool indicating whether the memory is C-:term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4152 +#: ../../library/stdtypes.rst:4203 msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4158 +#: ../../library/stdtypes.rst:4209 msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4166 +#: ../../library/stdtypes.rst:4217 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "" -#: ../../library/stdtypes.rst:4170 +#: ../../library/stdtypes.rst:4221 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -4445,7 +4594,7 @@ msgid "" "`collections` module.)" msgstr "" -#: ../../library/stdtypes.rst:4177 +#: ../../library/stdtypes.rst:4228 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 " @@ -4453,7 +4602,7 @@ msgid "" "slicing, or other sequence-like behavior." msgstr "" -#: ../../library/stdtypes.rst:4182 +#: ../../library/stdtypes.rst:4233 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -4465,18 +4614,18 @@ msgid "" "of another set." msgstr "" -#: ../../library/stdtypes.rst:4190 +#: ../../library/stdtypes.rst:4241 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:4194 +#: ../../library/stdtypes.rst:4245 msgid "The constructors for both classes work the same:" msgstr "" -#: ../../library/stdtypes.rst:4199 +#: ../../library/stdtypes.rst:4250 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 " @@ -4484,92 +4633,92 @@ msgid "" "*iterable* is not specified, a new empty set is returned." msgstr "" -#: ../../library/stdtypes.rst:4205 +#: ../../library/stdtypes.rst:4256 msgid "Sets can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4207 +#: ../../library/stdtypes.rst:4258 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4208 +#: ../../library/stdtypes.rst:4259 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" -#: ../../library/stdtypes.rst:4209 +#: ../../library/stdtypes.rst:4260 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" msgstr "" -#: ../../library/stdtypes.rst:4211 +#: ../../library/stdtypes.rst:4262 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" msgstr "" -#: ../../library/stdtypes.rst:4216 +#: ../../library/stdtypes.rst:4267 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" -#: ../../library/stdtypes.rst:4220 +#: ../../library/stdtypes.rst:4271 msgid "Test *x* for membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4224 +#: ../../library/stdtypes.rst:4275 msgid "Test *x* for non-membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4228 +#: ../../library/stdtypes.rst:4279 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:4234 +#: ../../library/stdtypes.rst:4285 msgid "Test whether every element in the set is in *other*." msgstr "" -#: ../../library/stdtypes.rst:4238 +#: ../../library/stdtypes.rst:4289 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4244 +#: ../../library/stdtypes.rst:4295 msgid "Test whether every element in *other* is in the set." msgstr "" -#: ../../library/stdtypes.rst:4248 +#: ../../library/stdtypes.rst:4299 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4254 +#: ../../library/stdtypes.rst:4305 msgid "Return a new set with elements from the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4259 +#: ../../library/stdtypes.rst:4310 msgid "Return a new set with elements common to the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4264 +#: ../../library/stdtypes.rst:4315 msgid "Return a new set with elements in the set that are not in the others." msgstr "" -#: ../../library/stdtypes.rst:4269 +#: ../../library/stdtypes.rst:4320 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" -#: ../../library/stdtypes.rst:4273 +#: ../../library/stdtypes.rst:4324 msgid "Return a shallow copy of the set." msgstr "" -#: ../../library/stdtypes.rst:4276 +#: ../../library/stdtypes.rst:4327 msgid "" "Note, the non-operator versions of :meth:`union`, :meth:`intersection`, :" "meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and :meth:" @@ -4579,7 +4728,7 @@ msgid "" "the more readable ``set('abc').intersection('cbs')``." msgstr "" -#: ../../library/stdtypes.rst:4283 +#: ../../library/stdtypes.rst:4334 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 " @@ -4589,14 +4738,14 @@ msgid "" "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -#: ../../library/stdtypes.rst:4290 +#: ../../library/stdtypes.rst:4341 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:4294 +#: ../../library/stdtypes.rst:4345 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 " @@ -4604,71 +4753,71 @@ msgid "" "``ab``." msgstr "" -#: ../../library/stdtypes.rst:4299 +#: ../../library/stdtypes.rst:4350 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:4302 +#: ../../library/stdtypes.rst:4353 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:4304 +#: ../../library/stdtypes.rst:4355 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:4308 +#: ../../library/stdtypes.rst:4359 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" msgstr "" -#: ../../library/stdtypes.rst:4314 +#: ../../library/stdtypes.rst:4365 msgid "Update the set, adding elements from all others." msgstr "" -#: ../../library/stdtypes.rst:4319 +#: ../../library/stdtypes.rst:4370 msgid "Update the set, keeping only elements found in it and all others." msgstr "" -#: ../../library/stdtypes.rst:4324 +#: ../../library/stdtypes.rst:4375 msgid "Update the set, removing elements found in others." msgstr "" -#: ../../library/stdtypes.rst:4329 +#: ../../library/stdtypes.rst:4380 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" -#: ../../library/stdtypes.rst:4333 +#: ../../library/stdtypes.rst:4384 msgid "Add element *elem* to the set." msgstr "" -#: ../../library/stdtypes.rst:4337 +#: ../../library/stdtypes.rst:4388 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." msgstr "" -#: ../../library/stdtypes.rst:4342 +#: ../../library/stdtypes.rst:4393 msgid "Remove element *elem* from the set if it is present." msgstr "" -#: ../../library/stdtypes.rst:4346 +#: ../../library/stdtypes.rst:4397 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." msgstr "" -#: ../../library/stdtypes.rst:4351 +#: ../../library/stdtypes.rst:4402 msgid "Remove all elements from the set." msgstr "" -#: ../../library/stdtypes.rst:4354 +#: ../../library/stdtypes.rst:4405 msgid "" "Note, the non-operator versions of the :meth:`update`, :meth:" "`intersection_update`, :meth:`difference_update`, and :meth:" @@ -4676,18 +4825,18 @@ msgid "" "argument." msgstr "" -#: ../../library/stdtypes.rst:4359 +#: ../../library/stdtypes.rst:4410 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*." +"Note, the *elem* argument to the :meth:`~object.__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:4367 +#: ../../library/stdtypes.rst:4419 msgid "Mapping Types --- :class:`dict`" msgstr "" -#: ../../library/stdtypes.rst:4377 +#: ../../library/stdtypes.rst:4429 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -4696,7 +4845,7 @@ msgid "" "module.)" msgstr "" -#: ../../library/stdtypes.rst:4383 +#: ../../library/stdtypes.rst:4435 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -4705,33 +4854,33 @@ msgid "" "and ``True``) can be used interchangeably to index the same dictionary entry." msgstr "" -#: ../../library/stdtypes.rst:4394 +#: ../../library/stdtypes.rst:4446 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:4397 +#: ../../library/stdtypes.rst:4449 msgid "Dictionaries can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4399 +#: ../../library/stdtypes.rst:4451 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:4401 +#: ../../library/stdtypes.rst:4453 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" -#: ../../library/stdtypes.rst:4402 +#: ../../library/stdtypes.rst:4454 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" msgstr "" -#: ../../library/stdtypes.rst:4405 +#: ../../library/stdtypes.rst:4457 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 " @@ -4743,7 +4892,7 @@ msgid "" "value for that key becomes the corresponding value in the new dictionary." msgstr "" -#: ../../library/stdtypes.rst:4415 +#: ../../library/stdtypes.rst:4467 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 " @@ -4751,39 +4900,39 @@ msgid "" "the value from the positional argument." msgstr "" -#: ../../library/stdtypes.rst:4420 +#: ../../library/stdtypes.rst:4472 msgid "" "To illustrate, the following examples all return a dictionary equal to " "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -#: ../../library/stdtypes.rst:4432 +#: ../../library/stdtypes.rst:4484 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:4436 +#: ../../library/stdtypes.rst:4488 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -#: ../../library/stdtypes.rst:4441 +#: ../../library/stdtypes.rst:4493 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4445 +#: ../../library/stdtypes.rst:4497 msgid "Return the number of items in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4449 +#: ../../library/stdtypes.rst:4501 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." msgstr "" -#: ../../library/stdtypes.rst:4454 +#: ../../library/stdtypes.rst:4506 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 " @@ -4794,51 +4943,51 @@ msgid "" "an instance variable::" msgstr "" -#: ../../library/stdtypes.rst:4472 +#: ../../library/stdtypes.rst:4525 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:4478 +#: ../../library/stdtypes.rst:4531 msgid "Set ``d[key]`` to *value*." msgstr "" -#: ../../library/stdtypes.rst:4482 +#: ../../library/stdtypes.rst:4535 msgid "" "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the " "map." msgstr "" -#: ../../library/stdtypes.rst:4487 +#: ../../library/stdtypes.rst:4540 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "" -#: ../../library/stdtypes.rst:4491 +#: ../../library/stdtypes.rst:4544 msgid "Equivalent to ``not key in d``." msgstr "" -#: ../../library/stdtypes.rst:4495 +#: ../../library/stdtypes.rst:4548 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4500 +#: ../../library/stdtypes.rst:4553 msgid "Remove all items from the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4504 +#: ../../library/stdtypes.rst:4557 msgid "Return a shallow copy of the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4508 +#: ../../library/stdtypes.rst:4561 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" -#: ../../library/stdtypes.rst:4510 +#: ../../library/stdtypes.rst:4563 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 " @@ -4847,70 +4996,70 @@ msgid "" "` instead." msgstr "" -#: ../../library/stdtypes.rst:4518 +#: ../../library/stdtypes.rst:4571 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:4524 +#: ../../library/stdtypes.rst:4577 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4529 +#: ../../library/stdtypes.rst:4582 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." msgstr "" -#: ../../library/stdtypes.rst:4534 +#: ../../library/stdtypes.rst:4587 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:4540 +#: ../../library/stdtypes.rst:4593 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:4543 +#: ../../library/stdtypes.rst:4596 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:4547 +#: ../../library/stdtypes.rst:4600 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." msgstr "" -#: ../../library/stdtypes.rst:4553 +#: ../../library/stdtypes.rst:4606 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4560 +#: ../../library/stdtypes.rst:4613 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:4566 +#: ../../library/stdtypes.rst:4619 msgid "" "Update the dictionary with the key/value pairs from *other*, overwriting " "existing keys. Return ``None``." msgstr "" -#: ../../library/stdtypes.rst:4569 +#: ../../library/stdtypes.rst:4622 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 " @@ -4918,71 +5067,71 @@ msgid "" "pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:4576 +#: ../../library/stdtypes.rst:4629 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4579 +#: ../../library/stdtypes.rst:4632 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:4589 +#: ../../library/stdtypes.rst:4642 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:4597 +#: ../../library/stdtypes.rst:4650 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:4603 +#: ../../library/stdtypes.rst:4656 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:4607 +#: ../../library/stdtypes.rst:4660 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:4625 +#: ../../library/stdtypes.rst:4678 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:4629 +#: ../../library/stdtypes.rst:4682 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:4641 +#: ../../library/stdtypes.rst:4694 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4646 +#: ../../library/stdtypes.rst:4699 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:4653 +#: ../../library/stdtypes.rst:4706 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:4655 +#: ../../library/stdtypes.rst:4708 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 " @@ -4990,23 +5139,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:4660 +#: ../../library/stdtypes.rst:4713 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:4665 +#: ../../library/stdtypes.rst:4718 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4669 +#: ../../library/stdtypes.rst:4722 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4672 +#: ../../library/stdtypes.rst:4725 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -5014,60 +5163,61 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:4677 +#: ../../library/stdtypes.rst:4730 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:4680 +#: ../../library/stdtypes.rst:4733 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:4685 +#: ../../library/stdtypes.rst:4738 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:4690 +#: ../../library/stdtypes.rst:4743 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:4693 +#: ../../library/stdtypes.rst:4746 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4698 +#: ../../library/stdtypes.rst:4751 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:4703 +#: ../../library/stdtypes.rst:4756 msgid "" -"Keys views are set-like since their entries are unique and :term:" -"`hashable`. If all values are hashable, so that ``(key, value)`` pairs are " -"unique and hashable, then the items view is also set-like. (Values views " -"are not treated as set-like since the entries are generally not unique.) " -"For set-like views, all of the operations defined for the abstract base " -"class :class:`collections.abc.Set` are available (for example, ``==``, " -"``<``, or ``^``). While using set operators, set-like views accept any " -"iterable as the other operand, unlike sets which only accept sets as the " +"Keys views are set-like since their entries are unique and :term:`hashable`. " +"Items views also have set-like operations since the (key, value) pairs are " +"unique and the keys are hashable. If all values in an items view are " +"hashable as well, then the items view can interoperate with other sets. " +"(Values views are not treated as set-like since the entries are generally " +"not unique.) For set-like views, all of the operations defined for the " +"abstract base class :class:`collections.abc.Set` are available (for example, " +"``==``, ``<``, or ``^``). While using set operators, set-like views accept " +"any iterable as the other operand, unlike sets which only accept sets as the " "input." msgstr "" -#: ../../library/stdtypes.rst:4710 +#: ../../library/stdtypes.rst:4768 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:4751 +#: ../../library/stdtypes.rst:4812 msgid "Context Manager Types" msgstr "" -#: ../../library/stdtypes.rst:4758 +#: ../../library/stdtypes.rst:4819 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 " @@ -5075,7 +5225,7 @@ msgid "" "before the statement body is executed and exited when the statement ends:" msgstr "" -#: ../../library/stdtypes.rst:4766 +#: ../../library/stdtypes.rst:4827 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 " @@ -5083,14 +5233,14 @@ msgid "" "using this context manager." msgstr "" -#: ../../library/stdtypes.rst:4771 +#: ../../library/stdtypes.rst:4832 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:4775 +#: ../../library/stdtypes.rst:4836 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 " @@ -5100,7 +5250,7 @@ msgid "" "the :keyword:`!with` statement." msgstr "" -#: ../../library/stdtypes.rst:4785 +#: ../../library/stdtypes.rst:4846 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -5109,7 +5259,7 @@ msgid "" "arguments are ``None``." msgstr "" -#: ../../library/stdtypes.rst:4790 +#: ../../library/stdtypes.rst:4851 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -5120,16 +5270,16 @@ msgid "" "statement." msgstr "" -#: ../../library/stdtypes.rst:4797 +#: ../../library/stdtypes.rst:4858 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " "successfully and does not want to suppress the raised exception. This allows " -"context management code to easily detect whether or not an :meth:`__exit__` " -"method has actually failed." +"context management code to easily detect whether or not an :meth:`~object." +"__exit__` method has actually failed." msgstr "" -#: ../../library/stdtypes.rst:4803 +#: ../../library/stdtypes.rst:4864 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -5138,7 +5288,7 @@ msgid "" "management protocol. See the :mod:`contextlib` module for some examples." msgstr "" -#: ../../library/stdtypes.rst:4809 +#: ../../library/stdtypes.rst:4870 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -5148,7 +5298,7 @@ msgid "" "rather than the iterator produced by an undecorated generator function." msgstr "" -#: ../../library/stdtypes.rst:4816 +#: ../../library/stdtypes.rst:4877 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 " @@ -5157,23 +5307,23 @@ msgid "" "a single class dictionary lookup is negligible." msgstr "" -#: ../../library/stdtypes.rst:4824 +#: ../../library/stdtypes.rst:4885 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" msgstr "" -#: ../../library/stdtypes.rst:4829 +#: ../../library/stdtypes.rst:4890 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." msgstr "" -#: ../../library/stdtypes.rst:4836 +#: ../../library/stdtypes.rst:4897 msgid "Generic Alias Type" msgstr "" -#: ../../library/stdtypes.rst:4842 +#: ../../library/stdtypes.rst:4903 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -5183,19 +5333,19 @@ msgid "" "are intended primarily for use with :term:`type annotations `." msgstr "" -#: ../../library/stdtypes.rst:4852 +#: ../../library/stdtypes.rst:4913 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:4855 +#: ../../library/stdtypes.rst:4916 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." msgstr "" -#: ../../library/stdtypes.rst:4858 +#: ../../library/stdtypes.rst:4919 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 " @@ -5204,7 +5354,7 @@ msgid "" "`bytes`." msgstr "" -#: ../../library/stdtypes.rst:4864 +#: ../../library/stdtypes.rst:4925 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 " @@ -5213,7 +5363,7 @@ msgid "" "the :class:`str` data type and the :class:`bytes` data type:" msgstr "" -#: ../../library/stdtypes.rst:4870 +#: ../../library/stdtypes.rst:4931 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 " @@ -5221,7 +5371,7 @@ msgid "" "annotations with the ``GenericAlias`` ``re.Match[str]``." msgstr "" -#: ../../library/stdtypes.rst:4876 +#: ../../library/stdtypes.rst:4937 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." @@ -5230,21 +5380,21 @@ msgid "" "objects>` objects with ``re.Match[bytes]``." msgstr "" -#: ../../library/stdtypes.rst:4882 +#: ../../library/stdtypes.rst:4943 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:4888 +#: ../../library/stdtypes.rst:4949 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:4896 +#: ../../library/stdtypes.rst:4957 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 " @@ -5252,13 +5402,13 @@ msgid "" "of type :class:`str` and values of type :class:`int`::" msgstr "" -#: ../../library/stdtypes.rst:4904 +#: ../../library/stdtypes.rst:4965 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" msgstr "" -#: ../../library/stdtypes.rst:4912 +#: ../../library/stdtypes.rst:4973 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -5267,331 +5417,331 @@ msgid "" "discouraged, but will run without errors::" msgstr "" -#: ../../library/stdtypes.rst:4922 +#: ../../library/stdtypes.rst:4983 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "" -#: ../../library/stdtypes.rst:4933 +#: ../../library/stdtypes.rst:4994 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "" -#: ../../library/stdtypes.rst:4941 +#: ../../library/stdtypes.rst:5002 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" msgstr "" -#: ../../library/stdtypes.rst:4949 +#: ../../library/stdtypes.rst:5010 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:4960 +#: ../../library/stdtypes.rst:5021 msgid "Standard Generic Classes" msgstr "" -#: ../../library/stdtypes.rst:4962 +#: ../../library/stdtypes.rst:5023 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "" -#: ../../library/stdtypes.rst:4965 +#: ../../library/stdtypes.rst:5026 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:4966 +#: ../../library/stdtypes.rst:5027 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:4967 +#: ../../library/stdtypes.rst:5028 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:4968 +#: ../../library/stdtypes.rst:5029 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:4969 +#: ../../library/stdtypes.rst:5030 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:4970 +#: ../../library/stdtypes.rst:5031 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:4971 +#: ../../library/stdtypes.rst:5032 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:4972 +#: ../../library/stdtypes.rst:5033 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:4973 +#: ../../library/stdtypes.rst:5034 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:4974 +#: ../../library/stdtypes.rst:5035 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:4975 +#: ../../library/stdtypes.rst:5036 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:4976 +#: ../../library/stdtypes.rst:5037 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:4977 +#: ../../library/stdtypes.rst:5038 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:4978 +#: ../../library/stdtypes.rst:5039 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:4979 +#: ../../library/stdtypes.rst:5040 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:4980 +#: ../../library/stdtypes.rst:5041 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:4981 +#: ../../library/stdtypes.rst:5042 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:4982 +#: ../../library/stdtypes.rst:5043 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:4983 +#: ../../library/stdtypes.rst:5044 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:4984 +#: ../../library/stdtypes.rst:5045 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:4985 +#: ../../library/stdtypes.rst:5046 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:4986 +#: ../../library/stdtypes.rst:5047 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:4987 +#: ../../library/stdtypes.rst:5048 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:4988 +#: ../../library/stdtypes.rst:5049 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:4989 +#: ../../library/stdtypes.rst:5050 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:4990 +#: ../../library/stdtypes.rst:5051 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:4991 +#: ../../library/stdtypes.rst:5052 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:4992 +#: ../../library/stdtypes.rst:5053 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:4993 +#: ../../library/stdtypes.rst:5054 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:4994 +#: ../../library/stdtypes.rst:5055 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:4995 +#: ../../library/stdtypes.rst:5056 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:4996 +#: ../../library/stdtypes.rst:5057 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:4997 +#: ../../library/stdtypes.rst:5058 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:4998 +#: ../../library/stdtypes.rst:5059 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:4999 +#: ../../library/stdtypes.rst:5060 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:5000 +#: ../../library/stdtypes.rst:5061 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:5001 +#: ../../library/stdtypes.rst:5062 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:5002 +#: ../../library/stdtypes.rst:5063 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:5003 +#: ../../library/stdtypes.rst:5064 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:5004 +#: ../../library/stdtypes.rst:5065 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:5005 +#: ../../library/stdtypes.rst:5066 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:5006 +#: ../../library/stdtypes.rst:5067 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:5007 +#: ../../library/stdtypes.rst:5068 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:5008 +#: ../../library/stdtypes.rst:5069 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:5009 +#: ../../library/stdtypes.rst:5070 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:5010 +#: ../../library/stdtypes.rst:5071 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:5011 +#: ../../library/stdtypes.rst:5072 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:5012 +#: ../../library/stdtypes.rst:5073 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5013 +#: ../../library/stdtypes.rst:5074 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5014 +#: ../../library/stdtypes.rst:5075 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5015 +#: ../../library/stdtypes.rst:5076 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5016 +#: ../../library/stdtypes.rst:5077 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5017 +#: ../../library/stdtypes.rst:5078 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5018 +#: ../../library/stdtypes.rst:5079 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5023 +#: ../../library/stdtypes.rst:5084 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "" -#: ../../library/stdtypes.rst:5025 +#: ../../library/stdtypes.rst:5086 msgid "All parameterized generics implement special read-only attributes." msgstr "" -#: ../../library/stdtypes.rst:5029 +#: ../../library/stdtypes.rst:5090 msgid "This attribute points at the non-parameterized generic class::" msgstr "" -#: ../../library/stdtypes.rst:5037 +#: ../../library/stdtypes.rst:5098 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:5047 +#: ../../library/stdtypes.rst:5108 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" msgstr "" -#: ../../library/stdtypes.rst:5058 +#: ../../library/stdtypes.rst:5119 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:5065 +#: ../../library/stdtypes.rst:5126 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." msgstr "" -#: ../../library/stdtypes.rst:5074 +#: ../../library/stdtypes.rst:5135 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../library/stdtypes.rst:5074 +#: ../../library/stdtypes.rst:5135 msgid "Introducing Python's framework for type annotations." msgstr "" -#: ../../library/stdtypes.rst:5079 +#: ../../library/stdtypes.rst:5140 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr "" -#: ../../library/stdtypes.rst:5077 +#: ../../library/stdtypes.rst:5138 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:5082 +#: ../../library/stdtypes.rst:5143 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" msgstr "" -#: ../../library/stdtypes.rst:5082 +#: ../../library/stdtypes.rst:5143 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../library/stdtypes.rst:5091 +#: ../../library/stdtypes.rst:5152 msgid "Union Type" msgstr "" -#: ../../library/stdtypes.rst:5097 +#: ../../library/stdtypes.rst:5158 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -5600,7 +5750,7 @@ msgid "" "Union`." msgstr "" -#: ../../library/stdtypes.rst:5104 +#: ../../library/stdtypes.rst:5165 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 " @@ -5608,7 +5758,7 @@ msgid "" "class:`float`::" msgstr "" -#: ../../library/stdtypes.rst:5114 +#: ../../library/stdtypes.rst:5175 msgid "" "The ``|`` operand cannot be used at runtime to define unions where one or " "more members is a forward reference. For example, ``int | \"Foo\"``, where " @@ -5617,76 +5767,76 @@ msgid "" "a string, e.g. ``\"int | Foo\"``." msgstr "" -#: ../../library/stdtypes.rst:5122 +#: ../../library/stdtypes.rst:5183 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "" -#: ../../library/stdtypes.rst:5124 +#: ../../library/stdtypes.rst:5185 msgid "Unions of unions are flattened::" msgstr "" -#: ../../library/stdtypes.rst:5128 +#: ../../library/stdtypes.rst:5189 msgid "Redundant types are removed::" msgstr "" -#: ../../library/stdtypes.rst:5132 +#: ../../library/stdtypes.rst:5193 msgid "When comparing unions, the order is ignored::" msgstr "" -#: ../../library/stdtypes.rst:5136 +#: ../../library/stdtypes.rst:5197 msgid "It is compatible with :data:`typing.Union`::" msgstr "" -#: ../../library/stdtypes.rst:5140 +#: ../../library/stdtypes.rst:5201 msgid "Optional types can be spelled as a union with ``None``::" msgstr "" -#: ../../library/stdtypes.rst:5147 +#: ../../library/stdtypes.rst:5208 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "" -#: ../../library/stdtypes.rst:5153 +#: ../../library/stdtypes.rst:5214 msgid "" "However, :ref:`parameterized generics ` in union objects " "cannot be checked::" msgstr "" -#: ../../library/stdtypes.rst:5161 +#: ../../library/stdtypes.rst:5224 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:5174 +#: ../../library/stdtypes.rst:5237 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::" +"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:5192 +#: ../../library/stdtypes.rst:5257 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr "" -#: ../../library/stdtypes.rst:5200 +#: ../../library/stdtypes.rst:5265 msgid "Other Built-in Types" msgstr "" -#: ../../library/stdtypes.rst:5202 +#: ../../library/stdtypes.rst:5267 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:5209 +#: ../../library/stdtypes.rst:5274 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:5211 +#: ../../library/stdtypes.rst:5276 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 " @@ -5697,7 +5847,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:5218 +#: ../../library/stdtypes.rst:5283 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -5708,32 +5858,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:5226 +#: ../../library/stdtypes.rst:5291 msgid "" -"Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." +"Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:5234 +#: ../../library/stdtypes.rst:5299 msgid "Classes and Class Instances" msgstr "" -#: ../../library/stdtypes.rst:5236 +#: ../../library/stdtypes.rst:5301 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "" -#: ../../library/stdtypes.rst:5242 +#: ../../library/stdtypes.rst:5307 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:5244 +#: ../../library/stdtypes.rst:5309 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:5247 +#: ../../library/stdtypes.rst:5312 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -5741,81 +5891,88 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:5251 +#: ../../library/stdtypes.rst:5316 msgid "See :ref:`function` for more information." -msgstr "更多資訊請見 :ref:`function`\\ 。" +msgstr "更多資訊請見 :ref:`function`。" -#: ../../library/stdtypes.rst:5257 +#: ../../library/stdtypes.rst:5322 msgid "Methods" msgstr "" -#: ../../library/stdtypes.rst:5261 +#: ../../library/stdtypes.rst:5326 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 " -"class instance methods. Built-in methods are described with the types that " -"support them." +"are two flavors: :ref:`built-in methods ` (such as :meth:" +"`append` on lists) and :ref:`class instance method `. " +"Built-in methods are described with the types that support them." msgstr "" -#: ../../library/stdtypes.rst:5266 +#: ../../library/stdtypes.rst:5331 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:" -"`instance method`) object. When called, it will add the ``self`` argument to " -"the argument list. Bound methods have two special read-only attributes: ``m." -"__self__`` is the object on which the method operates, and ``m.__func__`` is " -"the function implementing the method. Calling ``m(arg-1, arg-2, ..., arg-" -"n)`` is completely equivalent to calling ``m.__func__(m.__self__, arg-1, " +"instance, you get a special object: a :dfn:`bound method` (also called :ref:" +"`instance method `) object. When called, it will add the " +"``self`` argument to the argument list. Bound methods have two special read-" +"only attributes: :attr:`m.__self__ ` is the object on which " +"the method operates, and :attr:`m.__func__ ` is the " +"function implementing the method. Calling ``m(arg-1, arg-2, ..., arg-n)`` " +"is completely equivalent to calling ``m.__func__(m.__self__, arg-1, " "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:5275 +#: ../../library/stdtypes.rst:5342 msgid "" -"Like function objects, bound method objects support getting arbitrary " -"attributes. However, since method attributes are actually stored on the " -"underlying function object (``meth.__func__``), setting method attributes on " -"bound methods is disallowed. Attempting to set an attribute on a method " -"results in an :exc:`AttributeError` being raised. In order to set a method " -"attribute, you need to explicitly set it on the underlying function object::" +"Like :ref:`function objects `, bound method objects " +"support getting arbitrary attributes. However, since method attributes are " +"actually stored on the underlying function object (:attr:`method.__func__`), " +"setting method attributes on bound methods is disallowed. Attempting to set " +"an attribute on a method results in an :exc:`AttributeError` being raised. " +"In order to set a method attribute, you need to explicitly set it on the " +"underlying function object:" msgstr "" -#: ../../library/stdtypes.rst:5295 ../../library/stdtypes.rst:5326 -msgid "See :ref:`types` for more information." -msgstr "更多資訊請見 :ref:`types`\\ 。" +#: ../../library/stdtypes.rst:5365 +msgid "See :ref:`instance-methods` for more information." +msgstr "更多資訊請見 :ref:`instance-methods`。" -#: ../../library/stdtypes.rst:5303 +#: ../../library/stdtypes.rst:5373 msgid "Code Objects" msgstr "" -#: ../../library/stdtypes.rst:5309 +#: ../../library/stdtypes.rst:5379 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " "objects because they don't contain a reference to their global execution " "environment. Code objects are returned by the built-in :func:`compile` " "function and can be extracted from function objects through their :attr:" -"`__code__` attribute. See also the :mod:`code` module." +"`~function.__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:5316 +#: ../../library/stdtypes.rst:5386 msgid "" -"Accessing ``__code__`` raises an :ref:`auditing event ` ``object." -"__getattr__`` with arguments ``obj`` and ``\"__code__\"``." +"Accessing :attr:`~function.__code__` raises an :ref:`auditing event " +"` ``object.__getattr__`` with arguments ``obj`` and " +"``\"__code__\"``." msgstr "" -"存取 ``__code__`` 會引發一個附帶引數 ``obj`` 與 ``\"__code__\"`` 的\\ :ref:`" -"稽核事件 ` ``object.__getattr__``。" +"存取 :attr:`~function.__code__` 會引發一個附帶引數 ``obj`` 與 " +"``\"__code__\"`` 的\\ :ref:`稽核事件 ` ``object.__getattr__``。" -#: ../../library/stdtypes.rst:5323 +#: ../../library/stdtypes.rst:5393 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:5332 +#: ../../library/stdtypes.rst:5396 +msgid "See :ref:`types` for more information." +msgstr "更多資訊請見 :ref:`types`。" + +#: ../../library/stdtypes.rst:5402 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:5338 +#: ../../library/stdtypes.rst:5408 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 " @@ -5823,30 +5980,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:5343 +#: ../../library/stdtypes.rst:5413 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:5349 +#: ../../library/stdtypes.rst:5419 msgid "The Null Object" msgstr "" -#: ../../library/stdtypes.rst:5351 +#: ../../library/stdtypes.rst:5421 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:5355 +#: ../../library/stdtypes.rst:5425 msgid "It is written as ``None``." msgstr "" -#: ../../library/stdtypes.rst:5362 +#: ../../library/stdtypes.rst:5432 msgid "The Ellipsis Object" msgstr "" -#: ../../library/stdtypes.rst:5364 +#: ../../library/stdtypes.rst:5434 msgid "" "This object is commonly used by slicing (see :ref:`slicings`). It supports " "no special operations. There is exactly one ellipsis object, named :const:" @@ -5854,116 +6011,104 @@ msgid "" "`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:5369 +#: ../../library/stdtypes.rst:5439 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "" -#: ../../library/stdtypes.rst:5375 +#: ../../library/stdtypes.rst:5445 msgid "The NotImplemented Object" msgstr "" -#: ../../library/stdtypes.rst:5377 +#: ../../library/stdtypes.rst:5447 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 " -"more information. There is exactly one ``NotImplemented`` object. " -"``type(NotImplemented)()`` produces the singleton instance." -msgstr "" - -#: ../../library/stdtypes.rst:5382 -msgid "It is written as ``NotImplemented``." +"more information. There is exactly one :data:`NotImplemented` object. :code:" +"`type(NotImplemented)()` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:5388 -msgid "Boolean Values" +#: ../../library/stdtypes.rst:5452 +msgid "It is written as :code:`NotImplemented`." msgstr "" -#: ../../library/stdtypes.rst:5390 -msgid "" -"Boolean values are the two constant objects ``False`` and ``True``. They " -"are used to represent truth values (although other values can also be " -"considered false or true). In numeric contexts (for example when used as " -"the argument to an arithmetic operator), they behave like the integers 0 and " -"1, respectively. The built-in function :func:`bool` can be used to convert " -"any value to a Boolean, if the value can be interpreted as a truth value " -"(see section :ref:`truth` above)." -msgstr "" - -#: ../../library/stdtypes.rst:5403 -msgid "They are written as ``False`` and ``True``, respectively." -msgstr "" - -#: ../../library/stdtypes.rst:5409 +#: ../../library/stdtypes.rst:5458 msgid "Internal Objects" msgstr "" -#: ../../library/stdtypes.rst:5411 +#: ../../library/stdtypes.rst:5460 msgid "" -"See :ref:`types` for this information. It describes stack frame objects, " -"traceback objects, and slice objects." +"See :ref:`types` for this information. It describes :ref:`stack frame " +"objects `, :ref:`traceback objects `, and " +"slice objects." msgstr "" -#: ../../library/stdtypes.rst:5418 +#: ../../library/stdtypes.rst:5468 msgid "Special Attributes" msgstr "" -#: ../../library/stdtypes.rst:5420 +#: ../../library/stdtypes.rst:5470 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:5427 +#: ../../library/stdtypes.rst:5477 msgid "" "A dictionary or other mapping object used to store an object's (writable) " "attributes." msgstr "" -#: ../../library/stdtypes.rst:5433 +#: ../../library/stdtypes.rst:5483 msgid "The class to which a class instance belongs." msgstr "" -#: ../../library/stdtypes.rst:5438 +#: ../../library/stdtypes.rst:5488 msgid "The tuple of base classes of a class object." msgstr "" -#: ../../library/stdtypes.rst:5443 +#: ../../library/stdtypes.rst:5493 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:5449 +#: ../../library/stdtypes.rst:5499 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:5457 +#: ../../library/stdtypes.rst:5507 +msgid "" +"The :ref:`type parameters ` of generic classes, functions, and :" +"ref:`type aliases `." +msgstr "" + +#: ../../library/stdtypes.rst:5515 msgid "" "This attribute is a tuple of classes that are considered when looking for " "base classes during method resolution." msgstr "" -#: ../../library/stdtypes.rst:5463 +#: ../../library/stdtypes.rst:5521 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:5470 +#: ../../library/stdtypes.rst:5528 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:5481 +#: ../../library/stdtypes.rst:5539 msgid "Integer string conversion length limitation" msgstr "" -#: ../../library/stdtypes.rst:5483 +#: ../../library/stdtypes.rst:5541 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 " @@ -5971,7 +6116,7 @@ msgid "" "binary conversions are unlimited. The limit can be configured." msgstr "" -#: ../../library/stdtypes.rst:5488 +#: ../../library/stdtypes.rst:5546 msgid "" "The :class:`int` type in CPython is an arbitrary length number stored in " "binary form (commonly known as a \"bignum\"). There exists no algorithm that " @@ -5981,25 +6126,24 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:5495 +#: ../../library/stdtypes.rst:5553 msgid "" -"Limiting conversion size offers a practical way to avoid `CVE-2020-10735 " -"`_." +"Limiting conversion size offers a practical way to avoid :cve:`2020-10735`." msgstr "" -#: ../../library/stdtypes.rst:5498 +#: ../../library/stdtypes.rst:5555 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:5502 +#: ../../library/stdtypes.rst:5559 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:5524 +#: ../../library/stdtypes.rst:5581 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -6007,94 +6151,94 @@ msgid "" "str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:5529 +#: ../../library/stdtypes.rst:5586 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:5544 +#: ../../library/stdtypes.rst:5601 msgid "Affected APIs" msgstr "" -#: ../../library/stdtypes.rst:5546 +#: ../../library/stdtypes.rst:5603 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" msgstr "" -#: ../../library/stdtypes.rst:5549 +#: ../../library/stdtypes.rst:5606 msgid "``int(string)`` with default base 10." msgstr "" -#: ../../library/stdtypes.rst:5550 +#: ../../library/stdtypes.rst:5607 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "" -#: ../../library/stdtypes.rst:5551 +#: ../../library/stdtypes.rst:5608 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:5552 +#: ../../library/stdtypes.rst:5609 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:5553 +#: ../../library/stdtypes.rst:5610 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:5556 +#: ../../library/stdtypes.rst:5613 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:5558 +#: ../../library/stdtypes.rst:5615 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "" -#: ../../library/stdtypes.rst:5559 +#: ../../library/stdtypes.rst:5616 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr "" -#: ../../library/stdtypes.rst:5560 +#: ../../library/stdtypes.rst:5617 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr "" -#: ../../library/stdtypes.rst:5561 +#: ../../library/stdtypes.rst:5618 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr "" -#: ../../library/stdtypes.rst:5562 +#: ../../library/stdtypes.rst:5619 msgid ":class:`str` to :class:`float`." msgstr "" -#: ../../library/stdtypes.rst:5563 +#: ../../library/stdtypes.rst:5620 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr "" -#: ../../library/stdtypes.rst:5566 +#: ../../library/stdtypes.rst:5623 msgid "Configuring the limit" msgstr "" -#: ../../library/stdtypes.rst:5568 +#: ../../library/stdtypes.rst:5625 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:5571 +#: ../../library/stdtypes.rst:5628 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:5574 +#: ../../library/stdtypes.rst:5631 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" msgstr "" -#: ../../library/stdtypes.rst:5576 +#: ../../library/stdtypes.rst:5633 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 " @@ -6103,38 +6247,38 @@ msgid "" "int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:5582 +#: ../../library/stdtypes.rst:5639 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:5585 +#: ../../library/stdtypes.rst:5642 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:5589 +#: ../../library/stdtypes.rst:5646 msgid "" -"Information about the default and minimum can be found in :attr:`sys." +"Information about the default and minimum can be found in :data:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:5591 +#: ../../library/stdtypes.rst:5648 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:5593 +#: ../../library/stdtypes.rst:5650 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:5600 +#: ../../library/stdtypes.rst:5657 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 " @@ -6146,7 +6290,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:5609 +#: ../../library/stdtypes.rst:5666 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 " @@ -6154,11 +6298,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:5615 +#: ../../library/stdtypes.rst:5672 msgid "Recommended configuration" msgstr "" -#: ../../library/stdtypes.rst:5617 +#: ../../library/stdtypes.rst:5674 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 " @@ -6166,45 +6310,45 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.12." msgstr "" -#: ../../library/stdtypes.rst:5622 +#: ../../library/stdtypes.rst:5679 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/stdtypes.rst:5634 +#: ../../library/stdtypes.rst:5691 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:5638 +#: ../../library/stdtypes.rst:5695 msgid "Footnotes" msgstr "註解" -#: ../../library/stdtypes.rst:5639 +#: ../../library/stdtypes.rst:5696 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:5642 +#: ../../library/stdtypes.rst:5699 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:5645 +#: ../../library/stdtypes.rst:5702 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:5647 +#: ../../library/stdtypes.rst:5704 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:5650 +#: ../../library/stdtypes.rst:5707 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." @@ -6214,16 +6358,16 @@ msgstr "" msgid "built-in" msgstr "built-in(內建)" -#: ../../library/stdtypes.rst:13 ../../library/stdtypes.rst:315 -#: ../../library/stdtypes.rst:390 ../../library/stdtypes.rst:907 -#: ../../library/stdtypes.rst:1074 ../../library/stdtypes.rst:1096 -#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4369 -#: ../../library/stdtypes.rst:5334 +#: ../../library/stdtypes.rst:13 ../../library/stdtypes.rst:316 +#: ../../library/stdtypes.rst:393 ../../library/stdtypes.rst:950 +#: ../../library/stdtypes.rst:1117 ../../library/stdtypes.rst:1139 +#: ../../library/stdtypes.rst:1154 ../../library/stdtypes.rst:4421 +#: ../../library/stdtypes.rst:5404 msgid "types" msgstr "type(型別)" -#: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:1111 -#: ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:1154 +#: ../../library/stdtypes.rst:4421 msgid "statement" msgstr "statement(陳述式)" @@ -6243,13 +6387,13 @@ msgstr "truth(真)" msgid "value" msgstr "value" -#: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:80 -#: ../../library/stdtypes.rst:207 ../../library/stdtypes.rst:5398 +#: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:81 +#: ../../library/stdtypes.rst:208 ../../library/stdtypes.rst:817 msgid "Boolean" msgstr "Boolean(布林)" -#: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:80 -#: ../../library/stdtypes.rst:390 +#: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:81 +#: ../../library/stdtypes.rst:393 msgid "operations" msgstr "operations(操作)" @@ -6261,702 +6405,698 @@ msgstr "false" msgid "true" msgstr "true" -#: ../../library/stdtypes.rst:51 +#: ../../library/stdtypes.rst:52 msgid "None (Built-in object)" msgstr "None(內建物件)" -#: ../../library/stdtypes.rst:51 +#: ../../library/stdtypes.rst:52 msgid "False (Built-in object)" msgstr "False(內建物件)" -#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:97 -#: ../../library/stdtypes.rst:122 ../../library/stdtypes.rst:194 -#: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:390 -#: ../../library/stdtypes.rst:946 +#: ../../library/stdtypes.rst:64 ../../library/stdtypes.rst:98 +#: ../../library/stdtypes.rst:123 ../../library/stdtypes.rst:195 +#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:393 +#: ../../library/stdtypes.rst:950 msgid "operator" msgstr "operator(運算子)" -#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:97 +#: ../../library/stdtypes.rst:64 ../../library/stdtypes.rst:98 msgid "or" msgstr "or" -#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:97 +#: ../../library/stdtypes.rst:64 ../../library/stdtypes.rst:98 msgid "and" msgstr "and" -#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:5398 +#: ../../library/stdtypes.rst:64 ../../library/stdtypes.rst:817 msgid "False" msgstr "False" -#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:5398 +#: ../../library/stdtypes.rst:64 ../../library/stdtypes.rst:817 msgid "True" msgstr "True" -#: ../../library/stdtypes.rst:97 +#: ../../library/stdtypes.rst:98 msgid "not" msgstr "not" -#: ../../library/stdtypes.rst:122 +#: ../../library/stdtypes.rst:123 msgid "chaining" msgstr "chaining(鏈結)" -#: ../../library/stdtypes.rst:122 +#: ../../library/stdtypes.rst:123 msgid "comparisons" msgstr "comparisons(比較)" -#: ../../library/stdtypes.rst:122 +#: ../../library/stdtypes.rst:123 msgid "comparison" msgstr "comparison(比較)" -#: ../../library/stdtypes.rst:122 +#: ../../library/stdtypes.rst:123 msgid "==" msgstr "==" -#: ../../library/stdtypes.rst:122 +#: ../../library/stdtypes.rst:123 msgid "< (less)" msgstr "< (小於)" -#: ../../library/stdtypes.rst:122 +#: ../../library/stdtypes.rst:123 msgid "<=" msgstr "<=" -#: ../../library/stdtypes.rst:122 +#: ../../library/stdtypes.rst:123 msgid "> (greater)" msgstr "> (大於)" -#: ../../library/stdtypes.rst:122 +#: ../../library/stdtypes.rst:123 msgid ">=" msgstr ">=" -#: ../../library/stdtypes.rst:122 +#: ../../library/stdtypes.rst:123 msgid "!=" msgstr "!=" -#: ../../library/stdtypes.rst:122 +#: ../../library/stdtypes.rst:123 msgid "is" msgstr "is" -#: ../../library/stdtypes.rst:122 +#: ../../library/stdtypes.rst:123 msgid "is not" msgstr "is not" -#: ../../library/stdtypes.rst:162 ../../library/stdtypes.rst:207 -#: ../../library/stdtypes.rst:891 ../../library/stdtypes.rst:1074 -#: ../../library/stdtypes.rst:1096 ../../library/stdtypes.rst:1216 -#: ../../library/stdtypes.rst:1295 ../../library/stdtypes.rst:1339 -#: ../../library/stdtypes.rst:1461 ../../library/stdtypes.rst:1497 -#: ../../library/stdtypes.rst:2466 ../../library/stdtypes.rst:2485 -#: ../../library/stdtypes.rst:2592 ../../library/stdtypes.rst:4168 -#: ../../library/stdtypes.rst:4369 ../../library/stdtypes.rst:4838 -#: ../../library/stdtypes.rst:5093 ../../library/stdtypes.rst:5259 -#: ../../library/stdtypes.rst:5298 +#: ../../library/stdtypes.rst:163 ../../library/stdtypes.rst:208 +#: ../../library/stdtypes.rst:934 ../../library/stdtypes.rst:1117 +#: ../../library/stdtypes.rst:1139 ../../library/stdtypes.rst:1259 +#: ../../library/stdtypes.rst:1338 ../../library/stdtypes.rst:1382 +#: ../../library/stdtypes.rst:1503 ../../library/stdtypes.rst:1539 +#: ../../library/stdtypes.rst:2513 ../../library/stdtypes.rst:2532 +#: ../../library/stdtypes.rst:2639 ../../library/stdtypes.rst:4219 +#: ../../library/stdtypes.rst:4421 ../../library/stdtypes.rst:4899 +#: ../../library/stdtypes.rst:5154 ../../library/stdtypes.rst:5324 +#: ../../library/stdtypes.rst:5368 msgid "object" msgstr "object(物件)" -#: ../../library/stdtypes.rst:162 ../../library/stdtypes.rst:207 -#: ../../library/stdtypes.rst:228 ../../library/stdtypes.rst:315 -#: ../../library/stdtypes.rst:332 +#: ../../library/stdtypes.rst:163 ../../library/stdtypes.rst:208 +#: ../../library/stdtypes.rst:229 ../../library/stdtypes.rst:316 +#: ../../library/stdtypes.rst:335 msgid "numeric" msgstr "numeric(數值)" -#: ../../library/stdtypes.rst:162 +#: ../../library/stdtypes.rst:163 msgid "objects" msgstr "objects(物件)" -#: ../../library/stdtypes.rst:162 +#: ../../library/stdtypes.rst:163 msgid "comparing" msgstr "comparing(比較)" -#: ../../library/stdtypes.rst:172 +#: ../../library/stdtypes.rst:173 msgid "__eq__() (instance method)" msgstr "__eq__()(實例方法)" -#: ../../library/stdtypes.rst:172 +#: ../../library/stdtypes.rst:173 msgid "__ne__() (instance method)" msgstr "__ne__()(實例方法)" -#: ../../library/stdtypes.rst:172 +#: ../../library/stdtypes.rst:173 msgid "__lt__() (instance method)" msgstr "__lt__()(實例方法)" -#: ../../library/stdtypes.rst:172 +#: ../../library/stdtypes.rst:173 msgid "__le__() (instance method)" msgstr "__le__()(實例方法)" -#: ../../library/stdtypes.rst:172 +#: ../../library/stdtypes.rst:173 msgid "__gt__() (instance method)" msgstr "__gt__()(實例方法)" -#: ../../library/stdtypes.rst:172 +#: ../../library/stdtypes.rst:173 msgid "__ge__() (instance method)" msgstr "__ge__()(實例方法)" -#: ../../library/stdtypes.rst:194 ../../library/stdtypes.rst:946 +#: ../../library/stdtypes.rst:195 ../../library/stdtypes.rst:950 msgid "in" msgstr "in" -#: ../../library/stdtypes.rst:194 ../../library/stdtypes.rst:946 +#: ../../library/stdtypes.rst:195 ../../library/stdtypes.rst:950 msgid "not in" msgstr "not in" -#: ../../library/stdtypes.rst:207 ../../library/stdtypes.rst:228 -#: ../../library/stdtypes.rst:390 +#: ../../library/stdtypes.rst:208 ../../library/stdtypes.rst:229 +#: ../../library/stdtypes.rst:393 msgid "integer" msgstr "integer(整數)" -#: ../../library/stdtypes.rst:207 ../../library/stdtypes.rst:228 +#: ../../library/stdtypes.rst:208 ../../library/stdtypes.rst:229 msgid "floating point" msgstr "floating point(浮點數)" -#: ../../library/stdtypes.rst:207 ../../library/stdtypes.rst:228 +#: ../../library/stdtypes.rst:208 ../../library/stdtypes.rst:229 msgid "complex number" msgstr "complex number(複數)" -#: ../../library/stdtypes.rst:207 +#: ../../library/stdtypes.rst:208 msgid "C" msgstr "C" -#: ../../library/stdtypes.rst:207 +#: ../../library/stdtypes.rst:208 msgid "language" msgstr "language(語言)" -#: ../../library/stdtypes.rst:228 +#: ../../library/stdtypes.rst:229 msgid "literals" msgstr "literals(字面值)" -#: ../../library/stdtypes.rst:228 +#: ../../library/stdtypes.rst:229 msgid "hexadecimal" msgstr "hexadecimal(十六進位)" -#: ../../library/stdtypes.rst:228 +#: ../../library/stdtypes.rst:229 msgid "octal" msgstr "octal(八進位)" -#: ../../library/stdtypes.rst:228 +#: ../../library/stdtypes.rst:229 msgid "binary" msgstr "binary(二進位)" -#: ../../library/stdtypes.rst:245 +#: ../../library/stdtypes.rst:246 msgid "arithmetic" msgstr "arithmetic(算術)" -#: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:907 -#: ../../library/stdtypes.rst:1074 ../../library/stdtypes.rst:4369 -#: ../../library/stdtypes.rst:5305 ../../library/stdtypes.rst:5319 -#: ../../library/stdtypes.rst:5334 +#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:950 +#: ../../library/stdtypes.rst:1117 ../../library/stdtypes.rst:4421 +#: ../../library/stdtypes.rst:5375 ../../library/stdtypes.rst:5389 +#: ../../library/stdtypes.rst:5404 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/stdtypes.rst:245 +#: ../../library/stdtypes.rst:246 msgid "int" msgstr "int" -#: ../../library/stdtypes.rst:245 +#: ../../library/stdtypes.rst:246 msgid "float" msgstr "float" -#: ../../library/stdtypes.rst:245 +#: ../../library/stdtypes.rst:246 msgid "complex" msgstr "complex(複數)" -#: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:2386 -#: ../../library/stdtypes.rst:3604 +#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2389 +#: ../../library/stdtypes.rst:3607 msgid "+ (plus)" msgstr "+ (加號)" -#: ../../library/stdtypes.rst:245 +#: ../../library/stdtypes.rst:246 msgid "unary operator" msgstr "unary operator(一元運算子)" -#: ../../library/stdtypes.rst:245 +#: ../../library/stdtypes.rst:246 msgid "binary operator" msgstr "binary operator(二元運算子)" -#: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:2386 -#: ../../library/stdtypes.rst:3604 +#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2389 +#: ../../library/stdtypes.rst:3607 msgid "- (minus)" msgstr "- (減號)" -#: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:2343 -#: ../../library/stdtypes.rst:3561 +#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2346 +#: ../../library/stdtypes.rst:3564 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../library/stdtypes.rst:245 +#: ../../library/stdtypes.rst:246 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../library/stdtypes.rst:245 +#: ../../library/stdtypes.rst:246 msgid "//" msgstr "//" -#: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:2313 -#: ../../library/stdtypes.rst:3529 +#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2316 +#: ../../library/stdtypes.rst:3532 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/stdtypes.rst:245 +#: ../../library/stdtypes.rst:246 msgid "**" msgstr "**" -#: ../../library/stdtypes.rst:315 ../../library/stdtypes.rst:390 -#: ../../library/stdtypes.rst:907 ../../library/stdtypes.rst:1111 -#: ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:316 ../../library/stdtypes.rst:393 +#: ../../library/stdtypes.rst:950 ../../library/stdtypes.rst:1154 +#: ../../library/stdtypes.rst:4421 msgid "operations on" msgstr "operations on(操作於)" -#: ../../library/stdtypes.rst:315 +#: ../../library/stdtypes.rst:316 msgid "conjugate() (complex number method)" msgstr "conjugate()(複數方法)" -#: ../../library/stdtypes.rst:332 ../../library/stdtypes.rst:1563 -#: ../../library/stdtypes.rst:2466 ../../library/stdtypes.rst:5334 +#: ../../library/stdtypes.rst:335 ../../library/stdtypes.rst:1605 +#: ../../library/stdtypes.rst:2513 ../../library/stdtypes.rst:5404 msgid "module" msgstr "模組" -#: ../../library/stdtypes.rst:332 +#: ../../library/stdtypes.rst:335 msgid "math" msgstr "math" -#: ../../library/stdtypes.rst:332 +#: ../../library/stdtypes.rst:335 msgid "floor() (in module math)" msgstr "floor()(於 math 模組)" -#: ../../library/stdtypes.rst:332 +#: ../../library/stdtypes.rst:335 msgid "ceil() (in module math)" msgstr "ceil()(於 math 模組)" -#: ../../library/stdtypes.rst:332 +#: ../../library/stdtypes.rst:335 msgid "trunc() (in module math)" msgstr "trunc()(於 math 模組)" -#: ../../library/stdtypes.rst:332 +#: ../../library/stdtypes.rst:335 msgid "conversions" msgstr "conversions(轉換)" -#: ../../library/stdtypes.rst:390 +#: ../../library/stdtypes.rst:393 msgid "bitwise" msgstr "bitwise(位元)" -#: ../../library/stdtypes.rst:390 +#: ../../library/stdtypes.rst:393 msgid "shifting" msgstr "shifting(移位)" -#: ../../library/stdtypes.rst:390 +#: ../../library/stdtypes.rst:393 msgid "masking" msgstr "masking(遮罩)" -#: ../../library/stdtypes.rst:390 +#: ../../library/stdtypes.rst:393 msgid "| (vertical bar)" msgstr "| (垂直線)" -#: ../../library/stdtypes.rst:390 +#: ../../library/stdtypes.rst:393 msgid "^ (caret)" msgstr "^ (插入符號)" -#: ../../library/stdtypes.rst:390 +#: ../../library/stdtypes.rst:393 msgid "& (ampersand)" msgstr "& (和號)" -#: ../../library/stdtypes.rst:390 +#: ../../library/stdtypes.rst:393 msgid "<<" msgstr "<<" -#: ../../library/stdtypes.rst:390 +#: ../../library/stdtypes.rst:393 msgid ">>" msgstr ">>" -#: ../../library/stdtypes.rst:390 +#: ../../library/stdtypes.rst:393 msgid "~ (tilde)" msgstr "~ (波浪號)" -#: ../../library/stdtypes.rst:813 +#: ../../library/stdtypes.rst:817 msgid "values" msgstr "values" -#: ../../library/stdtypes.rst:843 +#: ../../library/stdtypes.rst:847 msgid "iterator protocol" msgstr "iterator protocol(疊代器協定)" -#: ../../library/stdtypes.rst:804 ../../library/stdtypes.rst:4753 +#: ../../library/stdtypes.rst:847 ../../library/stdtypes.rst:4814 msgid "protocol" msgstr "protocol(協定)" -#: ../../library/stdtypes.rst:843 +#: ../../library/stdtypes.rst:847 msgid "iterator" msgstr "iterator(疊代器)" -#: ../../library/stdtypes.rst:843 ../../library/stdtypes.rst:930 -#: ../../library/stdtypes.rst:946 ../../library/stdtypes.rst:1113 -#: ../../library/stdtypes.rst:1135 ../../library/stdtypes.rst:1150 +#: ../../library/stdtypes.rst:847 ../../library/stdtypes.rst:934 +#: ../../library/stdtypes.rst:950 ../../library/stdtypes.rst:1117 +#: ../../library/stdtypes.rst:1139 ../../library/stdtypes.rst:1154 msgid "sequence" msgstr "sequence(序列)" -#: ../../library/stdtypes.rst:843 +#: ../../library/stdtypes.rst:847 msgid "iteration" msgstr "iteration(疊代)" -#: ../../library/stdtypes.rst:843 +#: ../../library/stdtypes.rst:847 msgid "container" msgstr "container(容器)" -#: ../../library/stdtypes.rst:843 +#: ../../library/stdtypes.rst:847 msgid "iteration over" msgstr "iteration over(疊代於)" -#: ../../library/stdtypes.rst:907 ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:950 ../../library/stdtypes.rst:4421 msgid "len" msgstr "len" -#: ../../library/stdtypes.rst:946 +#: ../../library/stdtypes.rst:950 msgid "min" msgstr "min" -#: ../../library/stdtypes.rst:946 +#: ../../library/stdtypes.rst:950 msgid "max" msgstr "max" -#: ../../library/stdtypes.rst:946 +#: ../../library/stdtypes.rst:950 msgid "concatenation" msgstr "concatenation(串接)" -#: ../../library/stdtypes.rst:946 +#: ../../library/stdtypes.rst:950 msgid "operation" msgstr "operation(操作)" -#: ../../library/stdtypes.rst:946 +#: ../../library/stdtypes.rst:950 msgid "repetition" msgstr "repetition(重複)" -#: ../../library/stdtypes.rst:946 ../../library/stdtypes.rst:1150 +#: ../../library/stdtypes.rst:950 ../../library/stdtypes.rst:1154 msgid "subscript" msgstr "subscript(下標)" -#: ../../library/stdtypes.rst:946 ../../library/stdtypes.rst:1150 +#: ../../library/stdtypes.rst:950 ../../library/stdtypes.rst:1154 msgid "slice" msgstr "slice(切片)" -#: ../../library/stdtypes.rst:946 +#: ../../library/stdtypes.rst:950 msgid "count() (sequence method)" msgstr "count()(序列方法)" -#: ../../library/stdtypes.rst:946 +#: ../../library/stdtypes.rst:950 msgid "index() (sequence method)" msgstr "index()(序列方法)" -#: ../../library/stdtypes.rst:1002 +#: ../../library/stdtypes.rst:1006 msgid "loop" msgstr "loop(迴圈)" -#: ../../library/stdtypes.rst:1002 +#: ../../library/stdtypes.rst:1006 msgid "over mutable sequence" msgstr "over mutable sequence(於可變序列)" -#: ../../library/stdtypes.rst:1002 +#: ../../library/stdtypes.rst:1006 msgid "mutable sequence" msgstr "mutable sequence(可變序列)" -#: ../../library/stdtypes.rst:1002 +#: ../../library/stdtypes.rst:1006 msgid "loop over" msgstr "loop over(迴圈)" -#: ../../library/stdtypes.rst:1113 +#: ../../library/stdtypes.rst:1117 msgid "immutable" msgstr "immutable(不可變)" -#: ../../library/stdtypes.rst:1113 ../../library/stdtypes.rst:1334 +#: ../../library/stdtypes.rst:1117 ../../library/stdtypes.rst:1338 msgid "tuple" msgstr "tuple(元組)" -#: ../../library/stdtypes.rst:1113 +#: ../../library/stdtypes.rst:1117 msgid "hash" msgstr "hash(雜湊)" -#: ../../library/stdtypes.rst:1135 +#: ../../library/stdtypes.rst:1139 msgid "mutable" msgstr "mutable(可變)" -#: ../../library/stdtypes.rst:1135 ../../library/stdtypes.rst:1150 -#: ../../library/stdtypes.rst:1255 +#: ../../library/stdtypes.rst:1139 ../../library/stdtypes.rst:1154 +#: ../../library/stdtypes.rst:1259 msgid "list" msgstr "list(串列)" -#: ../../library/stdtypes.rst:1135 ../../library/stdtypes.rst:2510 -#: ../../library/stdtypes.rst:2636 ../../library/stdtypes.rst:2708 -#: ../../library/stdtypes.rst:3529 +#: ../../library/stdtypes.rst:1139 ../../library/stdtypes.rst:2513 +#: ../../library/stdtypes.rst:2639 ../../library/stdtypes.rst:2711 +#: ../../library/stdtypes.rst:3532 msgid "bytearray" msgstr "bytearray(位元組陣列)" -#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4369 -#: ../../library/stdtypes.rst:5093 ../../library/stdtypes.rst:5334 +#: ../../library/stdtypes.rst:1154 ../../library/stdtypes.rst:4421 +#: ../../library/stdtypes.rst:5154 ../../library/stdtypes.rst:5404 msgid "type" msgstr "type(型別)" -#: ../../library/stdtypes.rst:1150 +#: ../../library/stdtypes.rst:1154 msgid "assignment" msgstr "assignment(賦值)" -#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:1154 ../../library/stdtypes.rst:4421 msgid "del" msgstr "del" -#: ../../library/stdtypes.rst:1150 +#: ../../library/stdtypes.rst:1154 msgid "append() (sequence method)" msgstr "append()(序列方法)" -#: ../../library/stdtypes.rst:1150 +#: ../../library/stdtypes.rst:1154 msgid "clear() (sequence method)" msgstr "clear()(序列方法)" -#: ../../library/stdtypes.rst:1150 +#: ../../library/stdtypes.rst:1154 msgid "copy() (sequence method)" msgstr "copy()(序列方法)" -#: ../../library/stdtypes.rst:1150 +#: ../../library/stdtypes.rst:1154 msgid "extend() (sequence method)" msgstr "extend()(序列方法)" -#: ../../library/stdtypes.rst:1150 +#: ../../library/stdtypes.rst:1154 msgid "insert() (sequence method)" msgstr "insert()(序列方法)" -#: ../../library/stdtypes.rst:1150 +#: ../../library/stdtypes.rst:1154 msgid "pop() (sequence method)" msgstr "pop()(序列方法)" -#: ../../library/stdtypes.rst:1150 +#: ../../library/stdtypes.rst:1154 msgid "remove() (sequence method)" msgstr "remove()(序列方法)" -#: ../../library/stdtypes.rst:1150 +#: ../../library/stdtypes.rst:1154 msgid "reverse() (sequence method)" msgstr "reverse()(序列方法)" -#: ../../library/stdtypes.rst:1378 +#: ../../library/stdtypes.rst:1382 msgid "range" msgstr "range" -#: ../../library/stdtypes.rst:1500 ../../library/stdtypes.rst:1549 -#: ../../library/stdtypes.rst:1594 ../../library/stdtypes.rst:2313 +#: ../../library/stdtypes.rst:1503 ../../library/stdtypes.rst:1552 +#: ../../library/stdtypes.rst:1597 ../../library/stdtypes.rst:2316 msgid "string" msgstr "string(字串)" -#: ../../library/stdtypes.rst:1500 +#: ../../library/stdtypes.rst:1503 msgid "text sequence type" msgstr "text sequence type(文字序列型別)" -#: ../../library/stdtypes.rst:1500 ../../library/stdtypes.rst:1549 -#: ../../library/stdtypes.rst:1567 +#: ../../library/stdtypes.rst:1503 ../../library/stdtypes.rst:1552 +#: ../../library/stdtypes.rst:1570 msgid "str (built-in class)" msgstr "str(內建類別)" -#: ../../library/stdtypes.rst:1500 +#: ../../library/stdtypes.rst:1503 msgid "(see also string)" msgstr "(亦請見 string)" -#: ../../library/stdtypes.rst:1536 +#: ../../library/stdtypes.rst:1539 msgid "io.StringIO" msgstr "io.StringIO" -#: ../../library/stdtypes.rst:1567 ../../library/stdtypes.rst:2502 +#: ../../library/stdtypes.rst:1570 ../../library/stdtypes.rst:2505 msgid "buffer protocol" msgstr "buffer protocol(緩衝區協定)" -#: ../../library/stdtypes.rst:1567 ../../library/stdtypes.rst:2510 -#: ../../library/stdtypes.rst:2529 ../../library/stdtypes.rst:2708 -#: ../../library/stdtypes.rst:3529 +#: ../../library/stdtypes.rst:1570 ../../library/stdtypes.rst:2513 +#: ../../library/stdtypes.rst:2532 ../../library/stdtypes.rst:2711 +#: ../../library/stdtypes.rst:3532 msgid "bytes" msgstr "bytes(位元組)" -#: ../../library/stdtypes.rst:1594 ../../library/stdtypes.rst:2708 +#: ../../library/stdtypes.rst:1597 ../../library/stdtypes.rst:2711 msgid "methods" msgstr "methods(方法)" -#: ../../library/stdtypes.rst:1602 +#: ../../library/stdtypes.rst:1605 msgid "re" msgstr "re" -#: ../../library/stdtypes.rst:2121 ../../library/stdtypes.rst:3383 +#: ../../library/stdtypes.rst:2124 ../../library/stdtypes.rst:3386 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/stdtypes.rst:2121 +#: ../../library/stdtypes.rst:2124 msgid "str.splitlines method" msgstr "str.splitlines 方法" -#: ../../library/stdtypes.rst:2313 +#: ../../library/stdtypes.rst:2316 msgid "formatting, string (%)" msgstr "formatting(格式化)、字串 (%)" -#: ../../library/stdtypes.rst:2313 +#: ../../library/stdtypes.rst:2316 msgid "interpolation, string (%)" msgstr "interpolation(插值)、字串 (%)" -#: ../../library/stdtypes.rst:2313 +#: ../../library/stdtypes.rst:2316 msgid "formatting, printf" msgstr "formatting(格式化)、printf" -#: ../../library/stdtypes.rst:2313 +#: ../../library/stdtypes.rst:2316 msgid "interpolation, printf" msgstr "interpolation(插值)、printf" -#: ../../library/stdtypes.rst:2313 ../../library/stdtypes.rst:3529 +#: ../../library/stdtypes.rst:2316 ../../library/stdtypes.rst:3532 msgid "printf-style formatting" msgstr "printf 風格格式化" -#: ../../library/stdtypes.rst:2313 ../../library/stdtypes.rst:3529 +#: ../../library/stdtypes.rst:2316 ../../library/stdtypes.rst:3532 msgid "sprintf-style formatting" msgstr "sprintf 風格格式化" -#: ../../library/stdtypes.rst:2343 ../../library/stdtypes.rst:3561 +#: ../../library/stdtypes.rst:2346 ../../library/stdtypes.rst:3564 msgid "() (parentheses)" msgstr "() (圓括號)" -#: ../../library/stdtypes.rst:2343 ../../library/stdtypes.rst:2386 -#: ../../library/stdtypes.rst:3561 ../../library/stdtypes.rst:3604 +#: ../../library/stdtypes.rst:2346 ../../library/stdtypes.rst:2389 +#: ../../library/stdtypes.rst:3564 ../../library/stdtypes.rst:3607 msgid "in printf-style formatting" msgstr "於 printf 風格格式化" -#: ../../library/stdtypes.rst:2343 ../../library/stdtypes.rst:3561 +#: ../../library/stdtypes.rst:2346 ../../library/stdtypes.rst:3564 msgid ". (dot)" msgstr ". (點)" -#: ../../library/stdtypes.rst:2386 ../../library/stdtypes.rst:3604 +#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:3607 msgid "# (hash)" msgstr "# (井字號)" -#: ../../library/stdtypes.rst:2386 ../../library/stdtypes.rst:3604 +#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:3607 msgid "space" msgstr "space(空白)" -#: ../../library/stdtypes.rst:2502 +#: ../../library/stdtypes.rst:2505 msgid "binary sequence types" msgstr "binary sequence types(二進位序列型別)" -#: ../../library/stdtypes.rst:2510 +#: ../../library/stdtypes.rst:2513 msgid "memoryview" msgstr "memoryview(記憶體視圖)" -#: ../../library/stdtypes.rst:2510 +#: ../../library/stdtypes.rst:2513 msgid "array" msgstr "array(陣列)" -#: ../../library/stdtypes.rst:3383 +#: ../../library/stdtypes.rst:3386 msgid "bytes.splitlines method" msgstr "bytes.splitlines 方法" -#: ../../library/stdtypes.rst:3383 +#: ../../library/stdtypes.rst:3386 msgid "bytearray.splitlines method" msgstr "bytearray.splitlines 方法" -#: ../../library/stdtypes.rst:3529 +#: ../../library/stdtypes.rst:3532 msgid "formatting" msgstr "formatting(格式化)" -#: ../../library/stdtypes.rst:3529 +#: ../../library/stdtypes.rst:3532 msgid "bytes (%)" msgstr "bytes (%)" -#: ../../library/stdtypes.rst:3529 +#: ../../library/stdtypes.rst:3532 msgid "bytearray (%)" msgstr "bytearray (%)" -#: ../../library/stdtypes.rst:3529 +#: ../../library/stdtypes.rst:3532 msgid "interpolation" msgstr "interpolation(插值)" -#: ../../library/stdtypes.rst:4168 +#: ../../library/stdtypes.rst:4219 msgid "set" msgstr "set(集合)" -#: ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:4421 msgid "mapping" msgstr "mapping(對映)" -#: ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:4421 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../library/stdtypes.rst:4452 +#: ../../library/stdtypes.rst:4504 msgid "__missing__()" msgstr "__missing__()" -#: ../../library/stdtypes.rst:4753 +#: ../../library/stdtypes.rst:4814 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../library/stdtypes.rst:4753 +#: ../../library/stdtypes.rst:4814 msgid "context management protocol" msgstr "context management protocol(情境管理協定)" -#: ../../library/stdtypes.rst:4753 +#: ../../library/stdtypes.rst:4814 msgid "context management" msgstr "context management(情境管理)" -#: ../../library/stdtypes.rst:4826 +#: ../../library/stdtypes.rst:4887 msgid "annotation" msgstr "annotation(註記)" -#: ../../library/stdtypes.rst:4826 +#: ../../library/stdtypes.rst:4887 msgid "type annotation; type hint" msgstr "type annotation(型別註記);type hint(型別提示)" -#: ../../library/stdtypes.rst:4838 +#: ../../library/stdtypes.rst:4899 msgid "GenericAlias" msgstr "GenericAlias(泛型別名)" -#: ../../library/stdtypes.rst:4838 +#: ../../library/stdtypes.rst:4899 msgid "Generic" msgstr "Generic(泛型)" -#: ../../library/stdtypes.rst:4838 +#: ../../library/stdtypes.rst:4899 msgid "Alias" msgstr "Alias(別名)" -#: ../../library/stdtypes.rst:5093 +#: ../../library/stdtypes.rst:5154 msgid "Union" msgstr "Union(聯集)" -#: ../../library/stdtypes.rst:5093 +#: ../../library/stdtypes.rst:5154 msgid "union" msgstr "union(聯集)" -#: ../../library/stdtypes.rst:5259 +#: ../../library/stdtypes.rst:5324 msgid "method" msgstr "method(方法)" -#: ../../library/stdtypes.rst:5298 +#: ../../library/stdtypes.rst:5368 msgid "code" msgstr "code(程式碼)" -#: ../../library/stdtypes.rst:5298 +#: ../../library/stdtypes.rst:5368 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../library/stdtypes.rst:5305 +#: ../../library/stdtypes.rst:5375 msgid "compile" msgstr "compile(編譯)" -#: ../../library/stdtypes.rst:5305 +#: ../../library/stdtypes.rst:5375 msgid "__code__ (function object attribute)" msgstr "__code__(函式物件屬性)" -#: ../../library/stdtypes.rst:5319 +#: ../../library/stdtypes.rst:5389 msgid "exec" msgstr "exec" -#: ../../library/stdtypes.rst:5319 +#: ../../library/stdtypes.rst:5389 msgid "eval" msgstr "eval" -#: ../../library/stdtypes.rst:5358 +#: ../../library/stdtypes.rst:5428 msgid "..." msgstr "..." -#: ../../library/stdtypes.rst:5358 +#: ../../library/stdtypes.rst:5428 msgid "ellipsis literal" msgstr "ellipsis literal(刪節號)" - -#: ../../library/stdtypes.rst:5398 -msgid "values" -msgstr "values"