From 7fe1bd60ace342cff8281817a85a88d9241b9efe Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 9 Apr 2026 00:21:30 +0000 Subject: [PATCH 1/4] sync with cpython f46a17b1 --- library/itertools.po | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/library/itertools.po b/library/itertools.po index 2acbc69f0a..af2bdb446e 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-21 00:19+0000\n" +"POT-Creation-Date: 2026-04-09 00:20+0000\n" "PO-Revision-Date: 2024-08-16 15:01+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1808,6 +1808,7 @@ msgstr "" "term:`產生器 `,則能保持高速度。" #: ../../library/itertools.rst:831 +#, fuzzy msgid "" "from itertools import (accumulate, batched, chain, combinations, compress,\n" " count, cycle, filterfalse, groupby, islice, permutations, product,\n" @@ -1832,7 +1833,7 @@ msgid "" "\n" "def running_mean(iterable):\n" " \"Yield the average of all values seen so far.\"\n" -" # running_mean([8.5, 9.5, 7.5, 6.5]) -> 8.5 9.0 8.5 8.0\n" +" # running_mean([8.5, 9.5, 7.5, 6.5]) → 8.5 9.0 8.5 8.0\n" " return map(truediv, accumulate(iterable), count(1))\n" "\n" "def repeatfunc(function, times=None, *args):\n" @@ -1918,10 +1919,10 @@ msgid "" " yield element\n" "\n" "def unique(iterable, key=None, reverse=False):\n" -" \"Yield unique elements in sorted order. Supports unhashable inputs.\"\n" -" # unique([[1, 2], [3, 4], [1, 2]]) → [1, 2] [3, 4]\n" -" sequenced = sorted(iterable, key=key, reverse=reverse)\n" -" return unique_justseen(sequenced, key=key)\n" +" \"Yield unique elements in sorted order. Supports unhashable inputs.\"\n" +" # unique([[1, 2], [3, 4], [1, 2]]) → [1, 2] [3, 4]\n" +" sequenced = sorted(iterable, key=key, reverse=reverse)\n" +" return unique_justseen(sequenced, key=key)\n" "\n" "def sliding_window(iterable, n):\n" " \"Collect data into overlapping fixed-length chunks or blocks.\"\n" From 156dbcdb137fdfd4bcd43ff192ba73ee64421e52 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 9 Apr 2026 11:51:21 +0000 Subject: [PATCH 2/4] sync with cpython d31a16e6 --- library/glob.po | 69 ++++---- library/pathlib.po | 420 +++++++++++++++++++++++---------------------- 2 files changed, 253 insertions(+), 236 deletions(-) diff --git a/library/glob.po b/library/glob.po index b2f5820851..9f150b32a9 100644 --- a/library/glob.po +++ b/library/glob.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-21 00:14+0000\n" +"POT-Creation-Date: 2026-04-09 11:50+0000\n" "PO-Revision-Date: 2023-01-24 01:21+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,16 +35,16 @@ msgid "" "done by using the :func:`os.scandir` and :func:`fnmatch.fnmatch` functions " "in concert, and not by actually invoking a subshell." msgstr "" -":mod:`!glob` 模組使用類似於 Unix shell 的模式匹配規則來尋找路徑名稱。不會進" -"行波浪號擴展 (tilde expansion) ,但 ``*``、``?`` 和使用 ``[]`` 表達的字元範圍將會被正確匹配。這" -"是透過結合使用 :func:`os.scandir` 和 :func:`fnmatch.fnmatch` 函式來完成的,而沒有實際呼叫 subshell。" +":mod:`!glob` 模組使用類似於 Unix shell 的模式匹配規則來尋找路徑名稱。不會進行" +"波浪號擴展 (tilde expansion) ,但 ``*``、``?`` 和使用 ``[]`` 表達的字元範圍將" +"會被正確匹配。這是透過結合使用 :func:`os.scandir` 和 :func:`fnmatch.fnmatch` " +"函式來完成的,而沒有實際呼叫 subshell。" #: ../../library/glob.rst:29 msgid "" "The pathnames are returned in no particular order. If you need a specific " "order, sort the results." -msgstr "" -"路徑名稱不會以特定順序回傳。如果你需要特定的順序,請對結果進行排序。" +msgstr "路徑名稱不會以特定順序回傳。如果你需要特定的順序,請對結果進行排序。" #: ../../library/glob.rst:32 msgid "" @@ -53,9 +53,9 @@ msgid "" "glob`. For tilde and shell variable expansion, use :func:`os.path." "expanduser` and :func:`os.path.expandvars`." msgstr "" -"以點 (``.``) 開頭的檔案只能與同樣以點開頭的模式匹配,這與 :func:" -"`fnmatch.fnmatch` 或 :func:`pathlib.Path.glob` 不同。對於波浪號和 shell 變" -"數擴展,請使用 :func:`os.path.expanduser` 和 :func:`os.path.expandvars`。" +"以點 (``.``) 開頭的檔案只能與同樣以點開頭的模式匹配,這與 :func:`fnmatch." +"fnmatch` 或 :func:`pathlib.Path.glob` 不同。對於波浪號和 shell 變數擴展,請使" +"用 :func:`os.path.expanduser` 和 :func:`os.path.expandvars`。" #: ../../library/glob.rst:38 msgid "" @@ -122,7 +122,7 @@ msgid "" "directories." msgstr "如果 *include_hidden* 為真,\"``**``\" 模式將匹配被隱藏的目錄。" -#: ../../library/glob.rst:75 ../../library/glob.rst:102 +#: ../../library/glob.rst:75 ../../library/glob.rst:107 msgid "" "Raises an :ref:`auditing event ` ``glob.glob`` with arguments " "``pathname``, ``recursive``." @@ -130,7 +130,7 @@ msgstr "" "引發一個附帶引數 ``pathname``、``recursive`` 的\\ :ref:`稽核事件 ` " "``glob.glob``。" -#: ../../library/glob.rst:76 ../../library/glob.rst:103 +#: ../../library/glob.rst:76 ../../library/glob.rst:108 msgid "" "Raises an :ref:`auditing event ` ``glob.glob/2`` with arguments " "``pathname``, ``recursive``, ``root_dir``, ``dir_fd``." @@ -144,25 +144,32 @@ msgid "" "inordinate amount of time." msgstr "在大型目錄樹中使用 \"``**``\" 模式可能會消耗過多的時間。" -#: ../../library/glob.rst:83 ../../library/glob.rst:106 +#: ../../library/glob.rst:83 ../../library/glob.rst:111 msgid "" "This function may return duplicate path names if *pathname* contains " "multiple \"``**``\" patterns and *recursive* is true." msgstr "" -#: ../../library/glob.rst:86 ../../library/glob.rst:109 +#: ../../library/glob.rst:87 ../../library/glob.rst:115 +msgid "" +"Any :exc:`OSError` exceptions raised from scanning the filesystem are " +"suppressed. This includes :exc:`PermissionError` when accessing directories " +"without read permission." +msgstr "" + +#: ../../library/glob.rst:91 ../../library/glob.rst:119 msgid "Support for recursive globs using \"``**``\"." msgstr "支援以 \"``**``\" 使用遞迴 glob。" -#: ../../library/glob.rst:89 ../../library/glob.rst:112 +#: ../../library/glob.rst:94 ../../library/glob.rst:122 msgid "Added the *root_dir* and *dir_fd* parameters." msgstr "新增 *root_dir* 與 *dir_fd* 參數。" -#: ../../library/glob.rst:92 ../../library/glob.rst:115 +#: ../../library/glob.rst:97 ../../library/glob.rst:125 msgid "Added the *include_hidden* parameter." msgstr "新增 *include_hidden* 參數。" -#: ../../library/glob.rst:99 +#: ../../library/glob.rst:104 msgid "" "Return an :term:`iterator` which yields the same values as :func:`glob` " "without actually storing them all simultaneously." @@ -170,7 +177,7 @@ msgstr "" "回傳一個會產生與 :func:`glob` 相同的值的 :term:`iterator` ,而不是同時儲存全" "部的值。" -#: ../../library/glob.rst:121 +#: ../../library/glob.rst:131 msgid "" "Escape all special characters (``'?'``, ``'*'`` and ``'['``). This is useful " "if you want to match an arbitrary literal string that may have special " @@ -183,52 +190,52 @@ msgstr "" "(sharepoints) 中的特殊字元不會被跳脫,例如在 Windows 上,``escape('//?/c:/" "Quo vadis?.txt')`` 會回傳 ``'//?/c:/Quo vadis[?].txt'``。" -#: ../../library/glob.rst:132 +#: ../../library/glob.rst:142 msgid "" "Convert the given path specification to a regular expression for use with :" "func:`re.match`. The path specification can contain shell-style wildcards." msgstr "" -#: ../../library/glob.rst:135 +#: ../../library/glob.rst:145 msgid "For example:" msgstr "舉例來說:" -#: ../../library/glob.rst:146 +#: ../../library/glob.rst:156 msgid "" "Path separators and segments are meaningful to this function, unlike :func:" "`fnmatch.translate`. By default wildcards do not match path separators, and " "``*`` pattern segments match precisely one path segment." msgstr "" -#: ../../library/glob.rst:150 +#: ../../library/glob.rst:160 msgid "" "If *recursive* is true, the pattern segment \"``**``\" will match any number " "of path segments." msgstr "" -#: ../../library/glob.rst:153 +#: ../../library/glob.rst:163 msgid "" "If *include_hidden* is true, wildcards can match path segments that start " "with a dot (``.``)." msgstr "" -#: ../../library/glob.rst:156 +#: ../../library/glob.rst:166 msgid "" "A sequence of path separators may be supplied to the *seps* argument. If not " "given, :data:`os.sep` and :data:`~os.altsep` (if available) are used." msgstr "" -#: ../../library/glob.rst:161 +#: ../../library/glob.rst:171 msgid "" ":meth:`pathlib.PurePath.full_match` and :meth:`pathlib.Path.glob` methods, " "which call this function to implement pattern matching and globbing." msgstr "" -#: ../../library/glob.rst:169 +#: ../../library/glob.rst:179 msgid "Examples" msgstr "範例" -#: ../../library/glob.rst:171 +#: ../../library/glob.rst:181 msgid "" "Consider a directory containing the following files: :file:`1.gif`, :file:`2." "txt`, :file:`card.gif` and a subdirectory :file:`sub` which contains only " @@ -239,7 +246,7 @@ msgstr "" "gif`,和一個僅包含 :file:`3.txt` 檔案的子目錄 :file:`sub`,:func:`glob` 將產" "生以下結果。請注意路徑的任何前導部分是如何保留的。 ::" -#: ../../library/glob.rst:177 +#: ../../library/glob.rst:187 msgid "" ">>> import glob\n" ">>> glob.glob('./[0-9].*')\n" @@ -265,7 +272,7 @@ msgstr "" ">>> glob.glob('./**/', recursive=True)\n" "['./', './sub/']" -#: ../../library/glob.rst:189 +#: ../../library/glob.rst:199 msgid "" "If the directory contains files starting with ``.`` they won't be matched by " "default. For example, consider a directory containing :file:`card.gif` and :" @@ -274,7 +281,7 @@ msgstr "" "如果目錄包含以 ``.`` 開頭的檔案,則預設情況下不會去匹配到它們。例如,一個包" "含 :file:`card.gif` 和 :file:`.card.gif` 的目錄: ::" -#: ../../library/glob.rst:193 +#: ../../library/glob.rst:203 msgid "" ">>> import glob\n" ">>> glob.glob('*.gif')\n" @@ -288,12 +295,12 @@ msgstr "" ">>> glob.glob('.c*')\n" "['.card.gif']" -#: ../../library/glob.rst:200 +#: ../../library/glob.rst:210 msgid "" "The :mod:`fnmatch` module offers shell-style filename (not path) expansion." msgstr ":mod:`fnmatch` 模組提供了 shell 風格檔案名(不是路徑)的擴展" -#: ../../library/glob.rst:203 +#: ../../library/glob.rst:213 msgid "The :mod:`pathlib` module offers high-level path objects." msgstr ":mod:`pathlib` 模組提供高階路徑物件。" diff --git a/library/pathlib.po b/library/pathlib.po index 923ce1c718..94761f70e8 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-12 00:19+0000\n" +"POT-Creation-Date: 2026-04-09 11:50+0000\n" "PO-Revision-Date: 2024-12-23 19:15+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1157,13 +1157,13 @@ msgstr "" ">>> PurePath('/a/b/c.py').match('a/*.py')\n" "False" -#: ../../library/pathlib.rst:624 ../../library/pathlib.rst:1376 -#: ../../library/pathlib.rst:1405 +#: ../../library/pathlib.rst:624 ../../library/pathlib.rst:1381 +#: ../../library/pathlib.rst:1415 msgid "The *pattern* parameter accepts a :term:`path-like object`." msgstr "*pattern* 參數接受\\ :term:`類路徑物件 `。" -#: ../../library/pathlib.rst:627 ../../library/pathlib.rst:1370 -#: ../../library/pathlib.rst:1399 +#: ../../library/pathlib.rst:627 ../../library/pathlib.rst:1375 +#: ../../library/pathlib.rst:1409 msgid "The *case_sensitive* parameter was added." msgstr "新增 *case_sensitive* 參數。" @@ -1881,8 +1881,8 @@ msgstr "" #: ../../library/pathlib.rst:1045 ../../library/pathlib.rst:1075 #: ../../library/pathlib.rst:1089 ../../library/pathlib.rst:1103 -#: ../../library/pathlib.rst:1732 ../../library/pathlib.rst:1748 -#: ../../library/pathlib.rst:1769 +#: ../../library/pathlib.rst:1742 ../../library/pathlib.rst:1758 +#: ../../library/pathlib.rst:1779 msgid "The *follow_symlinks* parameter was added." msgstr "新增 *follow_symlinks* 參數。" @@ -2290,7 +2290,7 @@ msgstr "" " PosixPath('setup.py'),\n" " PosixPath('test_pathlib.py')]" -#: ../../library/pathlib.rst:1353 ../../library/pathlib.rst:1391 +#: ../../library/pathlib.rst:1353 ../../library/pathlib.rst:1396 msgid "" "The paths are returned in no particular order. If you need a specific order, " "sort the results." @@ -2318,7 +2318,17 @@ msgstr "" "候,此方法會跟隨符號連結,除非在擴展 \"``**``\" 萬用字元時。將 " "*recurse_symlinks* 設成 ``True`` 以總是跟隨符號連結。" -#: ../../library/pathlib.rst:1368 +#: ../../library/pathlib.rst:1369 ../../library/pathlib.rst:1400 +#, fuzzy +msgid "" +"Any :exc:`OSError` exceptions raised from scanning the filesystem are " +"suppressed. This includes :exc:`PermissionError` when accessing directories " +"without read permission." +msgstr "" +"從掃描檔案系統引發的任何 :exc:`OSError` 例外都會被抑制。在先前版本中,在許多" +"情況下這種例外都會被抑制,但不是所有情況。" + +#: ../../library/pathlib.rst:1373 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.glob`` with " "arguments ``self``, ``pattern``." @@ -2326,11 +2336,11 @@ msgstr "" "引發一個附帶引數 ``self``、``pattern`` 的\\ :ref:`稽核事件 ` " "``pathlib.Path.glob``。" -#: ../../library/pathlib.rst:1373 ../../library/pathlib.rst:1402 +#: ../../library/pathlib.rst:1378 ../../library/pathlib.rst:1412 msgid "The *recurse_symlinks* parameter was added." msgstr "新增 *recurse_symlinks* 參數。" -#: ../../library/pathlib.rst:1379 +#: ../../library/pathlib.rst:1384 msgid "" "Any :exc:`OSError` exceptions raised from scanning the filesystem are " "suppressed. In previous versions, such exceptions are suppressed in many " @@ -2339,7 +2349,7 @@ msgstr "" "從掃描檔案系統引發的任何 :exc:`OSError` 例外都會被抑制。在先前版本中,在許多" "情況下這種例外都會被抑制,但不是所有情況。" -#: ../../library/pathlib.rst:1387 +#: ../../library/pathlib.rst:1392 msgid "" "Glob the given relative *pattern* recursively. This is like calling :func:" "`Path.glob` with \"``**/``\" added in front of the *pattern*." @@ -2347,11 +2357,11 @@ msgstr "" "遞迴地 glob 給定的相對 *pattern*。這相當於在給定的相對 *pattern* 前面加上 " "\"``**/``\" 並呼叫 :func:`Path.glob`。" -#: ../../library/pathlib.rst:1395 +#: ../../library/pathlib.rst:1405 msgid ":ref:`pathlib-pattern-language` and :meth:`Path.glob` documentation." msgstr ":ref:`pathlib-pattern-language` 和 :meth:`Path.glob` 文件。" -#: ../../library/pathlib.rst:1397 +#: ../../library/pathlib.rst:1407 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.rglob`` with " "arguments ``self``, ``pattern``." @@ -2359,13 +2369,13 @@ msgstr "" "引發一個附帶引數 ``self``、``pattern`` 的\\ :ref:`稽核事件 ` " "``pathlib.Path.rglob``。" -#: ../../library/pathlib.rst:1411 +#: ../../library/pathlib.rst:1421 msgid "" "Generate the file names in a directory tree by walking the tree either top-" "down or bottom-up." msgstr "透過由上而下或由下而上地走訪目錄樹產生目錄樹裡的檔案名稱。" -#: ../../library/pathlib.rst:1414 +#: ../../library/pathlib.rst:1424 msgid "" "For each directory in the directory tree rooted at *self* (including *self* " "but excluding '.' and '..'), the method yields a 3-tuple of ``(dirpath, " @@ -2374,7 +2384,7 @@ msgstr "" "對每個以 *self* 為根且在目錄樹裡的目錄(包含 *self* 但不包含 '.' 和 '..' )," "此方法會 yield 一個 ``(dirpath, dirnames, filenames)`` 的三元素元組。" -#: ../../library/pathlib.rst:1418 +#: ../../library/pathlib.rst:1428 msgid "" "*dirpath* is a :class:`Path` to the directory currently being walked, " "*dirnames* is a list of strings for the names of subdirectories in *dirpath* " @@ -2389,7 +2399,7 @@ msgstr "" "裡檔案或目錄的完整路徑(以 *self* 開頭),可以使用 ``dirpath / name``。會根據" "檔案系統來決定串列是否有排序。" -#: ../../library/pathlib.rst:1426 +#: ../../library/pathlib.rst:1436 msgid "" "If the optional argument *top_down* is true (which is the default), the " "triple for a directory is generated before the triples for any of its " @@ -2405,7 +2415,7 @@ msgstr "" "不論 *top_down* 的值是什麼,子目錄的串列會在走訪該目錄及其子目錄的三元素元組" "之前取得。" -#: ../../library/pathlib.rst:1434 +#: ../../library/pathlib.rst:1444 msgid "" "When *top_down* is true, the caller can modify the *dirnames* list in-place " "(for example, using :keyword:`del` or slice assignment), and :meth:`Path." @@ -2425,7 +2435,7 @@ msgstr "" "*dirnames* 對 :meth:`Path.walk` 的行為沒有影響,因為 *dirnames* 裡的目錄已經" "在 *dirnames* yield 給呼叫者之前被產生。" -#: ../../library/pathlib.rst:1444 +#: ../../library/pathlib.rst:1454 msgid "" "By default, errors from :func:`os.scandir` are ignored. If the optional " "argument *on_error* is specified, it should be a callable; it will be called " @@ -2438,7 +2448,7 @@ msgstr "" "這個可呼叫物件可以處理錯誤以繼續走訪,或者再次引發錯誤來停止走訪。注意,檔案" "名稱可以從例外物件的 ``filename`` 屬性來取得。" -#: ../../library/pathlib.rst:1450 +#: ../../library/pathlib.rst:1460 msgid "" "By default, :meth:`Path.walk` does not follow symbolic links, and instead " "adds them to the *filenames* list. Set *follow_symlinks* to true to resolve " @@ -2451,7 +2461,7 @@ msgstr "" "適當的 *dirnames* 和 *filenames*,而因此瀏覽到符號連結指向的目錄(在有支援符" "號連結的地方)。" -#: ../../library/pathlib.rst:1457 +#: ../../library/pathlib.rst:1467 msgid "" "Be aware that setting *follow_symlinks* to true can lead to infinite " "recursion if a link points to a parent directory of itself. :meth:`Path." @@ -2460,7 +2470,7 @@ msgstr "" "需要注意的是如果符號連結指向一個其本身的父目錄,則將 *follow_symlinks* 設定" "為 true 會導致無窮的遞迴。:meth:`Path.walk` 不會紀錄其已經瀏覽過的目錄。" -#: ../../library/pathlib.rst:1462 +#: ../../library/pathlib.rst:1472 msgid "" ":meth:`Path.walk` assumes the directories it walks are not modified during " "execution. For example, if a directory from *dirnames* has been replaced " @@ -2473,7 +2483,7 @@ msgstr "" "meth:`Path.walk` 依然會試著往下進入它。為了防止這樣的行為,可以從 *dirnames* " "適當地移除目錄。" -#: ../../library/pathlib.rst:1470 +#: ../../library/pathlib.rst:1480 msgid "" "Unlike :func:`os.walk`, :meth:`Path.walk` lists symlinks to directories in " "*filenames* if *follow_symlinks* is false." @@ -2481,7 +2491,7 @@ msgstr "" "如果 *follow_symlinks* 是 false,和 :func:`os.walk` 行為不同的是 :meth:`Path." "walk` 會將指向目錄的符號連結放在 *filenames* 串列。" -#: ../../library/pathlib.rst:1473 +#: ../../library/pathlib.rst:1483 msgid "" "This example displays the number of bytes used by all files in each " "directory, while ignoring ``__pycache__`` directories::" @@ -2489,7 +2499,7 @@ msgstr "" "這個範例會顯示在每個目錄裡所有檔案使用的位元組數量,同時間忽略 " "``__pycache__`` 目錄: ::" -#: ../../library/pathlib.rst:1476 +#: ../../library/pathlib.rst:1486 msgid "" "from pathlib import Path\n" "for root, dirs, files in Path(\"cpython/Lib/concurrent\")." @@ -2519,7 +2529,7 @@ msgstr "" " if '__pycache__' in dirs:\n" " dirs.remove('__pycache__')" -#: ../../library/pathlib.rst:1489 +#: ../../library/pathlib.rst:1499 msgid "" "This next example is a simple implementation of :func:`shutil.rmtree`. " "Walking the tree bottom-up is essential as :func:`rmdir` doesn't allow " @@ -2528,7 +2538,7 @@ msgstr "" "下一個範例是 :func:`shutil.rmtree` 的一個簡單的實作方式。由下而上走訪目錄樹是" "必要的,因為 :func:`rmdir` 不允許在目錄為空之前刪除它: ::" -#: ../../library/pathlib.rst:1493 +#: ../../library/pathlib.rst:1503 msgid "" "# Delete everything reachable from the directory \"top\".\n" "# CAUTION: This is dangerous! For example, if top == Path('/'),\n" @@ -2548,11 +2558,11 @@ msgstr "" " for name in dirs:\n" " (root / name).rmdir()" -#: ../../library/pathlib.rst:1506 +#: ../../library/pathlib.rst:1516 msgid "Creating files and directories" msgstr "建立檔案和目錄" -#: ../../library/pathlib.rst:1510 +#: ../../library/pathlib.rst:1520 msgid "" "Create a file at this given path. If *mode* is given, it is combined with " "the process's ``umask`` value to determine the file mode and access flags. " @@ -2564,7 +2574,7 @@ msgstr "" "合,以確定檔案模式和存取旗標。當檔案已經存在時,若 *exist_ok* 為 true 則函式" "不會失敗(其變更時間會被更新為當下時間),否則會引發 :exc:`FileExistsError`。" -#: ../../library/pathlib.rst:1517 +#: ../../library/pathlib.rst:1527 msgid "" "The :meth:`~Path.open`, :meth:`~Path.write_text` and :meth:`~Path." "write_bytes` methods are often used to create files." @@ -2572,7 +2582,7 @@ msgstr "" ":meth:`~Path.open`、:meth:`~Path.write_text` 和 :meth:`~Path.write_bytes` 方" "法通常用於建立檔案。" -#: ../../library/pathlib.rst:1523 +#: ../../library/pathlib.rst:1533 msgid "" "Create a new directory at this given path. If *mode* is given, it is " "combined with the process's ``umask`` value to determine the file mode and " @@ -2582,7 +2592,7 @@ msgstr "" "``umask`` 值來決定檔案模式與存取旗標 (access flag)。如果路徑已經存在,會引" "發 :exc:`FileExistsError`。" -#: ../../library/pathlib.rst:1528 +#: ../../library/pathlib.rst:1538 msgid "" "If *parents* is true, any missing parents of this path are created as " "needed; they are created with the default permissions without taking *mode* " @@ -2591,7 +2601,7 @@ msgstr "" "如果 *parents* 是 true,則任何缺少的父路徑都會依需要被建立;它們不考慮 " "*mode* 而會以預設的權限來建立(模仿 POSIX 的 ``mkdir -p`` 指令)。" -#: ../../library/pathlib.rst:1532 +#: ../../library/pathlib.rst:1542 msgid "" "If *parents* is false (the default), a missing parent raises :exc:" "`FileNotFoundError`." @@ -2599,7 +2609,7 @@ msgstr "" "如果 *parents* 是 false(預設值),缺少的父路徑會引發 :exc:" "`FileNotFoundError`。" -#: ../../library/pathlib.rst:1535 +#: ../../library/pathlib.rst:1545 msgid "" "If *exist_ok* is false (the default), :exc:`FileExistsError` is raised if " "the target directory already exists." @@ -2607,7 +2617,7 @@ msgstr "" "如果 *exist_ok* 是 false(預設值),則當目標目錄已經存在的話會引發 :exc:" "`FileExistsError`。" -#: ../../library/pathlib.rst:1538 +#: ../../library/pathlib.rst:1548 msgid "" "If *exist_ok* is true, :exc:`FileExistsError` will not be raised unless the " "given path already exists in the file system and is not a directory (same " @@ -2616,15 +2626,15 @@ msgstr "" "如果 *exist_ok* 是 true,只有當最後的路徑組成不是一個已存在的非目錄檔案,:" "exc:`FileExistsError` 例外會被忽略(與 POSIX 的 ``mkdir -p`` 指令行為相同)。" -#: ../../library/pathlib.rst:1542 +#: ../../library/pathlib.rst:1552 msgid "The *exist_ok* parameter was added." msgstr "新增 *exist_ok* 參數。" -#: ../../library/pathlib.rst:1548 +#: ../../library/pathlib.rst:1558 msgid "Make this path a symbolic link pointing to *target*." msgstr "使這個路徑成為一個指向 *target* 的符號連結。" -#: ../../library/pathlib.rst:1550 +#: ../../library/pathlib.rst:1560 msgid "" "On Windows, a symlink represents either a file or a directory, and does not " "morph to the target dynamically. If the target is present, the type of the " @@ -2637,7 +2647,7 @@ msgstr "" "*target_is_directory* 是 true,該符號連結會被建立成目錄,如果不是則建立成檔案" "(預設值)。在非 Windows 平台上,*target_is_directory* 會被忽略。" -#: ../../library/pathlib.rst:1558 +#: ../../library/pathlib.rst:1568 msgid "" ">>> p = Path('mylink')\n" ">>> p.symlink_to('setup.py')\n" @@ -2657,12 +2667,12 @@ msgstr "" ">>> p.lstat().st_size\n" "8" -#: ../../library/pathlib.rst:1568 +#: ../../library/pathlib.rst:1578 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.symlink`'s." msgstr "引數的順序 (link, target) 和 :func:`os.symlink` 相反。" -#: ../../library/pathlib.rst:1571 +#: ../../library/pathlib.rst:1581 msgid "" "Raises :exc:`UnsupportedOperation` if :func:`os.symlink` is not available. " "In previous versions, :exc:`NotImplementedError` was raised." @@ -2670,16 +2680,16 @@ msgstr "" "如果 :func:`os.symlink` 不可用,會引發 :exc:`UnsupportedOperation`。在先前版" "本中,則是引發 :exc:`NotImplementedError`。" -#: ../../library/pathlib.rst:1578 +#: ../../library/pathlib.rst:1588 msgid "Make this path a hard link to the same file as *target*." msgstr "使這個路徑成為與 *target* 相同檔案的一個硬連結 (hard link)。" -#: ../../library/pathlib.rst:1581 +#: ../../library/pathlib.rst:1591 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.link`'s." msgstr "引數的順序 (link, target) 和 :func:`os.link` 相反。" -#: ../../library/pathlib.rst:1586 +#: ../../library/pathlib.rst:1596 msgid "" "Raises :exc:`UnsupportedOperation` if :func:`os.link` is not available. In " "previous versions, :exc:`NotImplementedError` was raised." @@ -2687,11 +2697,11 @@ msgstr "" "如果 :func:`os.link` 不可用,會引發 :exc:`UnsupportedOperation`。在先前版本" "中,則是引發 :exc:`NotImplementedError`。" -#: ../../library/pathlib.rst:1592 +#: ../../library/pathlib.rst:1602 msgid "Copying, moving and deleting" msgstr "複製、移動和刪除" -#: ../../library/pathlib.rst:1596 +#: ../../library/pathlib.rst:1606 msgid "" "Copy this file or directory tree to the given *target*, and return a new :" "class:`!Path` instance pointing to *target*." @@ -2699,7 +2709,7 @@ msgstr "" "將此檔案或目錄樹複製到給定的 *target*,並回傳一個指向 *target* 的新 :class:`!" "Path` 實例。" -#: ../../library/pathlib.rst:1599 +#: ../../library/pathlib.rst:1609 msgid "" "If the source is a file, the target will be replaced if it is an existing " "file. If the source is a symlink and *follow_symlinks* is true (the " @@ -2707,7 +2717,7 @@ msgid "" "recreated at the destination." msgstr "" -#: ../../library/pathlib.rst:1604 +#: ../../library/pathlib.rst:1614 msgid "" "If *preserve_metadata* is false (the default), only directory structures and " "file data are guaranteed to be copied. Set *preserve_metadata* to true to " @@ -2717,21 +2727,21 @@ msgid "" "always preserved)." msgstr "" -#: ../../library/pathlib.rst:1612 +#: ../../library/pathlib.rst:1622 msgid "" "Where supported by the operating system and file system, this method " "performs a lightweight copy, where data blocks are only copied when " "modified. This is known as copy-on-write." msgstr "" -#: ../../library/pathlib.rst:1622 +#: ../../library/pathlib.rst:1632 msgid "" "Copy this file or directory tree into the given *target_dir*, which should " "be an existing directory. Other arguments are handled identically to :meth:" "`Path.copy`. Returns a new :class:`!Path` instance pointing to the copy." msgstr "" -#: ../../library/pathlib.rst:1632 +#: ../../library/pathlib.rst:1642 msgid "" "Rename this file or directory to the given *target*, and return a new :class:" "`!Path` instance pointing to *target*. On Unix, if *target* exists and is a " @@ -2744,7 +2754,7 @@ msgstr "" "限,則會在不顯示訊息的情況下進行取代。在 Windows 系統上,若 *target* 存在,則" "會引發 :exc:`FileExistsError` 錯誤。*target* 可以是字串或另一個路徑物件: ::" -#: ../../library/pathlib.rst:1638 +#: ../../library/pathlib.rst:1648 msgid "" ">>> p = Path('foo')\n" ">>> p.open('w').write('some text')\n" @@ -2764,7 +2774,7 @@ msgstr "" ">>> target.open().read()\n" "'some text'" -#: ../../library/pathlib.rst:1647 ../../library/pathlib.rst:1663 +#: ../../library/pathlib.rst:1657 ../../library/pathlib.rst:1673 msgid "" "The target path may be absolute or relative. Relative paths are interpreted " "relative to the current working directory, *not* the directory of the :class:" @@ -2773,17 +2783,17 @@ msgstr "" "目標路徑可以是絕對路徑或相對路徑。相對路徑會相對於目前的工作目錄進行解釋,*而" "不是*\\ 相對於 :class:`!Path` 物件所在的目錄。" -#: ../../library/pathlib.rst:1651 +#: ../../library/pathlib.rst:1661 msgid "" "It is implemented in terms of :func:`os.rename` and gives the same " "guarantees." msgstr "此功能是使用 :func:`os.rename` 實現的,並提供相同的保證。" -#: ../../library/pathlib.rst:1653 ../../library/pathlib.rst:1667 +#: ../../library/pathlib.rst:1663 ../../library/pathlib.rst:1677 msgid "Added return value, return the new :class:`!Path` instance." msgstr "新增了回傳值,回傳新的 :class:`!Path` 實例。" -#: ../../library/pathlib.rst:1659 +#: ../../library/pathlib.rst:1669 msgid "" "Rename this file or directory to the given *target*, and return a new :class:" "`!Path` instance pointing to *target*. If *target* points to an existing " @@ -2792,7 +2802,7 @@ msgstr "" "將此檔案或目錄重新命名為給定的 *target*,並回傳一個指向 *target* 的新 :class:" "`!Path` 實例。如果 *target* 指向一個現有的檔案或空目錄,它將被無條件地取代。" -#: ../../library/pathlib.rst:1673 +#: ../../library/pathlib.rst:1683 msgid "" "Move this file or directory tree to the given *target*, and return a new :" "class:`!Path` instance pointing to *target*." @@ -2800,7 +2810,7 @@ msgstr "" "將此檔案或目錄樹移動到給定的 *target*,並回傳一個指向 *target* 的新 :class:`!" "Path` 實例。" -#: ../../library/pathlib.rst:1676 +#: ../../library/pathlib.rst:1686 msgid "" "If the *target* doesn't exist it will be created. If both this path and the " "*target* are existing files, then the target is overwritten. If both paths " @@ -2808,27 +2818,27 @@ msgid "" "directory, then :exc:`OSError` is raised." msgstr "" -#: ../../library/pathlib.rst:1681 +#: ../../library/pathlib.rst:1691 msgid "" "If both paths are on the same filesystem, the move is performed with :func:" "`os.replace`. Otherwise, this path is copied (preserving metadata and " "symlinks) and then deleted." msgstr "" -#: ../../library/pathlib.rst:1690 +#: ../../library/pathlib.rst:1700 msgid "" "Move this file or directory tree into the given *target_dir*, which should " "be an existing directory. Returns a new :class:`!Path` instance pointing to " "the moved path." msgstr "" -#: ../../library/pathlib.rst:1699 +#: ../../library/pathlib.rst:1709 msgid "" "Remove this file or symbolic link. If the path points to a directory, use :" "func:`Path.rmdir` instead." msgstr "移除這個檔案或符號連結。如果路徑指向目錄,請改用 :func:`Path.rmdir`。" -#: ../../library/pathlib.rst:1702 +#: ../../library/pathlib.rst:1712 msgid "" "If *missing_ok* is false (the default), :exc:`FileNotFoundError` is raised " "if the path does not exist." @@ -2836,7 +2846,7 @@ msgstr "" "如果 *missing_ok* 是 false(預設值),:exc:`FileNotFoundError` 會在路徑不存在" "時被引發。" -#: ../../library/pathlib.rst:1705 +#: ../../library/pathlib.rst:1715 msgid "" "If *missing_ok* is true, :exc:`FileNotFoundError` exceptions will be ignored " "(same behavior as the POSIX ``rm -f`` command)." @@ -2844,19 +2854,19 @@ msgstr "" "如果 *missing_ok* 是 true,:exc:`FileNotFoundError` 例外會被忽略(行為與 " "POSIX ``rm -f`` 指令相同)。" -#: ../../library/pathlib.rst:1708 +#: ../../library/pathlib.rst:1718 msgid "The *missing_ok* parameter was added." msgstr "新增 *missing_ok* 參數。" -#: ../../library/pathlib.rst:1714 +#: ../../library/pathlib.rst:1724 msgid "Remove this directory. The directory must be empty." msgstr "移除此目錄。該目錄必須為空。" -#: ../../library/pathlib.rst:1718 +#: ../../library/pathlib.rst:1728 msgid "Permissions and ownership" msgstr "權限和所有權" -#: ../../library/pathlib.rst:1722 +#: ../../library/pathlib.rst:1732 msgid "" "Return the name of the user owning the file. :exc:`KeyError` is raised if " "the file's user identifier (UID) isn't found in the system database." @@ -2864,7 +2874,7 @@ msgstr "" "回傳擁有該檔案的用戶名稱。如果在系統資料庫中找不到該檔案的使用者識別字 " "(UID),則會引發 :exc:`KeyError`。" -#: ../../library/pathlib.rst:1725 +#: ../../library/pathlib.rst:1735 msgid "" "This method normally follows symlinks; to get the owner of the symlink, add " "the argument ``follow_symlinks=False``." @@ -2872,7 +2882,7 @@ msgstr "" "此方法通常會跟隨符號連結;如果想取得符號連結的擁有者,可以加上引數 " "``follow_symlinks=False``。" -#: ../../library/pathlib.rst:1728 +#: ../../library/pathlib.rst:1738 msgid "" "Raises :exc:`UnsupportedOperation` if the :mod:`pwd` module is not " "available. In earlier versions, :exc:`NotImplementedError` was raised." @@ -2880,7 +2890,7 @@ msgstr "" "如果 :mod:`pwd` 模組不可用,會引發 :exc:`UnsupportedOperation`。在先前版本" "中,則是引發 :exc:`NotImplementedError`。" -#: ../../library/pathlib.rst:1738 +#: ../../library/pathlib.rst:1748 msgid "" "Return the name of the group owning the file. :exc:`KeyError` is raised if " "the file's group identifier (GID) isn't found in the system database." @@ -2888,7 +2898,7 @@ msgstr "" "回傳擁有該檔案的群組名稱。如果在系統資料庫裡找不到檔案的群組識別字 (GID) 會引" "發 :exc:`KeyError`。" -#: ../../library/pathlib.rst:1741 +#: ../../library/pathlib.rst:1751 msgid "" "This method normally follows symlinks; to get the group of the symlink, add " "the argument ``follow_symlinks=False``." @@ -2896,7 +2906,7 @@ msgstr "" "此方法通常會跟隨符號連結;如果想取得符號連結的群組,可以加上引數 " "``follow_symlinks=False``。" -#: ../../library/pathlib.rst:1744 +#: ../../library/pathlib.rst:1754 msgid "" "Raises :exc:`UnsupportedOperation` if the :mod:`grp` module is not " "available. In earlier versions, :exc:`NotImplementedError` was raised." @@ -2904,11 +2914,11 @@ msgstr "" "如果 :mod:`grp` 模組不可用,會引發 :exc:`UnsupportedOperation`。在先前版本" "中,則是引發 :exc:`NotImplementedError`。" -#: ../../library/pathlib.rst:1754 +#: ../../library/pathlib.rst:1764 msgid "Change the file mode and permissions, like :func:`os.chmod`." msgstr "修改檔案模式 (file mode) 與權限,像 :func:`os.chmod` 一樣。" -#: ../../library/pathlib.rst:1756 +#: ../../library/pathlib.rst:1766 msgid "" "This method normally follows symlinks. Some Unix flavours support changing " "permissions on the symlink itself; on these platforms you may add the " @@ -2917,7 +2927,7 @@ msgstr "" "此方法通常會跟隨符號連結。一些 Unix 類型支援修改符號連結本身的權限;在這些平" "台上你可以加上引數 ``follow_symlinks=False`` 或使用 :meth:`~Path.lchmod`。" -#: ../../library/pathlib.rst:1762 +#: ../../library/pathlib.rst:1772 msgid "" ">>> p = Path('setup.py')\n" ">>> p.stat().st_mode\n" @@ -2933,7 +2943,7 @@ msgstr "" ">>> p.stat().st_mode\n" "33060" -#: ../../library/pathlib.rst:1775 +#: ../../library/pathlib.rst:1785 msgid "" "Like :meth:`Path.chmod` but, if the path points to a symbolic link, the " "symbolic link's mode is changed rather than its target's." @@ -2941,11 +2951,11 @@ msgstr "" "類似 :meth:`Path.chmod`,但如果該路徑指向一個符號連結,則符號連結的模式 " "(mode) 會被改變而不是其指向的目標。" -#: ../../library/pathlib.rst:1782 +#: ../../library/pathlib.rst:1792 msgid "Pattern language" msgstr "模式語言 (pattern language)" -#: ../../library/pathlib.rst:1784 +#: ../../library/pathlib.rst:1794 msgid "" "The following wildcards are supported in patterns for :meth:`~PurePath." "full_match`, :meth:`~Path.glob` and :meth:`~Path.rglob`:" @@ -2953,43 +2963,43 @@ msgstr "" "以下的萬用字元在 :meth:`~PurePath.full_match`、:meth:`~Path.glob` 和 :meth:" "`~Path.rglob` 的模式中被支援:" -#: ../../library/pathlib.rst:1787 +#: ../../library/pathlib.rst:1797 msgid "``**`` (entire segment)" msgstr "``**``\\(整個片段)" -#: ../../library/pathlib.rst:1788 +#: ../../library/pathlib.rst:1798 msgid "Matches any number of file or directory segments, including zero." msgstr "匹配任何數量的檔案或目錄片段,包括零個。" -#: ../../library/pathlib.rst:1789 +#: ../../library/pathlib.rst:1799 msgid "``*`` (entire segment)" msgstr "``*``\\(整個片段)" -#: ../../library/pathlib.rst:1790 +#: ../../library/pathlib.rst:1800 msgid "Matches one file or directory segment." msgstr "匹配一個檔案或目錄的片段。" -#: ../../library/pathlib.rst:1791 +#: ../../library/pathlib.rst:1801 msgid "``*`` (part of a segment)" msgstr "``*``\\(片段的一部分)" -#: ../../library/pathlib.rst:1792 +#: ../../library/pathlib.rst:1802 msgid "Matches any number of non-separator characters, including zero." msgstr "匹配任意數量的非分隔字元,包括零個。" -#: ../../library/pathlib.rst:1793 +#: ../../library/pathlib.rst:1803 msgid "``?``" msgstr "``?``" -#: ../../library/pathlib.rst:1794 +#: ../../library/pathlib.rst:1804 msgid "Matches one non-separator character." msgstr "匹配一個非分隔字元。" -#: ../../library/pathlib.rst:1795 +#: ../../library/pathlib.rst:1805 msgid "``[seq]``" msgstr "``[seq]``" -#: ../../library/pathlib.rst:1796 +#: ../../library/pathlib.rst:1806 msgid "" "Matches one character in *seq*, where *seq* is a sequence of characters. " "Range expressions are supported; for example, ``[a-z]`` matches any " @@ -2997,17 +3007,17 @@ msgid "" "matches any ASCII letter, digit, or underscore." msgstr "" -#: ../../library/pathlib.rst:1800 +#: ../../library/pathlib.rst:1810 msgid "``[!seq]``" msgstr "``[!seq]``" -#: ../../library/pathlib.rst:1801 +#: ../../library/pathlib.rst:1811 msgid "" "Matches one character not in *seq*, where *seq* follows the same rules as " "above." msgstr "匹配一個不在 *seq* 中的字元,其中 *seq* 遵循上述相同的規則。" -#: ../../library/pathlib.rst:1803 +#: ../../library/pathlib.rst:1813 msgid "" "For a literal match, wrap the meta-characters in brackets. For example, " "``\"[?]\"`` matches the character ``\"?\"``." @@ -3015,52 +3025,52 @@ msgstr "" "對於文本 (literal) 匹配,可以用方括號包裝元字元 (meta-characters)。例如," "``\"[?]\"`` 會匹配字元 ``\"?\"``。" -#: ../../library/pathlib.rst:1806 +#: ../../library/pathlib.rst:1816 msgid "The \"``**``\" wildcard enables recursive globbing. A few examples:" msgstr "\"``**``\" 萬用字元讓它可以做遞迴 glob。例如:" -#: ../../library/pathlib.rst:1809 +#: ../../library/pathlib.rst:1819 msgid "Pattern" msgstr "模式" -#: ../../library/pathlib.rst:1809 +#: ../../library/pathlib.rst:1819 msgid "Meaning" msgstr "意涵" -#: ../../library/pathlib.rst:1811 +#: ../../library/pathlib.rst:1821 msgid "\"``**/*``\"" msgstr "\"``**/*``\"" -#: ../../library/pathlib.rst:1811 +#: ../../library/pathlib.rst:1821 msgid "Any path with at least one segment." msgstr "至少有一個片段的路徑。" -#: ../../library/pathlib.rst:1812 +#: ../../library/pathlib.rst:1822 msgid "\"``**/*.py``\"" msgstr "\"``**/*.py``\"" -#: ../../library/pathlib.rst:1812 +#: ../../library/pathlib.rst:1822 msgid "Any path with a final segment ending \"``.py``\"." msgstr "最後一個片段以 \"``.py``\" 結尾的任何路徑。" -#: ../../library/pathlib.rst:1813 +#: ../../library/pathlib.rst:1823 msgid "\"``assets/**``\"" msgstr "\"``assets/**``\"" -#: ../../library/pathlib.rst:1813 +#: ../../library/pathlib.rst:1823 msgid "Any path starting with \"``assets/``\"." msgstr "任何以 \"``assets/``\" 開頭的路徑。" -#: ../../library/pathlib.rst:1814 +#: ../../library/pathlib.rst:1824 msgid "\"``assets/**/*``\"" msgstr "\"``assets/**/*``\"" -#: ../../library/pathlib.rst:1814 +#: ../../library/pathlib.rst:1824 msgid "" "Any path starting with \"``assets/``\", excluding \"``assets/``\" itself." msgstr "任何以 \"``assets/``\" 開頭的路徑,不包括 \"``assets/``\" 本身。" -#: ../../library/pathlib.rst:1818 +#: ../../library/pathlib.rst:1828 msgid "" "Globbing with the \"``**``\" wildcard visits every directory in the tree. " "Large directory trees may take a long time to search." @@ -3068,7 +3078,7 @@ msgstr "" "Glob 使用 ``**`` 萬用字元會訪問目錄樹中的每個目錄。對於大型的目錄樹,搜尋可能" "需要花費很長的時間。" -#: ../../library/pathlib.rst:1821 +#: ../../library/pathlib.rst:1831 msgid "" "Globbing with a pattern that ends with \"``**``\" returns both files and " "directories. In previous versions, only directories were returned." @@ -3076,7 +3086,7 @@ msgstr "" "Glob 使用結尾為 ``**`` 的模式會同時回傳檔案和目錄。在先前版本中,只會回傳目" "錄。" -#: ../../library/pathlib.rst:1825 +#: ../../library/pathlib.rst:1835 msgid "" "In :meth:`Path.glob` and :meth:`~Path.rglob`, a trailing slash may be added " "to the pattern to match only directories." @@ -3084,7 +3094,7 @@ msgstr "" "在 :meth:`Path.glob` 和 :meth:`~Path.rglob` 中,可以在模式後面加上斜線以只匹" "配目錄。" -#: ../../library/pathlib.rst:1828 +#: ../../library/pathlib.rst:1838 msgid "" "Globbing with a pattern that ends with a pathname components separator (:" "data:`~os.sep` or :data:`~os.altsep`) returns only directories." @@ -3092,11 +3102,11 @@ msgstr "" "Glob 使用以路徑名稱組成的分隔符號(:data:`~os.sep` 或 :data:`~os.altsep`)作" "結尾的模式則只會回傳目錄。" -#: ../../library/pathlib.rst:1834 +#: ../../library/pathlib.rst:1844 msgid "Comparison to the :mod:`glob` module" msgstr "與 :mod:`glob` 模組的比較" -#: ../../library/pathlib.rst:1836 +#: ../../library/pathlib.rst:1846 msgid "" "The patterns accepted and results generated by :meth:`Path.glob` and :meth:" "`Path.rglob` differ slightly from those by the :mod:`glob` module:" @@ -3104,7 +3114,7 @@ msgstr "" ":meth:`Path.glob` 和 :meth:`Path.rglob` 接受的模式和產生的結果與 :mod:`glob` " "模組略有不同:" -#: ../../library/pathlib.rst:1839 +#: ../../library/pathlib.rst:1849 msgid "" "Files beginning with a dot are not special in pathlib. This is like passing " "``include_hidden=True`` to :func:`glob.glob`." @@ -3112,7 +3122,7 @@ msgstr "" "pathlib 中以點開頭的檔案並不特別。這和將 ``include_hidden=True`` 傳遞給 :" "func:`glob.glob` 相同。" -#: ../../library/pathlib.rst:1841 +#: ../../library/pathlib.rst:1851 msgid "" "\"``**``\" pattern components are always recursive in pathlib. This is like " "passing ``recursive=True`` to :func:`glob.glob`." @@ -3120,7 +3130,7 @@ msgstr "" "``**`` 模式組成在 pathlib 中總是遞迴的。這與將 ``recursive=True`` 傳遞給 :" "func:`glob.glob` 相同。" -#: ../../library/pathlib.rst:1843 +#: ../../library/pathlib.rst:1853 msgid "" "\"``**``\" pattern components do not follow symlinks by default in pathlib. " "This behaviour has no equivalent in :func:`glob.glob`, but you can pass " @@ -3130,7 +3140,7 @@ msgstr "" "有等效的行為,但你可以將 ``recurse_symlinks=True`` 傳遞給 :meth:`Path.glob` " "以獲得相容的行為。" -#: ../../library/pathlib.rst:1846 +#: ../../library/pathlib.rst:1856 msgid "" "Like all :class:`PurePath` and :class:`Path` objects, the values returned " "from :meth:`Path.glob` and :meth:`Path.rglob` don't include trailing slashes." @@ -3138,7 +3148,7 @@ msgstr "" "與所有 :class:`PurePath` 和 :class:`Path` 物件一樣,從 :meth:`Path.glob` 和 :" "meth:`Path.rglob` 回傳的值不包含結尾斜線。" -#: ../../library/pathlib.rst:1849 +#: ../../library/pathlib.rst:1859 msgid "" "The values returned from pathlib's ``path.glob()`` and ``path.rglob()`` " "include the *path* as a prefix, unlike the results of ``glob." @@ -3147,7 +3157,7 @@ msgstr "" "pathlib 的 ``path.glob()`` 和 ``path.rglob()`` 回傳的值包含了 *path* 作為前" "綴,而 ``glob.glob(root_dir=path)`` 的結果則不會如此。" -#: ../../library/pathlib.rst:1852 +#: ../../library/pathlib.rst:1862 msgid "" "The values returned from pathlib's ``path.glob()`` and ``path.rglob()`` may " "include *path* itself, for example when globbing \"``**``\", whereas the " @@ -3158,11 +3168,11 @@ msgstr "" "例如當使用 \"``**``\" 做 glob 的時候,然而 ``glob.glob(root_dir=path)`` 的結" "果則永遠不會包含一個對應到 *path* 的空字串。" -#: ../../library/pathlib.rst:1859 +#: ../../library/pathlib.rst:1869 msgid "Comparison to the :mod:`os` and :mod:`os.path` modules" msgstr "與 :mod:`os` 和 :mod:`os.path` 模組的比較" -#: ../../library/pathlib.rst:1861 +#: ../../library/pathlib.rst:1871 msgid "" "pathlib implements path operations using :class:`PurePath` and :class:`Path` " "objects, and so it's said to be *object-oriented*. On the other hand, the :" @@ -3175,7 +3185,7 @@ msgstr "" "與底層 ``str`` 和 ``bytes`` 物件互動的函式,這是一種更\\ *程序式*\\ 的方法。" "有些使用者認為物件導向的風格更易讀。" -#: ../../library/pathlib.rst:1867 +#: ../../library/pathlib.rst:1877 msgid "" "Many functions in :mod:`os` and :mod:`os.path` support ``bytes`` paths and :" "ref:`paths relative to directory descriptors `. These features " @@ -3185,7 +3195,7 @@ msgstr "" "徑的目錄描述器 (paths relative to directory descriptors) `。這些功能" "在 pathlib 中不可用。" -#: ../../library/pathlib.rst:1871 +#: ../../library/pathlib.rst:1881 msgid "" "Python's ``str`` and ``bytes`` types, and portions of the :mod:`os` and :mod:" "`os.path` modules, are written in C and are very speedy. pathlib is written " @@ -3195,7 +3205,7 @@ msgstr "" "一些部分,是用 C 寫的且非常快速。pathlib 是用純 Python 寫的且通常比較慢,但很" "少會慢到足以產生影響。" -#: ../../library/pathlib.rst:1875 +#: ../../library/pathlib.rst:1885 msgid "" "pathlib's path normalization is slightly more opinionated and consistent " "than :mod:`os.path`. For example, whereas :func:`os.path.abspath` eliminates " @@ -3207,12 +3217,12 @@ msgstr "" "path.abspath` 會從路徑中移除 \"``..``\" 片段,如果包含符號連結的話這可能會改" "變其意義,而 :meth:`Path.absolute` 則會保留這些片段以增加安全性。" -#: ../../library/pathlib.rst:1880 +#: ../../library/pathlib.rst:1890 msgid "" "pathlib's path normalization may render it unsuitable for some applications:" msgstr "pathlib 的路徑正規化可能會使它不適合某些應用程式:" -#: ../../library/pathlib.rst:1882 +#: ../../library/pathlib.rst:1892 msgid "" "pathlib normalizes ``Path(\"my_folder/\")`` to ``Path(\"my_folder\")``, " "which changes a path's meaning when supplied to various operating system " @@ -3224,7 +3234,7 @@ msgstr "" "提供給各種作業系統 API 和命令列工具時改變路徑的意義。具體來說,缺少結尾分隔符" "號可能會允許該路徑被解析為檔案或目錄,而不只是目錄。" -#: ../../library/pathlib.rst:1887 +#: ../../library/pathlib.rst:1897 msgid "" "pathlib normalizes ``Path(\"./my_program\")`` to ``Path(\"my_program\")``, " "which changes a path's meaning when used as an executable search path, such " @@ -3237,17 +3247,17 @@ msgstr "" "程時。具體來說,在路徑中缺少分隔符號可能會使其強制在 :envvar:`PATH` 中尋找," "而不是目前目錄。" -#: ../../library/pathlib.rst:1893 +#: ../../library/pathlib.rst:1903 msgid "" "As a consequence of these differences, pathlib is not a drop-in replacement " "for :mod:`os.path`." msgstr "因為這些差異,pathlib 不是 :mod:`os.path` 的直接替代品。" -#: ../../library/pathlib.rst:1898 +#: ../../library/pathlib.rst:1908 msgid "Corresponding tools" msgstr "對應工具" -#: ../../library/pathlib.rst:1900 +#: ../../library/pathlib.rst:1910 msgid "" "Below is a table mapping various :mod:`os` functions to their corresponding :" "class:`PurePath`/:class:`Path` equivalent." @@ -3255,267 +3265,267 @@ msgstr "" "以下是一張表格,對應許多 :mod:`os` 函式及其相符於 :class:`PurePath`/:class:" "`Path` 的項目。" -#: ../../library/pathlib.rst:1904 +#: ../../library/pathlib.rst:1914 msgid ":mod:`os` and :mod:`os.path`" msgstr ":mod:`os` 和 :mod:`os.path`" -#: ../../library/pathlib.rst:1904 +#: ../../library/pathlib.rst:1914 msgid ":mod:`!pathlib`" msgstr ":mod:`!pathlib`" -#: ../../library/pathlib.rst:1906 +#: ../../library/pathlib.rst:1916 msgid ":func:`os.path.dirname`" msgstr ":func:`os.path.dirname`" -#: ../../library/pathlib.rst:1906 +#: ../../library/pathlib.rst:1916 msgid ":attr:`PurePath.parent`" msgstr ":attr:`PurePath.parent`" -#: ../../library/pathlib.rst:1907 +#: ../../library/pathlib.rst:1917 msgid ":func:`os.path.basename`" msgstr ":func:`os.path.basename`" -#: ../../library/pathlib.rst:1907 +#: ../../library/pathlib.rst:1917 msgid ":attr:`PurePath.name`" msgstr ":attr:`PurePath.name`" -#: ../../library/pathlib.rst:1908 +#: ../../library/pathlib.rst:1918 msgid ":func:`os.path.splitext`" msgstr ":func:`os.path.splitext`" -#: ../../library/pathlib.rst:1908 +#: ../../library/pathlib.rst:1918 msgid ":attr:`PurePath.stem`, :attr:`PurePath.suffix`" msgstr ":attr:`PurePath.stem` 和 :attr:`PurePath.suffix`" -#: ../../library/pathlib.rst:1909 +#: ../../library/pathlib.rst:1919 msgid ":func:`os.path.join`" msgstr ":func:`os.path.join`" -#: ../../library/pathlib.rst:1909 +#: ../../library/pathlib.rst:1919 msgid ":meth:`PurePath.joinpath`" msgstr ":meth:`PurePath.joinpath`" -#: ../../library/pathlib.rst:1910 +#: ../../library/pathlib.rst:1920 msgid ":func:`os.path.isabs`" msgstr ":func:`os.path.isabs`" -#: ../../library/pathlib.rst:1910 +#: ../../library/pathlib.rst:1920 msgid ":meth:`PurePath.is_absolute`" msgstr ":meth:`PurePath.is_absolute`" -#: ../../library/pathlib.rst:1911 +#: ../../library/pathlib.rst:1921 msgid ":func:`os.path.relpath`" msgstr ":func:`os.path.relpath`" -#: ../../library/pathlib.rst:1911 +#: ../../library/pathlib.rst:1921 msgid ":meth:`PurePath.relative_to` [1]_" msgstr ":meth:`PurePath.relative_to` [1]_" -#: ../../library/pathlib.rst:1912 +#: ../../library/pathlib.rst:1922 msgid ":func:`os.path.expanduser`" msgstr ":func:`os.path.expanduser`" -#: ../../library/pathlib.rst:1912 +#: ../../library/pathlib.rst:1922 msgid ":meth:`Path.expanduser` [2]_" msgstr ":meth:`Path.expanduser` [2]_" -#: ../../library/pathlib.rst:1913 +#: ../../library/pathlib.rst:1923 msgid ":func:`os.path.realpath`" msgstr ":func:`os.path.realpath`" -#: ../../library/pathlib.rst:1913 +#: ../../library/pathlib.rst:1923 msgid ":meth:`Path.resolve`" msgstr ":meth:`Path.resolve`" -#: ../../library/pathlib.rst:1914 +#: ../../library/pathlib.rst:1924 msgid ":func:`os.path.abspath`" msgstr ":func:`os.path.abspath`" -#: ../../library/pathlib.rst:1914 +#: ../../library/pathlib.rst:1924 msgid ":meth:`Path.absolute` [3]_" msgstr ":meth:`Path.absolute` [3]_" -#: ../../library/pathlib.rst:1915 +#: ../../library/pathlib.rst:1925 msgid ":func:`os.path.exists`" msgstr ":func:`os.path.exists`" -#: ../../library/pathlib.rst:1915 +#: ../../library/pathlib.rst:1925 msgid ":meth:`Path.exists`" msgstr ":meth:`Path.exists`" -#: ../../library/pathlib.rst:1916 +#: ../../library/pathlib.rst:1926 msgid ":func:`os.path.isfile`" msgstr ":func:`os.path.isfile`" -#: ../../library/pathlib.rst:1916 +#: ../../library/pathlib.rst:1926 msgid ":meth:`Path.is_file`" msgstr ":meth:`Path.is_file`" -#: ../../library/pathlib.rst:1917 +#: ../../library/pathlib.rst:1927 msgid ":func:`os.path.isdir`" msgstr ":func:`os.path.isdir`" -#: ../../library/pathlib.rst:1917 +#: ../../library/pathlib.rst:1927 msgid ":meth:`Path.is_dir`" msgstr ":meth:`Path.is_dir`" -#: ../../library/pathlib.rst:1918 +#: ../../library/pathlib.rst:1928 msgid ":func:`os.path.islink`" msgstr ":func:`os.path.islink`" -#: ../../library/pathlib.rst:1918 +#: ../../library/pathlib.rst:1928 msgid ":meth:`Path.is_symlink`" msgstr ":meth:`Path.is_symlink`" -#: ../../library/pathlib.rst:1919 +#: ../../library/pathlib.rst:1929 msgid ":func:`os.path.isjunction`" msgstr ":func:`os.path.isjunction`" -#: ../../library/pathlib.rst:1919 +#: ../../library/pathlib.rst:1929 msgid ":meth:`Path.is_junction`" msgstr ":meth:`Path.is_junction`" -#: ../../library/pathlib.rst:1920 +#: ../../library/pathlib.rst:1930 msgid ":func:`os.path.ismount`" msgstr ":func:`os.path.ismount`" -#: ../../library/pathlib.rst:1920 +#: ../../library/pathlib.rst:1930 msgid ":meth:`Path.is_mount`" msgstr ":meth:`Path.is_mount`" -#: ../../library/pathlib.rst:1921 +#: ../../library/pathlib.rst:1931 msgid ":func:`os.path.samefile`" msgstr ":func:`os.path.samefile`" -#: ../../library/pathlib.rst:1921 +#: ../../library/pathlib.rst:1931 msgid ":meth:`Path.samefile`" msgstr ":meth:`Path.samefile`" -#: ../../library/pathlib.rst:1922 +#: ../../library/pathlib.rst:1932 msgid ":func:`os.getcwd`" msgstr ":func:`os.getcwd`" -#: ../../library/pathlib.rst:1922 +#: ../../library/pathlib.rst:1932 msgid ":meth:`Path.cwd`" msgstr ":meth:`Path.cwd`" -#: ../../library/pathlib.rst:1923 +#: ../../library/pathlib.rst:1933 msgid ":func:`os.stat`" msgstr ":func:`os.stat`" -#: ../../library/pathlib.rst:1923 +#: ../../library/pathlib.rst:1933 msgid ":meth:`Path.stat`" msgstr ":meth:`Path.stat`" -#: ../../library/pathlib.rst:1924 +#: ../../library/pathlib.rst:1934 msgid ":func:`os.lstat`" msgstr ":func:`os.lstat`" -#: ../../library/pathlib.rst:1924 +#: ../../library/pathlib.rst:1934 msgid ":meth:`Path.lstat`" msgstr ":meth:`Path.lstat`" -#: ../../library/pathlib.rst:1925 +#: ../../library/pathlib.rst:1935 msgid ":func:`os.listdir`" msgstr ":func:`os.listdir`" -#: ../../library/pathlib.rst:1925 +#: ../../library/pathlib.rst:1935 msgid ":meth:`Path.iterdir`" msgstr ":meth:`Path.iterdir`" -#: ../../library/pathlib.rst:1926 +#: ../../library/pathlib.rst:1936 msgid ":func:`os.walk`" msgstr ":func:`os.walk`" -#: ../../library/pathlib.rst:1926 +#: ../../library/pathlib.rst:1936 msgid ":meth:`Path.walk` [4]_" msgstr ":meth:`Path.walk` [4]_" -#: ../../library/pathlib.rst:1927 +#: ../../library/pathlib.rst:1937 msgid ":func:`os.mkdir`, :func:`os.makedirs`" msgstr ":func:`os.mkdir`、:func:`os.makedirs`" -#: ../../library/pathlib.rst:1927 +#: ../../library/pathlib.rst:1937 msgid ":meth:`Path.mkdir`" msgstr ":meth:`Path.mkdir`" -#: ../../library/pathlib.rst:1928 +#: ../../library/pathlib.rst:1938 msgid ":func:`os.link`" msgstr ":func:`os.link`" -#: ../../library/pathlib.rst:1928 +#: ../../library/pathlib.rst:1938 msgid ":meth:`Path.hardlink_to`" msgstr ":meth:`Path.hardlink_to`" -#: ../../library/pathlib.rst:1929 +#: ../../library/pathlib.rst:1939 msgid ":func:`os.symlink`" msgstr ":func:`os.symlink`" -#: ../../library/pathlib.rst:1929 +#: ../../library/pathlib.rst:1939 msgid ":meth:`Path.symlink_to`" msgstr ":meth:`Path.symlink_to`" -#: ../../library/pathlib.rst:1930 +#: ../../library/pathlib.rst:1940 msgid ":func:`os.readlink`" msgstr ":func:`os.readlink`" -#: ../../library/pathlib.rst:1930 +#: ../../library/pathlib.rst:1940 msgid ":meth:`Path.readlink`" msgstr ":meth:`Path.readlink`" -#: ../../library/pathlib.rst:1931 +#: ../../library/pathlib.rst:1941 msgid ":func:`os.rename`" msgstr ":func:`os.rename`" -#: ../../library/pathlib.rst:1931 +#: ../../library/pathlib.rst:1941 msgid ":meth:`Path.rename`" msgstr ":meth:`Path.rename`" -#: ../../library/pathlib.rst:1932 +#: ../../library/pathlib.rst:1942 msgid ":func:`os.replace`" msgstr ":func:`os.replace`" -#: ../../library/pathlib.rst:1932 +#: ../../library/pathlib.rst:1942 msgid ":meth:`Path.replace`" msgstr ":meth:`Path.replace`" -#: ../../library/pathlib.rst:1933 +#: ../../library/pathlib.rst:1943 msgid ":func:`os.remove`, :func:`os.unlink`" msgstr ":func:`os.remove`、:func:`os.unlink`" -#: ../../library/pathlib.rst:1933 +#: ../../library/pathlib.rst:1943 msgid ":meth:`Path.unlink`" msgstr ":meth:`Path.unlink`" -#: ../../library/pathlib.rst:1934 +#: ../../library/pathlib.rst:1944 msgid ":func:`os.rmdir`" msgstr ":func:`os.rmdir`" -#: ../../library/pathlib.rst:1934 +#: ../../library/pathlib.rst:1944 msgid ":meth:`Path.rmdir`" msgstr ":meth:`Path.rmdir`" -#: ../../library/pathlib.rst:1935 +#: ../../library/pathlib.rst:1945 msgid ":func:`os.chmod`" msgstr ":func:`os.chmod`" -#: ../../library/pathlib.rst:1935 +#: ../../library/pathlib.rst:1945 msgid ":meth:`Path.chmod`" msgstr ":meth:`Path.chmod`" -#: ../../library/pathlib.rst:1936 +#: ../../library/pathlib.rst:1946 msgid ":func:`os.lchmod`" msgstr ":func:`os.lchmod`" -#: ../../library/pathlib.rst:1936 +#: ../../library/pathlib.rst:1946 msgid ":meth:`Path.lchmod`" msgstr ":meth:`Path.lchmod`" -#: ../../library/pathlib.rst:1940 +#: ../../library/pathlib.rst:1950 msgid "Footnotes" msgstr "註腳" -#: ../../library/pathlib.rst:1941 +#: ../../library/pathlib.rst:1951 msgid "" ":func:`os.path.relpath` calls :func:`~os.path.abspath` to make paths " "absolute and remove \"``..``\" parts, whereas :meth:`PurePath.relative_to` " @@ -3527,7 +3537,7 @@ msgstr "" "當它輸入的錨點不同時(例如一個是絕對路徑,另一個則是相對路徑)會引發 :exc:" "`ValueError`。" -#: ../../library/pathlib.rst:1945 +#: ../../library/pathlib.rst:1955 msgid "" ":func:`os.path.expanduser` returns the path unchanged if the home directory " "can't be resolved, whereas :meth:`Path.expanduser` raises :exc:" @@ -3536,7 +3546,7 @@ msgstr "" ":func:`os.path.expanduser` 會在無法解析家目錄時回傳原始路徑,而 :meth:`Path." "expanduser` 則會引發 :exc:`RuntimeError`。" -#: ../../library/pathlib.rst:1948 +#: ../../library/pathlib.rst:1958 msgid "" ":func:`os.path.abspath` removes \"``..``\" components without resolving " "symlinks, which may change the meaning of the path, whereas :meth:`Path." @@ -3545,7 +3555,7 @@ msgstr "" ":func:`os.path.abspath` 將 \"``..``\" 組成移除而不解析符號連結,這可能會改變" "路徑的意義,而 :meth:`Path.absolute` 則會保留路徑中任何 \"``..``\" 組成。" -#: ../../library/pathlib.rst:1951 +#: ../../library/pathlib.rst:1961 msgid "" ":func:`os.walk` always follows symlinks when categorizing paths into " "*dirnames* and *filenames*, whereas :meth:`Path.walk` categorizes all " @@ -3555,23 +3565,23 @@ msgstr "" "而 :meth:`Path.walk` 在 *follow_symlinks* 為 false(預設值)時,會將所有符號" "連結都分類為 *filenames*。" -#: ../../library/pathlib.rst:1957 +#: ../../library/pathlib.rst:1967 msgid "Protocols" msgstr "" -#: ../../library/pathlib.rst:1963 +#: ../../library/pathlib.rst:1973 msgid "" "The :mod:`!pathlib.types` module provides types for static type checking." msgstr "" -#: ../../library/pathlib.rst:1970 +#: ../../library/pathlib.rst:1980 msgid "" "A :class:`typing.Protocol` describing the :attr:`Path.info ` attribute. Implementations may return cached results from their " "methods." msgstr "" -#: ../../library/pathlib.rst:1976 +#: ../../library/pathlib.rst:1986 msgid "" "Return ``True`` if the path is an existing file or directory, or any other " "kind of file; return ``False`` if the path doesn't exist." @@ -3579,41 +3589,41 @@ msgstr "" "如果路徑是個存在的檔案、目錄或任何其他類型的檔案則回傳 ``True``,如果路徑不存" "在則回傳 ``False``。" -#: ../../library/pathlib.rst:1979 +#: ../../library/pathlib.rst:1989 msgid "" "If *follow_symlinks* is ``False``, return ``True`` for symlinks without " "checking if their targets exist." msgstr "" -#: ../../library/pathlib.rst:1984 +#: ../../library/pathlib.rst:1994 msgid "" "Return ``True`` if the path is a directory, or a symbolic link pointing to a " "directory; return ``False`` if the path is (or points to) any other kind of " "file, or if it doesn't exist." msgstr "" -#: ../../library/pathlib.rst:1988 +#: ../../library/pathlib.rst:1998 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if the path is a " "directory (without following symlinks); return ``False`` if the path is any " "other kind of file, or if it doesn't exist." msgstr "" -#: ../../library/pathlib.rst:1994 +#: ../../library/pathlib.rst:2004 msgid "" "Return ``True`` if the path is a file, or a symbolic link pointing to a " "file; return ``False`` if the path is (or points to) a directory or other " "non-file, or if it doesn't exist." msgstr "" -#: ../../library/pathlib.rst:1998 +#: ../../library/pathlib.rst:2008 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if the path is a " "file (without following symlinks); return ``False`` if the path is a " "directory or other non-file, or if it doesn't exist." msgstr "" -#: ../../library/pathlib.rst:2004 +#: ../../library/pathlib.rst:2014 msgid "" "Return ``True`` if the path is a symbolic link (even if broken); return " "``False`` if the path is a directory or any kind of file, or if it doesn't " From 171d83f596dbb14a15ddeff1b7694ce5789b2012 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 10 Apr 2026 00:24:41 +0000 Subject: [PATCH 3/4] sync with cpython b87590fd --- c-api/unicode.po | 51 +- library/asyncio-eventloop.po | 5 +- library/asyncio-future.po | 138 +-- library/stdtypes.po | 1783 +++++++++++++++++----------------- 4 files changed, 1010 insertions(+), 967 deletions(-) diff --git a/c-api/unicode.po b/c-api/unicode.po index 163d0b46c1..4927bce096 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-03-23 00:22+0000\n" +"POT-Creation-Date: 2026-04-10 00:23+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2219,8 +2219,8 @@ msgstr "" #: ../../c-api/unicode.rst:1817 ../../c-api/unicode.rst:1827 #: ../../c-api/unicode.rst:1842 ../../c-api/unicode.rst:1852 #: ../../c-api/unicode.rst:1861 ../../c-api/unicode.rst:1868 -#: ../../c-api/unicode.rst:1877 ../../c-api/unicode.rst:1892 -#: ../../c-api/unicode.rst:1899 ../../c-api/unicode.rst:1918 +#: ../../c-api/unicode.rst:1881 ../../c-api/unicode.rst:1896 +#: ../../c-api/unicode.rst:1903 ../../c-api/unicode.rst:1922 msgid "" "On success, return ``0``. On error, set an exception, leave the writer " "unchanged, and return ``-1``." @@ -2233,7 +2233,7 @@ msgid "" msgstr "" #: ../../c-api/unicode.rst:1824 ../../c-api/unicode.rst:1836 -#: ../../c-api/unicode.rst:1907 +#: ../../c-api/unicode.rst:1911 msgid "" "*size* is the string length in bytes. If *size* is equal to ``-1``, call " "``strlen(str)`` to get the string length." @@ -2276,101 +2276,108 @@ msgid "" "Call :c:func:`PyObject_Str` on *obj* and write the output into *writer*." msgstr "於 *obj* 上呼叫 :c:func:`PyObject_Str` 並將輸出寫入 *writer*。" -#: ../../c-api/unicode.rst:1873 +#: ../../c-api/unicode.rst:1871 +msgid "" +"To write a :class:`str` subclass which overrides the :meth:`~object.__str__` " +"method, :c:func:`PyUnicode_FromObject` can be used to get the original " +"string." +msgstr "" + +#: ../../c-api/unicode.rst:1877 msgid "" "Call :c:func:`PyObject_Repr` on *obj* and write the output into *writer*." msgstr "於 *obj* 上呼叫 :c:func:`PyObject_Repr` 並將輸出寫入 *writer*。" -#: ../../c-api/unicode.rst:1875 +#: ../../c-api/unicode.rst:1879 msgid "If *obj* is ``NULL``, write the string ``\"\"`` into *writer*." msgstr "" -#: ../../c-api/unicode.rst:1882 +#: ../../c-api/unicode.rst:1886 msgid "Added support for ``NULL``." msgstr "" -#: ../../c-api/unicode.rst:1886 +#: ../../c-api/unicode.rst:1890 msgid "Write the substring ``str[start:end]`` into *writer*." msgstr "" -#: ../../c-api/unicode.rst:1888 +#: ../../c-api/unicode.rst:1892 msgid "" "*str* must be Python :class:`str` object. *start* must be greater than or " "equal to 0, and less than or equal to *end*. *end* must be less than or " "equal to *str* length." msgstr "" -#: ../../c-api/unicode.rst:1897 +#: ../../c-api/unicode.rst:1901 msgid "" "Similar to :c:func:`PyUnicode_FromFormat`, but write the output directly " "into *writer*." msgstr "類似於 :c:func:`PyUnicode_FromFormat`,但是直接將輸出寫入 *writer*。" -#: ../../c-api/unicode.rst:1904 +#: ../../c-api/unicode.rst:1908 msgid "" "Decode the string *str* from UTF-8 with *errors* error handler and write the " "output into *writer*." msgstr "" -#: ../../c-api/unicode.rst:1910 +#: ../../c-api/unicode.rst:1914 msgid "" "*errors* is an :ref:`error handler ` name, such as " "``\"replace\"``. If *errors* is ``NULL``, use the strict error handler." msgstr "" -#: ../../c-api/unicode.rst:1913 +#: ../../c-api/unicode.rst:1917 msgid "" "If *consumed* is not ``NULL``, set *\\*consumed* to the number of decoded " "bytes on success. If *consumed* is ``NULL``, treat trailing incomplete UTF-8 " "byte sequences as an error." msgstr "" -#: ../../c-api/unicode.rst:1921 +#: ../../c-api/unicode.rst:1925 msgid "See also :c:func:`PyUnicodeWriter_WriteUTF8`." msgstr "另請參閱 :c:func:`PyUnicodeWriter_WriteUTF8`。" -#: ../../c-api/unicode.rst:1924 +#: ../../c-api/unicode.rst:1928 msgid "Deprecated API" msgstr "已棄用的 API" -#: ../../c-api/unicode.rst:1926 +#: ../../c-api/unicode.rst:1930 msgid "The following API is deprecated." msgstr "以下 API 已棄用。" -#: ../../c-api/unicode.rst:1930 +#: ../../c-api/unicode.rst:1934 msgid "" "This is a typedef of :c:type:`wchar_t`, which is a 16-bit type or 32-bit " "type depending on the platform. Please use :c:type:`wchar_t` directly " "instead." msgstr "" -#: ../../c-api/unicode.rst:1934 +#: ../../c-api/unicode.rst:1938 msgid "" "In previous versions, this was a 16-bit type or a 32-bit type depending on " "whether you selected a \"narrow\" or \"wide\" Unicode version of Python at " "build time." msgstr "" -#: ../../c-api/unicode.rst:1944 +#: ../../c-api/unicode.rst:1948 msgid "" "Do nothing and return ``0``. This API is kept only for backward " "compatibility, but there are no plans to remove it." msgstr "" -#: ../../c-api/unicode.rst:1950 +#: ../../c-api/unicode.rst:1954 msgid "" "This API does nothing since Python 3.12. Previously, this needed to be " "called for each string created using the old API (:c:func:`!" "PyUnicode_FromUnicode` or similar)." msgstr "" -#: ../../c-api/unicode.rst:1958 +#: ../../c-api/unicode.rst:1962 msgid "" "Do nothing and return ``1``. This API is kept only for backward " "compatibility, but there are no plans to remove it." msgstr "" -#: ../../c-api/unicode.rst:1964 +#: ../../c-api/unicode.rst:1968 msgid "" "This API does nothing since Python 3.12. Previously, this could be called to " "check if :c:func:`PyUnicode_READY` is necessary." diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 7771745d47..edfdd919a5 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-03-22 00:20+0000\n" +"POT-Creation-Date: 2026-04-10 00:23+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3084,7 +3084,8 @@ msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "設定 SIGINT 和 SIGTERM 的訊號處理程式" #: ../../library/asyncio-eventloop.rst:2058 -msgid "(This ``signals`` example only works on Unix.)" +#, fuzzy +msgid "(This ``signal`` example only works on Unix.)" msgstr "(此 ``signals`` 範例僅在 Unix 上運作。)" #: ../../library/asyncio-eventloop.rst:2060 diff --git a/library/asyncio-future.po b/library/asyncio-future.po index c2812e4b70..ed4890aad0 100644 --- a/library/asyncio-future.po +++ b/library/asyncio-future.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2026-04-10 00:23+0000\n" "PO-Revision-Date: 2022-01-25 01:29+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -72,9 +72,9 @@ msgstr "" #: ../../library/asyncio-future.rst:42 msgid "" -"a :class:`Task` object wrapping *obj*, if *obj* is a coroutine " -"(:func:`iscoroutine` is used for the test); in this case the coroutine will " -"be scheduled by ``ensure_future()``." +"a :class:`Task` object wrapping *obj*, if *obj* is a coroutine (:func:" +"`iscoroutine` is used for the test); in this case the coroutine will be " +"scheduled by ``ensure_future()``." msgstr "" "包裝 (wrap) 了 *obj* 的 :class:`Task` 物件,如果 *obj* 是一個協程 " "(coroutine) (可以用 :func:`iscoroutine` 來進行檢查);在此情況下該協程將透過 " @@ -82,11 +82,11 @@ msgstr "" #: ../../library/asyncio-future.rst:47 msgid "" -"a :class:`Task` object that would await on *obj*, if *obj* is an awaitable " -"(:func:`inspect.isawaitable` is used for the test.)" +"a :class:`Task` object that would await on *obj*, if *obj* is an awaitable (:" +"func:`inspect.isawaitable` is used for the test.)" msgstr "" -"一個會等待 *obj* 的 :class:`Task` 物件,*obj* 須為一個可等待物件" -"(\\ :func:`inspect.isawaitable` 用於測試。)" +"一個會等待 *obj* 的 :class:`Task` 物件,*obj* 須為一個可等待物件(\\ :func:" +"`inspect.isawaitable` 用於測試。)" #: ../../library/asyncio-future.rst:50 msgid "If *obj* is neither of the above a :exc:`TypeError` is raised." @@ -103,8 +103,9 @@ msgid "" "See also the :func:`create_task` function which is the preferred way for " "creating new tasks or use :class:`asyncio.TaskGroup` which keeps reference " "to the task internally." -msgstr "請見 :func:`create_task` 函式,它是建立新 Task 的推薦方法。或者使用 " -":class:`asyncio.TaskGroup`,它會在內部保留對 Task 的參照。" +msgstr "" +"請見 :func:`create_task` 函式,它是建立新 Task 的推薦方法。或者使用 :class:" +"`asyncio.TaskGroup`,它會在內部保留對 Task 的參照。" #: ../../library/asyncio-future.rst:61 msgid "The function accepts any :term:`awaitable` object." @@ -120,8 +121,8 @@ msgstr "" #: ../../library/asyncio-future.rst:71 msgid "" -"Wrap a :class:`concurrent.futures.Future` object in " -"a :class:`asyncio.Future` object." +"Wrap a :class:`concurrent.futures.Future` object in a :class:`asyncio." +"Future` object." msgstr "" "將一個 :class:`concurrent.futures.Future` 物件包裝到 :class:`asyncio.Future` " "物件中。" @@ -160,21 +161,20 @@ msgid "" "protocols implemented using asyncio :ref:`transports `) to interoperate with high-level async/await code." msgstr "" -"Future 通常用於讓低階基於回呼的程式(例如在協定實作中使用 " -"asyncio :ref:`transports `\\ )能夠與高階 " -"async/await 程式互動。" +"Future 通常用於讓低階基於回呼的程式(例如在協定實作中使用 asyncio :ref:" +"`transports `\\ )能夠與高階 async/await 程式互" +"動。" #: ../../library/asyncio-future.rst:98 msgid "" "The rule of thumb is to never expose Future objects in user-facing APIs, and " -"the recommended way to create a Future object is to " -"call :meth:`loop.create_future`. This way alternative event loop " -"implementations can inject their own optimized implementations of a Future " -"object." +"the recommended way to create a Future object is to call :meth:`loop." +"create_future`. This way alternative event loop implementations can inject " +"their own optimized implementations of a Future object." msgstr "" -"經驗法則為永遠不要在提供給使用者的 API 中公開 Future 物件,同時建議使" -"用 :meth:`loop.create_future` 來建立 Future 物件。如此一來,不同實作的事件迴" -"圈可以注入自己最佳化實作的 Future 物件。" +"經驗法則為永遠不要在提供給使用者的 API 中公開 Future 物件,同時建議使用 :" +"meth:`loop.create_future` 來建立 Future 物件。如此一來,不同實作的事件迴圈可" +"以注入自己最佳化實作的 Future 物件。" #: ../../library/asyncio-future.rst:104 msgid "Added support for the :mod:`contextvars` module." @@ -200,24 +200,24 @@ msgstr "" #: ../../library/asyncio-future.rst:118 msgid "" -"If the Future is *done* and has an exception set by " -"the :meth:`set_exception` method, this method raises the exception." +"If the Future is *done* and has an exception set by the :meth:" +"`set_exception` method, this method raises the exception." msgstr "" "如果 Future 狀態為 *done*,並擁有 :meth:`set_exception` 方法設定的一個例外," "那麼這個方法會引發該例外。" -#: ../../library/asyncio-future.rst:121 ../../library/asyncio-future.rst:209 +#: ../../library/asyncio-future.rst:121 ../../library/asyncio-future.rst:213 msgid "" -"If the Future has been *cancelled*, this method raises " -"a :exc:`CancelledError` exception." +"If the Future has been *cancelled*, this method raises a :exc:" +"`CancelledError` exception." msgstr "" -"如果 Future 已被 *cancelled*\\ (取消),此方法會引發一" -"個 :exc:`CancelledError` 例外。" +"如果 Future 已被 *cancelled*\\ (取消),此方法會引發一個 :exc:" +"`CancelledError` 例外。" #: ../../library/asyncio-future.rst:124 msgid "" -"If the Future's result isn't yet available, this method raises " -"an :exc:`InvalidStateError` exception." +"If the Future's result isn't yet available, this method raises an :exc:" +"`InvalidStateError` exception." msgstr "" "如果 Future 的結果還不可用,此方法會引發一個 :exc:`InvalidStateError` 例外。" @@ -243,8 +243,8 @@ msgid "" "A Future is *done* if it was *cancelled* or if it has a result or an " "exception set with :meth:`set_result` or :meth:`set_exception` calls." msgstr "" -"如果 Future 有被 *cancelled*、:meth:`set_result` 有被呼叫來為其設定結果、" -"或 :meth:`set_exception` 有被呼叫為其設定例外,那麼它就是 *done*。" +"如果 Future 有被 *cancelled*、:meth:`set_result` 有被呼叫來為其設定結果、或 :" +"meth:`set_exception` 有被呼叫為其設定例外,那麼它就是 *done*。" #: ../../library/asyncio-future.rst:151 msgid "Return ``True`` if the Future was *cancelled*." @@ -283,18 +283,17 @@ msgstr "" #: ../../library/asyncio-future.rst:169 msgid "" -"An optional keyword-only *context* argument allows specifying a " -"custom :class:`contextvars.Context` for the *callback* to run in. The " -"current context is used when no *context* is provided." +"An optional keyword-only *context* argument allows specifying a custom :" +"class:`contextvars.Context` for the *callback* to run in. The current " +"context is used when no *context* is provided." msgstr "" -"可選僅限關鍵字引數 *context* 用來指定一個讓 *callback* 執行於其中的客製" -"化 :class:`contextvars.Context` 物件。如果沒有提供 *context*,則使用目前情" -"境。" +"可選僅限關鍵字引數 *context* 用來指定一個讓 *callback* 執行於其中的客製化 :" +"class:`contextvars.Context` 物件。如果沒有提供 *context*,則使用目前情境。" #: ../../library/asyncio-future.rst:173 msgid "" -":func:`functools.partial` can be used to pass parameters to the callback, " -"e.g.::" +":func:`functools.partial` can be used to pass parameters to the callback, e." +"g.::" msgstr "可以用 :func:`functools.partial` 傳遞引數給回呼函式,例如: ::" #: ../../library/asyncio-future.rst:176 @@ -334,32 +333,38 @@ msgstr "" "改為 *cancelled* 並在為回呼函式排程後回傳 ``True``。" #: ../../library/asyncio-future.rst:199 +msgid "" +"The optional string argument *msg* is passed as the argument to the :exc:" +"`CancelledError` exception raised when a cancelled Future is awaited." +msgstr "" + +#: ../../library/asyncio-future.rst:203 msgid "Added the *msg* parameter." msgstr "新增 *msg* 參數。" -#: ../../library/asyncio-future.rst:204 +#: ../../library/asyncio-future.rst:208 msgid "Return the exception that was set on this Future." msgstr "回傳被設定於此 Future 的例外。" -#: ../../library/asyncio-future.rst:206 +#: ../../library/asyncio-future.rst:210 msgid "" "The exception (or ``None`` if no exception was set) is returned only if the " "Future is *done*." msgstr "" "只有 Future 在 *done* 時才回傳例外(如果沒有設定例外則回傳 ``None``\\ )。" -#: ../../library/asyncio-future.rst:212 +#: ../../library/asyncio-future.rst:216 msgid "" -"If the Future isn't *done* yet, this method raises " -"an :exc:`InvalidStateError` exception." +"If the Future isn't *done* yet, this method raises an :exc:" +"`InvalidStateError` exception." msgstr "" "如果 Future 還不為 *done*,此方法會引發一個 :exc:`InvalidStateError` 例外。" -#: ../../library/asyncio-future.rst:217 +#: ../../library/asyncio-future.rst:221 msgid "Return the event loop the Future object is bound to." msgstr "回傳已被 Future 物件繫結 (bind) 的事件迴圈。" -#: ../../library/asyncio-future.rst:224 +#: ../../library/asyncio-future.rst:228 msgid "" "This example creates a Future object, creates and schedules an asynchronous " "Task to set result for the Future, and waits until the Future has a result::" @@ -367,7 +372,7 @@ msgstr "" "這個例子建立一個 Future 物件,建立一個非同步 Task 並為其排程以設定 Future 結" "果,然後等待 Future 結果出現: ::" -#: ../../library/asyncio-future.rst:228 +#: ../../library/asyncio-future.rst:232 msgid "" "async def set_after(fut, delay, value):\n" " # Sleep for *delay* seconds.\n" @@ -398,7 +403,7 @@ msgid "" "asyncio.run(main())" msgstr "" -#: ../../library/asyncio-future.rst:259 +#: ../../library/asyncio-future.rst:263 msgid "" "The Future object was designed to mimic :class:`concurrent.futures.Future`. " "Key differences include:" @@ -406,7 +411,7 @@ msgstr "" "該 Future 物件是為了模仿 :class:`concurrent.futures.Future` 而設計。主要差異" "包含:" -#: ../../library/asyncio-future.rst:262 +#: ../../library/asyncio-future.rst:266 msgid "" "unlike asyncio Futures, :class:`concurrent.futures.Future` instances cannot " "be awaited." @@ -414,7 +419,7 @@ msgstr "" "與 asyncio 的 Future 不同,:class:`concurrent.futures.Future` 實例不可被等" "待。" -#: ../../library/asyncio-future.rst:265 +#: ../../library/asyncio-future.rst:269 msgid "" ":meth:`asyncio.Future.result` and :meth:`asyncio.Future.exception` do not " "accept the *timeout* argument." @@ -422,16 +427,15 @@ msgstr "" ":meth:`asyncio.Future.result` 和 :meth:`asyncio.Future.exception` 不接受 " "*timeout* 引數。" -#: ../../library/asyncio-future.rst:268 +#: ../../library/asyncio-future.rst:272 msgid "" -":meth:`asyncio.Future.result` and :meth:`asyncio.Future.exception` raise " -"an :exc:`InvalidStateError` exception when the Future is not *done*." +":meth:`asyncio.Future.result` and :meth:`asyncio.Future.exception` raise an :" +"exc:`InvalidStateError` exception when the Future is not *done*." msgstr "" -"Future 不為 *done* 時 :meth:`asyncio.Future.result` " -"和 :meth:`asyncio.Future.exception` 會引發一個 :exc:`InvalidStateError` 例" -"外。" +"Future 不為 *done* 時 :meth:`asyncio.Future.result` 和 :meth:`asyncio.Future." +"exception` 會引發一個 :exc:`InvalidStateError` 例外。" -#: ../../library/asyncio-future.rst:272 +#: ../../library/asyncio-future.rst:276 msgid "" "Callbacks registered with :meth:`asyncio.Future.add_done_callback` are not " "called immediately. They are scheduled with :meth:`loop.call_soon` instead." @@ -439,18 +443,18 @@ msgstr "" "使用 :meth:`asyncio.Future.add_done_callback` 註冊的回呼函式不會立即呼叫,而" "是被 :meth:`loop.call_soon` 排程。" -#: ../../library/asyncio-future.rst:276 +#: ../../library/asyncio-future.rst:280 msgid "" "asyncio Future is not compatible with the :func:`concurrent.futures.wait` " "and :func:`concurrent.futures.as_completed` functions." msgstr "" -"asyncio Future 不能與 :func:`concurrent.futures.wait` " -"和 :func:`concurrent.futures.as_completed` 函式相容。" +"asyncio Future 不能與 :func:`concurrent.futures.wait` 和 :func:`concurrent." +"futures.as_completed` 函式相容。" -#: ../../library/asyncio-future.rst:280 +#: ../../library/asyncio-future.rst:284 msgid "" -":meth:`asyncio.Future.cancel` accepts an optional ``msg`` argument, " -"but :meth:`concurrent.futures.Future.cancel` does not." +":meth:`asyncio.Future.cancel` accepts an optional ``msg`` argument, but :" +"meth:`concurrent.futures.Future.cancel` does not." msgstr "" -":meth:`asyncio.Future.cancel` 接受一個可選的 ``msg`` 引數," -"但 :func:`concurrent.futures.Future.cancel` 無此引數。" +":meth:`asyncio.Future.cancel` 接受一個可選的 ``msg`` 引數,但 :func:" +"`concurrent.futures.Future.cancel` 無此引數。" diff --git a/library/stdtypes.po b/library/stdtypes.po index 9b5ac5b877..9f7b8d7ff3 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-03-19 00:23+0000\n" +"POT-Creation-Date: 2026-04-10 00:23+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -139,8 +139,8 @@ msgstr "結果" #: ../../library/stdtypes.rst:88 ../../library/stdtypes.rst:292 #: ../../library/stdtypes.rst:432 ../../library/stdtypes.rst:1015 -#: ../../library/stdtypes.rst:1237 ../../library/stdtypes.rst:3147 -#: ../../library/stdtypes.rst:4416 +#: ../../library/stdtypes.rst:1237 ../../library/stdtypes.rst:3161 +#: ../../library/stdtypes.rst:4430 msgid "Notes" msgstr "註解" @@ -154,7 +154,7 @@ msgstr "假如 *x* 為真,則 *x*,否則 *y*" #: ../../library/stdtypes.rst:90 ../../library/stdtypes.rst:1017 #: ../../library/stdtypes.rst:1020 ../../library/stdtypes.rst:1252 -#: ../../library/stdtypes.rst:3153 ../../library/stdtypes.rst:4422 +#: ../../library/stdtypes.rst:3167 ../../library/stdtypes.rst:4436 msgid "\\(1)" msgstr "\\(1)" @@ -168,8 +168,8 @@ msgstr "假如 *x* 為假,則 *x*,否則 *y*" #: ../../library/stdtypes.rst:93 ../../library/stdtypes.rst:305 #: ../../library/stdtypes.rst:325 ../../library/stdtypes.rst:1263 -#: ../../library/stdtypes.rst:3157 ../../library/stdtypes.rst:3159 -#: ../../library/stdtypes.rst:4426 ../../library/stdtypes.rst:4428 +#: ../../library/stdtypes.rst:3171 ../../library/stdtypes.rst:3173 +#: ../../library/stdtypes.rst:4440 ../../library/stdtypes.rst:4442 msgid "\\(2)" msgstr "\\(2)" @@ -181,18 +181,18 @@ msgstr "``not x``" msgid "if *x* is false, then ``True``, else ``False``" msgstr "假如 *x* 為假,則 ``True``,否則 ``False``" -#: ../../library/stdtypes.rst:96 ../../library/stdtypes.rst:3161 -#: ../../library/stdtypes.rst:3163 ../../library/stdtypes.rst:3165 -#: ../../library/stdtypes.rst:3167 ../../library/stdtypes.rst:4430 -#: ../../library/stdtypes.rst:4432 ../../library/stdtypes.rst:4434 -#: ../../library/stdtypes.rst:4436 +#: ../../library/stdtypes.rst:96 ../../library/stdtypes.rst:3175 +#: ../../library/stdtypes.rst:3177 ../../library/stdtypes.rst:3179 +#: ../../library/stdtypes.rst:3181 ../../library/stdtypes.rst:4444 +#: ../../library/stdtypes.rst:4446 ../../library/stdtypes.rst:4448 +#: ../../library/stdtypes.rst:4450 msgid "\\(3)" msgstr "\\(3)" #: ../../library/stdtypes.rst:105 ../../library/stdtypes.rst:336 #: ../../library/stdtypes.rst:450 ../../library/stdtypes.rst:1059 -#: ../../library/stdtypes.rst:1267 ../../library/stdtypes.rst:3197 -#: ../../library/stdtypes.rst:4466 +#: ../../library/stdtypes.rst:1267 ../../library/stdtypes.rst:3211 +#: ../../library/stdtypes.rst:4480 msgid "Notes:" msgstr "註解:" @@ -239,9 +239,9 @@ msgstr "" msgid "This table summarizes the comparison operations:" msgstr "這個表格統整所有比較運算:" -#: ../../library/stdtypes.rst:146 ../../library/stdtypes.rst:3124 -#: ../../library/stdtypes.rst:3147 ../../library/stdtypes.rst:4393 -#: ../../library/stdtypes.rst:4416 +#: ../../library/stdtypes.rst:146 ../../library/stdtypes.rst:3138 +#: ../../library/stdtypes.rst:3161 ../../library/stdtypes.rst:4407 +#: ../../library/stdtypes.rst:4430 msgid "Meaning" msgstr "含義" @@ -591,8 +591,8 @@ msgid "" "zero." msgstr "一個複數,其實部為 *re*,虛部為 *im*。*im* 預設為零。" -#: ../../library/stdtypes.rst:318 ../../library/stdtypes.rst:3155 -#: ../../library/stdtypes.rst:4453 +#: ../../library/stdtypes.rst:318 ../../library/stdtypes.rst:3169 +#: ../../library/stdtypes.rst:4467 msgid "\\(6)" msgstr "\\(6)" @@ -629,9 +629,9 @@ msgid "*x* to the power *y*" msgstr "*x* 的 *y* 次方" #: ../../library/stdtypes.rst:327 ../../library/stdtypes.rst:329 -#: ../../library/stdtypes.rst:3180 ../../library/stdtypes.rst:3183 -#: ../../library/stdtypes.rst:3186 ../../library/stdtypes.rst:4449 -#: ../../library/stdtypes.rst:4456 +#: ../../library/stdtypes.rst:3194 ../../library/stdtypes.rst:3197 +#: ../../library/stdtypes.rst:3200 ../../library/stdtypes.rst:4463 +#: ../../library/stdtypes.rst:4470 msgid "\\(5)" msgstr "\\(5)" @@ -789,9 +789,9 @@ msgid "bitwise :dfn:`or` of *x* and *y*" msgstr "*x* 及 *y* 的位元 :dfn:`或`" #: ../../library/stdtypes.rst:434 ../../library/stdtypes.rst:437 -#: ../../library/stdtypes.rst:440 ../../library/stdtypes.rst:3169 -#: ../../library/stdtypes.rst:3173 ../../library/stdtypes.rst:4438 -#: ../../library/stdtypes.rst:4442 +#: ../../library/stdtypes.rst:440 ../../library/stdtypes.rst:3183 +#: ../../library/stdtypes.rst:3187 ../../library/stdtypes.rst:4452 +#: ../../library/stdtypes.rst:4456 msgid "\\(4)" msgstr "\\(4)" @@ -2101,7 +2101,8 @@ msgstr "可變序列型別也支援以下方法:" msgid "" "Append *value* to the end of the sequence. This is equivalent to writing " "``seq[len(seq):len(seq)] = [value]``." -msgstr "將 *value* 附加到序列末尾,這和 ``seq[len(seq):len(seq)] = [value]`` 相同。" +msgstr "" +"將 *value* 附加到序列末尾,這和 ``seq[len(seq):len(seq)] = [value]`` 相同。" #: ../../library/stdtypes.rst:1301 msgid "" @@ -3141,7 +3142,7 @@ msgstr "" msgid "Return the string encoded to :class:`bytes`." msgstr "" -#: ../../library/stdtypes.rst:1917 ../../library/stdtypes.rst:3592 +#: ../../library/stdtypes.rst:1917 ../../library/stdtypes.rst:3606 msgid "" "*encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for " "possible values." @@ -3177,11 +3178,11 @@ msgstr "" ">>> encoded_str_to_bytes\n" "b'Python'" -#: ../../library/stdtypes.rst:1940 ../../library/stdtypes.rst:3611 +#: ../../library/stdtypes.rst:1940 ../../library/stdtypes.rst:3625 msgid "Added support for keyword arguments." msgstr "新增關鍵字引數的支援。" -#: ../../library/stdtypes.rst:1943 ../../library/stdtypes.rst:3614 +#: ../../library/stdtypes.rst:1943 ../../library/stdtypes.rst:3628 msgid "" "The value of the *errors* argument is now checked in :ref:`devmode` and in :" "ref:`debug mode `." @@ -3591,7 +3592,7 @@ msgstr "" #: ../../library/stdtypes.rst:2413 ../../library/stdtypes.rst:2524 #: ../../library/stdtypes.rst:2545 ../../library/stdtypes.rst:2724 #: ../../library/stdtypes.rst:2746 ../../library/stdtypes.rst:2760 -#: ../../library/stdtypes.rst:2853 +#: ../../library/stdtypes.rst:2867 msgid "For example:" msgstr "舉例來說:" @@ -3721,7 +3722,7 @@ msgstr "" ">>> 'Monty Python'.ljust(10, '.')\n" "'Monty Python'" -#: ../../library/stdtypes.rst:2351 ../../library/stdtypes.rst:2862 +#: ../../library/stdtypes.rst:2351 ../../library/stdtypes.rst:2876 msgid "See also :meth:`rjust`." msgstr "另請參閱 :meth:`rjust`。" @@ -4086,14 +4087,14 @@ msgstr "" #: ../../library/stdtypes.rst:2609 ../../library/stdtypes.rst:2627 #: ../../library/stdtypes.rst:2639 ../../library/stdtypes.rst:2693 -#: ../../library/stdtypes.rst:2783 ../../library/stdtypes.rst:2952 -#: ../../library/stdtypes.rst:3927 ../../library/stdtypes.rst:3945 -#: ../../library/stdtypes.rst:4035 ../../library/stdtypes.rst:4051 -#: ../../library/stdtypes.rst:4076 ../../library/stdtypes.rst:4090 -#: ../../library/stdtypes.rst:4118 ../../library/stdtypes.rst:4132 -#: ../../library/stdtypes.rst:4150 ../../library/stdtypes.rst:4177 -#: ../../library/stdtypes.rst:4200 ../../library/stdtypes.rst:4227 -#: ../../library/stdtypes.rst:4269 ../../library/stdtypes.rst:4293 +#: ../../library/stdtypes.rst:2797 ../../library/stdtypes.rst:2966 +#: ../../library/stdtypes.rst:3941 ../../library/stdtypes.rst:3959 +#: ../../library/stdtypes.rst:4049 ../../library/stdtypes.rst:4065 +#: ../../library/stdtypes.rst:4090 ../../library/stdtypes.rst:4104 +#: ../../library/stdtypes.rst:4132 ../../library/stdtypes.rst:4146 +#: ../../library/stdtypes.rst:4164 ../../library/stdtypes.rst:4191 +#: ../../library/stdtypes.rst:4214 ../../library/stdtypes.rst:4241 +#: ../../library/stdtypes.rst:4283 ../../library/stdtypes.rst:4307 msgid "For example::" msgstr "舉例來說: ::" @@ -4403,17 +4404,47 @@ msgstr "另請參閱 :meth:`rstrip`。" #: ../../library/stdtypes.rst:2773 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``." +"and vice versa. For example:" +msgstr "" + +#: ../../library/stdtypes.rst:2776 +#, fuzzy +msgid "" +">>> 'Hello World'.swapcase()\n" +"'hELLO wORLD'" +msgstr "" +">>> b'Hello World'.swapcase()\n" +"b'hELLO wORLD'" + +#: ../../library/stdtypes.rst:2781 +msgid "" +"Note that it is not necessarily true that ``s.swapcase().swapcase() == s``. " +"For example:" msgstr "" -#: ../../library/stdtypes.rst:2780 +#: ../../library/stdtypes.rst:2784 +#, fuzzy +msgid "" +">>> 'straße'.swapcase().swapcase()\n" +"'strasse'" +msgstr "" +">>> 'straße'.lower()\n" +"'straße'\n" +">>> 'straße'.casefold()\n" +"'strasse'" + +#: ../../library/stdtypes.rst:2789 +#, fuzzy +msgid "See also :meth:`str.lower` and :meth:`str.upper`." +msgstr "另請參閱 :meth:`removeprefix` 和 :meth:`endswith`。" + +#: ../../library/stdtypes.rst:2794 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:2785 +#: ../../library/stdtypes.rst:2799 msgid "" ">>> 'Hello world'.title()\n" "'Hello World'" @@ -4421,7 +4452,7 @@ msgstr "" ">>> 'Hello world'.title()\n" "'Hello World'" -#: ../../library/stdtypes.rst:2788 ../../library/stdtypes.rst:4237 +#: ../../library/stdtypes.rst:2802 ../../library/stdtypes.rst:4251 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 " @@ -4429,7 +4460,7 @@ msgid "" "which may not be the desired result::" msgstr "" -#: ../../library/stdtypes.rst:2793 +#: ../../library/stdtypes.rst:2807 msgid "" ">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" @@ -4437,19 +4468,19 @@ msgstr "" ">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" -#: ../../library/stdtypes.rst:2796 +#: ../../library/stdtypes.rst:2810 msgid "" "The :func:`string.capwords` function does not have this problem, as it " "splits words on spaces only." msgstr "" -#: ../../library/stdtypes.rst:2799 +#: ../../library/stdtypes.rst:2813 msgid "" "Alternatively, a workaround for apostrophes can be constructed using regular " "expressions::" msgstr "" -#: ../../library/stdtypes.rst:2802 +#: ../../library/stdtypes.rst:2816 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -4469,11 +4500,11 @@ msgstr "" ">>> titlecase(\"they're bill's friends.\")\n" "\"They're Bill's Friends.\"" -#: ../../library/stdtypes.rst:2811 +#: ../../library/stdtypes.rst:2825 msgid "See also :meth:`istitle`." msgstr "另請參閱 :meth:`istitle`。" -#: ../../library/stdtypes.rst:2816 +#: ../../library/stdtypes.rst:2830 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 " @@ -4485,19 +4516,19 @@ msgid "" "exception, to map the character to itself." msgstr "" -#: ../../library/stdtypes.rst:2825 +#: ../../library/stdtypes.rst:2839 msgid "" "You can use :meth:`str.maketrans` to create a translation map from character-" "to-character mappings in different formats." msgstr "" -#: ../../library/stdtypes.rst:2828 +#: ../../library/stdtypes.rst:2842 msgid "" "See also the :mod:`codecs` module for a more flexible approach to custom " "character mappings." msgstr "" -#: ../../library/stdtypes.rst:2834 +#: ../../library/stdtypes.rst:2848 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`` " @@ -4506,14 +4537,14 @@ msgid "" "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:2840 +#: ../../library/stdtypes.rst:2854 msgid "" "The uppercasing algorithm used is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." msgstr "" -#: ../../library/stdtypes.rst:2847 +#: ../../library/stdtypes.rst:2861 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 " @@ -4521,7 +4552,7 @@ msgid "" "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2855 +#: ../../library/stdtypes.rst:2869 msgid "" ">>> \"42\".zfill(5)\n" "'00042'\n" @@ -4533,27 +4564,27 @@ msgstr "" ">>> \"-42\".zfill(5)\n" "'-0042'" -#: ../../library/stdtypes.rst:2882 +#: ../../library/stdtypes.rst:2896 msgid "Formatted String Literals (f-strings)" msgstr "" -#: ../../library/stdtypes.rst:2885 +#: ../../library/stdtypes.rst:2899 msgid "" "The :keyword:`await` and :keyword:`async for` can be used in expressions " "within f-strings." msgstr "" -#: ../../library/stdtypes.rst:2888 +#: ../../library/stdtypes.rst:2902 msgid "Added the debug specifier (``=``)" msgstr "" -#: ../../library/stdtypes.rst:2890 +#: ../../library/stdtypes.rst:2904 msgid "" "Many restrictions on expressions within f-strings have been removed. " "Notably, nested strings, comments, and backslashes are now permitted." msgstr "" -#: ../../library/stdtypes.rst:2894 +#: ../../library/stdtypes.rst:2908 msgid "" "An :dfn:`f-string` (formally a :dfn:`formatted string literal`) is a string " "literal that is prefixed with ``f`` or ``F``. This type of string literal " @@ -4562,29 +4593,29 @@ msgid "" "replacement field must contain an expression, optionally followed by:" msgstr "" -#: ../../library/stdtypes.rst:2901 +#: ../../library/stdtypes.rst:2915 msgid "a *debug specifier* -- an equal sign (``=``);" msgstr "" -#: ../../library/stdtypes.rst:2902 +#: ../../library/stdtypes.rst:2916 msgid "a *conversion specifier* -- ``!s``, ``!r`` or ``!a``; and/or" msgstr "" -#: ../../library/stdtypes.rst:2903 +#: ../../library/stdtypes.rst:2917 msgid "a *format specifier* prefixed with a colon (``:``)." msgstr "" -#: ../../library/stdtypes.rst:2905 +#: ../../library/stdtypes.rst:2919 msgid "" "See the :ref:`Lexical Analysis section on f-strings ` for details " "on the syntax of these fields." msgstr "" -#: ../../library/stdtypes.rst:2909 +#: ../../library/stdtypes.rst:2923 msgid "Debug specifier" msgstr "" -#: ../../library/stdtypes.rst:2913 +#: ../../library/stdtypes.rst:2927 msgid "" "If a debug specifier -- an equal sign (``=``) -- appears after the " "replacement field expression, the resulting f-string will contain the " @@ -4592,7 +4623,7 @@ msgid "" "is often useful for debugging::" msgstr "" -#: ../../library/stdtypes.rst:2918 +#: ../../library/stdtypes.rst:2932 msgid "" ">>> number = 14.3\n" ">>> f'{number=}'\n" @@ -4602,13 +4633,13 @@ msgstr "" ">>> f'{number=}'\n" "'number=14.3'" -#: ../../library/stdtypes.rst:2922 +#: ../../library/stdtypes.rst:2936 msgid "" "Whitespace before, inside and after the expression, as well as whitespace " "after the equal sign, is significant --- it is retained in the result::" msgstr "" -#: ../../library/stdtypes.rst:2925 +#: ../../library/stdtypes.rst:2939 msgid "" ">>> f'{ number - 4 = }'\n" "' number - 4 = 10.3'" @@ -4616,17 +4647,17 @@ msgstr "" ">>> f'{ number - 4 = }'\n" "' number - 4 = 10.3'" -#: ../../library/stdtypes.rst:2930 +#: ../../library/stdtypes.rst:2944 msgid "Conversion specifier" msgstr "" -#: ../../library/stdtypes.rst:2932 +#: ../../library/stdtypes.rst:2946 msgid "" "By default, the value of a replacement field expression is converted to a " "string using :func:`str`::" msgstr "" -#: ../../library/stdtypes.rst:2935 +#: ../../library/stdtypes.rst:2949 msgid "" ">>> from fractions import Fraction\n" ">>> one_third = Fraction(1, 3)\n" @@ -4638,13 +4669,13 @@ msgstr "" ">>> f'{one_third}'\n" "'1/3'" -#: ../../library/stdtypes.rst:2940 +#: ../../library/stdtypes.rst:2954 msgid "" "When a debug specifier but no format specifier is used, the default " "conversion instead uses :func:`repr`::" msgstr "" -#: ../../library/stdtypes.rst:2943 +#: ../../library/stdtypes.rst:2957 msgid "" ">>> f'{one_third = }'\n" "'one_third = Fraction(1, 3)'" @@ -4652,24 +4683,24 @@ msgstr "" ">>> f'{one_third = }'\n" "'one_third = Fraction(1, 3)'" -#: ../../library/stdtypes.rst:2946 +#: ../../library/stdtypes.rst:2960 msgid "" "The conversion can be specified explicitly using one of these specifiers:" msgstr "" -#: ../../library/stdtypes.rst:2948 +#: ../../library/stdtypes.rst:2962 msgid "``!s`` for :func:`str`" msgstr "``!s`` 用於 :func:`str`" -#: ../../library/stdtypes.rst:2949 +#: ../../library/stdtypes.rst:2963 msgid "``!r`` for :func:`repr`" msgstr "``!r`` 用於 :func:`repr`" -#: ../../library/stdtypes.rst:2950 +#: ../../library/stdtypes.rst:2964 msgid "``!a`` for :func:`ascii`" msgstr "``!a`` 用於 :func:`ascii`" -#: ../../library/stdtypes.rst:2954 +#: ../../library/stdtypes.rst:2968 msgid "" ">>> str(one_third)\n" "'1/3'\n" @@ -4701,11 +4732,11 @@ msgstr "" ">>> f'{string = !a}'\n" "\"string = '\\\\xa1ko\\\\u010dka \\\\U0001f638!'\"" -#: ../../library/stdtypes.rst:2971 +#: ../../library/stdtypes.rst:2985 msgid "Format specifier" msgstr "" -#: ../../library/stdtypes.rst:2973 +#: ../../library/stdtypes.rst:2987 msgid "" "After the expression has been evaluated, and possibly converted using an " "explicit conversion specifier, it is formatted using the :func:`format` " @@ -4715,7 +4746,7 @@ msgid "" "the replacement field. For example::" msgstr "" -#: ../../library/stdtypes.rst:2980 +#: ../../library/stdtypes.rst:2994 msgid "" ">>> from fractions import Fraction\n" ">>> one_third = Fraction(1, 3)\n" @@ -4739,29 +4770,29 @@ msgstr "" ">>> f'{one_third = :~>10}~'\n" "'one_third = ~~~~~~~1/3~'" -#: ../../library/stdtypes.rst:2994 +#: ../../library/stdtypes.rst:3008 msgid "Template String Literals (t-strings)" msgstr "模板字串字面值 (t-strings)" -#: ../../library/stdtypes.rst:2996 +#: ../../library/stdtypes.rst:3010 msgid "" "An :dfn:`t-string` (formally a :dfn:`template string literal`) is a string " "literal that is prefixed with ``t`` or ``T``." msgstr "" -#: ../../library/stdtypes.rst:2999 +#: ../../library/stdtypes.rst:3013 msgid "" "These strings follow the same syntax and evaluation rules as :ref:`formatted " "string literals `, with for the following differences:" msgstr "" -#: ../../library/stdtypes.rst:3003 +#: ../../library/stdtypes.rst:3017 msgid "" "Rather than evaluating to a ``str`` object, template string literals " "evaluate to a :class:`string.templatelib.Template` object." msgstr "" -#: ../../library/stdtypes.rst:3006 +#: ../../library/stdtypes.rst:3020 msgid "" "The :func:`format` protocol is not used. Instead, the format specifier and " "conversions (if any) are passed to a new :class:`~string.templatelib." @@ -4770,7 +4801,7 @@ msgid "" "Template` object to decide how to handle format specifiers and conversions." msgstr "" -#: ../../library/stdtypes.rst:3013 +#: ../../library/stdtypes.rst:3027 msgid "" "Format specifiers containing nested replacement fields are evaluated " "eagerly, prior to being passed to the :class:`~string.templatelib." @@ -4780,7 +4811,7 @@ msgid "" "to be ``2``, the resulting format specifier would be ``'.2f'``." msgstr "" -#: ../../library/stdtypes.rst:3021 +#: ../../library/stdtypes.rst:3035 msgid "" "When the equals sign ``'='`` is provided in an interpolation expression, the " "text of the expression is appended to the literal string that precedes the " @@ -4792,18 +4823,18 @@ msgid "" "behaviour." msgstr "" -#: ../../library/stdtypes.rst:3035 +#: ../../library/stdtypes.rst:3049 msgid "``printf``-style String Formatting" msgstr "" -#: ../../library/stdtypes.rst:3048 +#: ../../library/stdtypes.rst:3062 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 " "dictionaries correctly)." msgstr "" -#: ../../library/stdtypes.rst:3052 +#: ../../library/stdtypes.rst:3066 msgid "" "Using :ref:`formatted string literals `, the :meth:`str.format` " "interface, or :class:`string.Template` may help avoid these errors. Each of " @@ -4811,7 +4842,7 @@ msgid "" "flexibility, and/or extensibility." msgstr "" -#: ../../library/stdtypes.rst:3057 +#: ../../library/stdtypes.rst:3071 msgid "" "String objects have one unique built-in operation: the ``%`` operator " "(modulo). This is also known as the string *formatting* or *interpolation* " @@ -4821,7 +4852,7 @@ msgid "" "function in the C language. For example:" msgstr "" -#: ../../library/stdtypes.rst:3064 +#: ../../library/stdtypes.rst:3078 msgid "" ">>> print('%s has %d quote types.' % ('Python', 2))\n" "Python has 2 quote types." @@ -4829,7 +4860,7 @@ msgstr "" ">>> print('%s has %d quote types.' % ('Python', 2))\n" "Python has 2 quote types." -#: ../../library/stdtypes.rst:3069 +#: ../../library/stdtypes.rst:3083 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 " @@ -4837,36 +4868,36 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:3079 ../../library/stdtypes.rst:4348 +#: ../../library/stdtypes.rst:3093 ../../library/stdtypes.rst:4362 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: ../../library/stdtypes.rst:3082 ../../library/stdtypes.rst:4351 +#: ../../library/stdtypes.rst:3096 ../../library/stdtypes.rst:4365 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../library/stdtypes.rst:3084 ../../library/stdtypes.rst:4353 +#: ../../library/stdtypes.rst:3098 ../../library/stdtypes.rst:4367 msgid "" "Mapping key (optional), consisting of a parenthesised sequence of characters " "(for example, ``(somename)``)." msgstr "" -#: ../../library/stdtypes.rst:3087 ../../library/stdtypes.rst:4356 +#: ../../library/stdtypes.rst:3101 ../../library/stdtypes.rst:4370 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: ../../library/stdtypes.rst:3090 ../../library/stdtypes.rst:4359 +#: ../../library/stdtypes.rst:3104 ../../library/stdtypes.rst:4373 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:3094 ../../library/stdtypes.rst:4363 +#: ../../library/stdtypes.rst:3108 ../../library/stdtypes.rst:4377 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. " "If specified as ``'*'`` (an asterisk), the actual precision is read from the " @@ -4874,15 +4905,15 @@ msgid "" "the precision." msgstr "" -#: ../../library/stdtypes.rst:3099 ../../library/stdtypes.rst:4368 +#: ../../library/stdtypes.rst:3113 ../../library/stdtypes.rst:4382 msgid "Length modifier (optional)." msgstr "" -#: ../../library/stdtypes.rst:3101 ../../library/stdtypes.rst:4370 +#: ../../library/stdtypes.rst:3115 ../../library/stdtypes.rst:4384 msgid "Conversion type." msgstr "" -#: ../../library/stdtypes.rst:3103 +#: ../../library/stdtypes.rst:3117 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 " @@ -4890,286 +4921,286 @@ msgid "" "selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:3112 ../../library/stdtypes.rst:4381 +#: ../../library/stdtypes.rst:3126 ../../library/stdtypes.rst:4395 msgid "" "In this case no ``*`` specifiers may occur in a format (since they require a " "sequential parameter list)." msgstr "" -#: ../../library/stdtypes.rst:3115 ../../library/stdtypes.rst:4384 +#: ../../library/stdtypes.rst:3129 ../../library/stdtypes.rst:4398 msgid "The conversion flag characters are:" msgstr "" -#: ../../library/stdtypes.rst:3124 ../../library/stdtypes.rst:4393 +#: ../../library/stdtypes.rst:3138 ../../library/stdtypes.rst:4407 msgid "Flag" msgstr "" -#: ../../library/stdtypes.rst:3126 ../../library/stdtypes.rst:4395 +#: ../../library/stdtypes.rst:3140 ../../library/stdtypes.rst:4409 msgid "``'#'``" msgstr "``'#'``" -#: ../../library/stdtypes.rst:3126 ../../library/stdtypes.rst:4395 +#: ../../library/stdtypes.rst:3140 ../../library/stdtypes.rst:4409 msgid "" "The value conversion will use the \"alternate form\" (where defined below)." msgstr "" -#: ../../library/stdtypes.rst:3129 ../../library/stdtypes.rst:4398 +#: ../../library/stdtypes.rst:3143 ../../library/stdtypes.rst:4412 msgid "``'0'``" msgstr "``'0'``" -#: ../../library/stdtypes.rst:3129 ../../library/stdtypes.rst:4398 +#: ../../library/stdtypes.rst:3143 ../../library/stdtypes.rst:4412 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: ../../library/stdtypes.rst:3131 ../../library/stdtypes.rst:4400 +#: ../../library/stdtypes.rst:3145 ../../library/stdtypes.rst:4414 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/stdtypes.rst:3131 ../../library/stdtypes.rst:4400 +#: ../../library/stdtypes.rst:3145 ../../library/stdtypes.rst:4414 msgid "" "The converted value is left adjusted (overrides the ``'0'`` conversion if " "both are given)." msgstr "" -#: ../../library/stdtypes.rst:3134 ../../library/stdtypes.rst:4403 +#: ../../library/stdtypes.rst:3148 ../../library/stdtypes.rst:4417 msgid "``' '``" msgstr "``' '``" -#: ../../library/stdtypes.rst:3134 ../../library/stdtypes.rst:4403 +#: ../../library/stdtypes.rst:3148 ../../library/stdtypes.rst:4417 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." msgstr "" -#: ../../library/stdtypes.rst:3137 ../../library/stdtypes.rst:4406 +#: ../../library/stdtypes.rst:3151 ../../library/stdtypes.rst:4420 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/stdtypes.rst:3137 ../../library/stdtypes.rst:4406 +#: ../../library/stdtypes.rst:3151 ../../library/stdtypes.rst:4420 msgid "" "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides " "a \"space\" flag)." msgstr "" -#: ../../library/stdtypes.rst:3141 ../../library/stdtypes.rst:4410 +#: ../../library/stdtypes.rst:3155 ../../library/stdtypes.rst:4424 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:3144 ../../library/stdtypes.rst:4413 +#: ../../library/stdtypes.rst:3158 ../../library/stdtypes.rst:4427 msgid "The conversion types are:" msgstr "" -#: ../../library/stdtypes.rst:3147 ../../library/stdtypes.rst:4416 +#: ../../library/stdtypes.rst:3161 ../../library/stdtypes.rst:4430 msgid "Conversion" msgstr "" -#: ../../library/stdtypes.rst:3149 ../../library/stdtypes.rst:4418 +#: ../../library/stdtypes.rst:3163 ../../library/stdtypes.rst:4432 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/stdtypes.rst:3149 ../../library/stdtypes.rst:3151 -#: ../../library/stdtypes.rst:4418 ../../library/stdtypes.rst:4420 +#: ../../library/stdtypes.rst:3163 ../../library/stdtypes.rst:3165 +#: ../../library/stdtypes.rst:4432 ../../library/stdtypes.rst:4434 msgid "Signed integer decimal." msgstr "" -#: ../../library/stdtypes.rst:3151 ../../library/stdtypes.rst:4420 +#: ../../library/stdtypes.rst:3165 ../../library/stdtypes.rst:4434 msgid "``'i'``" msgstr "``'i'``" -#: ../../library/stdtypes.rst:3153 ../../library/stdtypes.rst:4422 +#: ../../library/stdtypes.rst:3167 ../../library/stdtypes.rst:4436 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/stdtypes.rst:3153 ../../library/stdtypes.rst:4422 +#: ../../library/stdtypes.rst:3167 ../../library/stdtypes.rst:4436 msgid "Signed octal value." msgstr "" -#: ../../library/stdtypes.rst:3155 ../../library/stdtypes.rst:4424 +#: ../../library/stdtypes.rst:3169 ../../library/stdtypes.rst:4438 msgid "``'u'``" msgstr "``'u'``" -#: ../../library/stdtypes.rst:3155 ../../library/stdtypes.rst:4424 +#: ../../library/stdtypes.rst:3169 ../../library/stdtypes.rst:4438 msgid "Obsolete type -- it is identical to ``'d'``." msgstr "" -#: ../../library/stdtypes.rst:3157 ../../library/stdtypes.rst:4426 +#: ../../library/stdtypes.rst:3171 ../../library/stdtypes.rst:4440 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/stdtypes.rst:3157 ../../library/stdtypes.rst:4426 +#: ../../library/stdtypes.rst:3171 ../../library/stdtypes.rst:4440 msgid "Signed hexadecimal (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:3159 ../../library/stdtypes.rst:4428 +#: ../../library/stdtypes.rst:3173 ../../library/stdtypes.rst:4442 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/stdtypes.rst:3159 ../../library/stdtypes.rst:4428 +#: ../../library/stdtypes.rst:3173 ../../library/stdtypes.rst:4442 msgid "Signed hexadecimal (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:3161 ../../library/stdtypes.rst:4430 +#: ../../library/stdtypes.rst:3175 ../../library/stdtypes.rst:4444 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/stdtypes.rst:3161 ../../library/stdtypes.rst:4430 +#: ../../library/stdtypes.rst:3175 ../../library/stdtypes.rst:4444 msgid "Floating-point exponential format (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:3163 ../../library/stdtypes.rst:4432 +#: ../../library/stdtypes.rst:3177 ../../library/stdtypes.rst:4446 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/stdtypes.rst:3163 ../../library/stdtypes.rst:4432 +#: ../../library/stdtypes.rst:3177 ../../library/stdtypes.rst:4446 msgid "Floating-point exponential format (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:3165 ../../library/stdtypes.rst:4434 +#: ../../library/stdtypes.rst:3179 ../../library/stdtypes.rst:4448 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/stdtypes.rst:3165 ../../library/stdtypes.rst:3167 -#: ../../library/stdtypes.rst:4434 ../../library/stdtypes.rst:4436 +#: ../../library/stdtypes.rst:3179 ../../library/stdtypes.rst:3181 +#: ../../library/stdtypes.rst:4448 ../../library/stdtypes.rst:4450 msgid "Floating-point decimal format." msgstr "" -#: ../../library/stdtypes.rst:3167 ../../library/stdtypes.rst:4436 +#: ../../library/stdtypes.rst:3181 ../../library/stdtypes.rst:4450 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/stdtypes.rst:3169 ../../library/stdtypes.rst:4438 +#: ../../library/stdtypes.rst:3183 ../../library/stdtypes.rst:4452 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/stdtypes.rst:3169 ../../library/stdtypes.rst:4438 +#: ../../library/stdtypes.rst:3183 ../../library/stdtypes.rst:4452 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:3173 ../../library/stdtypes.rst:4442 +#: ../../library/stdtypes.rst:3187 ../../library/stdtypes.rst:4456 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/stdtypes.rst:3173 ../../library/stdtypes.rst:4442 +#: ../../library/stdtypes.rst:3187 ../../library/stdtypes.rst:4456 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:3177 ../../library/stdtypes.rst:4446 +#: ../../library/stdtypes.rst:3191 ../../library/stdtypes.rst:4460 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/stdtypes.rst:3177 +#: ../../library/stdtypes.rst:3191 msgid "Single character (accepts integer or single character string)." msgstr "" -#: ../../library/stdtypes.rst:3180 ../../library/stdtypes.rst:4459 +#: ../../library/stdtypes.rst:3194 ../../library/stdtypes.rst:4473 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/stdtypes.rst:3180 +#: ../../library/stdtypes.rst:3194 msgid "String (converts any Python object using :func:`repr`)." msgstr "" -#: ../../library/stdtypes.rst:3183 ../../library/stdtypes.rst:4453 +#: ../../library/stdtypes.rst:3197 ../../library/stdtypes.rst:4467 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/stdtypes.rst:3183 +#: ../../library/stdtypes.rst:3197 msgid "String (converts any Python object using :func:`str`)." msgstr "" -#: ../../library/stdtypes.rst:3186 ../../library/stdtypes.rst:4456 +#: ../../library/stdtypes.rst:3200 ../../library/stdtypes.rst:4470 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/stdtypes.rst:3186 +#: ../../library/stdtypes.rst:3200 msgid "String (converts any Python object using :func:`ascii`)." msgstr "" -#: ../../library/stdtypes.rst:3189 ../../library/stdtypes.rst:4462 +#: ../../library/stdtypes.rst:3203 ../../library/stdtypes.rst:4476 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/stdtypes.rst:3189 ../../library/stdtypes.rst:4462 +#: ../../library/stdtypes.rst:3203 ../../library/stdtypes.rst:4476 msgid "No argument is converted, results in a ``'%'`` character in the result." msgstr "" -#: ../../library/stdtypes.rst:3193 +#: ../../library/stdtypes.rst:3207 msgid "" "For floating-point formats, the result should be correctly rounded to a " "given precision ``p`` of digits after the decimal point. The rounding mode " "matches that of the :func:`round` builtin." msgstr "" -#: ../../library/stdtypes.rst:3200 ../../library/stdtypes.rst:4469 +#: ../../library/stdtypes.rst:3214 ../../library/stdtypes.rst:4483 msgid "" "The alternate form causes a leading octal specifier (``'0o'``) to be " "inserted before the first digit." msgstr "" -#: ../../library/stdtypes.rst:3204 ../../library/stdtypes.rst:4473 +#: ../../library/stdtypes.rst:3218 ../../library/stdtypes.rst:4487 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:3208 ../../library/stdtypes.rst:4477 +#: ../../library/stdtypes.rst:3222 ../../library/stdtypes.rst:4491 msgid "" "The alternate form causes the result to always contain a decimal point, even " "if no digits follow it." msgstr "" -#: ../../library/stdtypes.rst:3211 ../../library/stdtypes.rst:4480 +#: ../../library/stdtypes.rst:3225 ../../library/stdtypes.rst:4494 msgid "" "The precision determines the number of digits after the decimal point and " "defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:3215 ../../library/stdtypes.rst:4484 +#: ../../library/stdtypes.rst:3229 ../../library/stdtypes.rst:4498 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:3218 ../../library/stdtypes.rst:4487 +#: ../../library/stdtypes.rst:3232 ../../library/stdtypes.rst:4501 msgid "" "The precision determines the number of significant digits before and after " "the decimal point and defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:3222 ../../library/stdtypes.rst:4491 +#: ../../library/stdtypes.rst:3236 ../../library/stdtypes.rst:4505 msgid "If precision is ``N``, the output is truncated to ``N`` characters." msgstr "" -#: ../../library/stdtypes.rst:3225 ../../library/stdtypes.rst:4500 +#: ../../library/stdtypes.rst:3239 ../../library/stdtypes.rst:4514 msgid "See :pep:`237`." msgstr "參閱 :pep:`237`。" -#: ../../library/stdtypes.rst:3227 +#: ../../library/stdtypes.rst:3241 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:3232 +#: ../../library/stdtypes.rst:3246 msgid "" "``%f`` conversions for numbers whose absolute value is over 1e50 are no " "longer replaced by ``%g`` conversions." msgstr "" -#: ../../library/stdtypes.rst:3243 +#: ../../library/stdtypes.rst:3257 msgid "" "Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:" "`memoryview`" msgstr "" -#: ../../library/stdtypes.rst:3251 +#: ../../library/stdtypes.rst:3265 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 :" @@ -5177,17 +5208,17 @@ msgid "" "objects without needing to make a copy." msgstr "" -#: ../../library/stdtypes.rst:3256 +#: ../../library/stdtypes.rst:3270 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:3262 +#: ../../library/stdtypes.rst:3276 msgid "Bytes Objects" msgstr "" -#: ../../library/stdtypes.rst:3266 +#: ../../library/stdtypes.rst:3280 msgid "" "Bytes objects are immutable sequences of single bytes. Since many major " "binary protocols are based on the ASCII text encoding, bytes objects offer " @@ -5195,40 +5226,40 @@ msgid "" "and are closely related to string objects in a variety of other ways." msgstr "" -#: ../../library/stdtypes.rst:3274 +#: ../../library/stdtypes.rst:3288 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:3277 +#: ../../library/stdtypes.rst:3291 msgid "Single quotes: ``b'still allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:3278 +#: ../../library/stdtypes.rst:3292 msgid "Double quotes: ``b\"still allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:3279 +#: ../../library/stdtypes.rst:3293 msgid "" "Triple quoted: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:3281 +#: ../../library/stdtypes.rst:3295 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:3285 +#: ../../library/stdtypes.rst:3299 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:3289 +#: ../../library/stdtypes.rst:3303 msgid "" "While bytes literals and representations are based on ASCII text, bytes " "objects actually behave like immutable sequences of integers, with each " @@ -5241,29 +5272,29 @@ msgid "" "compatible will usually lead to data corruption)." msgstr "" -#: ../../library/stdtypes.rst:3299 +#: ../../library/stdtypes.rst:3313 msgid "" "In addition to the literal forms, bytes objects can be created in a number " "of other ways:" msgstr "" -#: ../../library/stdtypes.rst:3302 +#: ../../library/stdtypes.rst:3316 msgid "A zero-filled bytes object of a specified length: ``bytes(10)``" msgstr "" -#: ../../library/stdtypes.rst:3303 +#: ../../library/stdtypes.rst:3317 msgid "From an iterable of integers: ``bytes(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:3304 +#: ../../library/stdtypes.rst:3318 msgid "Copying existing binary data via the buffer protocol: ``bytes(obj)``" msgstr "" -#: ../../library/stdtypes.rst:3306 +#: ../../library/stdtypes.rst:3320 msgid "Also see the :ref:`bytes ` built-in." msgstr "另見內建的 :ref:`bytes `。" -#: ../../library/stdtypes.rst:3308 +#: ../../library/stdtypes.rst:3322 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -5271,38 +5302,38 @@ msgid "" "that format:" msgstr "" -#: ../../library/stdtypes.rst:3314 +#: ../../library/stdtypes.rst:3328 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:3321 +#: ../../library/stdtypes.rst:3335 msgid "" ":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just " "spaces." msgstr "" -#: ../../library/stdtypes.rst:3325 +#: ../../library/stdtypes.rst:3339 msgid "" ":meth:`bytes.fromhex` now accepts ASCII :class:`bytes` and :term:`bytes-like " "objects ` as input." msgstr "" -#: ../../library/stdtypes.rst:3329 +#: ../../library/stdtypes.rst:3343 msgid "" "A reverse conversion function exists to transform a bytes object into its " "hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:3335 ../../library/stdtypes.rst:3426 +#: ../../library/stdtypes.rst:3349 ../../library/stdtypes.rst:3440 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." msgstr "" -#: ../../library/stdtypes.rst:3341 +#: ../../library/stdtypes.rst:3355 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, " @@ -5311,13 +5342,13 @@ msgid "" "the separator position from the right, negative values from the left." msgstr "" -#: ../../library/stdtypes.rst:3358 +#: ../../library/stdtypes.rst:3372 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:3362 +#: ../../library/stdtypes.rst:3376 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 " @@ -5325,58 +5356,58 @@ msgid "" "and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:3367 +#: ../../library/stdtypes.rst:3381 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:3375 +#: ../../library/stdtypes.rst:3389 msgid "Bytearray Objects" msgstr "Bytearray 物件" -#: ../../library/stdtypes.rst:3379 +#: ../../library/stdtypes.rst:3393 msgid "" ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` " "objects." msgstr "" -#: ../../library/stdtypes.rst:3385 +#: ../../library/stdtypes.rst:3399 msgid "" "There is no dedicated literal syntax for bytearray objects, instead they are " "always created by calling the constructor:" msgstr "" -#: ../../library/stdtypes.rst:3388 +#: ../../library/stdtypes.rst:3402 msgid "Creating an empty instance: ``bytearray()``" msgstr "建立一個空的實例:``bytearray()``" -#: ../../library/stdtypes.rst:3389 +#: ../../library/stdtypes.rst:3403 msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" msgstr "" -#: ../../library/stdtypes.rst:3390 +#: ../../library/stdtypes.rst:3404 msgid "From an iterable of integers: ``bytearray(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:3391 +#: ../../library/stdtypes.rst:3405 msgid "" "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" -#: ../../library/stdtypes.rst:3393 +#: ../../library/stdtypes.rst:3407 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:3397 +#: ../../library/stdtypes.rst:3411 msgid "Also see the :ref:`bytearray ` built-in." msgstr "另見內建的 :ref:`bytearray `。" -#: ../../library/stdtypes.rst:3399 +#: ../../library/stdtypes.rst:3413 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -5384,64 +5415,64 @@ msgid "" "in that format:" msgstr "" -#: ../../library/stdtypes.rst:3405 +#: ../../library/stdtypes.rst:3419 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:3412 +#: ../../library/stdtypes.rst:3426 msgid "" ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not " "just spaces." msgstr "" -#: ../../library/stdtypes.rst:3416 +#: ../../library/stdtypes.rst:3430 msgid "" ":meth:`bytearray.fromhex` now accepts ASCII :class:`bytes` and :term:`bytes-" "like objects ` as input." msgstr "" -#: ../../library/stdtypes.rst:3420 +#: ../../library/stdtypes.rst:3434 msgid "" "A reverse conversion function exists to transform a bytearray object into " "its hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:3434 +#: ../../library/stdtypes.rst:3448 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:3441 +#: ../../library/stdtypes.rst:3455 msgid "" "Resize the :class:`bytearray` to contain *size* bytes. *size* must be " "greater than or equal to 0." msgstr "" -#: ../../library/stdtypes.rst:3444 +#: ../../library/stdtypes.rst:3458 msgid "" "If the :class:`bytearray` needs to shrink, bytes beyond *size* are truncated." msgstr "" -#: ../../library/stdtypes.rst:3446 +#: ../../library/stdtypes.rst:3460 msgid "" "If the :class:`bytearray` needs to grow, all new bytes, those beyond *size*, " "will be set to null bytes." msgstr "" -#: ../../library/stdtypes.rst:3450 +#: ../../library/stdtypes.rst:3464 msgid "This is equivalent to:" msgstr "等同於:" -#: ../../library/stdtypes.rst:3458 +#: ../../library/stdtypes.rst:3472 msgid "Examples:" msgstr "範例:" -#: ../../library/stdtypes.rst:3471 +#: ../../library/stdtypes.rst:3485 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 " @@ -5449,7 +5480,7 @@ msgid "" "both indexing and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:3476 +#: ../../library/stdtypes.rst:3490 msgid "" "The representation of bytearray objects uses the bytes literal format " "(``bytearray(b'...')``) since it is often more useful than e.g. " @@ -5457,17 +5488,17 @@ msgid "" "a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:3483 +#: ../../library/stdtypes.rst:3497 msgid "" "For detailed information on thread-safety guarantees for :class:`bytearray` " "objects, see :ref:`thread-safety-bytearray`." msgstr "" -#: ../../library/stdtypes.rst:3490 +#: ../../library/stdtypes.rst:3504 msgid "Bytes and Bytearray Operations" msgstr "Bytes 和 Bytearray 的操作" -#: ../../library/stdtypes.rst:3495 +#: ../../library/stdtypes.rst:3509 msgid "" "Both bytes and bytearray objects support the :ref:`common ` " "sequence operations. They interoperate not just with operands of the same " @@ -5476,14 +5507,14 @@ msgid "" "return type of the result may depend on the order of operands." msgstr "" -#: ../../library/stdtypes.rst:3503 +#: ../../library/stdtypes.rst:3517 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:3507 +#: ../../library/stdtypes.rst:3521 msgid "" "a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" @@ -5491,11 +5522,11 @@ msgstr "" "a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" -#: ../../library/stdtypes.rst:3510 +#: ../../library/stdtypes.rst:3524 msgid "and::" msgstr "和: ::" -#: ../../library/stdtypes.rst:3512 +#: ../../library/stdtypes.rst:3526 msgid "" "a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" @@ -5503,60 +5534,60 @@ msgstr "" "a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" -#: ../../library/stdtypes.rst:3515 +#: ../../library/stdtypes.rst:3529 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:3520 +#: ../../library/stdtypes.rst:3534 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:3523 +#: ../../library/stdtypes.rst:3537 msgid "" "The following methods on bytes and bytearray objects can be used with " "arbitrary binary data." msgstr "" -#: ../../library/stdtypes.rst:3529 +#: ../../library/stdtypes.rst:3543 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:3533 ../../library/stdtypes.rst:3638 -#: ../../library/stdtypes.rst:3660 ../../library/stdtypes.rst:3726 -#: ../../library/stdtypes.rst:3739 +#: ../../library/stdtypes.rst:3547 ../../library/stdtypes.rst:3652 +#: ../../library/stdtypes.rst:3674 ../../library/stdtypes.rst:3740 +#: ../../library/stdtypes.rst:3753 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:3536 +#: ../../library/stdtypes.rst:3550 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:3539 ../../library/stdtypes.rst:3650 -#: ../../library/stdtypes.rst:3663 ../../library/stdtypes.rst:3729 -#: ../../library/stdtypes.rst:3742 +#: ../../library/stdtypes.rst:3553 ../../library/stdtypes.rst:3664 +#: ../../library/stdtypes.rst:3677 ../../library/stdtypes.rst:3743 +#: ../../library/stdtypes.rst:3756 msgid "Also accept an integer in the range 0 to 255 as the subsequence." msgstr "" -#: ../../library/stdtypes.rst:3546 +#: ../../library/stdtypes.rst:3560 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:3550 +#: ../../library/stdtypes.rst:3564 msgid "" ">>> b'TestHook'.removeprefix(b'Test')\n" "b'Hook'\n" @@ -5568,32 +5599,32 @@ msgstr "" ">>> b'BaseTestCase'.removeprefix(b'Test')\n" "b'BaseTestCase'" -#: ../../library/stdtypes.rst:3555 +#: ../../library/stdtypes.rst:3569 msgid "The *prefix* may be any :term:`bytes-like object`." msgstr "*prefix* 可以是任何的 :term:`bytes-like object`。" -#: ../../library/stdtypes.rst:3559 ../../library/stdtypes.rst:3581 -#: ../../library/stdtypes.rst:3714 ../../library/stdtypes.rst:3807 -#: ../../library/stdtypes.rst:3821 ../../library/stdtypes.rst:3851 -#: ../../library/stdtypes.rst:3865 ../../library/stdtypes.rst:3906 -#: ../../library/stdtypes.rst:3976 ../../library/stdtypes.rst:3994 -#: ../../library/stdtypes.rst:4022 ../../library/stdtypes.rst:4161 -#: ../../library/stdtypes.rst:4216 ../../library/stdtypes.rst:4259 -#: ../../library/stdtypes.rst:4280 ../../library/stdtypes.rst:4302 -#: ../../library/stdtypes.rst:4504 +#: ../../library/stdtypes.rst:3573 ../../library/stdtypes.rst:3595 +#: ../../library/stdtypes.rst:3728 ../../library/stdtypes.rst:3821 +#: ../../library/stdtypes.rst:3835 ../../library/stdtypes.rst:3865 +#: ../../library/stdtypes.rst:3879 ../../library/stdtypes.rst:3920 +#: ../../library/stdtypes.rst:3990 ../../library/stdtypes.rst:4008 +#: ../../library/stdtypes.rst:4036 ../../library/stdtypes.rst:4175 +#: ../../library/stdtypes.rst:4230 ../../library/stdtypes.rst:4273 +#: ../../library/stdtypes.rst:4294 ../../library/stdtypes.rst:4316 +#: ../../library/stdtypes.rst:4518 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:3568 +#: ../../library/stdtypes.rst:3582 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:3572 +#: ../../library/stdtypes.rst:3586 msgid "" ">>> b'MiscTests'.removesuffix(b'Tests')\n" "b'Misc'\n" @@ -5605,15 +5636,15 @@ msgstr "" ">>> b'TmpDirMixin'.removesuffix(b'Tests')\n" "b'TmpDirMixin'" -#: ../../library/stdtypes.rst:3577 +#: ../../library/stdtypes.rst:3591 msgid "The *suffix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3590 +#: ../../library/stdtypes.rst:3604 msgid "Return the bytes decoded to a :class:`str`." msgstr "" -#: ../../library/stdtypes.rst:3595 +#: ../../library/stdtypes.rst:3609 msgid "" "*errors* controls how decoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -5621,21 +5652,21 @@ msgid "" "`codecs.register_error`. See :ref:`error-handlers` for details." msgstr "" -#: ../../library/stdtypes.rst:3601 +#: ../../library/stdtypes.rst:3615 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:3607 +#: ../../library/stdtypes.rst:3621 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:3622 +#: ../../library/stdtypes.rst:3636 msgid "" "Return ``True`` if the binary data ends with the specified *suffix*, " "otherwise return ``False``. *suffix* can also be a tuple of suffixes to " @@ -5643,11 +5674,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:3627 +#: ../../library/stdtypes.rst:3641 msgid "The suffix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3633 +#: ../../library/stdtypes.rst:3647 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 " @@ -5655,14 +5686,14 @@ msgid "" "``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:3643 +#: ../../library/stdtypes.rst:3657 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:3647 +#: ../../library/stdtypes.rst:3661 msgid "" ">>> b'Py' in b'Python'\n" "True" @@ -5670,13 +5701,13 @@ msgstr "" ">>> b'Py' in b'Python'\n" "True" -#: ../../library/stdtypes.rst:3657 +#: ../../library/stdtypes.rst:3671 msgid "" "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence " "is not found." msgstr "" -#: ../../library/stdtypes.rst:3670 +#: ../../library/stdtypes.rst:3684 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 " @@ -5686,7 +5717,7 @@ msgid "" "method." msgstr "" -#: ../../library/stdtypes.rst:3681 +#: ../../library/stdtypes.rst:3695 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 " @@ -5694,7 +5725,7 @@ msgid "" "objects ` and have the same length." msgstr "" -#: ../../library/stdtypes.rst:3692 +#: ../../library/stdtypes.rst:3706 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 " @@ -5703,24 +5734,24 @@ msgid "" "by two empty bytes or bytearray objects." msgstr "" -#: ../../library/stdtypes.rst:3699 ../../library/stdtypes.rst:3756 +#: ../../library/stdtypes.rst:3713 ../../library/stdtypes.rst:3770 msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3705 +#: ../../library/stdtypes.rst:3719 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:3709 +#: ../../library/stdtypes.rst:3723 msgid "" "The subsequence to search for and its replacement may be any :term:`bytes-" "like object`." msgstr "" -#: ../../library/stdtypes.rst:3721 +#: ../../library/stdtypes.rst:3735 msgid "" "Return the highest index in the sequence where the subsequence *sub* is " "found, such that *sub* is contained within ``s[start:end]``. Optional " @@ -5728,13 +5759,13 @@ msgid "" "``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:3736 +#: ../../library/stdtypes.rst:3750 msgid "" "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence " "*sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:3749 +#: ../../library/stdtypes.rst:3763 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 " @@ -5743,7 +5774,7 @@ msgid "" "followed by a copy of the original sequence." msgstr "" -#: ../../library/stdtypes.rst:3762 +#: ../../library/stdtypes.rst:3776 msgid "" "Return ``True`` if the binary data starts with the specified *prefix*, " "otherwise return ``False``. *prefix* can also be a tuple of prefixes to " @@ -5751,11 +5782,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:3767 +#: ../../library/stdtypes.rst:3781 msgid "The prefix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3773 +#: ../../library/stdtypes.rst:3787 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 " @@ -5763,18 +5794,18 @@ msgid "" "object of length 256." msgstr "" -#: ../../library/stdtypes.rst:3778 +#: ../../library/stdtypes.rst:3792 msgid "" "You can use the :func:`bytes.maketrans` method to create a translation table." msgstr "" -#: ../../library/stdtypes.rst:3781 +#: ../../library/stdtypes.rst:3795 msgid "" "Set the *table* argument to ``None`` for translations that only delete " "characters::" msgstr "" -#: ../../library/stdtypes.rst:3784 +#: ../../library/stdtypes.rst:3798 msgid "" ">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" @@ -5782,11 +5813,11 @@ msgstr "" ">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" -#: ../../library/stdtypes.rst:3787 +#: ../../library/stdtypes.rst:3801 msgid "*delete* is now supported as a keyword argument." msgstr "支援 *delete* 關鍵字引數。" -#: ../../library/stdtypes.rst:3791 +#: ../../library/stdtypes.rst:3805 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 " @@ -5795,7 +5826,7 @@ msgid "" "instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3800 +#: ../../library/stdtypes.rst:3814 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). " @@ -5803,7 +5834,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3814 +#: ../../library/stdtypes.rst:3828 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). " @@ -5811,7 +5842,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3828 +#: ../../library/stdtypes.rst:3842 msgid "" "Return a copy of the sequence with specified leading bytes removed. The " "*bytes* argument is a binary sequence specifying the set of byte values to " @@ -5820,7 +5851,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3834 +#: ../../library/stdtypes.rst:3848 msgid "" ">>> b' spacious '.lstrip()\n" "b'spacious '\n" @@ -5832,14 +5863,14 @@ msgstr "" ">>> b'www.example.com'.lstrip(b'cmowz.')\n" "b'example.com'" -#: ../../library/stdtypes.rst:3839 +#: ../../library/stdtypes.rst:3853 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:3844 +#: ../../library/stdtypes.rst:3858 msgid "" ">>> b'Arthur: three!'.lstrip(b'Arthur: ')\n" "b'ee!'\n" @@ -5851,7 +5882,7 @@ msgstr "" ">>> b'Arthur: three!'.removeprefix(b'Arthur: ')\n" "b'three!'" -#: ../../library/stdtypes.rst:3858 +#: ../../library/stdtypes.rst:3872 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). " @@ -5859,7 +5890,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3872 +#: ../../library/stdtypes.rst:3886 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 " @@ -5869,7 +5900,7 @@ msgid "" "described in detail below." msgstr "" -#: ../../library/stdtypes.rst:3883 +#: ../../library/stdtypes.rst:3897 msgid "" "Return a copy of the sequence with specified trailing bytes removed. The " "*bytes* argument is a binary sequence specifying the set of byte values to " @@ -5878,7 +5909,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3889 +#: ../../library/stdtypes.rst:3903 msgid "" ">>> b' spacious '.rstrip()\n" "b' spacious'\n" @@ -5890,14 +5921,14 @@ msgstr "" ">>> b'mississippi'.rstrip(b'ipz')\n" "b'mississ'" -#: ../../library/stdtypes.rst:3894 +#: ../../library/stdtypes.rst:3908 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:3899 +#: ../../library/stdtypes.rst:3913 msgid "" ">>> b'Monty Python'.rstrip(b' Python')\n" "b'M'\n" @@ -5909,7 +5940,7 @@ msgstr "" ">>> b'Monty Python'.removesuffix(b' Python')\n" "b'Monty'" -#: ../../library/stdtypes.rst:3913 +#: ../../library/stdtypes.rst:3927 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 " @@ -5918,7 +5949,7 @@ msgid "" "limit on the number of splits (all possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:3919 +#: ../../library/stdtypes.rst:3933 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',')`` " @@ -5929,7 +5960,7 @@ msgid "" "like object`." msgstr "" -#: ../../library/stdtypes.rst:3929 +#: ../../library/stdtypes.rst:3943 msgid "" ">>> b'1,2,3'.split(b',')\n" "[b'1', b'2', b'3']\n" @@ -5949,7 +5980,7 @@ msgstr "" ">>> b'1<>2<>3<4'.split(b'<>')\n" "[b'1', b'2', b'3<4']" -#: ../../library/stdtypes.rst:3938 +#: ../../library/stdtypes.rst:3952 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 " @@ -5959,7 +5990,7 @@ msgid "" "without a specified separator returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:3948 +#: ../../library/stdtypes.rst:3962 msgid "" ">>> b'1 2 3'.split()\n" "[b'1', b'2', b'3']\n" @@ -5975,7 +6006,7 @@ msgstr "" ">>> b' 1 2 3 '.split()\n" "[b'1', b'2', b'3']" -#: ../../library/stdtypes.rst:3959 +#: ../../library/stdtypes.rst:3973 msgid "" "Return a copy of the sequence with specified leading and trailing bytes " "removed. The *bytes* argument is a binary sequence specifying the set of " @@ -5984,7 +6015,7 @@ msgid "" "or suffix; rather, all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3966 +#: ../../library/stdtypes.rst:3980 msgid "" ">>> b' spacious '.strip()\n" "b'spacious'\n" @@ -5996,13 +6027,13 @@ msgstr "" ">>> b'www.example.com'.strip(b'cmowz.')\n" "b'example'" -#: ../../library/stdtypes.rst:3971 +#: ../../library/stdtypes.rst:3985 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`." msgstr "" -#: ../../library/stdtypes.rst:3980 +#: ../../library/stdtypes.rst:3994 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 " @@ -6010,14 +6041,14 @@ msgid "" "operate in place, and instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3988 +#: ../../library/stdtypes.rst:4002 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:4001 +#: ../../library/stdtypes.rst:4015 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 " @@ -6033,7 +6064,7 @@ msgid "" "by one regardless of how the byte value is represented when printed::" msgstr "" -#: ../../library/stdtypes.rst:4015 +#: ../../library/stdtypes.rst:4029 msgid "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs()\n" "b'01 012 0123 01234'\n" @@ -6045,7 +6076,7 @@ msgstr "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs(4)\n" "b'01 012 0123 01234'" -#: ../../library/stdtypes.rst:4029 +#: ../../library/stdtypes.rst:4043 msgid "" "Return ``True`` if all bytes in the sequence are alphabetical ASCII " "characters or ASCII decimal digits and the sequence is not empty, ``False`` " @@ -6054,7 +6085,7 @@ msgid "" "digits are those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:4037 +#: ../../library/stdtypes.rst:4051 msgid "" ">>> b'ABCabc1'.isalnum()\n" "True\n" @@ -6066,7 +6097,7 @@ msgstr "" ">>> b'ABC abc1'.isalnum()\n" "False" -#: ../../library/stdtypes.rst:4046 +#: ../../library/stdtypes.rst:4060 msgid "" "Return ``True`` if all bytes in the sequence are alphabetic ASCII characters " "and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII " @@ -6074,7 +6105,7 @@ msgid "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:4053 +#: ../../library/stdtypes.rst:4067 msgid "" ">>> b'ABCabc'.isalpha()\n" "True\n" @@ -6086,20 +6117,20 @@ msgstr "" ">>> b'ABCabc1'.isalpha()\n" "False" -#: ../../library/stdtypes.rst:4062 +#: ../../library/stdtypes.rst:4076 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:4072 +#: ../../library/stdtypes.rst:4086 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:4078 +#: ../../library/stdtypes.rst:4092 msgid "" ">>> b'1234'.isdigit()\n" "True\n" @@ -6111,13 +6142,13 @@ msgstr "" ">>> b'1.23'.isdigit()\n" "False" -#: ../../library/stdtypes.rst:4087 +#: ../../library/stdtypes.rst:4101 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:4092 +#: ../../library/stdtypes.rst:4106 msgid "" ">>> b'hello world'.islower()\n" "True\n" @@ -6129,16 +6160,16 @@ msgstr "" ">>> b'Hello world'.islower()\n" "False" -#: ../../library/stdtypes.rst:4097 ../../library/stdtypes.rst:4139 -#: ../../library/stdtypes.rst:4155 ../../library/stdtypes.rst:4205 -#: ../../library/stdtypes.rst:4274 +#: ../../library/stdtypes.rst:4111 ../../library/stdtypes.rst:4153 +#: ../../library/stdtypes.rst:4169 ../../library/stdtypes.rst:4219 +#: ../../library/stdtypes.rst:4288 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:4105 +#: ../../library/stdtypes.rst:4119 msgid "" "Return ``True`` if all bytes in the sequence are ASCII whitespace and the " "sequence is not empty, ``False`` otherwise. ASCII whitespace characters are " @@ -6146,14 +6177,14 @@ msgid "" "newline, carriage return, vertical tab, form feed)." msgstr "" -#: ../../library/stdtypes.rst:4114 +#: ../../library/stdtypes.rst:4128 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:4120 +#: ../../library/stdtypes.rst:4134 msgid "" ">>> b'Hello World'.istitle()\n" "True\n" @@ -6165,14 +6196,14 @@ msgstr "" ">>> b'Hello world'.istitle()\n" "False" -#: ../../library/stdtypes.rst:4129 +#: ../../library/stdtypes.rst:4143 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:4134 +#: ../../library/stdtypes.rst:4148 msgid "" ">>> b'HELLO WORLD'.isupper()\n" "True\n" @@ -6184,13 +6215,13 @@ msgstr "" ">>> b'Hello world'.isupper()\n" "False" -#: ../../library/stdtypes.rst:4147 +#: ../../library/stdtypes.rst:4161 msgid "" "Return a copy of the sequence with all the uppercase ASCII characters " "converted to their corresponding lowercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:4152 +#: ../../library/stdtypes.rst:4166 msgid "" ">>> b'Hello World'.lower()\n" "b'hello world'" @@ -6198,7 +6229,7 @@ msgstr "" ">>> b'Hello World'.lower()\n" "b'hello world'" -#: ../../library/stdtypes.rst:4172 +#: ../../library/stdtypes.rst:4186 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 " @@ -6206,7 +6237,7 @@ msgid "" "*keepends* is given and true." msgstr "" -#: ../../library/stdtypes.rst:4179 +#: ../../library/stdtypes.rst:4193 msgid "" ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "[b'ab c', b'', b'de fg', b'kl']\n" @@ -6218,14 +6249,14 @@ msgstr "" ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" "[b'ab c\\n', b'\\n', b'de fg\\r', b'kl\\r\\n']" -#: ../../library/stdtypes.rst:4184 +#: ../../library/stdtypes.rst:4198 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:4188 +#: ../../library/stdtypes.rst:4202 msgid "" ">>> b\"\".split(b'\\n'), b\"Two lines\\n\".split(b'\\n')\n" "([b''], [b'Two lines', b''])\n" @@ -6237,13 +6268,13 @@ msgstr "" ">>> b\"\".splitlines(), b\"One line\\n\".splitlines()\n" "([], [b'One line'])" -#: ../../library/stdtypes.rst:4197 +#: ../../library/stdtypes.rst:4211 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:4202 +#: ../../library/stdtypes.rst:4216 msgid "" ">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" @@ -6251,7 +6282,7 @@ msgstr "" ">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" -#: ../../library/stdtypes.rst:4209 +#: ../../library/stdtypes.rst:4223 msgid "" "Unlike :func:`str.swapcase`, it is always the case that ``bin.swapcase()." "swapcase() == bin`` for the binary versions. Case conversions are " @@ -6259,14 +6290,14 @@ msgid "" "Unicode code points." msgstr "" -#: ../../library/stdtypes.rst:4223 +#: ../../library/stdtypes.rst:4237 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:4229 +#: ../../library/stdtypes.rst:4243 msgid "" ">>> b'Hello world'.title()\n" "b'Hello World'" @@ -6274,7 +6305,7 @@ msgstr "" ">>> b'Hello world'.title()\n" "b'Hello World'" -#: ../../library/stdtypes.rst:4232 +#: ../../library/stdtypes.rst:4246 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -6282,7 +6313,7 @@ msgid "" "values are uncased." msgstr "" -#: ../../library/stdtypes.rst:4242 +#: ../../library/stdtypes.rst:4256 msgid "" ">>> b\"they're bill's friends from the UK\".title()\n" "b\"They'Re Bill'S Friends From The Uk\"" @@ -6290,12 +6321,12 @@ msgstr "" ">>> b\"they're bill's friends from the UK\".title()\n" "b\"They'Re Bill'S Friends From The Uk\"" -#: ../../library/stdtypes.rst:4245 +#: ../../library/stdtypes.rst:4259 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "" -#: ../../library/stdtypes.rst:4247 +#: ../../library/stdtypes.rst:4261 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -6317,13 +6348,13 @@ msgstr "" ">>> titlecase(b\"they're bill's friends.\")\n" "b\"They're Bill's Friends.\"" -#: ../../library/stdtypes.rst:4266 +#: ../../library/stdtypes.rst:4280 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:4271 +#: ../../library/stdtypes.rst:4285 msgid "" ">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" @@ -6331,7 +6362,7 @@ msgstr "" ">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" -#: ../../library/stdtypes.rst:4287 +#: ../../library/stdtypes.rst:4301 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 " @@ -6340,7 +6371,7 @@ msgid "" "*width* is less than or equal to ``len(seq)``." msgstr "" -#: ../../library/stdtypes.rst:4295 +#: ../../library/stdtypes.rst:4309 msgid "" ">>> b\"42\".zfill(5)\n" "b'00042'\n" @@ -6352,11 +6383,11 @@ msgstr "" ">>> b\"-42\".zfill(5)\n" "b'-0042'" -#: ../../library/stdtypes.rst:4309 +#: ../../library/stdtypes.rst:4323 msgid "``printf``-style Bytes Formatting" msgstr "" -#: ../../library/stdtypes.rst:4326 +#: ../../library/stdtypes.rst:4340 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 " @@ -6364,7 +6395,7 @@ msgid "" "dictionary, wrap it in a tuple." msgstr "" -#: ../../library/stdtypes.rst:4331 +#: ../../library/stdtypes.rst:4345 msgid "" "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " @@ -6374,7 +6405,7 @@ msgid "" "func:`sprintf` in the C language." msgstr "" -#: ../../library/stdtypes.rst:4338 +#: ../../library/stdtypes.rst:4352 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 " @@ -6382,7 +6413,7 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:4372 +#: ../../library/stdtypes.rst:4386 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 " @@ -6390,77 +6421,77 @@ msgid "" "mapping key selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:4424 +#: ../../library/stdtypes.rst:4438 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/stdtypes.rst:4446 +#: ../../library/stdtypes.rst:4460 msgid "Single byte (accepts integer or single byte objects)." msgstr "" -#: ../../library/stdtypes.rst:4449 +#: ../../library/stdtypes.rst:4463 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/stdtypes.rst:4449 +#: ../../library/stdtypes.rst:4463 msgid "" "Bytes (any object that follows the :ref:`buffer protocol ` or " "has :meth:`~object.__bytes__`)." msgstr "" -#: ../../library/stdtypes.rst:4453 +#: ../../library/stdtypes.rst:4467 msgid "" "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:4456 +#: ../../library/stdtypes.rst:4470 msgid "" "Bytes (converts any Python object using ``repr(obj).encode('ascii', " "'backslashreplace')``)." msgstr "" -#: ../../library/stdtypes.rst:4459 +#: ../../library/stdtypes.rst:4473 msgid "" "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:4459 +#: ../../library/stdtypes.rst:4473 msgid "\\(7)" msgstr "\\(7)" -#: ../../library/stdtypes.rst:4494 +#: ../../library/stdtypes.rst:4508 msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." msgstr "``b'%s'`` 已被棄用,但在 3.x 系列中不會被移除。" -#: ../../library/stdtypes.rst:4497 +#: ../../library/stdtypes.rst:4511 msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." msgstr "``b'%r'`` 已被棄用,但在 3.x 系列中不會被移除。" -#: ../../library/stdtypes.rst:4509 +#: ../../library/stdtypes.rst:4523 msgid ":pep:`461` - Adding % formatting to bytes and bytearray" msgstr "" -#: ../../library/stdtypes.rst:4516 +#: ../../library/stdtypes.rst:4530 msgid "Memory Views" msgstr "" -#: ../../library/stdtypes.rst:4518 +#: ../../library/stdtypes.rst:4532 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:4524 +#: ../../library/stdtypes.rst:4538 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:4528 +#: ../../library/stdtypes.rst:4542 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 " @@ -6468,32 +6499,32 @@ msgid "" "other types such as :class:`array.array` may have bigger elements." msgstr "" -#: ../../library/stdtypes.rst:4533 +#: ../../library/stdtypes.rst:4547 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:4537 +#: ../../library/stdtypes.rst:4551 msgid "" "If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of " "returning 1." msgstr "" -#: ../../library/stdtypes.rst:4540 +#: ../../library/stdtypes.rst:4554 msgid "" "The :class:`~memoryview.itemsize` attribute will give you the number of " "bytes in a single element." msgstr "" -#: ../../library/stdtypes.rst:4543 +#: ../../library/stdtypes.rst:4557 msgid "" "A :class:`memoryview` supports slicing and indexing to expose its data. One-" "dimensional slicing will result in a subview::" msgstr "" -#: ../../library/stdtypes.rst:4546 +#: ../../library/stdtypes.rst:4560 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> v[1]\n" @@ -6515,7 +6546,7 @@ msgstr "" ">>> bytes(v[1:4])\n" "b'bce'" -#: ../../library/stdtypes.rst:4556 +#: ../../library/stdtypes.rst:4570 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 " @@ -6526,11 +6557,11 @@ msgid "" "memoryviews can be indexed with the empty tuple." msgstr "" -#: ../../library/stdtypes.rst:4565 +#: ../../library/stdtypes.rst:4579 msgid "Here is an example with a non-byte format::" msgstr "" -#: ../../library/stdtypes.rst:4567 +#: ../../library/stdtypes.rst:4581 msgid "" ">>> import array\n" ">>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444])\n" @@ -6552,13 +6583,13 @@ msgstr "" ">>> m[::2].tolist()\n" "[-11111111, -33333333]" -#: ../../library/stdtypes.rst:4577 +#: ../../library/stdtypes.rst:4591 msgid "" "If the underlying object is writable, the memoryview supports one-" "dimensional slice assignment. Resizing is not allowed::" msgstr "" -#: ../../library/stdtypes.rst:4580 +#: ../../library/stdtypes.rst:4594 msgid "" ">>> data = bytearray(b'abcefg')\n" ">>> v = memoryview(data)\n" @@ -6598,14 +6629,14 @@ msgstr "" ">>> data\n" "bytearray(b'z1spam')" -#: ../../library/stdtypes.rst:4598 +#: ../../library/stdtypes.rst:4612 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:4602 +#: ../../library/stdtypes.rst:4616 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> hash(v) == hash(b'abcefg')\n" @@ -6623,44 +6654,44 @@ msgstr "" ">>> hash(v[::-2]) == hash(b'abcefg'[::-2])\n" "True" -#: ../../library/stdtypes.rst:4610 +#: ../../library/stdtypes.rst:4624 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:4614 +#: ../../library/stdtypes.rst:4628 msgid "" "memoryview is now registered automatically with :class:`collections.abc." "Sequence`" msgstr "" -#: ../../library/stdtypes.rst:4618 +#: ../../library/stdtypes.rst:4632 msgid "memoryviews can now be indexed with tuple of integers." msgstr "" -#: ../../library/stdtypes.rst:4621 +#: ../../library/stdtypes.rst:4635 msgid "memoryview is now a :term:`generic type`." msgstr "" -#: ../../library/stdtypes.rst:4624 +#: ../../library/stdtypes.rst:4638 msgid ":class:`memoryview` has several methods:" msgstr ":class:`memoryview` 有幾個方法:" -#: ../../library/stdtypes.rst:4628 +#: ../../library/stdtypes.rst:4642 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:4632 +#: ../../library/stdtypes.rst:4646 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:4635 +#: ../../library/stdtypes.rst:4649 msgid "" ">>> import array\n" ">>> a = array.array('I', [1, 2, 3, 4, 5])\n" @@ -6694,14 +6725,14 @@ msgstr "" ">>> z.tolist() == c.tolist()\n" "True" -#: ../../library/stdtypes.rst:4651 +#: ../../library/stdtypes.rst:4665 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:4655 +#: ../../library/stdtypes.rst:4669 msgid "" ">>> from ctypes import BigEndianStructure, c_long\n" ">>> class BEPoint(BigEndianStructure):\n" @@ -6727,25 +6758,25 @@ msgstr "" ">>> a == b\n" "False" -#: ../../library/stdtypes.rst:4667 +#: ../../library/stdtypes.rst:4681 msgid "" "Note that, as with floating-point numbers, ``v is w`` does *not* imply ``v " "== w`` for memoryview objects." msgstr "" -#: ../../library/stdtypes.rst:4670 +#: ../../library/stdtypes.rst:4684 msgid "" "Previous versions compared the raw memory disregarding the item format and " "the logical array structure." msgstr "" -#: ../../library/stdtypes.rst:4676 +#: ../../library/stdtypes.rst:4690 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:4679 +#: ../../library/stdtypes.rst:4693 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.tobytes()\n" @@ -6759,7 +6790,7 @@ msgstr "" ">>> bytes(m)\n" "b'abc'" -#: ../../library/stdtypes.rst:4685 +#: ../../library/stdtypes.rst:4699 msgid "" "For non-contiguous arrays the result is equal to the flattened list " "representation with all elements converted to bytes. :meth:`tobytes` " @@ -6767,7 +6798,7 @@ msgid "" "module syntax." msgstr "" -#: ../../library/stdtypes.rst:4690 +#: ../../library/stdtypes.rst:4704 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' " @@ -6776,13 +6807,13 @@ msgid "" "to C first. *order=None* is the same as *order='C'*." msgstr "" -#: ../../library/stdtypes.rst:4700 +#: ../../library/stdtypes.rst:4714 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the buffer. ::" msgstr "" -#: ../../library/stdtypes.rst:4703 +#: ../../library/stdtypes.rst:4717 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.hex()\n" @@ -6792,18 +6823,18 @@ msgstr "" ">>> m.hex()\n" "'616263'" -#: ../../library/stdtypes.rst:4709 +#: ../../library/stdtypes.rst:4723 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:4716 +#: ../../library/stdtypes.rst:4730 msgid "Return the data in the buffer as a list of elements. ::" msgstr "" -#: ../../library/stdtypes.rst:4718 +#: ../../library/stdtypes.rst:4732 msgid "" ">>> memoryview(b'abc').tolist()\n" "[97, 98, 99]\n" @@ -6821,19 +6852,19 @@ msgstr "" ">>> m.tolist()\n" "[1.1, 2.2, 3.3]" -#: ../../library/stdtypes.rst:4726 +#: ../../library/stdtypes.rst:4740 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:4733 +#: ../../library/stdtypes.rst:4747 msgid "" "Return a readonly version of the memoryview object. The original memoryview " "object is unchanged. ::" msgstr "" -#: ../../library/stdtypes.rst:4736 +#: ../../library/stdtypes.rst:4750 msgid "" ">>> m = memoryview(bytearray(b'abc'))\n" ">>> mm = m.toreadonly()\n" @@ -6859,7 +6890,7 @@ msgstr "" ">>> mm.tolist()\n" "[43, 98, 99]" -#: ../../library/stdtypes.rst:4752 +#: ../../library/stdtypes.rst:4766 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 :" @@ -6868,14 +6899,14 @@ msgid "" "resources) as soon as possible." msgstr "" -#: ../../library/stdtypes.rst:4758 +#: ../../library/stdtypes.rst:4772 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:4762 +#: ../../library/stdtypes.rst:4776 msgid "" ">>> m = memoryview(b'abc')\n" ">>> m.release()\n" @@ -6891,13 +6922,13 @@ msgstr "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" -#: ../../library/stdtypes.rst:4769 +#: ../../library/stdtypes.rst:4783 msgid "" "The context management protocol can be used for a similar effect, using the " "``with`` statement::" msgstr "" -#: ../../library/stdtypes.rst:4772 +#: ../../library/stdtypes.rst:4786 msgid "" ">>> with memoryview(b'abc') as m:\n" "... m[0]\n" @@ -6917,7 +6948,7 @@ msgstr "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" -#: ../../library/stdtypes.rst:4786 +#: ../../library/stdtypes.rst:4800 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 " @@ -6926,7 +6957,7 @@ msgid "" "contiguous -> 1D." msgstr "" -#: ../../library/stdtypes.rst:4792 +#: ../../library/stdtypes.rst:4806 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 " @@ -6934,11 +6965,11 @@ msgid "" "Note that all byte lengths may depend on the operating system." msgstr "" -#: ../../library/stdtypes.rst:4798 +#: ../../library/stdtypes.rst:4812 msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "" -#: ../../library/stdtypes.rst:4800 +#: ../../library/stdtypes.rst:4814 msgid "" ">>> import array\n" ">>> a = array.array('l', [1,2,3])\n" @@ -6982,11 +7013,11 @@ msgstr "" ">>> y.nbytes\n" "24" -#: ../../library/stdtypes.rst:4821 +#: ../../library/stdtypes.rst:4835 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "" -#: ../../library/stdtypes.rst:4823 +#: ../../library/stdtypes.rst:4837 msgid "" ">>> b = bytearray(b'zyz')\n" ">>> x = memoryview(b)\n" @@ -7010,11 +7041,11 @@ msgstr "" ">>> b\n" "bytearray(b'ayz')" -#: ../../library/stdtypes.rst:4834 +#: ../../library/stdtypes.rst:4848 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "" -#: ../../library/stdtypes.rst:4836 +#: ../../library/stdtypes.rst:4850 msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"i\"*12, *list(range(12)))\n" @@ -7064,11 +7095,11 @@ msgstr "" ">>> z.nbytes\n" "48" -#: ../../library/stdtypes.rst:4860 +#: ../../library/stdtypes.rst:4874 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "" -#: ../../library/stdtypes.rst:4862 +#: ../../library/stdtypes.rst:4876 msgid "" ">>> buf = struct.pack(\"L\"*6, *list(range(6)))\n" ">>> x = memoryview(buf)\n" @@ -7090,33 +7121,33 @@ msgstr "" ">>> y.tolist()\n" "[[0, 1, 2], [3, 4, 5]]" -#: ../../library/stdtypes.rst:4874 +#: ../../library/stdtypes.rst:4888 msgid "The source format is no longer restricted when casting to a byte view." msgstr "" -#: ../../library/stdtypes.rst:4879 +#: ../../library/stdtypes.rst:4893 msgid "Count the number of occurrences of *value*." msgstr "計算 *value* 的出現次數" -#: ../../library/stdtypes.rst:4885 +#: ../../library/stdtypes.rst:4899 msgid "" "Return the index of the first occurrence of *value* (at or after index " "*start* and before index *stop*)." msgstr "" -#: ../../library/stdtypes.rst:4888 +#: ../../library/stdtypes.rst:4902 msgid "Raises a :exc:`ValueError` if *value* cannot be found." msgstr "在找不到 *value* 時引發 :exc:`ValueError`。" -#: ../../library/stdtypes.rst:4892 +#: ../../library/stdtypes.rst:4906 msgid "There are also several readonly attributes available:" msgstr "" -#: ../../library/stdtypes.rst:4896 +#: ../../library/stdtypes.rst:4910 msgid "The underlying object of the memoryview::" msgstr "memoryview 的底層物件: ::" -#: ../../library/stdtypes.rst:4898 +#: ../../library/stdtypes.rst:4912 msgid "" ">>> b = bytearray(b'xyz')\n" ">>> m = memoryview(b)\n" @@ -7128,14 +7159,14 @@ msgstr "" ">>> m.obj is b\n" "True" -#: ../../library/stdtypes.rst:4907 +#: ../../library/stdtypes.rst:4921 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:4911 +#: ../../library/stdtypes.rst:4925 msgid "" ">>> import array\n" ">>> a = array.array('i', [1,2,3,4,5])\n" @@ -7167,11 +7198,11 @@ msgstr "" ">>> len(y.tobytes())\n" "12" -#: ../../library/stdtypes.rst:4926 +#: ../../library/stdtypes.rst:4940 msgid "Multi-dimensional arrays::" msgstr "" -#: ../../library/stdtypes.rst:4928 +#: ../../library/stdtypes.rst:4942 msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"d\"*12, *[1.5*x for x in range(12)])\n" @@ -7195,11 +7226,11 @@ msgstr "" ">>> y.nbytes\n" "96" -#: ../../library/stdtypes.rst:4943 +#: ../../library/stdtypes.rst:4957 msgid "A bool indicating whether the memory is read only." msgstr "" -#: ../../library/stdtypes.rst:4947 +#: ../../library/stdtypes.rst:4961 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 " @@ -7207,17 +7238,17 @@ msgid "" "restricted to native single element formats." msgstr "" -#: ../../library/stdtypes.rst:4952 +#: ../../library/stdtypes.rst:4966 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:4958 +#: ../../library/stdtypes.rst:4972 msgid "The size in bytes of each element of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4960 +#: ../../library/stdtypes.rst:4974 msgid "" ">>> import array, struct\n" ">>> m = memoryview(array.array('H', [32000, 32001, 32002]))\n" @@ -7237,55 +7268,55 @@ msgstr "" ">>> struct.calcsize('H') == m.itemsize\n" "True" -#: ../../library/stdtypes.rst:4971 +#: ../../library/stdtypes.rst:4985 msgid "" "An integer indicating how many dimensions of a multi-dimensional array the " "memory represents." msgstr "" -#: ../../library/stdtypes.rst:4976 +#: ../../library/stdtypes.rst:4990 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:4979 ../../library/stdtypes.rst:4987 +#: ../../library/stdtypes.rst:4993 ../../library/stdtypes.rst:5001 msgid "An empty tuple instead of ``None`` when ndim = 0." msgstr "" -#: ../../library/stdtypes.rst:4984 +#: ../../library/stdtypes.rst:4998 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:4992 +#: ../../library/stdtypes.rst:5006 msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" -#: ../../library/stdtypes.rst:4996 +#: ../../library/stdtypes.rst:5010 msgid "A bool indicating whether the memory is C-:term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:5002 +#: ../../library/stdtypes.rst:5016 msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:5008 +#: ../../library/stdtypes.rst:5022 msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:5012 +#: ../../library/stdtypes.rst:5026 msgid "" "For information on the thread safety of :class:`memoryview` objects in the :" "term:`free-threaded build`, see :ref:`thread-safety-memoryview`." msgstr "" -#: ../../library/stdtypes.rst:5019 +#: ../../library/stdtypes.rst:5033 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "" -#: ../../library/stdtypes.rst:5023 +#: ../../library/stdtypes.rst:5037 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -7295,7 +7326,7 @@ msgid "" "`collections` module.)" msgstr "" -#: ../../library/stdtypes.rst:5030 +#: ../../library/stdtypes.rst:5044 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 " @@ -7303,7 +7334,7 @@ msgid "" "slicing, or other sequence-like behavior." msgstr "" -#: ../../library/stdtypes.rst:5035 +#: ../../library/stdtypes.rst:5049 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -7315,18 +7346,18 @@ msgid "" "of another set." msgstr "" -#: ../../library/stdtypes.rst:5044 +#: ../../library/stdtypes.rst:5058 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:5048 +#: ../../library/stdtypes.rst:5062 msgid "The constructors for both classes work the same:" msgstr "" -#: ../../library/stdtypes.rst:5053 +#: ../../library/stdtypes.rst:5067 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 " @@ -7334,92 +7365,92 @@ msgid "" "*iterable* is not specified, a new empty set is returned." msgstr "" -#: ../../library/stdtypes.rst:5059 +#: ../../library/stdtypes.rst:5073 msgid "Sets can be created by several means:" msgstr "集合可以以多種方式建立:" -#: ../../library/stdtypes.rst:5061 +#: ../../library/stdtypes.rst:5075 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:5062 +#: ../../library/stdtypes.rst:5076 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" -#: ../../library/stdtypes.rst:5063 +#: ../../library/stdtypes.rst:5077 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" msgstr "" -#: ../../library/stdtypes.rst:5065 +#: ../../library/stdtypes.rst:5079 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" msgstr "" -#: ../../library/stdtypes.rst:5070 +#: ../../library/stdtypes.rst:5084 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" -#: ../../library/stdtypes.rst:5074 +#: ../../library/stdtypes.rst:5088 msgid "Test *x* for membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:5078 +#: ../../library/stdtypes.rst:5092 msgid "Test *x* for non-membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:5083 +#: ../../library/stdtypes.rst:5097 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:5090 +#: ../../library/stdtypes.rst:5104 msgid "Test whether every element in the set is in *other*." msgstr "" -#: ../../library/stdtypes.rst:5094 +#: ../../library/stdtypes.rst:5108 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." msgstr "" -#: ../../library/stdtypes.rst:5101 +#: ../../library/stdtypes.rst:5115 msgid "Test whether every element in *other* is in the set." msgstr "" -#: ../../library/stdtypes.rst:5105 +#: ../../library/stdtypes.rst:5119 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." msgstr "" -#: ../../library/stdtypes.rst:5112 +#: ../../library/stdtypes.rst:5126 msgid "Return a new set with elements from the set and all others." msgstr "" -#: ../../library/stdtypes.rst:5118 +#: ../../library/stdtypes.rst:5132 msgid "Return a new set with elements common to the set and all others." msgstr "" -#: ../../library/stdtypes.rst:5124 +#: ../../library/stdtypes.rst:5138 msgid "Return a new set with elements in the set that are not in the others." msgstr "" -#: ../../library/stdtypes.rst:5130 +#: ../../library/stdtypes.rst:5144 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" -#: ../../library/stdtypes.rst:5135 +#: ../../library/stdtypes.rst:5149 msgid "Return a shallow copy of the set." msgstr "" -#: ../../library/stdtypes.rst:5138 +#: ../../library/stdtypes.rst:5152 msgid "" "Note, the non-operator versions of :meth:`~frozenset.union`, :meth:" "`~frozenset.intersection`, :meth:`~frozenset.difference`, :meth:`~frozenset." @@ -7430,7 +7461,7 @@ msgid "" "the more readable ``set('abc').intersection('cbs')``." msgstr "" -#: ../../library/stdtypes.rst:5145 +#: ../../library/stdtypes.rst:5159 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 " @@ -7440,14 +7471,14 @@ msgid "" "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -#: ../../library/stdtypes.rst:5152 +#: ../../library/stdtypes.rst:5166 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:5156 +#: ../../library/stdtypes.rst:5170 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 " @@ -7455,78 +7486,78 @@ msgid "" "``ab``." msgstr "" -#: ../../library/stdtypes.rst:5161 +#: ../../library/stdtypes.rst:5175 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:5164 +#: ../../library/stdtypes.rst:5178 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:5166 +#: ../../library/stdtypes.rst:5180 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:5170 +#: ../../library/stdtypes.rst:5184 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" msgstr "" -#: ../../library/stdtypes.rst:5176 +#: ../../library/stdtypes.rst:5190 msgid "Update the set, adding elements from all others." msgstr "" -#: ../../library/stdtypes.rst:5181 +#: ../../library/stdtypes.rst:5195 msgid "Update the set, keeping only elements found in it and all others." msgstr "" -#: ../../library/stdtypes.rst:5186 +#: ../../library/stdtypes.rst:5200 msgid "Update the set, removing elements found in others." msgstr "" -#: ../../library/stdtypes.rst:5191 +#: ../../library/stdtypes.rst:5205 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" -#: ../../library/stdtypes.rst:5195 +#: ../../library/stdtypes.rst:5209 msgid "Add element *elem* to the set." msgstr "將元素 *elem* 加入集合。" -#: ../../library/stdtypes.rst:5199 +#: ../../library/stdtypes.rst:5213 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." msgstr "" -#: ../../library/stdtypes.rst:5204 +#: ../../library/stdtypes.rst:5218 msgid "Remove element *elem* from the set if it is present." msgstr "如果 *elem* 存在於集合中則將其移除。" -#: ../../library/stdtypes.rst:5208 +#: ../../library/stdtypes.rst:5222 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." msgstr "" -#: ../../library/stdtypes.rst:5213 +#: ../../library/stdtypes.rst:5227 msgid "Remove all elements from the set." msgstr "從集合中移除所有元素。" -#: ../../library/stdtypes.rst:5216 +#: ../../library/stdtypes.rst:5230 msgid "" "Note, the non-operator versions of the :meth:`~set.update`, :meth:`~set." "intersection_update`, :meth:`~set.difference_update`, and :meth:`~set." "symmetric_difference_update` methods will accept any iterable as an argument." msgstr "" -#: ../../library/stdtypes.rst:5221 +#: ../../library/stdtypes.rst:5235 msgid "" "Note, the *elem* argument to the :meth:`~object.__contains__`, :meth:`~set." "remove`, and :meth:`~set.discard` methods may be a set. To support " @@ -7534,17 +7565,17 @@ msgid "" "*elem*." msgstr "" -#: ../../library/stdtypes.rst:5228 +#: ../../library/stdtypes.rst:5242 msgid "" "For detailed information on thread-safety guarantees for :class:`set` " "objects, see :ref:`thread-safety-set`." msgstr "" -#: ../../library/stdtypes.rst:5235 +#: ../../library/stdtypes.rst:5249 msgid "Mapping Types --- :class:`dict`" msgstr "" -#: ../../library/stdtypes.rst:5245 +#: ../../library/stdtypes.rst:5259 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -7553,7 +7584,7 @@ msgid "" "module.)" msgstr "" -#: ../../library/stdtypes.rst:5251 +#: ../../library/stdtypes.rst:5265 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -7562,33 +7593,33 @@ msgid "" "and ``True``) can be used interchangeably to index the same dictionary entry." msgstr "" -#: ../../library/stdtypes.rst:5262 +#: ../../library/stdtypes.rst:5276 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:5265 +#: ../../library/stdtypes.rst:5279 msgid "Dictionaries can be created by several means:" msgstr "字典可以用數種方式建立:" -#: ../../library/stdtypes.rst:5267 +#: ../../library/stdtypes.rst:5281 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:5269 +#: ../../library/stdtypes.rst:5283 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" -#: ../../library/stdtypes.rst:5270 +#: ../../library/stdtypes.rst:5284 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" msgstr "" -#: ../../library/stdtypes.rst:5273 +#: ../../library/stdtypes.rst:5287 msgid "" "If no positional argument is given, an empty dictionary is created. If a " "positional argument is given and it defines a ``keys()`` method, a " @@ -7601,7 +7632,7 @@ msgid "" "that key becomes the corresponding value in the new dictionary." msgstr "" -#: ../../library/stdtypes.rst:5283 +#: ../../library/stdtypes.rst:5297 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 " @@ -7609,7 +7640,7 @@ msgid "" "the value from the positional argument." msgstr "" -#: ../../library/stdtypes.rst:5288 +#: ../../library/stdtypes.rst:5302 msgid "" "Dictionaries compare equal if and only if they have the same ``(key, " "value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', " @@ -7618,7 +7649,7 @@ msgid "" "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -#: ../../library/stdtypes.rst:5294 +#: ../../library/stdtypes.rst:5308 msgid "" ">>> a = dict(one=1, two=2, three=3)\n" ">>> b = {'one': 1, 'two': 2, 'three': 3}\n" @@ -7638,19 +7669,19 @@ msgstr "" ">>> a == b == c == d == e == f\n" "True" -#: ../../library/stdtypes.rst:5303 +#: ../../library/stdtypes.rst:5317 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:5306 +#: ../../library/stdtypes.rst:5320 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:5309 +#: ../../library/stdtypes.rst:5323 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -7682,33 +7713,33 @@ msgstr "" ">>> d\n" "{'one': 42, 'three': 3, 'four': 4, 'two': None}" -#: ../../library/stdtypes.rst:5324 +#: ../../library/stdtypes.rst:5338 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:5328 +#: ../../library/stdtypes.rst:5342 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -#: ../../library/stdtypes.rst:5333 +#: ../../library/stdtypes.rst:5347 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:5337 +#: ../../library/stdtypes.rst:5351 msgid "Return the number of items in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:5341 +#: ../../library/stdtypes.rst:5355 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." msgstr "" -#: ../../library/stdtypes.rst:5346 +#: ../../library/stdtypes.rst:5360 msgid "" "If a subclass of dict defines a method :meth:`~object.__missing__` and *key* " "is not present, the ``d[key]`` operation calls that method with the key " @@ -7719,7 +7750,7 @@ msgid "" "__missing__` must be a method; it cannot be an instance variable::" msgstr "" -#: ../../library/stdtypes.rst:5354 +#: ../../library/stdtypes.rst:5368 msgid "" ">>> class Counter(dict):\n" "... def __missing__(self, key):\n" @@ -7743,51 +7774,51 @@ msgstr "" ">>> c['red']\n" "1" -#: ../../library/stdtypes.rst:5365 +#: ../../library/stdtypes.rst:5379 msgid "" "The example above shows part of the implementation of :class:`collections." "Counter`. A different :meth:`!__missing__` method is used by :class:" "`collections.defaultdict`." msgstr "" -#: ../../library/stdtypes.rst:5372 +#: ../../library/stdtypes.rst:5386 msgid "Set ``d[key]`` to *value*." msgstr "將 ``d[key]`` 設為 *value*。" -#: ../../library/stdtypes.rst:5376 +#: ../../library/stdtypes.rst:5390 msgid "" "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the " "map." msgstr "從 *d* 中移除 ``d[key]``。若 *key* 不在對映中則引發 :exc:`KeyError`。" -#: ../../library/stdtypes.rst:5381 +#: ../../library/stdtypes.rst:5395 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "若 *d* 有鍵 *key* 則回傳 ``True``,否則回傳 ``False``。" -#: ../../library/stdtypes.rst:5385 +#: ../../library/stdtypes.rst:5399 msgid "Equivalent to ``not key in d``." msgstr "等價於 ``not key in d``。" -#: ../../library/stdtypes.rst:5389 +#: ../../library/stdtypes.rst:5403 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:5394 +#: ../../library/stdtypes.rst:5408 msgid "Remove all items from the dictionary." msgstr "從字典中移除所有項目。" -#: ../../library/stdtypes.rst:5398 +#: ../../library/stdtypes.rst:5412 msgid "Return a shallow copy of the dictionary." msgstr "" -#: ../../library/stdtypes.rst:5402 +#: ../../library/stdtypes.rst:5416 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" -#: ../../library/stdtypes.rst:5404 +#: ../../library/stdtypes.rst:5418 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 " @@ -7796,70 +7827,70 @@ msgid "" "` instead." msgstr "" -#: ../../library/stdtypes.rst:5412 +#: ../../library/stdtypes.rst:5426 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:5418 +#: ../../library/stdtypes.rst:5432 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." msgstr "" -#: ../../library/stdtypes.rst:5423 +#: ../../library/stdtypes.rst:5437 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." msgstr "" -#: ../../library/stdtypes.rst:5429 +#: ../../library/stdtypes.rst:5443 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:5435 +#: ../../library/stdtypes.rst:5449 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:5438 +#: ../../library/stdtypes.rst:5452 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:5442 +#: ../../library/stdtypes.rst:5456 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." msgstr "" -#: ../../library/stdtypes.rst:5448 +#: ../../library/stdtypes.rst:5462 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:5455 +#: ../../library/stdtypes.rst:5469 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:5463 +#: ../../library/stdtypes.rst:5477 msgid "" "Update the dictionary with the key/value pairs from *mapping* or *iterable* " "and *kwargs*, overwriting existing keys. Return ``None``." msgstr "" -#: ../../library/stdtypes.rst:5466 +#: ../../library/stdtypes.rst:5480 msgid "" ":meth:`update` accepts either another object with a ``keys()`` method (in " "which case :meth:`~object.__getitem__` is called with every key returned " @@ -7868,20 +7899,20 @@ msgid "" "is then updated with those key/value pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:5474 +#: ../../library/stdtypes.rst:5488 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:5477 +#: ../../library/stdtypes.rst:5491 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:5481 +#: ../../library/stdtypes.rst:5495 msgid "" ">>> d = {'a': 1}\n" ">>> d.values() == d.values()\n" @@ -7891,25 +7922,25 @@ msgstr "" ">>> d.values() == d.values()\n" "False" -#: ../../library/stdtypes.rst:5487 +#: ../../library/stdtypes.rst:5501 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:5495 +#: ../../library/stdtypes.rst:5509 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:5501 +#: ../../library/stdtypes.rst:5515 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:5503 +#: ../../library/stdtypes.rst:5517 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -7931,27 +7962,27 @@ msgstr "" ">>> list(reversed(d.items()))\n" "[('four', 4), ('three', 3), ('two', 2), ('one', 1)]" -#: ../../library/stdtypes.rst:5513 +#: ../../library/stdtypes.rst:5527 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:5518 +#: ../../library/stdtypes.rst:5532 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:5524 +#: ../../library/stdtypes.rst:5538 msgid "" "For detailed information on thread-safety guarantees for :class:`dict` " "objects, see :ref:`thread-safety-dict`." msgstr "" -#: ../../library/stdtypes.rst:5531 +#: ../../library/stdtypes.rst:5545 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:5533 +#: ../../library/stdtypes.rst:5547 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 " @@ -7959,23 +7990,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:5538 +#: ../../library/stdtypes.rst:5552 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:5543 +#: ../../library/stdtypes.rst:5557 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:5547 +#: ../../library/stdtypes.rst:5561 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:5550 +#: ../../library/stdtypes.rst:5564 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -7983,39 +8014,39 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:5555 +#: ../../library/stdtypes.rst:5569 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:5558 +#: ../../library/stdtypes.rst:5572 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:5563 +#: ../../library/stdtypes.rst:5577 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:5568 +#: ../../library/stdtypes.rst:5582 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:5571 +#: ../../library/stdtypes.rst:5585 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:5576 +#: ../../library/stdtypes.rst:5590 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:5581 +#: ../../library/stdtypes.rst:5595 msgid "" "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 " @@ -8029,11 +8060,11 @@ msgid "" "input." msgstr "" -#: ../../library/stdtypes.rst:5593 +#: ../../library/stdtypes.rst:5607 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:5595 +#: ../../library/stdtypes.rst:5609 msgid "" ">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" ">>> keys = dishes.keys()\n" @@ -8074,11 +8105,11 @@ msgid "" "500" msgstr "" -#: ../../library/stdtypes.rst:5637 +#: ../../library/stdtypes.rst:5651 msgid "Context Manager Types" msgstr "情境管理器型別" -#: ../../library/stdtypes.rst:5644 +#: ../../library/stdtypes.rst:5658 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 " @@ -8089,7 +8120,7 @@ msgstr "" "要使用兩個方法來實作,該方法讓使用者定義類別能夠去定義 runtime 情境,且該情境" "在執行陳述式主體 (statement body) 之前進入、在陳述式結束時退出:" -#: ../../library/stdtypes.rst:5652 +#: ../../library/stdtypes.rst:5666 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 " @@ -8100,7 +8131,7 @@ msgstr "" "的值有被綁定到使用此情境管理器的 :keyword:`with` 陳述式的 :keyword:`!as` 子句" "中的識別字。" -#: ../../library/stdtypes.rst:5657 +#: ../../library/stdtypes.rst:5671 msgid "" "An example of a context manager that returns itself is a :term:`file " "object`. File objects return themselves from __enter__() to allow :func:" @@ -8109,7 +8140,7 @@ msgstr "" "一個會回傳自己的情境管理器範例是 :term:`file object`。檔案物件從 __enter__() " "回傳自己,以允許將 :func:`open` 用作 :keyword:`with` 陳述式中的情境運算式。" -#: ../../library/stdtypes.rst:5661 +#: ../../library/stdtypes.rst:5675 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 " @@ -8123,7 +8154,7 @@ msgstr "" "本。這允許對 :keyword:`with` 陳述式主體中的目前十進位情境進行更改,而不會影" "響 :keyword:`!with` 陳述式外部的程式碼。" -#: ../../library/stdtypes.rst:5671 +#: ../../library/stdtypes.rst:5685 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -8135,7 +8166,7 @@ msgstr "" "keyword:`with` 陳述式主體時發生例外,則引數包含例外型別、值和回溯 " "(traceback) 資訊。否則,所有三個引數都是 ``None``。" -#: ../../library/stdtypes.rst:5676 +#: ../../library/stdtypes.rst:5690 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -8146,14 +8177,14 @@ msgstr "" "keyword:`!with` 陳述式之後的陳述式。否則,該例外將在該方法執行完畢後繼續傳播 " "(propagate)。" -#: ../../library/stdtypes.rst:5681 +#: ../../library/stdtypes.rst:5695 msgid "" "If this method raises an exception while handling an earlier exception from " "the :keyword:`with` block, the new exception is raised, and the original " "exception is stored in its :attr:`~BaseException.__context__` attribute." msgstr "" -#: ../../library/stdtypes.rst:5685 +#: ../../library/stdtypes.rst:5699 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -8165,7 +8196,7 @@ msgstr "" "已成功完成且不希望抑制引發的例外。這讓情境管理程式碼能輕鬆檢測 :meth:" "`~object.__exit__` 方法是否曾實際失敗過。" -#: ../../library/stdtypes.rst:5691 +#: ../../library/stdtypes.rst:5705 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -8177,7 +8208,7 @@ msgstr "" "及對有效十進位算術情境的更簡單操作。除了情境管理協定的實作之外,不會對特定型" "別進行特殊處理。更多範例請參閱 :mod:`contextlib` 模組。" -#: ../../library/stdtypes.rst:5697 +#: ../../library/stdtypes.rst:5711 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -8192,7 +8223,7 @@ msgstr "" "`~contextmanager.__enter__` 和 :meth:`~contextmanager.__exit__` 方法的情境管" "理器,而不是由未裝飾產生器函式產生的疊代器。" -#: ../../library/stdtypes.rst:5704 +#: ../../library/stdtypes.rst:5718 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 " @@ -8204,7 +8235,7 @@ msgstr "" "定義這些方法的擴充型別必須將它們作為普通的 Python 可存取方法提供。與設定 " "runtime 情境的開銷相比,單一類別字典查找的開銷可以忽略不計。" -#: ../../library/stdtypes.rst:5712 +#: ../../library/stdtypes.rst:5726 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" @@ -8212,7 +8243,7 @@ msgstr "" "型別註釋的型別 --- :ref:`泛型別名 (Generic Alias) `、:" "ref:`聯合 (Union) `" -#: ../../library/stdtypes.rst:5717 +#: ../../library/stdtypes.rst:5731 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." @@ -8220,11 +8251,11 @@ msgstr "" ":term:`型別註釋 ` 的核心內建型別是\\ :ref:`泛型別名 `\\ 和\\ :ref:`聯合 `。" -#: ../../library/stdtypes.rst:5724 +#: ../../library/stdtypes.rst:5738 msgid "Generic Alias Type" msgstr "泛型別名型別" -#: ../../library/stdtypes.rst:5730 +#: ../../library/stdtypes.rst:5744 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -8240,7 +8271,7 @@ msgstr "" "立的。``GenericAlias`` 物件主要會與\\ :term:`型別註釋 ` 一起使" "用。" -#: ../../library/stdtypes.rst:5740 +#: ../../library/stdtypes.rst:5754 msgid "" "It is generally only possible to subscript a class if the class implements " "the special method :meth:`~object.__class_getitem__`." @@ -8248,7 +8279,7 @@ msgstr "" "通常只有當類別有實作特殊方法 :meth:`~object.__class_getitem__` 時才可以去下標" "該類別。" -#: ../../library/stdtypes.rst:5743 +#: ../../library/stdtypes.rst:5757 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." @@ -8256,7 +8287,7 @@ msgstr "" "將一個 ``GenericAlias`` 物件用作 :term:`generic type` 的代理,實作\\ *參數化" "泛型 (parameterized generics)*。" -#: ../../library/stdtypes.rst:5746 +#: ../../library/stdtypes.rst:5760 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 " @@ -8268,7 +8299,7 @@ msgstr "" "物件所包含元素的型別。例如 ``set[bytes]`` 可以用於型別註釋來表示一個 :class:" "`set`,其中所有元素的型別都是 :class:`bytes`。" -#: ../../library/stdtypes.rst:5752 +#: ../../library/stdtypes.rst:5766 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 " @@ -8280,7 +8311,7 @@ msgstr "" "標引數通常會指示物件上有定義的一個或多個方法的回傳型別。例如\\ :mod:`正規表示" "式 `\\ 可以用於 :class:`str` 和 :class:`bytes` 資料型別:" -#: ../../library/stdtypes.rst:5758 +#: ../../library/stdtypes.rst:5772 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 " @@ -8292,7 +8323,7 @@ msgstr "" "別。我們就可以用 ``GenericAlias`` ``re.Match[str]`` 在型別註釋中表示這種物" "件。" -#: ../../library/stdtypes.rst:5764 +#: ../../library/stdtypes.rst:5778 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." @@ -8305,7 +8336,7 @@ msgstr "" "別都是 :class:`bytes`。在型別註釋中,我們將用 ``re.Match[bytes]`` 來表示各" "種 :ref:`re.Match ` 物件。" -#: ../../library/stdtypes.rst:5770 +#: ../../library/stdtypes.rst:5784 msgid "" "``GenericAlias`` objects are instances of the class :class:`types." "GenericAlias`, which can also be used to create ``GenericAlias`` objects " @@ -8314,7 +8345,7 @@ msgstr "" "``GenericAlias`` 物件是 :class:`types.GenericAlias` 類別的實例,也可以用來直" "接建立 ``GenericAlias`` 物件。" -#: ../../library/stdtypes.rst:5776 +#: ../../library/stdtypes.rst:5790 msgid "" "Creates a ``GenericAlias`` representing a type ``T`` parameterized by types " "*X*, *Y*, and more depending on the ``T`` used. For example, a function " @@ -8324,7 +8355,7 @@ msgstr "" "所使用的 ``T``)來參數化。例如,一個函式需要一個包含 :class:`float` 元素的 :" "class:`list`: ::" -#: ../../library/stdtypes.rst:5781 +#: ../../library/stdtypes.rst:5795 msgid "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" @@ -8332,7 +8363,7 @@ msgstr "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" -#: ../../library/stdtypes.rst:5784 +#: ../../library/stdtypes.rst:5798 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 " @@ -8343,7 +8374,7 @@ msgstr "" "別,需要兩個型別參數,分別表示鍵型別和值型別。在此範例中,函式需要一個 " "``dict``,其帶有 :class:`str` 型別的鍵和 :class:`int` 型別的值: ::" -#: ../../library/stdtypes.rst:5789 +#: ../../library/stdtypes.rst:5803 msgid "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." @@ -8351,7 +8382,7 @@ msgstr "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." -#: ../../library/stdtypes.rst:5792 +#: ../../library/stdtypes.rst:5806 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" @@ -8359,7 +8390,7 @@ msgstr "" "內建函式 :func:`isinstance` 和 :func:`issubclass` 不接受 ``GenericAlias`` 型" "別作為第二個引數: ::" -#: ../../library/stdtypes.rst:5795 +#: ../../library/stdtypes.rst:5809 msgid "" ">>> isinstance([1, 2], list[str])\n" "Traceback (most recent call last):\n" @@ -8371,7 +8402,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: isinstance() argument 2 cannot be a parameterized generic" -#: ../../library/stdtypes.rst:5800 +#: ../../library/stdtypes.rst:5814 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -8383,7 +8414,7 @@ msgstr "" "及其型別參數。當從 ``GenericAlias`` 建立容器物件時,不會檢查容器中元素的型" "別。例如,不鼓勵使用以下程式碼,但 runtime 不會出現錯誤: ::" -#: ../../library/stdtypes.rst:5806 +#: ../../library/stdtypes.rst:5820 msgid "" ">>> t = list[str]\n" ">>> t([1, 2, 3])\n" @@ -8393,13 +8424,13 @@ msgstr "" ">>> t([1, 2, 3])\n" "[1, 2, 3]" -#: ../../library/stdtypes.rst:5810 +#: ../../library/stdtypes.rst:5824 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "此外,參數化泛型在物件建立期間會擦除 (erase) 型別參數: ::" -#: ../../library/stdtypes.rst:5813 +#: ../../library/stdtypes.rst:5827 msgid "" ">>> t = list[str]\n" ">>> type(t)\n" @@ -8417,13 +8448,13 @@ msgstr "" ">>> type(l)\n" "" -#: ../../library/stdtypes.rst:5821 +#: ../../library/stdtypes.rst:5835 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "在泛型上呼叫 :func:`repr` 或 :func:`str` 會顯示參數化型別: ::" -#: ../../library/stdtypes.rst:5823 +#: ../../library/stdtypes.rst:5837 msgid "" ">>> repr(list[int])\n" "'list[int]'\n" @@ -8437,7 +8468,7 @@ msgstr "" ">>> str(list[int])\n" "'list[int]'" -#: ../../library/stdtypes.rst:5829 +#: ../../library/stdtypes.rst:5843 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" @@ -8445,7 +8476,7 @@ msgstr "" "為防止像是 ``dict[str][str]`` 的錯誤出現,泛型容器的 :meth:`~object." "__getitem__` 方法會在這種情況下引發例外: ::" -#: ../../library/stdtypes.rst:5832 +#: ../../library/stdtypes.rst:5846 msgid "" ">>> dict[str][str]\n" "Traceback (most recent call last):\n" @@ -8457,7 +8488,7 @@ msgstr "" " ...\n" "TypeError: dict[str] is not a generic class" -#: ../../library/stdtypes.rst:5837 +#: ../../library/stdtypes.rst:5851 msgid "" "However, such expressions are valid when :ref:`type variables ` " "are used. The index must have as many elements as there are type variable " @@ -8467,7 +8498,7 @@ msgstr "" "的。索引的元素數量必須與 ``GenericAlias`` 物件的 :attr:`~genericalias." "__args__` 中的型別變數項目一樣多: ::" -#: ../../library/stdtypes.rst:5841 +#: ../../library/stdtypes.rst:5855 msgid "" ">>> from typing import TypeVar\n" ">>> Y = TypeVar('Y')\n" @@ -8479,253 +8510,253 @@ msgstr "" ">>> dict[str, Y][int]\n" "dict[str, int]" -#: ../../library/stdtypes.rst:5848 +#: ../../library/stdtypes.rst:5862 msgid "Standard Generic Classes" msgstr "標準泛型類別" -#: ../../library/stdtypes.rst:5850 +#: ../../library/stdtypes.rst:5864 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "以下標準函式庫類別有支援參數化泛型。此列表並非詳盡無遺。" -#: ../../library/stdtypes.rst:5853 +#: ../../library/stdtypes.rst:5867 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:5854 +#: ../../library/stdtypes.rst:5868 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:5855 +#: ../../library/stdtypes.rst:5869 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:5856 +#: ../../library/stdtypes.rst:5870 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:5857 +#: ../../library/stdtypes.rst:5871 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:5858 +#: ../../library/stdtypes.rst:5872 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:5859 +#: ../../library/stdtypes.rst:5873 msgid ":class:`asyncio.Future`" msgstr ":class:`asyncio.Future`" -#: ../../library/stdtypes.rst:5860 +#: ../../library/stdtypes.rst:5874 msgid ":class:`asyncio.Task`" msgstr ":class:`asyncio.Task`" -#: ../../library/stdtypes.rst:5861 +#: ../../library/stdtypes.rst:5875 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:5862 +#: ../../library/stdtypes.rst:5876 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:5863 +#: ../../library/stdtypes.rst:5877 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:5864 +#: ../../library/stdtypes.rst:5878 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:5865 +#: ../../library/stdtypes.rst:5879 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:5866 +#: ../../library/stdtypes.rst:5880 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:5867 +#: ../../library/stdtypes.rst:5881 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:5868 +#: ../../library/stdtypes.rst:5882 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:5869 +#: ../../library/stdtypes.rst:5883 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:5870 +#: ../../library/stdtypes.rst:5884 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:5871 +#: ../../library/stdtypes.rst:5885 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:5872 +#: ../../library/stdtypes.rst:5886 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:5873 +#: ../../library/stdtypes.rst:5887 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:5874 +#: ../../library/stdtypes.rst:5888 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:5875 +#: ../../library/stdtypes.rst:5889 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:5876 +#: ../../library/stdtypes.rst:5890 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:5877 +#: ../../library/stdtypes.rst:5891 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:5878 +#: ../../library/stdtypes.rst:5892 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:5879 +#: ../../library/stdtypes.rst:5893 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:5880 +#: ../../library/stdtypes.rst:5894 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:5881 +#: ../../library/stdtypes.rst:5895 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:5882 +#: ../../library/stdtypes.rst:5896 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:5883 +#: ../../library/stdtypes.rst:5897 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:5884 +#: ../../library/stdtypes.rst:5898 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:5885 +#: ../../library/stdtypes.rst:5899 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:5886 +#: ../../library/stdtypes.rst:5900 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:5887 +#: ../../library/stdtypes.rst:5901 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:5888 +#: ../../library/stdtypes.rst:5902 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:5889 +#: ../../library/stdtypes.rst:5903 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:5890 +#: ../../library/stdtypes.rst:5904 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:5891 +#: ../../library/stdtypes.rst:5905 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:5892 +#: ../../library/stdtypes.rst:5906 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:5893 +#: ../../library/stdtypes.rst:5907 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:5894 +#: ../../library/stdtypes.rst:5908 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:5895 +#: ../../library/stdtypes.rst:5909 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:5896 +#: ../../library/stdtypes.rst:5910 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:5897 +#: ../../library/stdtypes.rst:5911 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:5898 +#: ../../library/stdtypes.rst:5912 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:5899 +#: ../../library/stdtypes.rst:5913 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:5900 +#: ../../library/stdtypes.rst:5914 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:5901 +#: ../../library/stdtypes.rst:5915 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:5902 +#: ../../library/stdtypes.rst:5916 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5903 +#: ../../library/stdtypes.rst:5917 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5904 +#: ../../library/stdtypes.rst:5918 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5905 +#: ../../library/stdtypes.rst:5919 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5906 +#: ../../library/stdtypes.rst:5920 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5907 +#: ../../library/stdtypes.rst:5921 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5908 +#: ../../library/stdtypes.rst:5922 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5913 +#: ../../library/stdtypes.rst:5927 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "``GenericAlias`` 物件的特殊屬性" -#: ../../library/stdtypes.rst:5915 +#: ../../library/stdtypes.rst:5929 msgid "All parameterized generics implement special read-only attributes." msgstr "所有參數化泛型都有實作特殊的唯讀屬性。" -#: ../../library/stdtypes.rst:5919 +#: ../../library/stdtypes.rst:5933 msgid "This attribute points at the non-parameterized generic class::" msgstr "此屬性指向非參數化泛型類別: ::" -#: ../../library/stdtypes.rst:5921 +#: ../../library/stdtypes.rst:5935 msgid "" ">>> list[int].__origin__\n" "" @@ -8733,7 +8764,7 @@ msgstr "" ">>> list[int].__origin__\n" "" -#: ../../library/stdtypes.rst:5927 +#: ../../library/stdtypes.rst:5941 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 " @@ -8742,7 +8773,7 @@ msgstr "" "此屬性是傳遞給泛型類別之原始 :meth:`~object.__class_getitem__` 的泛型型別 :" "class:`tuple`\\ (長度可以為 1): ::" -#: ../../library/stdtypes.rst:5931 +#: ../../library/stdtypes.rst:5945 msgid "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" @@ -8750,7 +8781,7 @@ msgstr "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" -#: ../../library/stdtypes.rst:5937 +#: ../../library/stdtypes.rst:5951 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" @@ -8758,7 +8789,7 @@ msgstr "" "此屬性是個會被延遲計算 (lazily computed) 的元組(可能為空),包含了在 " "``__args__`` 中找得到的不重複型別變數: ::" -#: ../../library/stdtypes.rst:5940 +#: ../../library/stdtypes.rst:5954 msgid "" ">>> from typing import TypeVar\n" "\n" @@ -8772,7 +8803,7 @@ msgstr "" ">>> list[T].__parameters__\n" "(~T,)" -#: ../../library/stdtypes.rst:5948 +#: ../../library/stdtypes.rst:5962 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " "have correct ``__parameters__`` after substitution because :class:`typing." @@ -8782,7 +8813,7 @@ msgstr "" "有正確的 ``__parameters__``,因為 :class:`typing.ParamSpec` 主要用於靜態型別" "檢查。" -#: ../../library/stdtypes.rst:5955 +#: ../../library/stdtypes.rst:5969 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." @@ -8790,19 +8821,19 @@ msgstr "" "如果別名已使用 ``*`` 運算子解包 (unpack) 則為 true 的布林值(請參閱 :data:" "`~typing.TypeVarTuple`\\ )。" -#: ../../library/stdtypes.rst:5963 +#: ../../library/stdtypes.rst:5977 msgid ":pep:`484` - Type Hints" msgstr ":pep:`484` - 型別提示" -#: ../../library/stdtypes.rst:5964 +#: ../../library/stdtypes.rst:5978 msgid "Introducing Python's framework for type annotations." msgstr "引入 Python 的型別註釋框架。" -#: ../../library/stdtypes.rst:5966 +#: ../../library/stdtypes.rst:5980 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr ":pep:`585` - 標準集合 (Standard Collections) 中的型別提示泛型" -#: ../../library/stdtypes.rst:5967 +#: ../../library/stdtypes.rst:5981 msgid "" "Introducing the ability to natively parameterize standard-library classes, " "provided they implement the special class method :meth:`~object." @@ -8811,7 +8842,7 @@ msgstr "" "引入原生參數化標準函式庫類別的能力,前提是它們有實作特殊的類別方法 :meth:" "`~object.__class_getitem__`。" -#: ../../library/stdtypes.rst:5971 +#: ../../library/stdtypes.rst:5985 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" @@ -8819,18 +8850,18 @@ msgstr "" ":ref:`Generics`、:ref:`使用者定義泛型 `\\ 和 :class:" "`typing.Generic`" -#: ../../library/stdtypes.rst:5972 +#: ../../library/stdtypes.rst:5986 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" "有關如何實作可以在 runtime 參數化並能被靜態型別檢查器理解的泛型類別的文件。" -#: ../../library/stdtypes.rst:5981 +#: ../../library/stdtypes.rst:5995 msgid "Union Type" msgstr "聯合型別 (Union Type)" -#: ../../library/stdtypes.rst:5987 +#: ../../library/stdtypes.rst:6001 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -8843,7 +8874,7 @@ msgstr "" "釋 (type annotation) `。與下標 :data:`typing.Union` 相比,聯合型" "別運算式可以讓型別提示語法更清晰簡潔。" -#: ../../library/stdtypes.rst:5994 +#: ../../library/stdtypes.rst:6008 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 " @@ -8854,7 +8885,7 @@ msgstr "" "``typing.Union[X, Y]``。舉例來說,下列函式需要一個型別為 :class:`int` 或 :" "class:`float` 的引數: ::" -#: ../../library/stdtypes.rst:5999 +#: ../../library/stdtypes.rst:6013 msgid "" "def square(number: int | float) -> int | float:\n" " return number ** 2" @@ -8862,7 +8893,7 @@ msgstr "" "def square(number: int | float) -> int | float:\n" " return number ** 2" -#: ../../library/stdtypes.rst:6004 +#: ../../library/stdtypes.rst:6018 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 " @@ -8875,40 +8906,40 @@ msgstr "" "義類別的參照,將在 runtime 失敗。對於包含向前參照的聯合,請將整個運算式以字串" "呈現,例如 ``\"int | Foo\"``。" -#: ../../library/stdtypes.rst:6012 +#: ../../library/stdtypes.rst:6026 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "聯合物件可以與其他聯合物件一起進行相等性測試。細節如下:" -#: ../../library/stdtypes.rst:6014 +#: ../../library/stdtypes.rst:6028 msgid "Unions of unions are flattened::" msgstr "聯合的聯合會被扁平化: ::" -#: ../../library/stdtypes.rst:6016 +#: ../../library/stdtypes.rst:6030 msgid "(int | str) | float == int | str | float" msgstr "(int | str) | float == int | str | float" -#: ../../library/stdtypes.rst:6018 +#: ../../library/stdtypes.rst:6032 msgid "Redundant types are removed::" msgstr "冗餘型別會被刪除: ::" -#: ../../library/stdtypes.rst:6020 +#: ../../library/stdtypes.rst:6034 msgid "int | str | int == int | str" msgstr "int | str | int == int | str" -#: ../../library/stdtypes.rst:6022 +#: ../../library/stdtypes.rst:6036 msgid "When comparing unions, the order is ignored::" msgstr "比較聯合時,順序會被忽略: ::" -#: ../../library/stdtypes.rst:6024 +#: ../../library/stdtypes.rst:6038 msgid "int | str == str | int" msgstr "int | str == str | int" -#: ../../library/stdtypes.rst:6026 +#: ../../library/stdtypes.rst:6040 msgid "It creates instances of :class:`typing.Union`::" msgstr "它會建立 :class:`typing.Union` 的實例: ::" -#: ../../library/stdtypes.rst:6028 +#: ../../library/stdtypes.rst:6042 msgid "" "int | str == typing.Union[int, str]\n" "type(int | str) is typing.Union" @@ -8916,21 +8947,21 @@ msgstr "" "int | str == typing.Union[int, str]\n" "type(int | str) is typing.Union" -#: ../../library/stdtypes.rst:6031 +#: ../../library/stdtypes.rst:6045 msgid "Optional types can be spelled as a union with ``None``::" msgstr "可選型別可以表示為與 ``None`` 的聯合: ::" -#: ../../library/stdtypes.rst:6033 +#: ../../library/stdtypes.rst:6047 msgid "str | None == typing.Optional[str]" msgstr "str | None == typing.Optional[str]" -#: ../../library/stdtypes.rst:6038 +#: ../../library/stdtypes.rst:6052 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "聯合物件也支援 :func:`isinstance` 和 :func:`issubclass` 的呼叫: ::" -#: ../../library/stdtypes.rst:6041 +#: ../../library/stdtypes.rst:6055 msgid "" ">>> isinstance(\"\", int | str)\n" "True" @@ -8938,14 +8969,14 @@ msgstr "" ">>> isinstance(\"\", int | str)\n" "True" -#: ../../library/stdtypes.rst:6044 +#: ../../library/stdtypes.rst:6058 msgid "" "However, :ref:`parameterized generics ` in union objects " "cannot be checked::" msgstr "" "然而聯合物件中的\\ :ref:`參數化泛型 `\\ 則無法被檢查: ::" -#: ../../library/stdtypes.rst:6047 +#: ../../library/stdtypes.rst:6061 msgid "" ">>> isinstance(1, int | list[int]) # short-circuit evaluation\n" "True\n" @@ -8955,7 +8986,7 @@ msgid "" "TypeError: isinstance() argument 2 cannot be a parameterized generic" msgstr "" -#: ../../library/stdtypes.rst:6054 +#: ../../library/stdtypes.rst:6068 msgid "" "The user-exposed type for the union object can be accessed from :class:" "`typing.Union` and used for :func:`isinstance` checks::" @@ -8963,7 +8994,7 @@ msgstr "" "構成聯合物件的對使用者公開型別 (user-exposed type) 可以透過 :data:`typing." "Union` 存取並用於 :func:`isinstance` 檢查: ::" -#: ../../library/stdtypes.rst:6057 +#: ../../library/stdtypes.rst:6071 msgid "" ">>> import typing\n" ">>> isinstance(int | str, typing.Union)\n" @@ -8981,7 +9012,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: cannot create 'typing.Union' instances" -#: ../../library/stdtypes.rst:6066 +#: ../../library/stdtypes.rst:6080 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 " @@ -8990,7 +9021,7 @@ msgstr "" "新增了型別物件的 :meth:`!__or__` 方法來支援 ``X | Y`` 語法。如果元類別有實" "作 :meth:`!__or__`,則 Union 可以覆寫 (override) 它: ::" -#: ../../library/stdtypes.rst:6070 +#: ../../library/stdtypes.rst:6084 msgid "" ">>> class M(type):\n" "... def __or__(self, other):\n" @@ -9016,32 +9047,32 @@ msgstr "" ">>> int | C\n" "int | C" -#: ../../library/stdtypes.rst:6086 +#: ../../library/stdtypes.rst:6100 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr ":pep:`604` -- PEP 提出 ``X | Y`` 語法和聯合型別。" -#: ../../library/stdtypes.rst:6092 +#: ../../library/stdtypes.rst:6106 msgid "" "Union objects are now instances of :class:`typing.Union`. Previously, they " "were instances of :class:`types.UnionType`, which remains an alias for :" "class:`typing.Union`." msgstr "" -#: ../../library/stdtypes.rst:6099 +#: ../../library/stdtypes.rst:6113 msgid "Other Built-in Types" msgstr "其他內建型別" -#: ../../library/stdtypes.rst:6101 +#: ../../library/stdtypes.rst:6115 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:6108 +#: ../../library/stdtypes.rst:6122 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:6110 +#: ../../library/stdtypes.rst:6124 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 " @@ -9052,7 +9083,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:6117 +#: ../../library/stdtypes.rst:6131 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -9063,32 +9094,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:6125 +#: ../../library/stdtypes.rst:6139 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:6133 +#: ../../library/stdtypes.rst:6147 msgid "Classes and Class Instances" msgstr "類別與類別實例" -#: ../../library/stdtypes.rst:6135 +#: ../../library/stdtypes.rst:6149 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "請見 :ref:`objects` 和 :ref:`class`。" -#: ../../library/stdtypes.rst:6141 +#: ../../library/stdtypes.rst:6155 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:6143 +#: ../../library/stdtypes.rst:6157 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:6146 +#: ../../library/stdtypes.rst:6160 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -9096,15 +9127,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:6150 +#: ../../library/stdtypes.rst:6164 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`。" -#: ../../library/stdtypes.rst:6156 +#: ../../library/stdtypes.rst:6170 msgid "Methods" msgstr "方法" -#: ../../library/stdtypes.rst:6160 +#: ../../library/stdtypes.rst:6174 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: :ref:`built-in methods ` (such as :meth:" @@ -9112,7 +9143,7 @@ msgid "" "methods>`. Built-in methods are described with the types that support them." msgstr "" -#: ../../library/stdtypes.rst:6166 +#: ../../library/stdtypes.rst:6180 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 :ref:" @@ -9125,7 +9156,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:6177 +#: ../../library/stdtypes.rst:6191 msgid "" "Like :ref:`function objects `, bound method objects " "support getting arbitrary attributes. However, since method attributes are " @@ -9136,7 +9167,7 @@ msgid "" "underlying function object:" msgstr "" -#: ../../library/stdtypes.rst:6185 +#: ../../library/stdtypes.rst:6199 msgid "" ">>> class C:\n" "... def method(self):\n" @@ -9164,15 +9195,15 @@ msgstr "" ">>> c.method.whoami\n" "'my name is method'" -#: ../../library/stdtypes.rst:6200 +#: ../../library/stdtypes.rst:6214 msgid "See :ref:`instance-methods` for more information." msgstr "更多資訊請見 :ref:`instance-methods`。" -#: ../../library/stdtypes.rst:6208 +#: ../../library/stdtypes.rst:6222 msgid "Code Objects" msgstr "程式碼物件" -#: ../../library/stdtypes.rst:6214 +#: ../../library/stdtypes.rst:6228 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -9182,7 +9213,7 @@ msgid "" "`~function.__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:6221 +#: ../../library/stdtypes.rst:6235 msgid "" "Accessing :attr:`~function.__code__` raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and " @@ -9191,21 +9222,21 @@ msgstr "" "存取 :attr:`~function.__code__` 會引發一個附帶引數 ``obj`` 與 " "``\"__code__\"`` 的\\ :ref:`稽核事件 ` ``object.__getattr__``。" -#: ../../library/stdtypes.rst:6228 +#: ../../library/stdtypes.rst:6242 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:6231 +#: ../../library/stdtypes.rst:6245 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`。" -#: ../../library/stdtypes.rst:6237 +#: ../../library/stdtypes.rst:6251 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:6243 +#: ../../library/stdtypes.rst:6257 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 " @@ -9213,30 +9244,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:6248 +#: ../../library/stdtypes.rst:6262 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:6254 +#: ../../library/stdtypes.rst:6268 msgid "The Null Object" msgstr "Null 物件" -#: ../../library/stdtypes.rst:6256 +#: ../../library/stdtypes.rst:6270 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:6260 +#: ../../library/stdtypes.rst:6274 msgid "It is written as ``None``." msgstr "它被寫為 ``None``。" -#: ../../library/stdtypes.rst:6267 +#: ../../library/stdtypes.rst:6281 msgid "The Ellipsis Object" msgstr "Ellipsis 物件" -#: ../../library/stdtypes.rst:6269 +#: ../../library/stdtypes.rst:6283 msgid "" "This object is commonly used to indicate that something is omitted. It " "supports no special operations. There is exactly one ellipsis object, " @@ -9244,63 +9275,63 @@ msgid "" "the :const:`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:6274 +#: ../../library/stdtypes.rst:6288 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "它被寫為 ``Ellipsis`` 或 ``...``。" -#: ../../library/stdtypes.rst:6276 +#: ../../library/stdtypes.rst:6290 msgid "" "In typical use, ``...`` as the ``Ellipsis`` object appears in a few " "different places, for instance:" msgstr "" -#: ../../library/stdtypes.rst:6279 +#: ../../library/stdtypes.rst:6293 msgid "" "In type annotations, such as :ref:`callable arguments ` or :ref:`tuple elements `." msgstr "" -#: ../../library/stdtypes.rst:6282 +#: ../../library/stdtypes.rst:6296 msgid "" "As the body of a function instead of a :ref:`pass statement `." msgstr "" -#: ../../library/stdtypes.rst:6284 +#: ../../library/stdtypes.rst:6298 msgid "" "In third-party libraries, such as `Numpy's slicing and striding `_." msgstr "" -#: ../../library/stdtypes.rst:6287 +#: ../../library/stdtypes.rst:6301 msgid "" "Python also uses three dots in ways that are not ``Ellipsis`` objects, for " "instance:" msgstr "" -#: ../../library/stdtypes.rst:6289 +#: ../../library/stdtypes.rst:6303 msgid "" "Doctest's :const:`ELLIPSIS `, as a pattern for missing " "content." msgstr "" -#: ../../library/stdtypes.rst:6291 +#: ../../library/stdtypes.rst:6305 msgid "" "The default Python prompt of the :term:`interactive` shell when partial " "input is incomplete." msgstr "" -#: ../../library/stdtypes.rst:6293 +#: ../../library/stdtypes.rst:6307 msgid "" "Lastly, the Python documentation often uses three dots in conventional " "English usage to mean omitted content, even in code examples that also use " "them as the ``Ellipsis``." msgstr "" -#: ../../library/stdtypes.rst:6301 +#: ../../library/stdtypes.rst:6315 msgid "The NotImplemented Object" msgstr "NotImplemented 物件" -#: ../../library/stdtypes.rst:6303 +#: ../../library/stdtypes.rst:6317 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 " @@ -9308,64 +9339,64 @@ msgid "" "`type(NotImplemented)()` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:6308 +#: ../../library/stdtypes.rst:6322 msgid "It is written as :code:`NotImplemented`." msgstr "它被寫為 :code:`NotImplemented`。" -#: ../../library/stdtypes.rst:6314 +#: ../../library/stdtypes.rst:6328 msgid "Internal Objects" msgstr "內部物件" -#: ../../library/stdtypes.rst:6316 +#: ../../library/stdtypes.rst:6330 msgid "" "See :ref:`types` for this information. It describes :ref:`stack frame " "objects `, :ref:`traceback objects `, and " "slice objects." msgstr "" -#: ../../library/stdtypes.rst:6324 +#: ../../library/stdtypes.rst:6338 msgid "Special Attributes" msgstr "特殊屬性" -#: ../../library/stdtypes.rst:6326 +#: ../../library/stdtypes.rst:6340 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:6333 +#: ../../library/stdtypes.rst:6347 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:6339 +#: ../../library/stdtypes.rst:6353 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:6347 +#: ../../library/stdtypes.rst:6361 msgid "The name of the module in which a class or function was defined." msgstr "" -#: ../../library/stdtypes.rst:6352 +#: ../../library/stdtypes.rst:6366 msgid "" "The documentation string of a class or function, or ``None`` if undefined." msgstr "" -#: ../../library/stdtypes.rst:6357 +#: ../../library/stdtypes.rst:6371 msgid "" "The :ref:`type parameters ` of generic classes, functions, and :" "ref:`type aliases `. For classes and functions that are not " "generic, this will be an empty tuple." msgstr "" -#: ../../library/stdtypes.rst:6367 +#: ../../library/stdtypes.rst:6381 msgid "Integer string conversion length limitation" msgstr "整數字串轉換長度限制" -#: ../../library/stdtypes.rst:6369 +#: ../../library/stdtypes.rst:6383 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 " @@ -9377,7 +9408,7 @@ msgstr "" "進位的數值。十六進位、八進位,還有二進位的轉換則沒有長度限制。此限制值可以被" "調整。" -#: ../../library/stdtypes.rst:6374 +#: ../../library/stdtypes.rst:6388 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 " @@ -9387,24 +9418,24 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:6381 +#: ../../library/stdtypes.rst:6395 msgid "" "Limiting conversion size offers a practical way to avoid :cve:`2020-10735`." msgstr "" -#: ../../library/stdtypes.rst:6383 +#: ../../library/stdtypes.rst:6397 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:6387 +#: ../../library/stdtypes.rst:6401 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:6389 +#: ../../library/stdtypes.rst:6403 msgid "" ">>> import sys\n" ">>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default.\n" @@ -9428,7 +9459,7 @@ msgid "" ">>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited." msgstr "" -#: ../../library/stdtypes.rst:6409 +#: ../../library/stdtypes.rst:6423 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -9436,11 +9467,11 @@ msgid "" "str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:6414 +#: ../../library/stdtypes.rst:6428 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:6416 +#: ../../library/stdtypes.rst:6430 msgid "" ">>> import sys\n" ">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" @@ -9458,11 +9489,11 @@ msgstr "" "... '571186405732').to_bytes(53, 'big')\n" "..." -#: ../../library/stdtypes.rst:6429 +#: ../../library/stdtypes.rst:6443 msgid "Affected APIs" msgstr "受影響的 API" -#: ../../library/stdtypes.rst:6431 +#: ../../library/stdtypes.rst:6445 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" @@ -9470,74 +9501,74 @@ msgstr "" "此限制僅適用於 :class:`int` 與 :class:`str` 或 :class:`bytes` 之間可能較慢的" "轉換:" -#: ../../library/stdtypes.rst:6434 +#: ../../library/stdtypes.rst:6448 msgid "``int(string)`` with default base 10." msgstr "``int(string)`` 以預設的 10 為底。" -#: ../../library/stdtypes.rst:6435 +#: ../../library/stdtypes.rst:6449 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "``int(string, base)`` 用於所有非 2 冪次方的底。" -#: ../../library/stdtypes.rst:6436 +#: ../../library/stdtypes.rst:6450 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:6437 +#: ../../library/stdtypes.rst:6451 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:6438 +#: ../../library/stdtypes.rst:6452 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:6441 +#: ../../library/stdtypes.rst:6455 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:6443 +#: ../../library/stdtypes.rst:6457 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "``int(string, base)`` 以 2、4、8、16 或 32 為底。" -#: ../../library/stdtypes.rst:6444 +#: ../../library/stdtypes.rst:6458 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr ":func:`int.from_bytes` 和 :func:`int.to_bytes`。" -#: ../../library/stdtypes.rst:6445 +#: ../../library/stdtypes.rst:6459 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr ":func:`hex`、:func:`oct`、:func:`bin`。" -#: ../../library/stdtypes.rst:6446 +#: ../../library/stdtypes.rst:6460 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr ":ref:`formatspec` 用於十六進位、八進位和二進位數字。" -#: ../../library/stdtypes.rst:6447 +#: ../../library/stdtypes.rst:6461 msgid ":class:`str` to :class:`float`." msgstr ":class:`str` 轉換為 :class:`float`。" -#: ../../library/stdtypes.rst:6448 +#: ../../library/stdtypes.rst:6462 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr ":class:`str` 轉換為 :class:`decimal.Decimal`。" -#: ../../library/stdtypes.rst:6451 +#: ../../library/stdtypes.rst:6465 msgid "Configuring the limit" msgstr "設定限制" -#: ../../library/stdtypes.rst:6453 +#: ../../library/stdtypes.rst:6467 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:6456 +#: ../../library/stdtypes.rst:6470 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:6459 +#: ../../library/stdtypes.rst:6473 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" @@ -9545,7 +9576,7 @@ msgstr "" ":option:`-X int_max_str_digits <-X>`,例如 ``python3 -X " "int_max_str_digits=640``" -#: ../../library/stdtypes.rst:6461 +#: ../../library/stdtypes.rst:6475 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 " @@ -9554,38 +9585,38 @@ msgid "" "int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:6467 +#: ../../library/stdtypes.rst:6481 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:6470 +#: ../../library/stdtypes.rst:6484 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:6474 +#: ../../library/stdtypes.rst:6488 msgid "" "Information about the default and minimum can be found in :data:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:6476 +#: ../../library/stdtypes.rst:6490 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:6478 +#: ../../library/stdtypes.rst:6492 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:6485 +#: ../../library/stdtypes.rst:6499 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 " @@ -9597,7 +9628,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:6494 +#: ../../library/stdtypes.rst:6508 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 " @@ -9605,11 +9636,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:6500 +#: ../../library/stdtypes.rst:6514 msgid "Recommended configuration" msgstr "建議的配置" -#: ../../library/stdtypes.rst:6502 +#: ../../library/stdtypes.rst:6516 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 " @@ -9617,11 +9648,11 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.12." msgstr "" -#: ../../library/stdtypes.rst:6507 +#: ../../library/stdtypes.rst:6521 msgid "Example::" msgstr "範例: ::" -#: ../../library/stdtypes.rst:6509 +#: ../../library/stdtypes.rst:6523 msgid "" ">>> import sys\n" ">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" @@ -9643,38 +9674,38 @@ msgstr "" "... elif current_limit < lower_bound:\n" "... sys.set_int_max_str_digits(lower_bound)" -#: ../../library/stdtypes.rst:6519 +#: ../../library/stdtypes.rst:6533 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:6523 +#: ../../library/stdtypes.rst:6537 msgid "Footnotes" msgstr "註腳" -#: ../../library/stdtypes.rst:6524 +#: ../../library/stdtypes.rst:6538 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:6527 +#: ../../library/stdtypes.rst:6541 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:6530 +#: ../../library/stdtypes.rst:6544 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:6532 +#: ../../library/stdtypes.rst:6546 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:6535 +#: ../../library/stdtypes.rst:6549 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." @@ -9687,13 +9718,13 @@ msgstr "built-in(內建)" #: ../../library/stdtypes.rst:13 ../../library/stdtypes.rst:332 #: ../../library/stdtypes.rst:409 ../../library/stdtypes.rst:1002 #: ../../library/stdtypes.rst:1192 ../../library/stdtypes.rst:1214 -#: ../../library/stdtypes.rst:1229 ../../library/stdtypes.rst:5237 -#: ../../library/stdtypes.rst:6239 +#: ../../library/stdtypes.rst:1229 ../../library/stdtypes.rst:5251 +#: ../../library/stdtypes.rst:6253 msgid "types" msgstr "type(型別)" #: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:1229 -#: ../../library/stdtypes.rst:5237 +#: ../../library/stdtypes.rst:5251 msgid "statement" msgstr "statement(陳述式)" @@ -9815,11 +9846,11 @@ msgstr "is not" #: ../../library/stdtypes.rst:1214 ../../library/stdtypes.rst:1379 #: ../../library/stdtypes.rst:1463 ../../library/stdtypes.rst:1507 #: ../../library/stdtypes.rst:1628 ../../library/stdtypes.rst:1758 -#: ../../library/stdtypes.rst:3245 ../../library/stdtypes.rst:3264 -#: ../../library/stdtypes.rst:3377 ../../library/stdtypes.rst:5021 -#: ../../library/stdtypes.rst:5237 ../../library/stdtypes.rst:5726 -#: ../../library/stdtypes.rst:5983 ../../library/stdtypes.rst:6158 -#: ../../library/stdtypes.rst:6203 +#: ../../library/stdtypes.rst:3259 ../../library/stdtypes.rst:3278 +#: ../../library/stdtypes.rst:3391 ../../library/stdtypes.rst:5035 +#: ../../library/stdtypes.rst:5251 ../../library/stdtypes.rst:5740 +#: ../../library/stdtypes.rst:5997 ../../library/stdtypes.rst:6172 +#: ../../library/stdtypes.rst:6217 msgid "object" msgstr "object(物件)" @@ -9911,9 +9942,9 @@ msgid "arithmetic" msgstr "arithmetic(算術)" #: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:1002 -#: ../../library/stdtypes.rst:1192 ../../library/stdtypes.rst:5237 -#: ../../library/stdtypes.rst:6210 ../../library/stdtypes.rst:6224 -#: ../../library/stdtypes.rst:6239 +#: ../../library/stdtypes.rst:1192 ../../library/stdtypes.rst:5251 +#: ../../library/stdtypes.rst:6224 ../../library/stdtypes.rst:6238 +#: ../../library/stdtypes.rst:6253 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -9929,8 +9960,8 @@ msgstr "float" msgid "complex" msgstr "complex(複數)" -#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3117 -#: ../../library/stdtypes.rst:4386 +#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3131 +#: ../../library/stdtypes.rst:4400 msgid "+ (plus)" msgstr "+ (加號)" @@ -9942,13 +9973,13 @@ msgstr "unary operator(一元運算子)" msgid "binary operator" msgstr "binary operator(二元運算子)" -#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3117 -#: ../../library/stdtypes.rst:4386 +#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3131 +#: ../../library/stdtypes.rst:4400 msgid "- (minus)" msgstr "- (減號)" -#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3074 -#: ../../library/stdtypes.rst:4343 +#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3088 +#: ../../library/stdtypes.rst:4357 msgid "* (asterisk)" msgstr "* (星號)" @@ -9960,8 +9991,8 @@ msgstr "/ (斜線)" msgid "//" msgstr "//" -#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3037 -#: ../../library/stdtypes.rst:4311 +#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3051 +#: ../../library/stdtypes.rst:4325 msgid "% (percent)" msgstr "% (百分號)" @@ -9971,7 +10002,7 @@ msgstr "**" #: ../../library/stdtypes.rst:332 ../../library/stdtypes.rst:409 #: ../../library/stdtypes.rst:1002 ../../library/stdtypes.rst:1229 -#: ../../library/stdtypes.rst:5237 +#: ../../library/stdtypes.rst:5251 msgid "operations on" msgstr "operations on(操作於)" @@ -9980,7 +10011,7 @@ msgid "conjugate() (complex number method)" msgstr "conjugate()(複數方法)" #: ../../library/stdtypes.rst:351 ../../library/stdtypes.rst:1826 -#: ../../library/stdtypes.rst:3245 ../../library/stdtypes.rst:6239 +#: ../../library/stdtypes.rst:3259 ../../library/stdtypes.rst:6253 msgid "module" msgstr "模組" @@ -10048,7 +10079,7 @@ msgstr "values" msgid "iterator protocol" msgstr "iterator protocol(疊代器協定)" -#: ../../library/stdtypes.rst:899 ../../library/stdtypes.rst:5639 +#: ../../library/stdtypes.rst:899 ../../library/stdtypes.rst:5653 msgid "protocol" msgstr "protocol(協定)" @@ -10074,7 +10105,7 @@ msgstr "container(容器)" msgid "iteration over" msgstr "iteration over(疊代於)" -#: ../../library/stdtypes.rst:1002 ../../library/stdtypes.rst:5237 +#: ../../library/stdtypes.rst:1002 ../../library/stdtypes.rst:5251 msgid "len" msgstr "len" @@ -10143,14 +10174,14 @@ msgstr "mutable(可變)" msgid "list" msgstr "list(串列)" -#: ../../library/stdtypes.rst:1214 ../../library/stdtypes.rst:3245 -#: ../../library/stdtypes.rst:3377 ../../library/stdtypes.rst:3492 -#: ../../library/stdtypes.rst:4311 +#: ../../library/stdtypes.rst:1214 ../../library/stdtypes.rst:3259 +#: ../../library/stdtypes.rst:3391 ../../library/stdtypes.rst:3506 +#: ../../library/stdtypes.rst:4325 msgid "bytearray" msgstr "bytearray(位元組陣列)" -#: ../../library/stdtypes.rst:1229 ../../library/stdtypes.rst:5237 -#: ../../library/stdtypes.rst:5983 ../../library/stdtypes.rst:6239 +#: ../../library/stdtypes.rst:1229 ../../library/stdtypes.rst:5251 +#: ../../library/stdtypes.rst:5997 ../../library/stdtypes.rst:6253 msgid "type" msgstr "type(型別)" @@ -10158,7 +10189,7 @@ msgstr "type(型別)" msgid "assignment" msgstr "assignment(賦值)" -#: ../../library/stdtypes.rst:1229 ../../library/stdtypes.rst:5237 +#: ../../library/stdtypes.rst:1229 ../../library/stdtypes.rst:5251 msgid "del" msgstr "del" @@ -10167,8 +10198,8 @@ msgid "range" msgstr "range" #: ../../library/stdtypes.rst:1628 ../../library/stdtypes.rst:1771 -#: ../../library/stdtypes.rst:1818 ../../library/stdtypes.rst:2865 -#: ../../library/stdtypes.rst:3037 +#: ../../library/stdtypes.rst:1818 ../../library/stdtypes.rst:2879 +#: ../../library/stdtypes.rst:3051 msgid "string" msgstr "string(字串)" @@ -10189,17 +10220,17 @@ msgstr "(亦請見 string)" msgid "io.StringIO" msgstr "io.StringIO" -#: ../../library/stdtypes.rst:1791 ../../library/stdtypes.rst:3237 +#: ../../library/stdtypes.rst:1791 ../../library/stdtypes.rst:3251 msgid "buffer protocol" msgstr "buffer protocol(緩衝區協定)" -#: ../../library/stdtypes.rst:1791 ../../library/stdtypes.rst:3245 -#: ../../library/stdtypes.rst:3264 ../../library/stdtypes.rst:3492 -#: ../../library/stdtypes.rst:4311 +#: ../../library/stdtypes.rst:1791 ../../library/stdtypes.rst:3259 +#: ../../library/stdtypes.rst:3278 ../../library/stdtypes.rst:3506 +#: ../../library/stdtypes.rst:4325 msgid "bytes" msgstr "bytes(位元組)" -#: ../../library/stdtypes.rst:1818 ../../library/stdtypes.rst:3492 +#: ../../library/stdtypes.rst:1818 ../../library/stdtypes.rst:3506 msgid "methods" msgstr "methods(方法)" @@ -10207,7 +10238,7 @@ msgstr "methods(方法)" msgid "re" msgstr "re" -#: ../../library/stdtypes.rst:2651 ../../library/stdtypes.rst:4165 +#: ../../library/stdtypes.rst:2651 ../../library/stdtypes.rst:4179 msgid "universal newlines" msgstr "universal newlines" @@ -10215,231 +10246,231 @@ msgstr "universal newlines" msgid "str.splitlines method" msgstr "str.splitlines 方法" -#: ../../library/stdtypes.rst:2865 +#: ../../library/stdtypes.rst:2879 msgid "! formatted string literal" msgstr "! formatted string literals(! 格式化字串常數)" -#: ../../library/stdtypes.rst:2865 +#: ../../library/stdtypes.rst:2879 msgid "formatted string literals" msgstr "formatted string literals(格式化字串常數)" -#: ../../library/stdtypes.rst:2865 +#: ../../library/stdtypes.rst:2879 msgid "! f-string" msgstr "! f-string(! f 字串)" -#: ../../library/stdtypes.rst:2865 +#: ../../library/stdtypes.rst:2879 msgid "f-strings" msgstr "f-string(f 字串)" -#: ../../library/stdtypes.rst:2865 +#: ../../library/stdtypes.rst:2879 msgid "fstring" msgstr "fstring(f 字串)" -#: ../../library/stdtypes.rst:2865 +#: ../../library/stdtypes.rst:2879 msgid "interpolated string literal" msgstr "interpolated string literal(插值字串常數)" -#: ../../library/stdtypes.rst:2865 +#: ../../library/stdtypes.rst:2879 msgid "formatted literal" msgstr "formatted literal(格式化常數)" -#: ../../library/stdtypes.rst:2865 +#: ../../library/stdtypes.rst:2879 msgid "interpolated literal" msgstr "interpolated literal(插值常數)" -#: ../../library/stdtypes.rst:2865 +#: ../../library/stdtypes.rst:2879 msgid "{} (curly brackets)" msgstr "{} (花括號)" -#: ../../library/stdtypes.rst:2865 +#: ../../library/stdtypes.rst:2879 msgid "in formatted string literal" msgstr "於格式化字串常數中" -#: ../../library/stdtypes.rst:2865 +#: ../../library/stdtypes.rst:2879 msgid "! (exclamation mark)" msgstr "! (驚嘆號)" -#: ../../library/stdtypes.rst:2865 +#: ../../library/stdtypes.rst:2879 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/stdtypes.rst:2865 +#: ../../library/stdtypes.rst:2879 msgid "= (equals)" msgstr "= (等號)" -#: ../../library/stdtypes.rst:2865 +#: ../../library/stdtypes.rst:2879 msgid "for help in debugging using string literals" msgstr "" -#: ../../library/stdtypes.rst:3037 +#: ../../library/stdtypes.rst:3051 msgid "formatting, string (%)" msgstr "formatting(格式化)、字串 (%)" -#: ../../library/stdtypes.rst:3037 +#: ../../library/stdtypes.rst:3051 msgid "interpolation, string (%)" msgstr "interpolation(插值)、字串 (%)" -#: ../../library/stdtypes.rst:3037 +#: ../../library/stdtypes.rst:3051 msgid "formatting, printf" msgstr "formatting(格式化)、printf" -#: ../../library/stdtypes.rst:3037 +#: ../../library/stdtypes.rst:3051 msgid "interpolation, printf" msgstr "interpolation(插值)、printf" -#: ../../library/stdtypes.rst:3037 ../../library/stdtypes.rst:4311 +#: ../../library/stdtypes.rst:3051 ../../library/stdtypes.rst:4325 msgid "printf-style formatting" msgstr "printf 風格格式化" -#: ../../library/stdtypes.rst:3037 ../../library/stdtypes.rst:4311 +#: ../../library/stdtypes.rst:3051 ../../library/stdtypes.rst:4325 msgid "sprintf-style formatting" msgstr "sprintf 風格格式化" -#: ../../library/stdtypes.rst:3074 ../../library/stdtypes.rst:4343 +#: ../../library/stdtypes.rst:3088 ../../library/stdtypes.rst:4357 msgid "() (parentheses)" msgstr "() (圓括號)" -#: ../../library/stdtypes.rst:3074 ../../library/stdtypes.rst:3117 -#: ../../library/stdtypes.rst:4343 ../../library/stdtypes.rst:4386 +#: ../../library/stdtypes.rst:3088 ../../library/stdtypes.rst:3131 +#: ../../library/stdtypes.rst:4357 ../../library/stdtypes.rst:4400 msgid "in printf-style formatting" msgstr "於 printf 風格格式化" -#: ../../library/stdtypes.rst:3074 ../../library/stdtypes.rst:4343 +#: ../../library/stdtypes.rst:3088 ../../library/stdtypes.rst:4357 msgid ". (dot)" msgstr ". (點)" -#: ../../library/stdtypes.rst:3117 ../../library/stdtypes.rst:4386 +#: ../../library/stdtypes.rst:3131 ../../library/stdtypes.rst:4400 msgid "# (hash)" msgstr "# (井字號)" -#: ../../library/stdtypes.rst:3117 ../../library/stdtypes.rst:4386 +#: ../../library/stdtypes.rst:3131 ../../library/stdtypes.rst:4400 msgid "space" msgstr "space(空白)" -#: ../../library/stdtypes.rst:3237 +#: ../../library/stdtypes.rst:3251 msgid "binary sequence types" msgstr "binary sequence types(二進位序列型別)" -#: ../../library/stdtypes.rst:3245 +#: ../../library/stdtypes.rst:3259 msgid "memoryview" msgstr "memoryview(記憶體視圖)" -#: ../../library/stdtypes.rst:3245 +#: ../../library/stdtypes.rst:3259 msgid "array" msgstr "array(陣列)" -#: ../../library/stdtypes.rst:4165 +#: ../../library/stdtypes.rst:4179 msgid "bytes.splitlines method" msgstr "bytes.splitlines 方法" -#: ../../library/stdtypes.rst:4165 +#: ../../library/stdtypes.rst:4179 msgid "bytearray.splitlines method" msgstr "bytearray.splitlines 方法" -#: ../../library/stdtypes.rst:4311 +#: ../../library/stdtypes.rst:4325 msgid "formatting" msgstr "formatting(格式化)" -#: ../../library/stdtypes.rst:4311 +#: ../../library/stdtypes.rst:4325 msgid "bytes (%)" msgstr "bytes (%)" -#: ../../library/stdtypes.rst:4311 +#: ../../library/stdtypes.rst:4325 msgid "bytearray (%)" msgstr "bytearray (%)" -#: ../../library/stdtypes.rst:4311 +#: ../../library/stdtypes.rst:4325 msgid "interpolation" msgstr "interpolation(插值)" -#: ../../library/stdtypes.rst:5021 +#: ../../library/stdtypes.rst:5035 msgid "set" msgstr "set(集合)" -#: ../../library/stdtypes.rst:5237 +#: ../../library/stdtypes.rst:5251 msgid "mapping" msgstr "mapping(對映)" -#: ../../library/stdtypes.rst:5237 +#: ../../library/stdtypes.rst:5251 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../library/stdtypes.rst:5344 +#: ../../library/stdtypes.rst:5358 msgid "__missing__()" msgstr "__missing__()" -#: ../../library/stdtypes.rst:5639 +#: ../../library/stdtypes.rst:5653 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../library/stdtypes.rst:5639 +#: ../../library/stdtypes.rst:5653 msgid "context management protocol" msgstr "context management protocol(情境管理協定)" -#: ../../library/stdtypes.rst:5639 +#: ../../library/stdtypes.rst:5653 msgid "context management" msgstr "context management(情境管理)" -#: ../../library/stdtypes.rst:5714 +#: ../../library/stdtypes.rst:5728 msgid "annotation" msgstr "annotation(註記)" -#: ../../library/stdtypes.rst:5714 +#: ../../library/stdtypes.rst:5728 msgid "type annotation; type hint" msgstr "type annotation(型別註記);type hint(型別提示)" -#: ../../library/stdtypes.rst:5726 +#: ../../library/stdtypes.rst:5740 msgid "GenericAlias" msgstr "GenericAlias(泛型別名)" -#: ../../library/stdtypes.rst:5726 +#: ../../library/stdtypes.rst:5740 msgid "Generic" msgstr "Generic(泛型)" -#: ../../library/stdtypes.rst:5726 +#: ../../library/stdtypes.rst:5740 msgid "Alias" msgstr "Alias(別名)" -#: ../../library/stdtypes.rst:5983 +#: ../../library/stdtypes.rst:5997 msgid "Union" msgstr "Union(聯合)" -#: ../../library/stdtypes.rst:5983 +#: ../../library/stdtypes.rst:5997 msgid "union" msgstr "union(聯集)" -#: ../../library/stdtypes.rst:6158 +#: ../../library/stdtypes.rst:6172 msgid "method" msgstr "method(方法)" -#: ../../library/stdtypes.rst:6203 +#: ../../library/stdtypes.rst:6217 msgid "code" msgstr "code(程式碼)" -#: ../../library/stdtypes.rst:6203 +#: ../../library/stdtypes.rst:6217 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../library/stdtypes.rst:6210 +#: ../../library/stdtypes.rst:6224 msgid "compile" msgstr "compile(編譯)" -#: ../../library/stdtypes.rst:6210 +#: ../../library/stdtypes.rst:6224 msgid "__code__ (function object attribute)" msgstr "__code__(函式物件屬性)" -#: ../../library/stdtypes.rst:6224 +#: ../../library/stdtypes.rst:6238 msgid "exec" msgstr "exec" -#: ../../library/stdtypes.rst:6224 +#: ../../library/stdtypes.rst:6238 msgid "eval" msgstr "eval" -#: ../../library/stdtypes.rst:6263 +#: ../../library/stdtypes.rst:6277 msgid "..." msgstr "..." -#: ../../library/stdtypes.rst:6263 +#: ../../library/stdtypes.rst:6277 msgid "ellipsis literal" msgstr "ellipsis literal(刪節號字面值)" From 4998e66eb4c090a9fb72171661952b9d96a09c7b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 11 Apr 2026 00:23:36 +0000 Subject: [PATCH 4/4] sync with cpython f36da66c --- using/configure.po | 74 ++++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 35 deletions(-) diff --git a/using/configure.po b/using/configure.po index 08a6d07c79..50667edee6 100644 --- a/using/configure.po +++ b/using/configure.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-04-04 00:21+0000\n" +"POT-Creation-Date: 2026-04-11 00:22+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2164,7 +2164,7 @@ msgid "" "have headers in a nonstandard directory *include_dir*." msgstr "" -#: ../../using/configure.rst:1416 ../../using/configure.rst:1606 +#: ../../using/configure.rst:1416 ../../using/configure.rst:1612 msgid "" "Both :envvar:`CPPFLAGS` and :envvar:`LDFLAGS` need to contain the shell's " "value to be able to build extension modules using the directories specified " @@ -2256,25 +2256,29 @@ msgid "Strict or non-strict aliasing flags used to compile ``Python/dtoa.c``." msgstr "" #: ../../using/configure.rst:1511 +msgid "Flags used to compile ``Python/ceval.c``." +msgstr "" + +#: ../../using/configure.rst:1517 msgid "Compiler flags used to build a shared library." msgstr "用於建置共享函式庫的編譯器旗標。" -#: ../../using/configure.rst:1513 +#: ../../using/configure.rst:1519 msgid "For example, ``-fPIC`` is used on Linux and on BSD." msgstr "例如說 ``-fPIC`` 被使用於 Linux 與 BSD 上。" -#: ../../using/configure.rst:1517 +#: ../../using/configure.rst:1523 msgid "Extra C flags added for building the interpreter object files." msgstr "用於建置直譯器目的檔的額外 C 旗標。" -#: ../../using/configure.rst:1519 +#: ../../using/configure.rst:1525 msgid "" "Default: ``$(CCSHARED)`` when :option:`--enable-shared` is used, or an empty " "string otherwise." msgstr "" "預設值:當使用 :option:`--enable-shared` 時為 ``$(CCSHARED)``,否則為空字串。" -#: ../../using/configure.rst:1524 +#: ../../using/configure.rst:1530 msgid "" "Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " "$(EXTRA_CFLAGS)``." @@ -2282,7 +2286,7 @@ msgstr "" "預設值:``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " "$(EXTRA_CFLAGS)``。" -#: ../../using/configure.rst:1528 +#: ../../using/configure.rst:1534 msgid "" "Default: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``." @@ -2290,11 +2294,11 @@ msgstr "" "預設值:``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``。" -#: ../../using/configure.rst:1534 +#: ../../using/configure.rst:1540 msgid "C flags used for building the interpreter object files." msgstr "用於建置直譯器目的檔的 C 旗標。" -#: ../../using/configure.rst:1536 +#: ../../using/configure.rst:1542 msgid "" "Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " "$(CFLAGSFORSHARED)``." @@ -2302,126 +2306,126 @@ msgstr "" "預設值:``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " "$(CFLAGSFORSHARED)``。" -#: ../../using/configure.rst:1542 +#: ../../using/configure.rst:1548 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``." msgstr "預設值:``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``。" -#: ../../using/configure.rst:1548 +#: ../../using/configure.rst:1554 msgid "" "Compiler flags to build a standard library extension module as a built-in " "module, like the :mod:`posix` module." msgstr "" -#: ../../using/configure.rst:1551 +#: ../../using/configure.rst:1557 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``." msgstr "預設值:``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``。" -#: ../../using/configure.rst:1557 +#: ../../using/configure.rst:1563 msgid "Purify command. Purify is a memory debugger program." msgstr "" -#: ../../using/configure.rst:1559 +#: ../../using/configure.rst:1565 msgid "Default: empty string (not used)." msgstr "預設值:空字串(未使用)。" -#: ../../using/configure.rst:1563 +#: ../../using/configure.rst:1569 msgid "Linker flags" msgstr "" -#: ../../using/configure.rst:1567 +#: ../../using/configure.rst:1573 msgid "" "Linker command used to build programs like ``python`` and ``_testembed``." msgstr "" -#: ../../using/configure.rst:1569 +#: ../../using/configure.rst:1575 msgid "Default: ``$(PURIFY) $(CC)``." msgstr "預設值:``$(PURIFY) $(CC)``。" -#: ../../using/configure.rst:1573 +#: ../../using/configure.rst:1579 msgid "" "Value of :envvar:`LDFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1575 +#: ../../using/configure.rst:1581 msgid "" "Avoid assigning :envvar:`CFLAGS`, :envvar:`LDFLAGS`, etc. so users can use " "them on the command line to append to these values without stomping the pre-" "set values." msgstr "" -#: ../../using/configure.rst:1583 +#: ../../using/configure.rst:1589 msgid "" ":envvar:`LDFLAGS_NODIST` is used in the same manner as :envvar:" "`CFLAGS_NODIST`. Use it when a linker flag should *not* be part of :envvar:" "`LDFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:1587 +#: ../../using/configure.rst:1593 msgid "In particular, :envvar:`LDFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:1589 +#: ../../using/configure.rst:1595 msgid "" "the compiler flag ``-L`` (for setting the search path for libraries). The ``-" "L`` flags are processed from left to right, and any flags in :envvar:" "`LDFLAGS` would take precedence over user- and package-supplied ``-L`` flags." msgstr "" -#: ../../using/configure.rst:1596 +#: ../../using/configure.rst:1602 msgid "" "Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:1603 +#: ../../using/configure.rst:1609 msgid "" "Linker flags, e.g. :samp:`-L{lib_dir}` if you have libraries in a " "nonstandard directory *lib_dir*." msgstr "" -#: ../../using/configure.rst:1612 +#: ../../using/configure.rst:1618 msgid "" "Linker flags to pass libraries to the linker when linking the Python " "executable." msgstr "" -#: ../../using/configure.rst:1615 +#: ../../using/configure.rst:1621 msgid "Example: ``-lrt``." msgstr "範例:``-lrt``。" -#: ../../using/configure.rst:1619 +#: ../../using/configure.rst:1625 msgid "Command to build a shared library." msgstr "建置共享函式庫的指令。" -#: ../../using/configure.rst:1621 +#: ../../using/configure.rst:1627 msgid "Default: ``@LDSHARED@ $(PY_LDFLAGS)``." msgstr "預設值:``@LDSHARED@ $(PY_LDFLAGS)``。" -#: ../../using/configure.rst:1625 +#: ../../using/configure.rst:1631 msgid "Command to build ``libpython`` shared library." msgstr "建置 ``libpython`` 共享函式庫的指令。" -#: ../../using/configure.rst:1627 +#: ../../using/configure.rst:1633 msgid "Default: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``." msgstr "預設值:``@BLDSHARED@ $(PY_CORE_LDFLAGS)``。" -#: ../../using/configure.rst:1631 +#: ../../using/configure.rst:1637 msgid "Default: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``。" -#: ../../using/configure.rst:1635 +#: ../../using/configure.rst:1641 msgid "Default: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``。" -#: ../../using/configure.rst:1641 +#: ../../using/configure.rst:1647 msgid "Linker flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1647 +#: ../../using/configure.rst:1653 msgid "Footnotes" msgstr "註腳" -#: ../../using/configure.rst:1648 +#: ../../using/configure.rst:1654 msgid "" "``git clean -fdx`` is an even more extreme way to \"clean\" your checkout. " "It removes all files not known to Git. When bug hunting using ``git "