From e4f5596b0a8e21c4746e9061f0d19ddd288c0144 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 22 Jan 2026 16:57:18 +0000 Subject: [PATCH 01/11] sync with cpython fbc81558 --- c-api/bytes.po | 5 +- c-api/typeobj.po | 82 ++++++-------- howto/annotations.po | 4 +- howto/curses.po | 4 +- howto/ipaddress.po | 30 +++--- howto/isolating-extensions.po | 4 +- howto/regex.po | 4 +- howto/sockets.po | 4 +- howto/urllib2.po | 6 +- library/asyncio.po | 4 +- library/codecs.po | 8 +- library/datetime.po | 60 +++++------ library/dialog.po | 16 +-- library/enum.po | 9 +- library/functions.po | 184 ++++++++++++++++---------------- library/logging.config.po | 9 +- library/logging.handlers.po | 9 +- library/logging.po | 9 +- library/stdtypes.po | 11 +- library/tkinter.font.po | 26 ++--- library/turtle.po | 194 +++++++++++++++++----------------- library/xml.sax.handler.po | 24 ++--- reference/executionmodel.po | 18 ++-- using/configure.po | 6 +- using/windows.po | 14 +-- whatsnew/3.11.po | 71 ++++++------- whatsnew/3.7.po | 4 +- 27 files changed, 398 insertions(+), 421 deletions(-) diff --git a/c-api/bytes.po b/c-api/bytes.po index 86da7979be..c931a1c3d1 100644 --- a/c-api/bytes.po +++ b/c-api/bytes.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2018-05-23 14:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -159,7 +159,8 @@ msgid "``%zd``" msgstr "``%zd``" #: ../../c-api/bytes.rst:84 -msgid ":c:type:` Py_ssize_t`" +#, fuzzy +msgid ":c:type:`\\ Py_ssize_t`" msgstr ":c:type:` Py_ssize_t`" #: ../../c-api/bytes.rst:84 diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 927b3d0ae6..e18b0c311b 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-15 00:15+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2018-05-23 14:33+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -93,8 +93,8 @@ msgstr "I" msgid " :c:member:`~PyTypeObject.tp_name`" msgstr " :c:member:`~PyTypeObject.tp_name`" -#: ../../c-api/typeobj.rst:44 ../../c-api/typeobj.rst:86 -#: ../../c-api/typeobj.rst:372 ../../c-api/typeobj.rst:377 +#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:44 +#: ../../c-api/typeobj.rst:86 msgid "const char *" msgstr "const char *" @@ -125,11 +125,10 @@ msgstr "X" msgid ":c:member:`~PyTypeObject.tp_basicsize`" msgstr ":c:member:`~PyTypeObject.tp_basicsize`" -#: ../../c-api/typeobj.rst:46 ../../c-api/typeobj.rst:48 -#: ../../c-api/typeobj.rst:52 ../../c-api/typeobj.rst:99 -#: ../../c-api/typeobj.rst:120 ../../c-api/typeobj.rst:343 -#: ../../c-api/typeobj.rst:417 ../../c-api/typeobj.rst:448 -#: ../../c-api/typeobj.rst:453 +#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:46 +#: ../../c-api/typeobj.rst:48 ../../c-api/typeobj.rst:52 +#: ../../c-api/typeobj.rst:99 ../../c-api/typeobj.rst:120 +#: ../../c-api/typeobj.rst:417 msgid ":c:type:`Py_ssize_t`" msgstr ":c:type:`Py_ssize_t`" @@ -403,8 +402,7 @@ msgstr ":c:type:`PyGetSetDef` []" msgid ":c:member:`~PyTypeObject.tp_base`" msgstr ":c:member:`~PyTypeObject.tp_base`" -#: ../../c-api/typeobj.rst:111 ../../c-api/typeobj.rst:342 -#: ../../c-api/typeobj.rst:357 +#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:111 msgid ":c:type:`PyTypeObject` *" msgstr ":c:type:`PyTypeObject` *" @@ -416,32 +414,18 @@ msgstr "__base__" msgid ":c:member:`~PyTypeObject.tp_dict`" msgstr ":c:member:`~PyTypeObject.tp_dict`" -#: ../../c-api/typeobj.rst:113 ../../c-api/typeobj.rst:132 -#: ../../c-api/typeobj.rst:134 ../../c-api/typeobj.rst:136 -#: ../../c-api/typeobj.rst:140 ../../c-api/typeobj.rst:342 -#: ../../c-api/typeobj.rst:347 ../../c-api/typeobj.rst:351 -#: ../../c-api/typeobj.rst:357 ../../c-api/typeobj.rst:358 -#: ../../c-api/typeobj.rst:359 ../../c-api/typeobj.rst:363 -#: ../../c-api/typeobj.rst:364 ../../c-api/typeobj.rst:365 -#: ../../c-api/typeobj.rst:369 ../../c-api/typeobj.rst:371 -#: ../../c-api/typeobj.rst:376 ../../c-api/typeobj.rst:378 -#: ../../c-api/typeobj.rst:382 ../../c-api/typeobj.rst:383 -#: ../../c-api/typeobj.rst:387 ../../c-api/typeobj.rst:388 -#: ../../c-api/typeobj.rst:389 ../../c-api/typeobj.rst:393 -#: ../../c-api/typeobj.rst:394 ../../c-api/typeobj.rst:395 -#: ../../c-api/typeobj.rst:399 ../../c-api/typeobj.rst:400 -#: ../../c-api/typeobj.rst:401 ../../c-api/typeobj.rst:405 -#: ../../c-api/typeobj.rst:407 ../../c-api/typeobj.rst:408 -#: ../../c-api/typeobj.rst:413 ../../c-api/typeobj.rst:415 -#: ../../c-api/typeobj.rst:417 ../../c-api/typeobj.rst:419 -#: ../../c-api/typeobj.rst:425 ../../c-api/typeobj.rst:430 -#: ../../c-api/typeobj.rst:432 ../../c-api/typeobj.rst:436 -#: ../../c-api/typeobj.rst:437 ../../c-api/typeobj.rst:441 -#: ../../c-api/typeobj.rst:442 ../../c-api/typeobj.rst:443 -#: ../../c-api/typeobj.rst:447 ../../c-api/typeobj.rst:452 -#: ../../c-api/typeobj.rst:454 ../../c-api/typeobj.rst:458 -#: ../../c-api/typeobj.rst:459 ../../c-api/typeobj.rst:463 -#: ../../c-api/typeobj.rst:464 ../../c-api/typeobj.rst:465 +#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:113 +#: ../../c-api/typeobj.rst:132 ../../c-api/typeobj.rst:134 +#: ../../c-api/typeobj.rst:136 ../../c-api/typeobj.rst:140 +#: ../../c-api/typeobj.rst:342 ../../c-api/typeobj.rst:347 +#: ../../c-api/typeobj.rst:357 ../../c-api/typeobj.rst:369 +#: ../../c-api/typeobj.rst:371 ../../c-api/typeobj.rst:382 +#: ../../c-api/typeobj.rst:393 ../../c-api/typeobj.rst:405 +#: ../../c-api/typeobj.rst:407 ../../c-api/typeobj.rst:413 +#: ../../c-api/typeobj.rst:415 ../../c-api/typeobj.rst:417 +#: ../../c-api/typeobj.rst:430 ../../c-api/typeobj.rst:432 +#: ../../c-api/typeobj.rst:436 ../../c-api/typeobj.rst:441 +#: ../../c-api/typeobj.rst:447 msgid ":c:type:`PyObject` *" msgstr ":c:type:`PyObject` *" @@ -549,8 +533,8 @@ msgstr "[:c:member:`~PyTypeObject.tp_cache`]" msgid "[:c:member:`~PyTypeObject.tp_subclasses`]" msgstr "[:c:member:`~PyTypeObject.tp_subclasses`]" -#: ../../c-api/typeobj.rst:138 ../../c-api/typeobj.rst:279 -#: ../../c-api/typeobj.rst:349 ../../c-api/typeobj.rst:353 +#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:138 +#: ../../c-api/typeobj.rst:279 ../../c-api/typeobj.rst:349 msgid "void *" msgstr "void *" @@ -1133,7 +1117,8 @@ msgid ":c:func:`releasebufferproc`" msgstr ":c:func:`releasebufferproc`" #: ../../c-api/typeobj.rst:330 -msgid "__release_ buffer\\__" +#, fuzzy +msgid "__release_\\ buffer\\__" msgstr "__release_ buffer\\__" #: ../../c-api/typeobj.rst:337 @@ -1157,16 +1142,16 @@ msgstr "" msgid "void" msgstr "void" -#: ../../c-api/typeobj.rst:352 +#: ../../c-api/typeobj.rst:0 msgid ":c:type:`visitproc`" msgstr ":c:type:`visitproc`" -#: ../../c-api/typeobj.rst:351 ../../c-api/typeobj.rst:363 -#: ../../c-api/typeobj.rst:376 ../../c-api/typeobj.rst:387 -#: ../../c-api/typeobj.rst:399 ../../c-api/typeobj.rst:409 -#: ../../c-api/typeobj.rst:419 ../../c-api/typeobj.rst:421 -#: ../../c-api/typeobj.rst:430 ../../c-api/typeobj.rst:452 -#: ../../c-api/typeobj.rst:458 ../../c-api/typeobj.rst:463 +#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:351 +#: ../../c-api/typeobj.rst:363 ../../c-api/typeobj.rst:376 +#: ../../c-api/typeobj.rst:387 ../../c-api/typeobj.rst:399 +#: ../../c-api/typeobj.rst:419 ../../c-api/typeobj.rst:430 +#: ../../c-api/typeobj.rst:452 ../../c-api/typeobj.rst:458 +#: ../../c-api/typeobj.rst:463 msgid "int" msgstr "int" @@ -1178,7 +1163,7 @@ msgstr "Py_hash_t" msgid ":c:type:`getbufferproc`" msgstr ":c:type:`getbufferproc`" -#: ../../c-api/typeobj.rst:420 ../../c-api/typeobj.rst:426 +#: ../../c-api/typeobj.rst:0 msgid ":c:type:`Py_buffer` *" msgstr ":c:type:`Py_buffer` *" @@ -2444,7 +2429,8 @@ msgid "" "Renamed to the current name, without the leading underscore. The old " "provisional name is :term:`soft deprecated`." msgstr "" -"重新命名為目前的名稱,沒有前導底線。舊的臨時名稱已被 :term:`軟性棄用 `。" +"重新命名為目前的名稱,沒有前導底線。舊的臨時名稱已被 :term:`軟性棄用 `。" #: ../../c-api/typeobj.rst:1384 msgid "" diff --git a/howto/annotations.po b/howto/annotations.po index f6a5b8f4ca..bef59517aa 100644 --- a/howto/annotations.po +++ b/howto/annotations.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2023-11-08 23:11+0800\n" "Last-Translator: rockleon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,7 +29,7 @@ msgstr "作者" msgid "Larry Hastings" msgstr "Larry Hastings" -#: ../../howto/annotations.rst:9 +#: ../../howto/annotations.rst:-1 msgid "Abstract" msgstr "摘要" diff --git a/howto/curses.po b/howto/curses.po index 38eb0c2a5e..5809cd8c95 100644 --- a/howto/curses.po +++ b/howto/curses.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,7 +37,7 @@ msgstr "發佈版本" msgid "2.04" msgstr "2.04" -#: ../../howto/curses.rst:13 +#: ../../howto/curses.rst:-1 msgid "Abstract" msgstr "摘要" diff --git a/howto/ipaddress.po b/howto/ipaddress.po index 060f61e22a..08ee8de730 100644 --- a/howto/ipaddress.po +++ b/howto/ipaddress.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2025-12-26 10:42-0500\n" "Last-Translator: Chih-Chao Chang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,7 +35,7 @@ msgstr "Peter Moody" msgid "Nick Coghlan" msgstr "Nick Coghlan" -#: ../../howto/ipaddress.rst:14 +#: ../../howto/ipaddress.rst:-1 msgid "Overview" msgstr "總攬" @@ -200,9 +200,9 @@ msgid "" "commonly used to describe network interfaces of a computer on a given " "network and are described further in the next section." msgstr "" -"網路物件不能設定任何主機位元。這樣做的實際效果是 ``192.0.2.1/24`` 並不描述一個網" -"路。這類定義被稱為介面物件,因為 ip-on-a-network 標記法通常用於描述電腦在給定" -"網路上的網路介面,並將在下一節中進一步說明。" +"網路物件不能設定任何主機位元。這樣做的實際效果是 ``192.0.2.1/24`` 並不描述一" +"個網路。這類定義被稱為介面物件,因為 ip-on-a-network 標記法通常用於描述電腦在" +"給定網路上的網路介面,並將在下一節中進一步說明。" #: ../../howto/ipaddress.rst:107 msgid "" @@ -279,9 +279,9 @@ msgid "" msgstr "" "如上所述,如果你需要描述特定網路上的位址,位址類別和網路類別都不足以滿足需" "求。像 ``192.0.2.1/24`` 這樣的標記法通常被網路工程師以及編寫防火牆和路由器工" -"具的人用作「網路 ``192.0.2.0/24`` 上的主機 ``192.0.2.1``」的簡寫。因" -"此,:mod:`ipaddress` 提供了一組混合類別,將位址與特定網路關聯起來。建立介面的" -"方式與定義網路物件相同,只是位址部分不受限於必須是網路位址。" +"具的人用作「網路 ``192.0.2.0/24`` 上的主機 ``192.0.2.1``」的簡寫。因此,:mod:" +"`ipaddress` 提供了一組混合類別,將位址與特定網路關聯起來。建立介面的方式與定" +"義網路物件相同,只是位址部分不受限於必須是網路位址。" #: ../../howto/ipaddress.rst:152 msgid "" @@ -565,10 +565,10 @@ msgid "" "because it's necessary to know whether the value is *supposed* to be IPv4 or " "IPv6 in order to provide more detail on why it has been rejected." msgstr "" -"當使用版本無關的工廠函式建立位址/網路/介面物件時,任何錯誤都會" -"以 :exc:`ValueError` 回報,並附帶一個通用的錯誤訊息,簡單地說明傳入的值未被識" -"別為該類型的物件。缺乏具體錯誤的原因是,為了提供更多關於為何被拒絕的細節,需" -"要知道該值應該是 IPv4 還是 IPv6。" +"當使用版本無關的工廠函式建立位址/網路/介面物件時,任何錯誤都會以 :exc:" +"`ValueError` 回報,並附帶一個通用的錯誤訊息,簡單地說明傳入的值未被識別為該類" +"型的物件。缺乏具體錯誤的原因是,為了提供更多關於為何被拒絕的細節,需要知道該" +"值應該是 IPv4 還是 IPv6。" #: ../../howto/ipaddress.rst:305 msgid "" @@ -578,9 +578,9 @@ msgid "" "`ipaddress.NetmaskValueError` to indicate exactly which part of the " "definition failed to parse correctly." msgstr "" -"為了支援需要存取這些額外細節的使用情境,個別類別建構子實際上會引" -"發 :exc:`ValueError` 的子類別 :exc:`ipaddress.AddressValueError` " -"和 :exc:`ipaddress.NetmaskValueError`,以明確指出定義的哪個部分無法正確解析。" +"為了支援需要存取這些額外細節的使用情境,個別類別建構子實際上會引發 :exc:" +"`ValueError` 的子類別 :exc:`ipaddress.AddressValueError` 和 :exc:`ipaddress." +"NetmaskValueError`,以明確指出定義的哪個部分無法正確解析。" #: ../../howto/ipaddress.rst:311 msgid "" diff --git a/howto/isolating-extensions.po b/howto/isolating-extensions.po index 2c5f99df61..c4a4f7501f 100644 --- a/howto/isolating-extensions.po +++ b/howto/isolating-extensions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+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-" @@ -21,7 +21,7 @@ msgstr "" msgid "Isolating Extension Modules" msgstr "隔離擴充模組" -#: ../../howto/isolating-extensions.rst:9 +#: ../../howto/isolating-extensions.rst:-1 msgid "Abstract" msgstr "摘要" diff --git a/howto/regex.po b/howto/regex.po index 02a25aaf4d..4840ea5412 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,7 +31,7 @@ msgstr "作者" msgid "A.M. Kuchling " msgstr "A.M. Kuchling " -#: ../../howto/regex.rst:16 +#: ../../howto/regex.rst:-1 msgid "Abstract" msgstr "摘要" diff --git a/howto/sockets.po b/howto/sockets.po index 11ec58c7e6..c7e63d526f 100644 --- a/howto/sockets.po +++ b/howto/sockets.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2023-08-12 15:16+0800\n" "Last-Translator: Jay \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,7 +30,7 @@ msgstr "作者" msgid "Gordon McMillan" msgstr "Gordon McMillan" -#: ../../howto/sockets.rst:10 +#: ../../howto/sockets.rst:-1 msgid "Abstract" msgstr "摘要" diff --git a/howto/urllib2.po b/howto/urllib2.po index 540848cedb..2838843ae7 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2022-06-27 09:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,10 +35,6 @@ msgstr "`Michael Foord `_" msgid "Introduction" msgstr "簡介" -#: ../../howto/urllib2.rst:13 -msgid "Related Articles" -msgstr "" - #: ../../howto/urllib2.rst:15 msgid "" "You may also find useful the following article on fetching web resources " diff --git a/library/asyncio.po b/library/asyncio.po index 79c9d8f5e1..8c267942ad 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2025-07-06 17:13+0800\n" "Last-Translator: Weilin Du\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,7 +37,7 @@ msgstr "指南與教學" msgid ":mod:`!asyncio` --- Asynchronous I/O" msgstr ":mod:`!asyncio` --- 非同步 I/O" -#: ../../library/asyncio.rst:9 +#: ../../library/asyncio.rst:-1 msgid "Hello World!" msgstr "Hello World!" diff --git a/library/codecs.po b/library/codecs.po index 4d4aee110f..ab26604c3e 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1328,15 +1328,15 @@ msgid "" "charmap encoded file starts with these byte values (which would e.g. map to" msgstr "" -#: ../../library/codecs.rst:1049 +#: ../../library/codecs.rst:0 msgid "LATIN SMALL LETTER I WITH DIAERESIS" msgstr "" -#: ../../library/codecs.rst:1050 +#: ../../library/codecs.rst:0 msgid "RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK" msgstr "" -#: ../../library/codecs.rst:1051 +#: ../../library/codecs.rst:0 msgid "INVERTED QUESTION MARK" msgstr "" diff --git a/library/datetime.po b/library/datetime.po index ae1b1b16c3..c5707f46d0 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-22 00:16+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2023-08-07 10:20+0800\n" "Last-Translator: Griiid \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1061,11 +1061,11 @@ msgstr "``timedelta = date1 - date2``" msgid "\\(3)" msgstr "\\(3)" -#: ../../library/datetime.rst:663 +#: ../../library/datetime.rst:0 msgid "``date1 == date2``" msgstr "``date1 == date2``" -#: ../../library/datetime.rst:664 +#: ../../library/datetime.rst:0 msgid "``date1 != date2``" msgstr "``date1 != date2``" @@ -1073,19 +1073,19 @@ msgstr "``date1 != date2``" msgid "Equality comparison. (4)" msgstr "" -#: ../../library/datetime.rst:666 +#: ../../library/datetime.rst:0 msgid "``date1 < date2``" msgstr "``date1 < date2``" -#: ../../library/datetime.rst:667 +#: ../../library/datetime.rst:0 msgid "``date1 > date2``" msgstr "``date1 > date2``" -#: ../../library/datetime.rst:668 +#: ../../library/datetime.rst:0 msgid "``date1 <= date2``" msgstr "``date1 <= date2``" -#: ../../library/datetime.rst:669 +#: ../../library/datetime.rst:0 msgid "``date1 >= date2``" msgstr "``date1 >= date2``" @@ -1899,27 +1899,27 @@ msgstr "\\(2)" msgid "``timedelta = datetime1 - datetime2``" msgstr "``timedelta = datetime1 - datetime2``" -#: ../../library/datetime.rst:1259 +#: ../../library/datetime.rst:0 msgid "``datetime1 == datetime2``" msgstr "``datetime1 == datetime2``" -#: ../../library/datetime.rst:1260 +#: ../../library/datetime.rst:0 msgid "``datetime1 != datetime2``" msgstr "``datetime1 != datetime2``" -#: ../../library/datetime.rst:1262 +#: ../../library/datetime.rst:0 msgid "``datetime1 < datetime2``" msgstr "``datetime1 < datetime2``" -#: ../../library/datetime.rst:1263 +#: ../../library/datetime.rst:0 msgid "``datetime1 > datetime2``" msgstr "``datetime1 > datetime2``" -#: ../../library/datetime.rst:1264 +#: ../../library/datetime.rst:0 msgid "``datetime1 <= datetime2``" msgstr "``datetime1 <= datetime2``" -#: ../../library/datetime.rst:1265 +#: ../../library/datetime.rst:0 msgid "``datetime1 >= datetime2``" msgstr "``datetime1 >= datetime2``" @@ -3744,11 +3744,11 @@ msgstr "``%a``" msgid "Weekday as locale's abbreviated name." msgstr "" -#: ../../library/datetime.rst:2490 +#: ../../library/datetime.rst:0 msgid "Sun, Mon, ..., Sat (en_US);" msgstr "" -#: ../../library/datetime.rst:2492 +#: ../../library/datetime.rst:0 msgid "So, Mo, ..., Sa (de_DE)" msgstr "" @@ -3760,11 +3760,11 @@ msgstr "``%A``" msgid "Weekday as locale's full name." msgstr "" -#: ../../library/datetime.rst:2495 +#: ../../library/datetime.rst:0 msgid "Sunday, Monday, ..., Saturday (en_US);" msgstr "" -#: ../../library/datetime.rst:2497 +#: ../../library/datetime.rst:0 msgid "Sonntag, Montag, ..., Samstag (de_DE)" msgstr "" @@ -3807,11 +3807,11 @@ msgstr "``%b``" msgid "Month as locale's abbreviated name." msgstr "" -#: ../../library/datetime.rst:2507 +#: ../../library/datetime.rst:0 msgid "Jan, Feb, ..., Dec (en_US);" msgstr "" -#: ../../library/datetime.rst:2509 +#: ../../library/datetime.rst:0 msgid "Jan, Feb, ..., Dez (de_DE)" msgstr "" @@ -3823,11 +3823,11 @@ msgstr "``%B``" msgid "Month as locale's full name." msgstr "" -#: ../../library/datetime.rst:2512 +#: ../../library/datetime.rst:0 msgid "January, February, ..., December (en_US);" msgstr "" -#: ../../library/datetime.rst:2514 +#: ../../library/datetime.rst:0 msgid "Januar, Februar, ..., Dezember (de_DE)" msgstr "" @@ -3895,11 +3895,11 @@ msgstr "``%p``" msgid "Locale's equivalent of either AM or PM." msgstr "" -#: ../../library/datetime.rst:2532 +#: ../../library/datetime.rst:0 msgid "AM, PM (en_US);" msgstr "AM, PM (en_US);" -#: ../../library/datetime.rst:2533 +#: ../../library/datetime.rst:0 msgid "am, pm (de_DE)" msgstr "am, pm (de_DE)" @@ -4028,11 +4028,11 @@ msgstr "``%c``" msgid "Locale's appropriate date and time representation." msgstr "" -#: ../../library/datetime.rst:2572 +#: ../../library/datetime.rst:0 msgid "Tue Aug 16 21:30:00 1988 (en_US);" msgstr "" -#: ../../library/datetime.rst:2574 +#: ../../library/datetime.rst:0 msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "" @@ -4044,15 +4044,15 @@ msgstr "``%x``" msgid "Locale's appropriate date representation." msgstr "" -#: ../../library/datetime.rst:2577 +#: ../../library/datetime.rst:0 msgid "08/16/88 (None);" msgstr "" -#: ../../library/datetime.rst:2578 +#: ../../library/datetime.rst:0 msgid "08/16/1988 (en_US);" msgstr "" -#: ../../library/datetime.rst:2579 +#: ../../library/datetime.rst:0 msgid "16.08.1988 (de_DE)" msgstr "" @@ -4064,11 +4064,11 @@ msgstr "``%X``" msgid "Locale's appropriate time representation." msgstr "" -#: ../../library/datetime.rst:2581 +#: ../../library/datetime.rst:0 msgid "21:30:00 (en_US);" msgstr "" -#: ../../library/datetime.rst:2582 +#: ../../library/datetime.rst:0 msgid "21:30:00 (de_DE)" msgstr "" diff --git a/library/dialog.po b/library/dialog.po index 7bc9c50cda..3ab19f244e 100644 --- a/library/dialog.po +++ b/library/dialog.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+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-" @@ -83,32 +83,32 @@ msgid "" "listed below:" msgstr "" -#: ../../library/dialog.rst:64 +#: ../../library/dialog.rst:0 msgid "*parent* - the window to place the dialog on top of" msgstr "" -#: ../../library/dialog.rst:66 +#: ../../library/dialog.rst:0 msgid "*title* - the title of the window" msgstr "" -#: ../../library/dialog.rst:68 +#: ../../library/dialog.rst:0 msgid "*initialdir* - the directory that the dialog starts in" msgstr "" -#: ../../library/dialog.rst:70 +#: ../../library/dialog.rst:0 msgid "*initialfile* - the file selected upon opening of the dialog" msgstr "" -#: ../../library/dialog.rst:72 +#: ../../library/dialog.rst:0 msgid "" "*filetypes* - a sequence of (label, pattern) tuples, '*' wildcard is allowed" msgstr "" -#: ../../library/dialog.rst:74 +#: ../../library/dialog.rst:0 msgid "*defaultextension* - default extension to append to file (save dialogs)" msgstr "" -#: ../../library/dialog.rst:76 +#: ../../library/dialog.rst:0 msgid "*multiple* - when true, selection of multiple items is allowed" msgstr "" diff --git a/library/enum.po b/library/enum.po index 0a45558139..c625a7a3b7 100644 --- a/library/enum.po +++ b/library/enum.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-12 12:22+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2024-12-21 13:50+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,10 +25,6 @@ msgstr ":mod:`!enum` --- 對列舉的支援" msgid "**Source code:** :source:`Lib/enum.py`" msgstr "**原始碼:**\\ :source:`Lib/enum.py`" -#: ../../library/enum.rst:16 -msgid "Important" -msgstr "重點資訊" - #: ../../library/enum.rst:18 msgid "" "This page contains the API reference information. For tutorial information " @@ -1908,3 +1904,6 @@ msgstr "" ">>> from enum import Enum, IntEnum\n" ">>> class MyIntEnum(IntEnum):\n" "... __str__ = Enum.__str__" + +#~ msgid "Important" +#~ msgstr "重點資訊" diff --git a/library/functions.po b/library/functions.po index 5465e746b0..544e51bc1e 100644 --- a/library/functions.po +++ b/library/functions.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-12 12:22+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2024-05-06 17:06+0800\n" "Last-Translator: KNChiu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,367 +33,367 @@ msgid "" msgstr "" "Python 直譯器有內建多個可隨時使用的函式和型別。以下按照英文字母排序列出。" -#: ../../library/functions.rst:13 +#: ../../library/functions.rst:0 msgid "**A**" msgstr "**A**" -#: ../../library/functions.rst:14 +#: ../../library/functions.rst:0 msgid ":func:`abs`" msgstr ":func:`abs`" -#: ../../library/functions.rst:15 +#: ../../library/functions.rst:0 msgid ":func:`aiter`" msgstr ":func:`aiter`" -#: ../../library/functions.rst:16 +#: ../../library/functions.rst:0 msgid ":func:`all`" msgstr ":func:`all`" -#: ../../library/functions.rst:17 +#: ../../library/functions.rst:0 msgid ":func:`anext`" msgstr ":func:`anext`" -#: ../../library/functions.rst:18 +#: ../../library/functions.rst:0 msgid ":func:`any`" msgstr ":func:`any`" -#: ../../library/functions.rst:19 +#: ../../library/functions.rst:0 msgid ":func:`ascii`" msgstr ":func:`ascii`" -#: ../../library/functions.rst:21 +#: ../../library/functions.rst:0 msgid "**B**" msgstr "**B**" -#: ../../library/functions.rst:22 +#: ../../library/functions.rst:0 msgid ":func:`bin`" msgstr ":func:`bin`" -#: ../../library/functions.rst:23 +#: ../../library/functions.rst:0 msgid ":func:`bool`" msgstr ":func:`bool`" -#: ../../library/functions.rst:24 +#: ../../library/functions.rst:0 msgid ":func:`breakpoint`" msgstr ":func:`breakpoint`" -#: ../../library/functions.rst:25 +#: ../../library/functions.rst:0 msgid "|func-bytearray|_" msgstr "|func-bytearray|_" -#: ../../library/functions.rst:26 +#: ../../library/functions.rst:0 msgid "|func-bytes|_" msgstr "|func-bytes|_" -#: ../../library/functions.rst:28 +#: ../../library/functions.rst:0 msgid "**C**" msgstr "**C**" -#: ../../library/functions.rst:29 +#: ../../library/functions.rst:0 msgid ":func:`callable`" msgstr ":func:`callable`" -#: ../../library/functions.rst:30 +#: ../../library/functions.rst:0 msgid ":func:`chr`" msgstr ":func:`chr`" -#: ../../library/functions.rst:31 +#: ../../library/functions.rst:0 msgid ":func:`classmethod`" msgstr ":func:`classmethod`" -#: ../../library/functions.rst:32 +#: ../../library/functions.rst:0 msgid ":func:`compile`" msgstr ":func:`compile`" -#: ../../library/functions.rst:33 +#: ../../library/functions.rst:0 msgid ":func:`complex`" msgstr ":func:`complex`" -#: ../../library/functions.rst:35 +#: ../../library/functions.rst:0 msgid "**D**" msgstr "**D**" -#: ../../library/functions.rst:36 +#: ../../library/functions.rst:0 msgid ":func:`delattr`" msgstr ":func:`delattr`" -#: ../../library/functions.rst:37 +#: ../../library/functions.rst:0 msgid "|func-dict|_" msgstr "|func-dict|_" -#: ../../library/functions.rst:38 +#: ../../library/functions.rst:0 msgid ":func:`dir`" msgstr ":func:`dir`" -#: ../../library/functions.rst:39 +#: ../../library/functions.rst:0 msgid ":func:`divmod`" msgstr ":func:`divmod`" -#: ../../library/functions.rst:13 +#: ../../library/functions.rst:0 msgid "**E**" msgstr "**E**" -#: ../../library/functions.rst:14 +#: ../../library/functions.rst:0 msgid ":func:`enumerate`" msgstr ":func:`enumerate`" -#: ../../library/functions.rst:15 +#: ../../library/functions.rst:0 msgid ":func:`eval`" msgstr ":func:`eval`" -#: ../../library/functions.rst:16 +#: ../../library/functions.rst:0 msgid ":func:`exec`" msgstr ":func:`exec`" -#: ../../library/functions.rst:18 +#: ../../library/functions.rst:0 msgid "**F**" msgstr "**F**" -#: ../../library/functions.rst:19 +#: ../../library/functions.rst:0 msgid ":func:`filter`" msgstr ":func:`filter`" -#: ../../library/functions.rst:20 +#: ../../library/functions.rst:0 msgid ":func:`float`" msgstr ":func:`float`" -#: ../../library/functions.rst:21 +#: ../../library/functions.rst:0 msgid ":func:`format`" msgstr ":func:`format`" -#: ../../library/functions.rst:22 +#: ../../library/functions.rst:0 msgid "|func-frozenset|_" msgstr "|func-frozenset|_" -#: ../../library/functions.rst:24 +#: ../../library/functions.rst:0 msgid "**G**" msgstr "**G**" -#: ../../library/functions.rst:25 +#: ../../library/functions.rst:0 msgid ":func:`getattr`" msgstr ":func:`getattr`" -#: ../../library/functions.rst:26 +#: ../../library/functions.rst:0 msgid ":func:`globals`" msgstr ":func:`globals`" -#: ../../library/functions.rst:28 +#: ../../library/functions.rst:0 msgid "**H**" msgstr "**H**" -#: ../../library/functions.rst:29 +#: ../../library/functions.rst:0 msgid ":func:`hasattr`" msgstr ":func:`hasattr`" -#: ../../library/functions.rst:30 +#: ../../library/functions.rst:0 msgid ":func:`hash`" msgstr ":func:`hash`" -#: ../../library/functions.rst:31 +#: ../../library/functions.rst:0 msgid ":func:`help`" msgstr ":func:`help`" -#: ../../library/functions.rst:32 +#: ../../library/functions.rst:0 msgid ":func:`hex`" msgstr ":func:`hex`" -#: ../../library/functions.rst:34 +#: ../../library/functions.rst:0 msgid "**I**" msgstr "**I**" -#: ../../library/functions.rst:35 +#: ../../library/functions.rst:0 msgid ":func:`id`" msgstr ":func:`id`" -#: ../../library/functions.rst:36 +#: ../../library/functions.rst:0 msgid ":func:`input`" msgstr ":func:`input`" -#: ../../library/functions.rst:37 +#: ../../library/functions.rst:0 msgid ":func:`int`" msgstr ":func:`int`" -#: ../../library/functions.rst:38 +#: ../../library/functions.rst:0 msgid ":func:`isinstance`" msgstr ":func:`isinstance`" -#: ../../library/functions.rst:39 +#: ../../library/functions.rst:0 msgid ":func:`issubclass`" msgstr ":func:`issubclass`" -#: ../../library/functions.rst:40 +#: ../../library/functions.rst:0 msgid ":func:`iter`" msgstr ":func:`iter`" -#: ../../library/functions.rst:13 +#: ../../library/functions.rst:0 msgid "**L**" msgstr "**L**" -#: ../../library/functions.rst:14 +#: ../../library/functions.rst:0 msgid ":func:`len`" msgstr ":func:`len`" -#: ../../library/functions.rst:15 +#: ../../library/functions.rst:0 msgid "|func-list|_" msgstr "|func-list|_" -#: ../../library/functions.rst:16 +#: ../../library/functions.rst:0 msgid ":func:`locals`" msgstr ":func:`locals`" -#: ../../library/functions.rst:18 +#: ../../library/functions.rst:0 msgid "**M**" msgstr "**M**" -#: ../../library/functions.rst:19 +#: ../../library/functions.rst:0 msgid ":func:`map`" msgstr ":func:`map`" -#: ../../library/functions.rst:20 +#: ../../library/functions.rst:0 msgid ":func:`max`" msgstr ":func:`max`" -#: ../../library/functions.rst:21 +#: ../../library/functions.rst:0 msgid "|func-memoryview|_" msgstr "|func-memoryview|_" -#: ../../library/functions.rst:22 +#: ../../library/functions.rst:0 msgid ":func:`min`" msgstr ":func:`min`" -#: ../../library/functions.rst:24 +#: ../../library/functions.rst:0 msgid "**N**" msgstr "**N**" -#: ../../library/functions.rst:25 +#: ../../library/functions.rst:0 msgid ":func:`next`" msgstr ":func:`next`" -#: ../../library/functions.rst:27 +#: ../../library/functions.rst:0 msgid "**O**" msgstr "**O**" -#: ../../library/functions.rst:28 +#: ../../library/functions.rst:0 msgid ":func:`object`" msgstr ":func:`object`" -#: ../../library/functions.rst:29 +#: ../../library/functions.rst:0 msgid ":func:`oct`" msgstr ":func:`oct`" -#: ../../library/functions.rst:30 +#: ../../library/functions.rst:0 msgid ":func:`open`" msgstr ":func:`open`" -#: ../../library/functions.rst:31 +#: ../../library/functions.rst:0 msgid ":func:`ord`" msgstr ":func:`ord`" -#: ../../library/functions.rst:33 +#: ../../library/functions.rst:0 msgid "**P**" msgstr "**P**" -#: ../../library/functions.rst:34 +#: ../../library/functions.rst:0 msgid ":func:`pow`" msgstr ":func:`pow`" -#: ../../library/functions.rst:35 +#: ../../library/functions.rst:0 msgid ":func:`print`" msgstr ":func:`print`" -#: ../../library/functions.rst:36 +#: ../../library/functions.rst:0 msgid ":func:`property`" msgstr ":func:`property`" -#: ../../library/functions.rst:13 +#: ../../library/functions.rst:0 msgid "**R**" msgstr "**R**" -#: ../../library/functions.rst:14 +#: ../../library/functions.rst:0 msgid "|func-range|_" msgstr "|func-range|_" -#: ../../library/functions.rst:15 +#: ../../library/functions.rst:0 msgid ":func:`repr`" msgstr ":func:`repr`" -#: ../../library/functions.rst:16 +#: ../../library/functions.rst:0 msgid ":func:`reversed`" msgstr ":func:`reversed`" -#: ../../library/functions.rst:17 +#: ../../library/functions.rst:0 msgid ":func:`round`" msgstr ":func:`round`" -#: ../../library/functions.rst:19 +#: ../../library/functions.rst:0 msgid "**S**" msgstr "**S**" -#: ../../library/functions.rst:20 +#: ../../library/functions.rst:0 msgid "|func-set|_" msgstr "|func-set|_" -#: ../../library/functions.rst:21 +#: ../../library/functions.rst:0 msgid ":func:`setattr`" msgstr ":func:`setattr`" -#: ../../library/functions.rst:22 +#: ../../library/functions.rst:0 msgid ":func:`slice`" msgstr ":func:`slice`" -#: ../../library/functions.rst:23 +#: ../../library/functions.rst:0 msgid ":func:`sorted`" msgstr ":func:`sorted`" -#: ../../library/functions.rst:24 +#: ../../library/functions.rst:0 msgid ":func:`staticmethod`" msgstr ":func:`staticmethod`" -#: ../../library/functions.rst:25 +#: ../../library/functions.rst:0 msgid "|func-str|_" msgstr "|func-str|_" -#: ../../library/functions.rst:26 +#: ../../library/functions.rst:0 msgid ":func:`sum`" msgstr ":func:`sum`" -#: ../../library/functions.rst:27 +#: ../../library/functions.rst:0 msgid ":func:`super`" msgstr ":func:`super`" -#: ../../library/functions.rst:29 +#: ../../library/functions.rst:0 msgid "**T**" msgstr "**T**" -#: ../../library/functions.rst:30 +#: ../../library/functions.rst:0 msgid "|func-tuple|_" msgstr "|func-tuple|_" -#: ../../library/functions.rst:31 +#: ../../library/functions.rst:0 msgid ":func:`type`" msgstr ":func:`type`" -#: ../../library/functions.rst:33 +#: ../../library/functions.rst:0 msgid "**V**" msgstr "**V**" -#: ../../library/functions.rst:34 +#: ../../library/functions.rst:0 msgid ":func:`vars`" msgstr ":func:`vars`" -#: ../../library/functions.rst:36 +#: ../../library/functions.rst:0 msgid "**Z**" msgstr "**Z**" -#: ../../library/functions.rst:37 +#: ../../library/functions.rst:0 msgid ":func:`zip`" msgstr ":func:`zip`" -#: ../../library/functions.rst:39 +#: ../../library/functions.rst:0 msgid "**_**" msgstr "**_**" -#: ../../library/functions.rst:40 +#: ../../library/functions.rst:0 msgid ":func:`__import__`" msgstr ":func:`__import__`" diff --git a/library/logging.config.po b/library/logging.config.po index 534425a49c..d0c5307537 100644 --- a/library/logging.config.po +++ b/library/logging.config.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,10 +25,6 @@ msgstr ":mod:`!logging.config` --- 日誌記錄配置" msgid "**Source code:** :source:`Lib/logging/config.py`" msgstr "**原始碼:**\\ :source:`Lib/logging/config.py`" -#: ../../library/logging.config.rst:12 -msgid "Important" -msgstr "重點資訊" - #: ../../library/logging.config.rst:14 msgid "" "This page contains only reference information. For tutorials, please see" @@ -1513,3 +1509,6 @@ msgstr ":mod:`logging.handlers` 模組" #: ../../library/logging.config.rst:1000 msgid "Useful handlers included with the logging module." msgstr "" + +#~ msgid "Important" +#~ msgstr "重點資訊" diff --git a/library/logging.handlers.po b/library/logging.handlers.po index 6c838f085b..0455bcb787 100644 --- a/library/logging.handlers.po +++ b/library/logging.handlers.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,10 +25,6 @@ msgstr ":mod:`!logging.handlers` --- 日誌紀錄處理器" msgid "**Source code:** :source:`Lib/logging/handlers.py`" msgstr "**原始碼:**\\ :source:`Lib/logging/handlers.py`" -#: ../../library/logging.handlers.rst:12 -msgid "Important" -msgstr "重點資訊" - #: ../../library/logging.handlers.rst:14 msgid "" "This page contains only reference information. For tutorials, please see" @@ -1688,3 +1684,6 @@ msgstr ":mod:`logging.config` 模組" #: ../../library/logging.handlers.rst:1235 msgid "Configuration API for the logging module." msgstr "" + +#~ msgid "Important" +#~ msgstr "重點資訊" diff --git a/library/logging.po b/library/logging.po index b7ad8c2038..f13d09f62c 100644 --- a/library/logging.po +++ b/library/logging.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-26 00:15+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2024-03-28 22:40+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,10 +27,6 @@ msgstr ":mod:`!logging` --- Python 的日誌記錄工具" msgid "**Source code:** :source:`Lib/logging/__init__.py`" msgstr "**原始碼:**\\ :source:`Lib/logging/__init__.py`" -#: ../../library/logging.rst:14 -msgid "Important" -msgstr "重點資訊" - #: ../../library/logging.rst:16 msgid "" "This page contains the API reference information. For tutorial information " @@ -2349,3 +2345,6 @@ msgstr "Errors(錯誤)" #: ../../library/logging.rst:12 msgid "logging" msgstr "logging(日誌)" + +#~ msgid "Important" +#~ msgstr "重點資訊" diff --git a/library/stdtypes.po b/library/stdtypes.po index 4275be44cc..a710385440 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-01-20 00:15+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+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-" @@ -697,7 +697,8 @@ msgstr "" "算:" #: ../../library/stdtypes.rst:376 -msgid ":func:`math.trunc( x) `" +#, fuzzy +msgid ":func:`math.trunc(\\ x) `" msgstr ":func:`math.trunc( x) `" #: ../../library/stdtypes.rst:376 @@ -715,7 +716,8 @@ msgid "" msgstr "*x* 進位至小數點後第 *n* 位,使用偶數捨入法。若省略 *n* ,則預設為 0。" #: ../../library/stdtypes.rst:383 -msgid ":func:`math.floor( x) `" +#, fuzzy +msgid ":func:`math.floor(\\ x) `" msgstr ":func:`math.floor( x) `" #: ../../library/stdtypes.rst:383 @@ -9418,7 +9420,8 @@ msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" msgstr "" -"此限制僅適用於 :class:`int` 與 :class:`str` 或 :class:`bytes` 之間可能較慢的轉換:" +"此限制僅適用於 :class:`int` 與 :class:`str` 或 :class:`bytes` 之間可能較慢的" +"轉換:" #: ../../library/stdtypes.rst:6399 msgid "``int(string)`` with default base 10." diff --git a/library/tkinter.font.po b/library/tkinter.font.po index b2b3a10acc..7179e207b4 100644 --- a/library/tkinter.font.po +++ b/library/tkinter.font.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2024-02-15 23:09+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -52,15 +52,15 @@ msgstr "" msgid "arguments:" msgstr "引數:" -#: ../../library/tkinter.font.rst:32 +#: ../../library/tkinter.font.rst:0 msgid "*font* - font specifier tuple (family, size, options)" msgstr "*font* - 字型指定符號元組 (family, size, options)" -#: ../../library/tkinter.font.rst:33 +#: ../../library/tkinter.font.rst:0 msgid "*name* - unique font name" msgstr "*name* - 獨特字型名稱" -#: ../../library/tkinter.font.rst:34 +#: ../../library/tkinter.font.rst:0 msgid "*exists* - self points to existing named font if true" msgstr "*exists* - 如果存在的話,指向現有的已命名字型" @@ -68,39 +68,39 @@ msgstr "*exists* - 如果存在的話,指向現有的已命名字型" msgid "additional keyword options (ignored if *font* is specified):" msgstr "額外的關鍵字選項(若已指定 *font* 則會忽略):" -#: ../../library/tkinter.font.rst:38 +#: ../../library/tkinter.font.rst:0 msgid "*family* - font family i.e. Courier, Times" msgstr "*family* - 字型家族,例如:Courier、Times" -#: ../../library/tkinter.font.rst:39 +#: ../../library/tkinter.font.rst:0 msgid "*size* - font size" msgstr "*size* - 字級" -#: ../../library/tkinter.font.rst:40 +#: ../../library/tkinter.font.rst:0 msgid "If *size* is positive it is interpreted as size in points." msgstr "如果 *size* 是正數則會直譯成以點 (point) 為單位的字級。" -#: ../../library/tkinter.font.rst:41 +#: ../../library/tkinter.font.rst:0 msgid "If *size* is a negative number its absolute value is treated" msgstr "如果 *size* 是負數則會變成絕對值" -#: ../../library/tkinter.font.rst:42 +#: ../../library/tkinter.font.rst:0 msgid "as size in pixels." msgstr "以像素 (pixel) 為單位的字級。" -#: ../../library/tkinter.font.rst:43 +#: ../../library/tkinter.font.rst:0 msgid "*weight* - font emphasis (NORMAL, BOLD)" msgstr "*weight* - 強調字型,例如:NORMAL(標準體)、BOLD(粗體)" -#: ../../library/tkinter.font.rst:44 +#: ../../library/tkinter.font.rst:0 msgid "*slant* - ROMAN, ITALIC" msgstr "*slant* - 例如:ROMAN(正體)、ITALIC(斜體)" -#: ../../library/tkinter.font.rst:45 +#: ../../library/tkinter.font.rst:0 msgid "*underline* - font underlining (0 - none, 1 - underline)" msgstr "*underline* - 字型加上底線(0 - 無底線、 1 - 加上底線)" -#: ../../library/tkinter.font.rst:46 +#: ../../library/tkinter.font.rst:0 msgid "*overstrike* - font strikeout (0 - none, 1 - strikeout)" msgstr "*overstrike* - 字型加上刪除線(0 - 無刪除線、 1 - 加上刪除線)" diff --git a/library/turtle.po b/library/turtle.po index 4a251a317e..50b78f9895 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -61,10 +61,6 @@ msgid "" "degrees clockwise." msgstr "" -#: ../../library/turtle.rst:43 -msgid "Turtle star" -msgstr "" - #: ../../library/turtle.rst:45 msgid "" "Turtle can draw intricate shapes using programs that repeat simple moves." @@ -551,71 +547,71 @@ msgstr "" msgid "Move and draw" msgstr "" -#: ../../library/turtle.rst:336 +#: ../../library/turtle.rst:0 msgid ":func:`forward` | :func:`fd`" msgstr ":func:`forward` | :func:`fd`" -#: ../../library/turtle.rst:337 +#: ../../library/turtle.rst:0 msgid ":func:`backward` | :func:`bk` | :func:`back`" msgstr ":func:`backward` | :func:`bk` | :func:`back`" -#: ../../library/turtle.rst:338 +#: ../../library/turtle.rst:0 msgid ":func:`right` | :func:`rt`" msgstr ":func:`right` | :func:`rt`" -#: ../../library/turtle.rst:339 +#: ../../library/turtle.rst:0 msgid ":func:`left` | :func:`lt`" msgstr ":func:`left` | :func:`lt`" -#: ../../library/turtle.rst:340 +#: ../../library/turtle.rst:0 msgid ":func:`goto` | :func:`setpos` | :func:`setposition`" msgstr ":func:`goto` | :func:`setpos` | :func:`setposition`" -#: ../../library/turtle.rst:341 +#: ../../library/turtle.rst:0 msgid ":func:`teleport`" msgstr ":func:`teleport`" -#: ../../library/turtle.rst:342 +#: ../../library/turtle.rst:0 msgid ":func:`setx`" msgstr ":func:`setx`" -#: ../../library/turtle.rst:343 +#: ../../library/turtle.rst:0 msgid ":func:`sety`" msgstr ":func:`sety`" -#: ../../library/turtle.rst:344 +#: ../../library/turtle.rst:0 msgid ":func:`setheading` | :func:`seth`" msgstr ":func:`setheading` | :func:`seth`" -#: ../../library/turtle.rst:345 +#: ../../library/turtle.rst:0 msgid ":func:`home`" msgstr ":func:`home`" -#: ../../library/turtle.rst:346 ../../library/turtle.rst:2864 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2864 msgid ":func:`circle`" msgstr ":func:`circle`" -#: ../../library/turtle.rst:347 +#: ../../library/turtle.rst:0 msgid ":func:`dot`" msgstr ":func:`dot`" -#: ../../library/turtle.rst:348 ../../library/turtle.rst:2842 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2842 msgid ":func:`stamp`" msgstr ":func:`stamp`" -#: ../../library/turtle.rst:349 +#: ../../library/turtle.rst:0 msgid ":func:`clearstamp`" msgstr ":func:`clearstamp`" -#: ../../library/turtle.rst:350 +#: ../../library/turtle.rst:0 msgid ":func:`clearstamps`" msgstr ":func:`clearstamps`" -#: ../../library/turtle.rst:351 +#: ../../library/turtle.rst:0 msgid ":func:`undo`" msgstr ":func:`undo`" -#: ../../library/turtle.rst:352 +#: ../../library/turtle.rst:0 msgid ":func:`speed`" msgstr ":func:`speed`" @@ -623,27 +619,27 @@ msgstr ":func:`speed`" msgid "Tell Turtle's state" msgstr "" -#: ../../library/turtle.rst:355 +#: ../../library/turtle.rst:0 msgid ":func:`position` | :func:`pos`" msgstr ":func:`position` | :func:`pos`" -#: ../../library/turtle.rst:356 +#: ../../library/turtle.rst:0 msgid ":func:`towards`" msgstr ":func:`towards`" -#: ../../library/turtle.rst:357 +#: ../../library/turtle.rst:0 msgid ":func:`xcor`" msgstr ":func:`xcor`" -#: ../../library/turtle.rst:358 +#: ../../library/turtle.rst:0 msgid ":func:`ycor`" msgstr ":func:`ycor`" -#: ../../library/turtle.rst:359 +#: ../../library/turtle.rst:0 msgid ":func:`heading`" msgstr ":func:`heading`" -#: ../../library/turtle.rst:360 +#: ../../library/turtle.rst:0 msgid ":func:`distance`" msgstr ":func:`distance`" @@ -651,11 +647,11 @@ msgstr ":func:`distance`" msgid "Setting and measurement" msgstr "" -#: ../../library/turtle.rst:363 +#: ../../library/turtle.rst:0 msgid ":func:`degrees`" msgstr ":func:`degrees`" -#: ../../library/turtle.rst:364 +#: ../../library/turtle.rst:0 msgid ":func:`radians`" msgstr ":func:`radians`" @@ -663,23 +659,23 @@ msgstr ":func:`radians`" msgid "Drawing state" msgstr "" -#: ../../library/turtle.rst:368 +#: ../../library/turtle.rst:0 msgid ":func:`pendown` | :func:`pd` | :func:`down`" msgstr ":func:`pendown` | :func:`pd` | :func:`down`" -#: ../../library/turtle.rst:369 +#: ../../library/turtle.rst:0 msgid ":func:`penup` | :func:`pu` | :func:`up`" msgstr ":func:`penup` | :func:`pu` | :func:`up`" -#: ../../library/turtle.rst:370 +#: ../../library/turtle.rst:0 msgid ":func:`pensize` | :func:`width`" msgstr ":func:`pensize` | :func:`width`" -#: ../../library/turtle.rst:371 +#: ../../library/turtle.rst:0 msgid ":func:`pen`" msgstr ":func:`pen`" -#: ../../library/turtle.rst:372 +#: ../../library/turtle.rst:0 msgid ":func:`isdown`" msgstr ":func:`isdown`" @@ -687,15 +683,15 @@ msgstr ":func:`isdown`" msgid "Color control" msgstr "" -#: ../../library/turtle.rst:375 +#: ../../library/turtle.rst:0 msgid ":func:`color`" msgstr ":func:`color`" -#: ../../library/turtle.rst:376 +#: ../../library/turtle.rst:0 msgid ":func:`pencolor`" msgstr ":func:`pencolor`" -#: ../../library/turtle.rst:377 +#: ../../library/turtle.rst:0 msgid ":func:`fillcolor`" msgstr ":func:`fillcolor`" @@ -703,19 +699,19 @@ msgstr ":func:`fillcolor`" msgid "Filling" msgstr "" -#: ../../library/turtle.rst:380 +#: ../../library/turtle.rst:0 msgid ":func:`filling`" msgstr ":func:`filling`" -#: ../../library/turtle.rst:381 +#: ../../library/turtle.rst:0 msgid ":func:`fill`" msgstr ":func:`fill`" -#: ../../library/turtle.rst:382 +#: ../../library/turtle.rst:0 msgid ":func:`begin_fill`" msgstr ":func:`begin_fill`" -#: ../../library/turtle.rst:383 +#: ../../library/turtle.rst:0 msgid ":func:`end_fill`" msgstr ":func:`end_fill`" @@ -723,15 +719,15 @@ msgstr ":func:`end_fill`" msgid "More drawing control" msgstr "" -#: ../../library/turtle.rst:386 +#: ../../library/turtle.rst:0 msgid ":func:`reset`" msgstr ":func:`reset`" -#: ../../library/turtle.rst:387 +#: ../../library/turtle.rst:0 msgid ":func:`clear`" msgstr ":func:`clear`" -#: ../../library/turtle.rst:388 +#: ../../library/turtle.rst:0 msgid ":func:`write`" msgstr ":func:`write`" @@ -743,15 +739,15 @@ msgstr "" msgid "Visibility" msgstr "" -#: ../../library/turtle.rst:392 +#: ../../library/turtle.rst:0 msgid ":func:`showturtle` | :func:`st`" msgstr ":func:`showturtle` | :func:`st`" -#: ../../library/turtle.rst:393 +#: ../../library/turtle.rst:0 msgid ":func:`hideturtle` | :func:`ht`" msgstr ":func:`hideturtle` | :func:`ht`" -#: ../../library/turtle.rst:394 +#: ../../library/turtle.rst:0 msgid ":func:`isvisible`" msgstr ":func:`isvisible`" @@ -759,35 +755,35 @@ msgstr ":func:`isvisible`" msgid "Appearance" msgstr "" -#: ../../library/turtle.rst:397 +#: ../../library/turtle.rst:0 msgid ":func:`shape`" msgstr ":func:`shape`" -#: ../../library/turtle.rst:398 +#: ../../library/turtle.rst:0 msgid ":func:`resizemode`" msgstr ":func:`resizemode`" -#: ../../library/turtle.rst:399 +#: ../../library/turtle.rst:0 msgid ":func:`shapesize` | :func:`turtlesize`" msgstr ":func:`shapesize` | :func:`turtlesize`" -#: ../../library/turtle.rst:400 +#: ../../library/turtle.rst:0 msgid ":func:`shearfactor`" msgstr ":func:`shearfactor`" -#: ../../library/turtle.rst:401 +#: ../../library/turtle.rst:0 msgid ":func:`tiltangle`" msgstr ":func:`tiltangle`" -#: ../../library/turtle.rst:402 +#: ../../library/turtle.rst:0 msgid ":func:`tilt`" msgstr ":func:`tilt`" -#: ../../library/turtle.rst:403 +#: ../../library/turtle.rst:0 msgid ":func:`shapetransform`" msgstr ":func:`shapetransform`" -#: ../../library/turtle.rst:404 +#: ../../library/turtle.rst:0 msgid ":func:`get_shapepoly`" msgstr ":func:`get_shapepoly`" @@ -795,15 +791,15 @@ msgstr ":func:`get_shapepoly`" msgid "Using events" msgstr "" -#: ../../library/turtle.rst:407 ../../library/turtle.rst:2836 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2836 msgid ":func:`onclick`" msgstr ":func:`onclick`" -#: ../../library/turtle.rst:408 +#: ../../library/turtle.rst:0 msgid ":func:`onrelease`" msgstr ":func:`onrelease`" -#: ../../library/turtle.rst:409 ../../library/turtle.rst:2819 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2819 msgid ":func:`ondrag`" msgstr ":func:`ondrag`" @@ -811,39 +807,39 @@ msgstr ":func:`ondrag`" msgid "Special Turtle methods" msgstr "" -#: ../../library/turtle.rst:412 +#: ../../library/turtle.rst:0 msgid ":func:`poly`" msgstr ":func:`poly`" -#: ../../library/turtle.rst:413 +#: ../../library/turtle.rst:0 msgid ":func:`begin_poly`" msgstr ":func:`begin_poly`" -#: ../../library/turtle.rst:414 +#: ../../library/turtle.rst:0 msgid ":func:`end_poly`" msgstr ":func:`end_poly`" -#: ../../library/turtle.rst:415 +#: ../../library/turtle.rst:0 msgid ":func:`get_poly`" msgstr ":func:`get_poly`" -#: ../../library/turtle.rst:416 ../../library/turtle.rst:2858 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2858 msgid ":func:`clone`" msgstr ":func:`clone`" -#: ../../library/turtle.rst:417 +#: ../../library/turtle.rst:0 msgid ":func:`getturtle` | :func:`getpen`" msgstr ":func:`getturtle` | :func:`getpen`" -#: ../../library/turtle.rst:418 +#: ../../library/turtle.rst:0 msgid ":func:`getscreen`" msgstr ":func:`getscreen`" -#: ../../library/turtle.rst:419 +#: ../../library/turtle.rst:0 msgid ":func:`setundobuffer`" msgstr ":func:`setundobuffer`" -#: ../../library/turtle.rst:420 +#: ../../library/turtle.rst:0 msgid ":func:`undobufferentries`" msgstr ":func:`undobufferentries`" @@ -855,27 +851,27 @@ msgstr "" msgid "Window control" msgstr "" -#: ../../library/turtle.rst:427 +#: ../../library/turtle.rst:0 msgid ":func:`bgcolor`" msgstr ":func:`bgcolor`" -#: ../../library/turtle.rst:428 +#: ../../library/turtle.rst:0 msgid ":func:`bgpic`" msgstr ":func:`bgpic`" -#: ../../library/turtle.rst:429 +#: ../../library/turtle.rst:0 msgid ":func:`clearscreen`" msgstr ":func:`clearscreen`" -#: ../../library/turtle.rst:430 +#: ../../library/turtle.rst:0 msgid ":func:`resetscreen`" msgstr ":func:`resetscreen`" -#: ../../library/turtle.rst:431 +#: ../../library/turtle.rst:0 msgid ":func:`screensize`" msgstr ":func:`screensize`" -#: ../../library/turtle.rst:432 +#: ../../library/turtle.rst:0 msgid ":func:`setworldcoordinates`" msgstr ":func:`setworldcoordinates`" @@ -883,19 +879,19 @@ msgstr ":func:`setworldcoordinates`" msgid "Animation control" msgstr "" -#: ../../library/turtle.rst:435 +#: ../../library/turtle.rst:0 msgid ":func:`no_animation`" msgstr ":func:`no_animation`" -#: ../../library/turtle.rst:436 +#: ../../library/turtle.rst:0 msgid ":func:`delay`" msgstr ":func:`delay`" -#: ../../library/turtle.rst:437 +#: ../../library/turtle.rst:0 msgid ":func:`tracer`" msgstr ":func:`tracer`" -#: ../../library/turtle.rst:438 +#: ../../library/turtle.rst:0 msgid ":func:`update`" msgstr ":func:`update`" @@ -903,27 +899,27 @@ msgstr ":func:`update`" msgid "Using screen events" msgstr "" -#: ../../library/turtle.rst:441 +#: ../../library/turtle.rst:0 msgid ":func:`listen`" msgstr ":func:`listen`" -#: ../../library/turtle.rst:442 +#: ../../library/turtle.rst:0 msgid ":func:`onkey` | :func:`onkeyrelease`" msgstr ":func:`onkey` | :func:`onkeyrelease`" -#: ../../library/turtle.rst:443 +#: ../../library/turtle.rst:0 msgid ":func:`onkeypress`" msgstr ":func:`onkeypress`" -#: ../../library/turtle.rst:444 +#: ../../library/turtle.rst:0 msgid ":func:`onclick` | :func:`onscreenclick`" msgstr ":func:`onclick` | :func:`onscreenclick`" -#: ../../library/turtle.rst:445 +#: ../../library/turtle.rst:0 msgid ":func:`ontimer`" msgstr ":func:`ontimer`" -#: ../../library/turtle.rst:446 +#: ../../library/turtle.rst:0 msgid ":func:`mainloop` | :func:`done`" msgstr ":func:`mainloop` | :func:`done`" @@ -931,35 +927,35 @@ msgstr ":func:`mainloop` | :func:`done`" msgid "Settings and special methods" msgstr "" -#: ../../library/turtle.rst:449 +#: ../../library/turtle.rst:0 msgid ":func:`mode`" msgstr ":func:`mode`" -#: ../../library/turtle.rst:450 +#: ../../library/turtle.rst:0 msgid ":func:`colormode`" msgstr ":func:`colormode`" -#: ../../library/turtle.rst:451 +#: ../../library/turtle.rst:0 msgid ":func:`getcanvas`" msgstr ":func:`getcanvas`" -#: ../../library/turtle.rst:452 +#: ../../library/turtle.rst:0 msgid ":func:`getshapes`" msgstr ":func:`getshapes`" -#: ../../library/turtle.rst:453 +#: ../../library/turtle.rst:0 msgid ":func:`register_shape` | :func:`addshape`" msgstr ":func:`register_shape` | :func:`addshape`" -#: ../../library/turtle.rst:454 +#: ../../library/turtle.rst:0 msgid ":func:`turtles`" msgstr ":func:`turtles`" -#: ../../library/turtle.rst:455 +#: ../../library/turtle.rst:0 msgid ":func:`window_height`" msgstr ":func:`window_height`" -#: ../../library/turtle.rst:456 +#: ../../library/turtle.rst:0 msgid ":func:`window_width`" msgstr ":func:`window_width`" @@ -967,11 +963,11 @@ msgstr ":func:`window_width`" msgid "Input methods" msgstr "" -#: ../../library/turtle.rst:459 +#: ../../library/turtle.rst:0 msgid ":func:`textinput`" msgstr ":func:`textinput`" -#: ../../library/turtle.rst:460 +#: ../../library/turtle.rst:0 msgid ":func:`numinput`" msgstr ":func:`numinput`" @@ -979,23 +975,23 @@ msgstr ":func:`numinput`" msgid "Methods specific to Screen" msgstr "" -#: ../../library/turtle.rst:463 +#: ../../library/turtle.rst:0 msgid ":func:`bye`" msgstr ":func:`bye`" -#: ../../library/turtle.rst:464 +#: ../../library/turtle.rst:0 msgid ":func:`exitonclick`" msgstr ":func:`exitonclick`" -#: ../../library/turtle.rst:465 +#: ../../library/turtle.rst:0 msgid ":func:`save`" msgstr ":func:`save`" -#: ../../library/turtle.rst:466 +#: ../../library/turtle.rst:0 msgid ":func:`setup`" msgstr ":func:`setup`" -#: ../../library/turtle.rst:467 +#: ../../library/turtle.rst:0 msgid ":func:`title`" msgstr ":func:`title`" diff --git a/library/xml.sax.handler.po b/library/xml.sax.handler.po index 56431110ec..5cf0a00d3b 100644 --- a/library/xml.sax.handler.po +++ b/library/xml.sax.handler.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2016-11-19 00:36+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -87,7 +87,7 @@ msgstr "" msgid "true: Perform Namespace processing." msgstr "" -#: ../../library/xml.sax.handler.rst:64 +#: ../../library/xml.sax.handler.rst:65 msgid "" "false: Optionally do not perform Namespace processing (implies namespace-" "prefixes; default)." @@ -104,13 +104,13 @@ msgstr "" msgid "value: ``\"http://xml.org/sax/features/namespace-prefixes\"``" msgstr "" -#: ../../library/xml.sax.handler.rst:72 +#: ../../library/xml.sax.handler.rst:73 msgid "" "true: Report the original prefixed names and attributes used for Namespace " "declarations." msgstr "" -#: ../../library/xml.sax.handler.rst:74 +#: ../../library/xml.sax.handler.rst:75 msgid "" "false: Do not report attributes used for Namespace declarations, and " "optionally do not report original prefixed names (default)." @@ -120,7 +120,7 @@ msgstr "" msgid "value: ``\"http://xml.org/sax/features/string-interning\"``" msgstr "" -#: ../../library/xml.sax.handler.rst:82 +#: ../../library/xml.sax.handler.rst:83 msgid "" "true: All element names, prefixes, attribute names, Namespace URIs, and " "local names are interned using the built-in intern function." @@ -135,7 +135,7 @@ msgstr "" msgid "value: ``\"http://xml.org/sax/features/validation\"``" msgstr "" -#: ../../library/xml.sax.handler.rst:91 +#: ../../library/xml.sax.handler.rst:92 msgid "" "true: Report all validation errors (implies external-general-entities and " "external-parameter-entities)." @@ -169,13 +169,13 @@ msgstr "" msgid "value: ``\"http://xml.org/sax/features/external-parameter-entities\"``" msgstr "" -#: ../../library/xml.sax.handler.rst:116 +#: ../../library/xml.sax.handler.rst:117 msgid "" "true: Include all external parameter entities, including the external DTD " "subset." msgstr "" -#: ../../library/xml.sax.handler.rst:118 +#: ../../library/xml.sax.handler.rst:119 msgid "" "false: Do not include any external parameter entities, even the external DTD " "subset." @@ -193,7 +193,7 @@ msgstr "" msgid "data type: xml.sax.handler.LexicalHandler (not supported in Python 2)" msgstr "" -#: ../../library/xml.sax.handler.rst:132 +#: ../../library/xml.sax.handler.rst:133 msgid "" "description: An optional extension handler for lexical events like comments." msgstr "" @@ -210,7 +210,7 @@ msgstr "" msgid "data type: xml.sax.sax2lib.DeclHandler (not supported in Python 2)" msgstr "" -#: ../../library/xml.sax.handler.rst:141 +#: ../../library/xml.sax.handler.rst:142 msgid "" "description: An optional extension handler for DTD-related events other than " "notations and unparsed entities." @@ -224,7 +224,7 @@ msgstr "" msgid "data type: org.w3c.dom.Node (not supported in Python 2)" msgstr "" -#: ../../library/xml.sax.handler.rst:150 +#: ../../library/xml.sax.handler.rst:151 msgid "" "description: When parsing, the current DOM node being visited if this is a " "DOM iterator; when not parsing, the root DOM node for iteration." @@ -238,7 +238,7 @@ msgstr "" msgid "data type: Bytes" msgstr "" -#: ../../library/xml.sax.handler.rst:159 +#: ../../library/xml.sax.handler.rst:160 msgid "" "description: The literal string of characters that was the source for the " "current event." diff --git a/reference/executionmodel.po b/reference/executionmodel.po index 036403c608..566bdb6d9b 100644 --- a/reference/executionmodel.po +++ b/reference/executionmodel.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -591,17 +591,15 @@ msgid "" "how it runs on the host look something like this:" msgstr "" -#: ../../reference/executionmodel.rst:415 -#: ../../reference/executionmodel.rst:474 +#: ../../reference/executionmodel.rst:0 msgid "**host machine**" msgstr "" -#: ../../reference/executionmodel.rst:416 -#: ../../reference/executionmodel.rst:475 +#: ../../reference/executionmodel.rst:0 msgid "**process** (global resources)" msgstr "" -#: ../../reference/executionmodel.rst:417 +#: ../../reference/executionmodel.rst:0 msgid "**thread** (runs machine code)" msgstr "" @@ -683,19 +681,19 @@ msgid "" "data layers specific to Python:" msgstr "" -#: ../../reference/executionmodel.rst:476 +#: ../../reference/executionmodel.rst:0 msgid "Python global runtime (*state*)" msgstr "" -#: ../../reference/executionmodel.rst:477 +#: ../../reference/executionmodel.rst:0 msgid "Python interpreter (*state*)" msgstr "" -#: ../../reference/executionmodel.rst:478 +#: ../../reference/executionmodel.rst:0 msgid "**thread** (runs Python bytecode and \"C-API\")" msgstr "" -#: ../../reference/executionmodel.rst:479 +#: ../../reference/executionmodel.rst:0 msgid "Python thread *state*" msgstr "" diff --git a/using/configure.po b/using/configure.po index c01f0c9f01..a31ca6249d 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: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+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-" @@ -196,11 +196,11 @@ msgstr ":mod:`curses`" msgid "`OpenSSL `_" msgstr "`OpenSSL `_" -#: ../../using/configure.rst:97 +#: ../../using/configure.rst:0 msgid "3.0.18 recommended" msgstr "" -#: ../../using/configure.rst:98 +#: ../../using/configure.rst:0 msgid "(1.1.1 minimum)" msgstr "" diff --git a/using/windows.po b/using/windows.po index 67611d22c1..cdb1cc0ba1 100644 --- a/using/windows.po +++ b/using/windows.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-22 00:16+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2339,9 +2339,10 @@ msgid "The default installation directory for all-user installs" msgstr "" #: ../../using/windows.rst:1452 +#, fuzzy msgid "" -":file:`%ProgramFiles%\\\\ Python X.Y` or :file:` %ProgramFiles(x86)%\\\\ " -"Python X.Y`" +":file:`%ProgramFiles%\\\\\\ Python X.Y` or :file:`\\ %ProgramFiles(x86)%\\\\" +"\\ Python X.Y`" msgstr "" ":file:`%ProgramFiles%\\\\ Python X.Y` or :file:` %ProgramFiles(x86)%\\\\ " "Python X.Y`" @@ -2355,10 +2356,11 @@ msgid "The default install directory for just-for-me installs" msgstr "" #: ../../using/windows.rst:1457 +#, fuzzy msgid "" -":file:`%LocalAppData%\\\\ Programs\\\\Python\\\\ PythonXY` or :file:" -"`%LocalAppData%\\\\ Programs\\\\Python\\\\ PythonXY-32` or :file:" -"`%LocalAppData%\\\\ Programs\\\\Python\\\\ PythonXY-64`" +":file:`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY` or :file:" +"`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY-32` or :file:" +"`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY-64`" msgstr "" ":file:`%LocalAppData%\\\\ Programs\\\\Python\\\\ PythonXY` 或 :file:" "`%LocalAppData%\\\\ Programs\\\\Python\\\\ PythonXY-32` 或 :file:" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index ef699f40c2..0fefe72458 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2023-05-28 18:21+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1852,9 +1852,9 @@ msgid "" msgstr "" "在 Unix 上,如果 ``sem_clockwait()`` 函式在 C 函式庫(glibc 2.30 與其更新的版" "本)中可被使用,則 :meth:`threading.Lock.acquire` 方法現在會使用單調時鐘 (:" -"const:`time.CLOCK_MONOTONIC`) 用於超時 (timeout),而不是使用系統時鐘 (:" -"const:`time.CLOCK_REALTIME`),以免受系統時鐘變化的影響。 由 Victor Stinner " -"在 :issue:`41710` 中貢獻。)" +"const:`time.CLOCK_MONOTONIC`) 用於超時 (timeout),而不是使用系統時鐘 (:const:" +"`time.CLOCK_REALTIME`),以免受系統時鐘變化的影響。 由 Victor Stinner 在 :" +"issue:`41710` 中貢獻。)" #: ../../whatsnew/3.11.rst:1093 msgid "time" @@ -2588,8 +2588,7 @@ msgid "" "Subscripting custom :meth:`~object.__getitem__` is also inlined similar to :" "ref:`inline-calls`." msgstr "" -"下標自訂 :meth:`~object.__getitem__` 也是行內的,類似於 :ref:`inline-" -"calls`。" +"下標自訂 :meth:`~object.__getitem__` 也是行內的,類似於 :ref:`inline-calls`。" #: ../../whatsnew/3.11.rst:1474 ../../whatsnew/3.11.rst:1481 msgid "10-25%" @@ -2981,11 +2980,11 @@ msgstr "新的操作碼" msgid "Notes" msgstr "註記" -#: ../../whatsnew/3.11.rst:1650 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!BINARY_*`" msgstr ":opcode:`!BINARY_*`" -#: ../../whatsnew/3.11.rst:1651 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!INPLACE_*`" msgstr ":opcode:`!INPLACE_*`" @@ -2997,31 +2996,31 @@ msgstr ":opcode:`BINARY_OP`" msgid "Replaced all numeric binary/in-place opcodes with a single opcode" msgstr "以單一一個操作碼來取代所有數值的、二進位/原位 (in-place) 操作碼" -#: ../../whatsnew/3.11.rst:1653 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!CALL_FUNCTION`" msgstr ":opcode:`!CALL_FUNCTION`" -#: ../../whatsnew/3.11.rst:1654 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!CALL_FUNCTION_KW`" msgstr ":opcode:`!CALL_FUNCTION_KW`" -#: ../../whatsnew/3.11.rst:1655 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!CALL_METHOD`" msgstr ":opcode:`!CALL_METHOD`" -#: ../../whatsnew/3.11.rst:1653 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`CALL`" msgstr ":opcode:`CALL`" -#: ../../whatsnew/3.11.rst:1654 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!KW_NAMES`" msgstr ":opcode:`!KW_NAMES`" -#: ../../whatsnew/3.11.rst:1655 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!PRECALL`" msgstr ":opcode:`!PRECALL`" -#: ../../whatsnew/3.11.rst:1656 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`PUSH_NULL`" msgstr ":opcode:`PUSH_NULL`" @@ -3033,35 +3032,35 @@ msgstr "" "將方法的引數搬移 (argument shifting) 與關鍵字引數的處理分離開來;允許更好的呼" "叫特化" -#: ../../whatsnew/3.11.rst:1658 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!DUP_TOP`" msgstr ":opcode:`!DUP_TOP`" -#: ../../whatsnew/3.11.rst:1659 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!DUP_TOP_TWO`" msgstr ":opcode:`!DUP_TOP_TWO`" -#: ../../whatsnew/3.11.rst:1660 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!ROT_TWO`" msgstr ":opcode:`!ROT_TWO`" -#: ../../whatsnew/3.11.rst:1661 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!ROT_THREE`" msgstr ":opcode:`!ROT_THREE`" -#: ../../whatsnew/3.11.rst:1662 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!ROT_FOUR`" msgstr ":opcode:`!ROT_FOUR`" -#: ../../whatsnew/3.11.rst:1663 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!ROT_N`" msgstr ":opcode:`!ROT_N`" -#: ../../whatsnew/3.11.rst:1658 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`COPY`" msgstr ":opcode:`COPY`" -#: ../../whatsnew/3.11.rst:1659 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`SWAP`" msgstr ":opcode:`SWAP`" @@ -3069,11 +3068,11 @@ msgstr ":opcode:`SWAP`" msgid "Stack manipulation instructions" msgstr "堆疊操作指示" -#: ../../whatsnew/3.11.rst:1665 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!JUMP_IF_NOT_EXC_MATCH`" msgstr ":opcode:`!JUMP_IF_NOT_EXC_MATCH`" -#: ../../whatsnew/3.11.rst:1665 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`CHECK_EXC_MATCH`" msgstr ":opcode:`CHECK_EXC_MATCH`" @@ -3081,27 +3080,27 @@ msgstr ":opcode:`CHECK_EXC_MATCH`" msgid "Now performs check but doesn't jump" msgstr "現在執行檢查但不跳位 (jump)" -#: ../../whatsnew/3.11.rst:1667 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!JUMP_ABSOLUTE`" msgstr ":opcode:`!JUMP_ABSOLUTE`" -#: ../../whatsnew/3.11.rst:1668 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!POP_JUMP_IF_FALSE`" msgstr ":opcode:`!POP_JUMP_IF_FALSE`" -#: ../../whatsnew/3.11.rst:1669 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!POP_JUMP_IF_TRUE`" msgstr ":opcode:`!POP_JUMP_IF_TRUE`" -#: ../../whatsnew/3.11.rst:1667 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`JUMP_BACKWARD`" msgstr ":opcode:`JUMP_BACKWARD`" -#: ../../whatsnew/3.11.rst:1668 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!POP_JUMP_BACKWARD_IF_*`" msgstr ":opcode:`!POP_JUMP_BACKWARD_IF_*`" -#: ../../whatsnew/3.11.rst:1669 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!POP_JUMP_FORWARD_IF_*`" msgstr ":opcode:`!POP_JUMP_FORWARD_IF_*`" @@ -3113,11 +3112,11 @@ msgstr "" "參見 [#bytecode-jump]_;每個方向的 ``TRUE``、``FALSE``、``NONE`` 和 " "``NOT_NONE`` 變體" -#: ../../whatsnew/3.11.rst:1673 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!SETUP_WITH`" msgstr ":opcode:`!SETUP_WITH`" -#: ../../whatsnew/3.11.rst:1674 +#: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!SETUP_ASYNC_WITH`" msgstr ":opcode:`!SETUP_ASYNC_WITH`" @@ -4598,9 +4597,9 @@ msgid "" "method." msgstr "" ":c:func:`!PyCode_New` 和 :c:func:`!PyCode_NewWithPosOnlyArgs` 現在採用額外的 " -"``exception_table`` 引數。如果可能的話應該避免使用這些函式。要取得自訂程式" -"碼物件,使用編譯器建立一個程式碼物件,然後使用 ``replace`` 方法來得到修改後的" -"版本。" +"``exception_table`` 引數。如果可能的話應該避免使用這些函式。要取得自訂程式碼" +"物件,使用編譯器建立一個程式碼物件,然後使用 ``replace`` 方法來得到修改後的版" +"本。" #: ../../whatsnew/3.11.rst:2318 msgid "" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index 54c4904499..dc6419a7dc 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2026-01-22 16:55+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1048,7 +1048,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:731 msgid "" -"The :meth:`loop.create_datagram_endpoint() ` method gained support for Unix sockets. " "(Contributed by Quentin Dawans in :issue:`31245`.)" msgstr "" From f103aad30693f79293690e6d7a011c88600e2256 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 24 Jan 2026 22:48:43 +0000 Subject: [PATCH 02/11] sync with cpython f3a6e8ed --- library/base64.po | 66 +++--- library/http.cookies.po | 75 ++++--- library/importlib.po | 455 +++++++++++++--------------------------- library/inspect.po | 11 +- whatsnew/3.7.po | 8 +- 5 files changed, 229 insertions(+), 386 deletions(-) diff --git a/library/base64.po b/library/base64.po index 9af6ca2344..c68ba96752 100644 --- a/library/base64.po +++ b/library/base64.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-27 07:36+0000\n" +"POT-Creation-Date: 2026-01-24 22:47+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -34,8 +34,8 @@ msgid "" "Base32 and Base16) and the non-standard :ref:`Base85 encodings `." msgstr "" -"這個模組提供將二進位資料編碼成可顯示 ASCII 字元以及解碼回原始資料的功能。這包括" -"了 :rfc:`4648` 中\\ :ref:`指定的編碼 `\\ (Base64、Base32 " +"這個模組提供將二進位資料編碼成可顯示 ASCII 字元以及解碼回原始資料的功能。這包" +"括了 :rfc:`4648` 中\\ :ref:`指定的編碼 `\\ (Base64、Base32 " "和 Base16)和非標準的 :ref:`Base85 編碼 `。" #: ../../library/base64.rst:22 @@ -61,10 +61,10 @@ msgid "" "`2045`. Note that if you are looking for :rfc:`2045` support you probably " "want to be looking at the :mod:`email` package instead." msgstr "" -":ref:`舊版介面 `\\ 不支援從字串解碼,但它提供對\\ :term:`檔案物件 `\\ 進行" -"編碼和解碼的函式。它僅支援 Base64 標準字母表,並且按照 :rfc:`2045` 每 76 個字" -"元添加換行字元。請注意,如果你需要 :rfc:`2045` 的支援,你可能會需要 :mod:" -"`email` 函式庫。" +":ref:`舊版介面 `\\ 不支援從字串解碼,但它提供對\\ :term:`檔案" +"物件 `\\ 進行編碼和解碼的函式。它僅支援 Base64 標準字母表,並且" +"按照 :rfc:`2045` 每 76 個字元添加換行字元。請注意,如果你需要 :rfc:`2045` 的" +"支援,你可能會需要 :mod:`email` 函式庫。" #: ../../library/base64.rst:36 msgid "" @@ -407,17 +407,17 @@ msgstr "" "``~>``)。" #: ../../library/base64.rst:242 +#, fuzzy msgid "" -"*ignorechars* should be a :term:`bytes-like object` or ASCII string " -"containing characters to ignore from the input. This should only contain " -"whitespace characters, and by default contains all whitespace characters in " -"ASCII." +"*ignorechars* should be a byte string containing characters to ignore from " +"the input. This should only contain whitespace characters, and by default " +"contains all whitespace characters in ASCII." msgstr "" "*ignorechars* 是一個包含要從輸入中忽略的字元的\\ :term:`類位元組物件 `\\ 或 ASCII 字串。這只包含空格字元,預設情況下包含 ASCII 中的所" "有空格字元。" -#: ../../library/base64.rst:252 +#: ../../library/base64.rst:251 msgid "" "Encode the :term:`bytes-like object` *b* using base85 (as used in e.g. git-" "style binary diffs) and return the encoded :class:`bytes`." @@ -425,7 +425,7 @@ msgstr "" "使用 Base85(例如,git 風格的二進位差異 (binary diff))對\\ :term:`類位元組物" "件 ` *b* 進行編碼,並回傳編碼後的 :class:`bytes`。" -#: ../../library/base64.rst:255 +#: ../../library/base64.rst:254 msgid "" "If *pad* is true, the input is padded with ``b'\\0'`` so its length is a " "multiple of 4 bytes before encoding." @@ -433,7 +433,7 @@ msgstr "" "如果 *pad* 為 true,則在編碼之前,輸入將使用 ``b'\\0'`` 進行填充,以使其長度" "為 4 的倍數。" -#: ../../library/base64.rst:263 +#: ../../library/base64.rst:262 msgid "" "Decode the base85-encoded :term:`bytes-like object` or ASCII string *b* and " "return the decoded :class:`bytes`. Padding is implicitly removed, if " @@ -442,29 +442,31 @@ msgstr "" "解碼經過 base85 編碼的\\ :term:`類位元組物件 `\\ 或 ASCII " "字串 *b*,並回傳解碼後的 :class:`bytes`。必要時會隱式移除填充。" -#: ../../library/base64.rst:272 +#: ../../library/base64.rst:271 msgid "" "Encode the :term:`bytes-like object` *s* using Z85 (as used in ZeroMQ) and " "return the encoded :class:`bytes`. See `Z85 specification `_ for more information." msgstr "" -"使用 Z85(如用於 ZeroMQ)對\\ :term:`類位元組物件 ` *s* 進行編碼,並回傳" -"編碼後的 :class:`bytes`。有關更多資訊,請參閱 `Z85 規格 `_。" +"使用 Z85(如用於 ZeroMQ)對\\ :term:`類位元組物件 ` *s* 進" +"行編碼,並回傳編碼後的 :class:`bytes`。有關更多資訊,請參閱 `Z85 規格 " +"`_。" -#: ../../library/base64.rst:281 +#: ../../library/base64.rst:280 msgid "" "Decode the Z85-encoded :term:`bytes-like object` or ASCII string *s* and " "return the decoded :class:`bytes`. See `Z85 specification `_ for more information." msgstr "" -"解碼經 Z85 編碼的\\ :term:`類位元組物件 `\\ 或 ASCII " -"字串 *s*,並回傳解碼後的 :class:`bytes`。有關更多資訊,請參閱 `Z85 規格 `_。" +"解碼經 Z85 編碼的\\ :term:`類位元組物件 `\\ 或 ASCII 字串 " +"*s*,並回傳解碼後的 :class:`bytes`。有關更多資訊,請參閱 `Z85 規格 `_。" -#: ../../library/base64.rst:291 +#: ../../library/base64.rst:290 msgid "Legacy Interface" msgstr "舊版介面" -#: ../../library/base64.rst:295 +#: ../../library/base64.rst:294 msgid "" "Decode the contents of the binary *input* file and write the resulting " "binary data to the *output* file. *input* and *output* must be :term:`file " @@ -475,7 +477,7 @@ msgstr "" "*input* 和 *output* 必須是\\ :term:`檔案物件 `。*input* 將被讀" "取,直到 ``input.readline()`` 回傳一個空的 bytes 物件為止。" -#: ../../library/base64.rst:303 +#: ../../library/base64.rst:302 msgid "" "Decode the :term:`bytes-like object` *s*, which must contain one or more " "lines of base64 encoded data, and return the decoded :class:`bytes`." @@ -483,7 +485,7 @@ msgstr "" "解碼必須包含一行或多行的 base64 編碼資料\\ :term:`類位元組物件 ` *s*,並回傳解碼後的 :class:`bytes`。" -#: ../../library/base64.rst:311 +#: ../../library/base64.rst:310 msgid "" "Encode the contents of the binary *input* file and write the resulting " "base64 encoded data to the *output* file. *input* and *output* must be :term:" @@ -498,7 +500,7 @@ msgstr "" "出的每 76 個位元組之後插入一個換行字元 (``b'\\n'``),並確保輸出始終以換行字元" "結尾,符合 :rfc:`2045` (MIME) 的規定。" -#: ../../library/base64.rst:321 +#: ../../library/base64.rst:320 msgid "" "Encode the :term:`bytes-like object` *s*, which can contain arbitrary binary " "data, and return :class:`bytes` containing the base64-encoded data, with " @@ -509,15 +511,15 @@ msgstr "" "碼,並回傳包含 base64 編碼資料 :class:`bytes`,在每 76 個輸出位元組後插入換行" "字元 (``b'\\n'``) ,並確保有尾隨換行字元,符合 :rfc:`2045` (MIME) 的規定。" -#: ../../library/base64.rst:329 +#: ../../library/base64.rst:328 msgid "An example usage of the module:" msgstr "模組的一個範例用法:" -#: ../../library/base64.rst:342 +#: ../../library/base64.rst:341 msgid "Security Considerations" msgstr "安全性注意事項" -#: ../../library/base64.rst:344 +#: ../../library/base64.rst:343 msgid "" "A new security considerations section was added to :rfc:`4648` (section 12); " "it's recommended to review the security section for any code deployed to " @@ -526,18 +528,18 @@ msgstr "" ":rfc:`4648`\\ (第 12 節)中添加了一個新的安全性考量部分;建議對部署到正式環" "境的任何程式碼進行安全性部分的審查。" -#: ../../library/base64.rst:349 +#: ../../library/base64.rst:348 msgid "Module :mod:`binascii`" msgstr ":mod:`binascii` 模組" -#: ../../library/base64.rst:350 +#: ../../library/base64.rst:349 msgid "" "Support module containing ASCII-to-binary and binary-to-ASCII conversions." msgstr "" "支援模組中包含 ASCII 到二進位 (ASCII-to-binary) 和二進位到 ASCII (binary-to-" "ASCII) 的轉換功能。" -#: ../../library/base64.rst:352 +#: ../../library/base64.rst:351 msgid "" ":rfc:`1521` - MIME (Multipurpose Internet Mail Extensions) Part One: " "Mechanisms for Specifying and Describing the Format of Internet Message " @@ -546,7 +548,7 @@ msgstr "" ":rfc:`1521` - MIME(多用途網際網路郵件擴展)第一部分:指定和描述網際網路主體" "格式的機制。" -#: ../../library/base64.rst:353 +#: ../../library/base64.rst:352 msgid "" "Section 5.2, \"Base64 Content-Transfer-Encoding,\" provides the definition " "of the base64 encoding." diff --git a/library/http.cookies.po b/library/http.cookies.po index 25cf3a3e44..79839e666f 100644 --- a/library/http.cookies.po +++ b/library/http.cookies.po @@ -6,7 +6,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-01-24 22:47+0000\n" "PO-Revision-Date: 2024-12-24 18:49+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -38,12 +38,12 @@ msgstr "" #: ../../library/http.cookies.rst:19 msgid "" -"The module formerly strictly applied the parsing rules described in " -"the :rfc:`2109` and :rfc:`2068` specifications. It has since been " -"discovered that MSIE 3.0x didn't follow the character rules outlined in " -"those specs; many current-day browsers and servers have also relaxed parsing " -"rules when it comes to cookie handling. As a result, this module now uses " -"parsing rules that are a bit less strict than they once were." +"The module formerly strictly applied the parsing rules described in the :rfc:" +"`2109` and :rfc:`2068` specifications. It has since been discovered that " +"MSIE 3.0x didn't follow the character rules outlined in those specs; many " +"current-day browsers and servers have also relaxed parsing rules when it " +"comes to cookie handling. As a result, this module now uses parsing rules " +"that are a bit less strict than they once were." msgstr "" "此模組原先嚴格遵循了 :rfc:`2109` 和 :rfc:`2068` 規範所描述的剖析規則。自從發" "現 MSIE 3.0x 並不遵循這些規範所描述的字元規則,許多目前的瀏覽器和伺服器也在處" @@ -55,9 +55,8 @@ msgid "" "``!#$%&'*+-.^_`|~:`` denote the set of valid characters allowed by this " "module in a cookie name (as :attr:`~Morsel.key`)." msgstr "" -"字元集 :data:`string.ascii_letters`、:data:`string.digits` 和 ``!#$" -"%&'*+-.^_`|~`` 表示此模組在 cookie 名稱 (:attr:`~Morsel.key`) 中允許的合法字" -"元集合。" +"字元集 :data:`string.ascii_letters`、:data:`string.digits` 和 ``!#$%&'*+-." +"^_`|~`` 表示此模組在 cookie 名稱 (:attr:`~Morsel.key`) 中允許的合法字元集合。" #: ../../library/http.cookies.rst:30 msgid "Allowed ':' as a valid cookie name character." @@ -96,12 +95,11 @@ msgstr "如果有給定 *input*,它會被傳遞給 :meth:`load` 方法。" #: ../../library/http.cookies.rst:58 msgid "" -"This class derives from :class:`BaseCookie` and " -"overrides :meth:`~BaseCookie.value_decode` " -"and :meth:`~BaseCookie.value_encode`. :class:`!SimpleCookie` supports " -"strings as cookie values. When setting the value, :class:`!SimpleCookie` " -"calls the builtin :func:`str` to convert the value to a string. Values " -"received from HTTP are kept as strings." +"This class derives from :class:`BaseCookie` and overrides :meth:`~BaseCookie." +"value_decode` and :meth:`~BaseCookie.value_encode`. :class:`!SimpleCookie` " +"supports strings as cookie values. When setting the value, :class:`!" +"SimpleCookie` calls the builtin :func:`str` to convert the value to a " +"string. Values received from HTTP are kept as strings." msgstr "" "這個類別繼承自 :class:`BaseCookie` 並覆寫了 :meth:`~BaseCookie.value_decode` " "和 :meth:`~BaseCookie.value_encode`。:class:`!SimpleCookie` 支援字串作為 " @@ -114,11 +112,11 @@ msgstr ":mod:`http.cookiejar` 模組" #: ../../library/http.cookies.rst:67 msgid "" -"HTTP cookie handling for web *clients*. The :mod:`http.cookiejar` " -"and :mod:`http.cookies` modules do not depend on each other." +"HTTP cookie handling for web *clients*. The :mod:`http.cookiejar` and :mod:" +"`http.cookies` modules do not depend on each other." msgstr "" -"用於網路\\ *用戶端*\\ 的 HTTP cookie 處理。:mod:`http.cookiejar` " -"和 :mod:`http.cookies` 模組互不相依。" +"用於網路\\ *用戶端*\\ 的 HTTP cookie 處理。:mod:`http.cookiejar` 和 :mod:" +"`http.cookies` 模組互不相依。" #: ../../library/http.cookies.rst:70 msgid ":rfc:`2109` - HTTP State Management Mechanism" @@ -135,8 +133,8 @@ msgstr "Cookie 物件" #: ../../library/http.cookies.rst:82 msgid "" "Return a tuple ``(real_value, coded_value)`` from a string representation. " -"``real_value`` can be any type. This method does no decoding " -"in :class:`BaseCookie` --- it exists so it can be overridden." +"``real_value`` can be any type. This method does no decoding in :class:" +"`BaseCookie` --- it exists so it can be overridden." msgstr "" "從字串表示回傳 ``(real_value, coded_value)`` 的元組。``real_value`` 可以是任" "何型別。此方法在 :class:`BaseCookie` 中不做解碼 --- 它存在以便可以被覆寫。" @@ -153,8 +151,8 @@ msgstr "" #: ../../library/http.cookies.rst:94 msgid "" -"In general, it should be the case that :meth:`value_encode` " -"and :meth:`value_decode` are inverses on the range of *value_decode*." +"In general, it should be the case that :meth:`value_encode` and :meth:" +"`value_decode` are inverses on the range of *value_decode*." msgstr "" "一般來說,:meth:`value_encode` 和 :meth:`value_decode` 應該在 *value_decode* " "的範圍內是互逆的 (inverse)。" @@ -246,9 +244,9 @@ msgid "" "the cookie was first set in. For this to be accepted by the user agent, you " "**must** also set ``Secure``." msgstr "" -"屬性 :attr:`partitioned` 向 user agent(使用者代理)表明這些跨網站 cookie " -"*應該*\\ 只能在與首次設定 cookie 時相同的頂層情境中使用。要讓 user agent 接受" -"此設定,你\\ **必須**\\ 同時設定 ``Secure``。" +"屬性 :attr:`partitioned` 向 user agent(使用者代理)表明這些跨網站 cookie *應" +"該*\\ 只能在與首次設定 cookie 時相同的頂層情境中使用。要讓 user agent 接受此" +"設定,你\\ **必須**\\ 同時設定 ``Secure``。" #: ../../library/http.cookies.rst:163 msgid "" @@ -258,8 +256,8 @@ msgid "" "State)`_ for full details and examples." msgstr "" "此外,建議在設定 partitioned(分區)cookie 時使用 ``__Host`` 前綴,使其綁定到" -"主機名稱而非可註冊網域。請閱讀 `CHIPS (Cookies Having Independent Partitioned " -"State)`_ 以取得完整細節和範例。" +"主機名稱而非可註冊網域。請閱讀 `CHIPS (Cookies Having Independent " +"Partitioned State)`_ 以取得完整細節和範例。" #: ../../library/http.cookies.rst:171 msgid "The keys are case-insensitive and their default value is ``''``." @@ -274,13 +272,11 @@ msgstr "" #: ../../library/http.cookies.rst:177 msgid "" -"Attributes :attr:`~Morsel.key`, :attr:`~Morsel.value` " -"and :attr:`~Morsel.coded_value` are read-only. Use :meth:`~Morsel.set` for " -"setting them." +"Attributes :attr:`~Morsel.key`, :attr:`~Morsel.value` and :attr:`~Morsel." +"coded_value` are read-only. Use :meth:`~Morsel.set` for setting them." msgstr "" -"屬性 :attr:`~Morsel.key`、:attr:`~Morsel.value` " -"和 :attr:`~Morsel.coded_value` 是唯讀的。請使用 :meth:`~Morsel.set` 來設定它" -"們。" +"屬性 :attr:`~Morsel.key`、:attr:`~Morsel.value` 和 :attr:`~Morsel." +"coded_value` 是唯讀的。請使用 :meth:`~Morsel.set` 來設定它們。" #: ../../library/http.cookies.rst:182 msgid "Added support for the :attr:`samesite` attribute." @@ -361,8 +357,8 @@ msgid "" "Raise an error if key is not a valid :rfc:`2109` attribute, otherwise behave " "the same as :meth:`dict.setdefault`." msgstr "" -"如果鍵不是一個有效的 :rfc:`2109` 屬性會引發錯誤,否則行為" -"與 :meth:`dict.setdefault` 相同。" +"如果鍵不是一個有效的 :rfc:`2109` 屬性會引發錯誤,否則行為與 :meth:`dict." +"setdefault` 相同。" #: ../../library/http.cookies.rst:265 msgid "Example" @@ -374,6 +370,7 @@ msgid "" msgstr "以下範例示範如何使用 :mod:`http.cookies` 模組。" #: ../../library/http.cookies.rst:269 +#, fuzzy msgid "" ">>> from http import cookies\n" ">>> C = cookies.SimpleCookie()\n" @@ -399,9 +396,9 @@ msgid "" "Set-Cookie: chips=ahoy\n" "Set-Cookie: vienna=finger\n" ">>> C = cookies.SimpleCookie()\n" -">>> C.load('keebler=\"E=everybody; L=\\\\\"Loves\\\\\"; fudge=\\\\012;\";')\n" +">>> C.load('keebler=\"E=everybody; L=\\\\\"Loves\\\\\"; fudge=;\";')\n" ">>> print(C)\n" -"Set-Cookie: keebler=\"E=everybody; L=\\\"Loves\\\"; fudge=\\012;\"\n" +"Set-Cookie: keebler=\"E=everybody; L=\\\"Loves\\\"; fudge=;\"\n" ">>> C = cookies.SimpleCookie()\n" ">>> C[\"oreo\"] = \"doublestuff\"\n" ">>> C[\"oreo\"][\"path\"] = \"/\"\n" diff --git a/library/importlib.po b/library/importlib.po index 714d1903ff..968b405316 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-17 00:14+0000\n" +"POT-Creation-Date: 2026-01-24 22:47+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -580,7 +580,7 @@ msgid "" "implemented." msgstr "" -#: ../../library/importlib.rst:387 ../../library/importlib.rst:642 +#: ../../library/importlib.rst:387 msgid "*Superseded by TraversableResources*" msgstr "" @@ -738,7 +738,7 @@ msgstr "" msgid "Use :meth:`Loader.exec_module` instead." msgstr "改用 :meth:`Loader.exec_module`。" -#: ../../library/importlib.rst:539 ../../library/importlib.rst:1146 +#: ../../library/importlib.rst:539 ../../library/importlib.rst:980 msgid "Returns :attr:`path`." msgstr "回傳 :attr:`path`。" @@ -864,228 +864,59 @@ msgid "" "``__init__``." msgstr "" -#: ../../library/importlib.rst:644 -msgid "" -"An :term:`abstract base class` to provide the ability to read *resources*." -msgstr "" - -#: ../../library/importlib.rst:647 -msgid "" -"From the perspective of this ABC, a *resource* is a binary artifact that is " -"shipped within a package. Typically this is something like a data file that " -"lives next to the ``__init__.py`` file of the package. The purpose of this " -"class is to help abstract out the accessing of such data files so that it " -"does not matter if the package and its data file(s) are stored e.g. in a zip " -"file versus on the file system." -msgstr "" - -#: ../../library/importlib.rst:655 -msgid "" -"For any of methods of this class, a *resource* argument is expected to be a :" -"term:`path-like object` which represents conceptually just a file name. This " -"means that no subdirectory paths should be included in the *resource* " -"argument. This is because the location of the package the reader is for, " -"acts as the \"directory\". Hence the metaphor for directories and file names " -"is packages and resources, respectively. This is also why instances of this " -"class are expected to directly correlate to a specific package (instead of " -"potentially representing multiple packages or a module)." -msgstr "" - -#: ../../library/importlib.rst:666 -msgid "" -"Loaders that wish to support resource reading are expected to provide a " -"method called ``get_resource_reader(fullname)`` which returns an object " -"implementing this ABC's interface. If the module specified by fullname is " -"not a package, this method should return :const:`None`. An object compatible " -"with this ABC should only be returned when the specified module is a package." -msgstr "" - -#: ../../library/importlib.rst:675 ../../library/importlib.rst:795 -msgid "Use :class:`importlib.resources.abc.TraversableResources` instead." -msgstr "" - -#: ../../library/importlib.rst:681 -msgid "" -"Returns an opened, :term:`file-like object` for binary reading of the " -"*resource*." -msgstr "" - -#: ../../library/importlib.rst:684 -msgid "If the resource cannot be found, :exc:`FileNotFoundError` is raised." -msgstr "" - -#: ../../library/importlib.rst:690 -msgid "Returns the file system path to the *resource*." -msgstr "" - -#: ../../library/importlib.rst:692 -msgid "" -"If the resource does not concretely exist on the file system, raise :exc:" -"`FileNotFoundError`." -msgstr "" - -#: ../../library/importlib.rst:698 -msgid "" -"Returns ``True`` if the named *name* is considered a resource. :exc:" -"`FileNotFoundError` is raised if *name* does not exist." -msgstr "" - -#: ../../library/importlib.rst:704 -msgid "" -"Returns an :term:`iterable` of strings over the contents of the package. Do " -"note that it is not required that all names returned by the iterator be " -"actual resources, e.g. it is acceptable to return names for which :meth:" -"`is_resource` would be false." -msgstr "" - -#: ../../library/importlib.rst:710 -msgid "" -"Allowing non-resource names to be returned is to allow for situations where " -"how a package and its resources are stored are known a priori and the non-" -"resource names would be useful. For instance, returning subdirectory names " -"is allowed so that when it is known that the package and resources are " -"stored on the file system then those subdirectory names can be used directly." -msgstr "" - -#: ../../library/importlib.rst:718 -msgid "The abstract method returns an iterable of no items." -msgstr "" - -#: ../../library/importlib.rst:723 -msgid "" -"An object with a subset of :class:`pathlib.Path` methods suitable for " -"traversing directories and opening files." -msgstr "" - -#: ../../library/importlib.rst:726 -msgid "" -"For a representation of the object on the file-system, use :meth:`importlib." -"resources.as_file`." -msgstr "" - -#: ../../library/importlib.rst:731 -msgid "Use :class:`importlib.resources.abc.Traversable` instead." -msgstr "" - -#: ../../library/importlib.rst:736 -msgid "Abstract. The base name of this object without any parent references." -msgstr "" - -#: ../../library/importlib.rst:741 -msgid "Yield ``Traversable`` objects in ``self``." -msgstr "" - -#: ../../library/importlib.rst:746 -msgid "Return ``True`` if ``self`` is a directory." -msgstr "" - -#: ../../library/importlib.rst:751 -msgid "Return ``True`` if ``self`` is a file." -msgstr "" - -#: ../../library/importlib.rst:756 -msgid "Return Traversable child in ``self``." -msgstr "" - -#: ../../library/importlib.rst:761 -msgid "Return ``Traversable`` child in ``self``." -msgstr "" - -#: ../../library/importlib.rst:766 -msgid "" -"*mode* may be 'r' or 'rb' to open as text or binary. Return a handle " -"suitable for reading (same as :attr:`pathlib.Path.open`)." -msgstr "" - -#: ../../library/importlib.rst:769 -msgid "" -"When opening as text, accepts encoding parameters such as those accepted by :" -"class:`io.TextIOWrapper`." -msgstr "" - -#: ../../library/importlib.rst:774 -msgid "Read contents of ``self`` as bytes." -msgstr "以位元組讀取 ``self`` 的內容。" - -#: ../../library/importlib.rst:778 -msgid "Read contents of ``self`` as text." -msgstr "以文字讀取 ``self`` 的內容。" - -#: ../../library/importlib.rst:783 -msgid "" -"An abstract base class for resource readers capable of serving the :meth:" -"`importlib.resources.files` interface. Subclasses :class:`importlib." -"resources.abc.ResourceReader` and provides concrete implementations of the :" -"class:`importlib.resources.abc.ResourceReader`'s abstract methods. " -"Therefore, any loader supplying :class:`importlib.abc.TraversableResources` " -"also supplies ResourceReader." -msgstr "" - -#: ../../library/importlib.rst:790 -msgid "" -"Loaders that wish to support resource reading are expected to implement this " -"interface." -msgstr "" - -#: ../../library/importlib.rst:801 -msgid "" -"Returns a :class:`importlib.resources.abc.Traversable` object for the loaded " -"package." -msgstr "" - -#: ../../library/importlib.rst:807 +#: ../../library/importlib.rst:641 msgid ":mod:`importlib.machinery` -- Importers and path hooks" msgstr "" -#: ../../library/importlib.rst:812 +#: ../../library/importlib.rst:646 msgid "**Source code:** :source:`Lib/importlib/machinery.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/machinery.py`" -#: ../../library/importlib.rst:816 +#: ../../library/importlib.rst:650 msgid "" "This module contains the various objects that help :keyword:`import` find " "and load modules." msgstr "" -#: ../../library/importlib.rst:821 +#: ../../library/importlib.rst:655 msgid "" "A list of strings representing the recognized file suffixes for source " "modules." msgstr "" -#: ../../library/importlib.rst:828 +#: ../../library/importlib.rst:662 msgid "" "A list of strings representing the file suffixes for non-optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:833 ../../library/importlib.rst:843 +#: ../../library/importlib.rst:667 ../../library/importlib.rst:677 msgid "Use :const:`BYTECODE_SUFFIXES` instead." msgstr "改用 :const:`BYTECODE_SUFFIXES`。" -#: ../../library/importlib.rst:838 +#: ../../library/importlib.rst:672 msgid "" "A list of strings representing the file suffixes for optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:848 +#: ../../library/importlib.rst:682 msgid "" "A list of strings representing the recognized file suffixes for bytecode " "modules (including the leading dot)." msgstr "" -#: ../../library/importlib.rst:853 +#: ../../library/importlib.rst:687 msgid "The value is no longer dependent on ``__debug__``." msgstr "" -#: ../../library/importlib.rst:858 +#: ../../library/importlib.rst:692 msgid "" "A list of strings representing the recognized file suffixes for extension " "modules." msgstr "" -#: ../../library/importlib.rst:865 +#: ../../library/importlib.rst:699 msgid "" "Returns a combined list of strings representing all file suffixes for " "modules recognized by the standard import machinery. This is a helper for " @@ -1094,57 +925,57 @@ msgid "" "`inspect.getmodulename`)." msgstr "" -#: ../../library/importlib.rst:876 +#: ../../library/importlib.rst:710 msgid "" "An :term:`importer` for built-in modules. All known built-in modules are " "listed in :data:`sys.builtin_module_names`. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:881 ../../library/importlib.rst:895 -#: ../../library/importlib.rst:908 ../../library/importlib.rst:923 +#: ../../library/importlib.rst:715 ../../library/importlib.rst:729 +#: ../../library/importlib.rst:742 ../../library/importlib.rst:757 msgid "" "Only class methods are defined by this class to alleviate the need for " "instantiation." msgstr "" -#: ../../library/importlib.rst:884 +#: ../../library/importlib.rst:718 msgid "" "As part of :pep:`489`, the builtin importer now implements :meth:`Loader." "create_module` and :meth:`Loader.exec_module`" msgstr "" -#: ../../library/importlib.rst:891 +#: ../../library/importlib.rst:725 msgid "" "An :term:`importer` for frozen modules. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:898 +#: ../../library/importlib.rst:732 msgid "" "Gained :meth:`~Loader.create_module` and :meth:`~Loader.exec_module` methods." msgstr "" -#: ../../library/importlib.rst:905 +#: ../../library/importlib.rst:739 msgid "" ":term:`Finder ` for modules declared in the Windows registry. This " "class implements the :class:`importlib.abc.MetaPathFinder` ABC." msgstr "" -#: ../../library/importlib.rst:913 +#: ../../library/importlib.rst:747 msgid "" "Use :mod:`site` configuration instead. Future versions of Python may not " "enable this finder by default." msgstr "" -#: ../../library/importlib.rst:920 +#: ../../library/importlib.rst:754 msgid "" "A :term:`Finder ` for :data:`sys.path` and package ``__path__`` " "attributes. This class implements the :class:`importlib.abc.MetaPathFinder` " "ABC." msgstr "" -#: ../../library/importlib.rst:928 +#: ../../library/importlib.rst:762 msgid "" "Class method that attempts to find a :term:`spec ` for the " "module specified by *fullname* on :data:`sys.path` or, if defined, on " @@ -1158,43 +989,43 @@ msgid "" "cache and returned." msgstr "" -#: ../../library/importlib.rst:942 +#: ../../library/importlib.rst:776 msgid "" "If the current working directory -- represented by an empty string -- is no " "longer valid then ``None`` is returned but no value is cached in :data:`sys." "path_importer_cache`." msgstr "" -#: ../../library/importlib.rst:949 +#: ../../library/importlib.rst:783 msgid "" "Calls :meth:`importlib.abc.PathEntryFinder.invalidate_caches` on all finders " "stored in :data:`sys.path_importer_cache` that define the method. Otherwise " "entries in :data:`sys.path_importer_cache` set to ``None`` are deleted." msgstr "" -#: ../../library/importlib.rst:954 +#: ../../library/importlib.rst:788 msgid "Entries of ``None`` in :data:`sys.path_importer_cache` are deleted." msgstr "" -#: ../../library/importlib.rst:957 +#: ../../library/importlib.rst:791 msgid "" "Calls objects in :data:`sys.path_hooks` with the current working directory " "for ``''`` (i.e. the empty string)." msgstr "" -#: ../../library/importlib.rst:964 +#: ../../library/importlib.rst:798 msgid "" "A concrete implementation of :class:`importlib.abc.PathEntryFinder` which " "caches results from the file system." msgstr "" -#: ../../library/importlib.rst:967 +#: ../../library/importlib.rst:801 msgid "" "The *path* argument is the directory for which the finder is in charge of " "searching." msgstr "" -#: ../../library/importlib.rst:970 +#: ../../library/importlib.rst:804 msgid "" "The *loader_details* argument is a variable number of 2-item tuples each " "containing a loader and a sequence of file suffixes the loader recognizes. " @@ -1202,7 +1033,7 @@ msgid "" "module's name and the path to the file found." msgstr "" -#: ../../library/importlib.rst:975 +#: ../../library/importlib.rst:809 msgid "" "The finder will cache the directory contents as necessary, making stat calls " "for each module search to verify the cache is not outdated. Because cache " @@ -1215,166 +1046,166 @@ msgid "" "to call :func:`importlib.invalidate_caches`." msgstr "" -#: ../../library/importlib.rst:989 +#: ../../library/importlib.rst:823 msgid "The path the finder will search in." msgstr "" -#: ../../library/importlib.rst:993 +#: ../../library/importlib.rst:827 msgid "Attempt to find the spec to handle *fullname* within :attr:`path`." msgstr "" -#: ../../library/importlib.rst:999 +#: ../../library/importlib.rst:833 msgid "Clear out the internal cache." msgstr "" -#: ../../library/importlib.rst:1003 +#: ../../library/importlib.rst:837 msgid "" "A class method which returns a closure for use on :data:`sys.path_hooks`. An " "instance of :class:`FileFinder` is returned by the closure using the path " "argument given to the closure directly and *loader_details* indirectly." msgstr "" -#: ../../library/importlib.rst:1008 +#: ../../library/importlib.rst:842 msgid "" "If the argument to the closure is not an existing directory, :exc:" "`ImportError` is raised." msgstr "" -#: ../../library/importlib.rst:1014 +#: ../../library/importlib.rst:848 msgid "" "A concrete implementation of :class:`importlib.abc.SourceLoader` by " "subclassing :class:`importlib.abc.FileLoader` and providing some concrete " "implementations of other methods." msgstr "" -#: ../../library/importlib.rst:1022 +#: ../../library/importlib.rst:856 msgid "The name of the module that this loader will handle." msgstr "" -#: ../../library/importlib.rst:1026 +#: ../../library/importlib.rst:860 msgid "The path to the source file." msgstr "" -#: ../../library/importlib.rst:1030 +#: ../../library/importlib.rst:864 msgid "Return ``True`` if :attr:`path` appears to be for a package." msgstr "" -#: ../../library/importlib.rst:1034 +#: ../../library/importlib.rst:868 msgid "" "Concrete implementation of :meth:`importlib.abc.SourceLoader.path_stats`." msgstr "" -#: ../../library/importlib.rst:1038 +#: ../../library/importlib.rst:872 msgid "Concrete implementation of :meth:`importlib.abc.SourceLoader.set_data`." msgstr "" -#: ../../library/importlib.rst:1042 ../../library/importlib.rst:1085 +#: ../../library/importlib.rst:876 ../../library/importlib.rst:919 msgid "" "Concrete implementation of :meth:`importlib.abc.Loader.load_module` where " "specifying the name of the module to load is optional." msgstr "" -#: ../../library/importlib.rst:1047 ../../library/importlib.rst:1090 +#: ../../library/importlib.rst:881 ../../library/importlib.rst:924 msgid "Use :meth:`importlib.abc.Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:1052 +#: ../../library/importlib.rst:886 msgid "" "A concrete implementation of :class:`importlib.abc.FileLoader` which can " "import bytecode files (i.e. no source code files exist)." msgstr "" -#: ../../library/importlib.rst:1055 +#: ../../library/importlib.rst:889 msgid "" "Please note that direct use of bytecode files (and thus not source code " "files) inhibits your modules from being usable by all Python implementations " "or new versions of Python which change the bytecode format." msgstr "" -#: ../../library/importlib.rst:1064 +#: ../../library/importlib.rst:898 msgid "The name of the module the loader will handle." msgstr "" -#: ../../library/importlib.rst:1068 +#: ../../library/importlib.rst:902 msgid "The path to the bytecode file." msgstr "" -#: ../../library/importlib.rst:1072 +#: ../../library/importlib.rst:906 msgid "Determines if the module is a package based on :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1076 +#: ../../library/importlib.rst:910 msgid "Returns the code object for :attr:`name` created from :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1080 +#: ../../library/importlib.rst:914 msgid "" "Returns ``None`` as bytecode files have no source when this loader is used." msgstr "" -#: ../../library/importlib.rst:1095 +#: ../../library/importlib.rst:929 msgid "" "A concrete implementation of :class:`importlib.abc.ExecutionLoader` for " "extension modules." msgstr "" -#: ../../library/importlib.rst:1098 +#: ../../library/importlib.rst:932 msgid "" "The *fullname* argument specifies the name of the module the loader is to " "support. The *path* argument is the path to the extension module's file." msgstr "" -#: ../../library/importlib.rst:1101 +#: ../../library/importlib.rst:935 msgid "" "Note that, by default, importing an extension module will fail in " "subinterpreters if it doesn't implement multi-phase init (see :pep:`489`), " "even if it would otherwise import successfully." msgstr "" -#: ../../library/importlib.rst:1107 +#: ../../library/importlib.rst:941 msgid "Multi-phase init is now required for use in subinterpreters." msgstr "" -#: ../../library/importlib.rst:1112 ../../library/importlib.rst:1298 +#: ../../library/importlib.rst:946 ../../library/importlib.rst:1132 msgid "Name of the module the loader supports." msgstr "" -#: ../../library/importlib.rst:1116 +#: ../../library/importlib.rst:950 msgid "Path to the extension module." msgstr "" -#: ../../library/importlib.rst:1120 +#: ../../library/importlib.rst:954 msgid "" "Creates the module object from the given specification in accordance with :" "pep:`489`." msgstr "" -#: ../../library/importlib.rst:1127 +#: ../../library/importlib.rst:961 msgid "Initializes the given module object in accordance with :pep:`489`." msgstr "" -#: ../../library/importlib.rst:1133 +#: ../../library/importlib.rst:967 msgid "" "Returns ``True`` if the file path points to a package's ``__init__`` module " "based on :const:`EXTENSION_SUFFIXES`." msgstr "" -#: ../../library/importlib.rst:1138 +#: ../../library/importlib.rst:972 msgid "Returns ``None`` as extension modules lack a code object." msgstr "" -#: ../../library/importlib.rst:1142 +#: ../../library/importlib.rst:976 msgid "Returns ``None`` as extension modules do not have source code." msgstr "" -#: ../../library/importlib.rst:1153 +#: ../../library/importlib.rst:987 msgid "" "A concrete implementation of :class:`importlib.abc.InspectLoader` for " "namespace packages. This is an alias for a private class and is only made " "public for introspecting the ``__loader__`` attribute on namespace packages::" msgstr "" -#: ../../library/importlib.rst:1158 +#: ../../library/importlib.rst:992 msgid "" ">>> from importlib.machinery import NamespaceLoader\n" ">>> import my_namespace\n" @@ -1392,7 +1223,7 @@ msgstr "" ">>> isinstance(my_namespace.__loader__, importlib.abc.Loader)\n" "True" -#: ../../library/importlib.rst:1171 +#: ../../library/importlib.rst:1005 msgid "" "A specification for a module's import-system-related state. This is " "typically exposed as the module's :attr:`~module.__spec__` attribute. Many " @@ -1405,19 +1236,19 @@ msgid "" "origin>`, and vice versa." msgstr "" -#: ../../library/importlib.rst:1185 +#: ../../library/importlib.rst:1019 msgid "" "The module's fully qualified name (see :attr:`module.__name__`). The :term:" "`finder` should always set this attribute to a non-empty string." msgstr "" -#: ../../library/importlib.rst:1190 +#: ../../library/importlib.rst:1024 msgid "" "The :term:`loader` used to load the module (see :attr:`module.__loader__`). " "The :term:`finder` should always set this attribute." msgstr "" -#: ../../library/importlib.rst:1195 +#: ../../library/importlib.rst:1029 msgid "" "The location the :term:`loader` should use to load the module (see :attr:" "`module.__file__`). For example, for modules loaded from a ``.py`` file this " @@ -1426,14 +1257,14 @@ msgid "" "there is not one (like for namespace packages), it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1204 +#: ../../library/importlib.rst:1038 msgid "" "A (possibly empty) :term:`sequence` of strings enumerating the locations in " "which a package's submodules will be found (see :attr:`module.__path__`). " "Most of the time there will only be a single directory in this list." msgstr "" -#: ../../library/importlib.rst:1209 +#: ../../library/importlib.rst:1043 msgid "" "The :term:`finder` should set this attribute to a sequence, even an empty " "one, to indicate to the import system that the module is a package. It " @@ -1441,41 +1272,41 @@ msgid "" "later to a special object for namespace packages." msgstr "" -#: ../../library/importlib.rst:1217 +#: ../../library/importlib.rst:1051 msgid "" "The :term:`finder` may set this attribute to an object containing " "additional, module-specific data to use when loading the module. Otherwise " "it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1223 +#: ../../library/importlib.rst:1057 msgid "" "The filename of a compiled version of the module's code (see :attr:`module." "__cached__`). The :term:`finder` should always set this attribute but it may " "be ``None`` for modules that do not need compiled code stored." msgstr "" -#: ../../library/importlib.rst:1230 +#: ../../library/importlib.rst:1064 msgid "" "(Read-only) The fully qualified name of the package the module is in (or the " "empty string for a top-level module). See :attr:`module.__package__`. If the " "module is a package then this is the same as :attr:`name`." msgstr "" -#: ../../library/importlib.rst:1237 +#: ../../library/importlib.rst:1071 msgid "" "``True`` if the spec's :attr:`origin` refers to a loadable location, " "``False`` otherwise. This value impacts how :attr:`!origin` is interpreted " "and how the module's :attr:`~module.__file__` is populated." msgstr "" -#: ../../library/importlib.rst:1244 +#: ../../library/importlib.rst:1078 msgid "" "A specialization of :class:`importlib.machinery.ExtensionFileLoader` that is " "able to load extension modules in Framework format." msgstr "" -#: ../../library/importlib.rst:1247 +#: ../../library/importlib.rst:1081 msgid "" "For compatibility with the iOS App Store, *all* binary modules in an iOS app " "must be dynamic libraries, contained in a framework with appropriate " @@ -1484,7 +1315,7 @@ msgid "" "material outside the Frameworks folder." msgstr "" -#: ../../library/importlib.rst:1253 +#: ../../library/importlib.rst:1087 msgid "" "To accommodate this requirement, when running on iOS, extension module " "binaries are *not* packaged as ``.so`` files on ``sys.path``, but as " @@ -1498,7 +1329,7 @@ msgid "" "fwork`` file, relative to the app bundle." msgstr "" -#: ../../library/importlib.rst:1264 +#: ../../library/importlib.rst:1098 msgid "" "For example, consider the case of an import ``from foo.bar import _whiz``, " "where ``_whiz`` is implemented with the binary module ``sources/foo/bar/" @@ -1514,7 +1345,7 @@ msgid "" "_whiz.origin``, containing the path to the ``.fwork`` file." msgstr "" -#: ../../library/importlib.rst:1278 +#: ../../library/importlib.rst:1112 msgid "" "When a module is loaded with this loader, the ``__file__`` for the module " "will report as the location of the ``.fwork`` file. This allows code to use " @@ -1523,7 +1354,7 @@ msgid "" "in the ``.framework`` folder." msgstr "" -#: ../../library/importlib.rst:1284 +#: ../../library/importlib.rst:1118 msgid "" "The Xcode project building the app is responsible for converting any ``.so`` " "files from wherever they exist in the ``PYTHONPATH`` into frameworks in the " @@ -1534,35 +1365,35 @@ msgid "" "details on how to construct this build step." msgstr "" -#: ../../library/importlib.rst:1294 +#: ../../library/importlib.rst:1128 msgid "Availability" msgstr "可用性" -#: ../../library/importlib.rst:1302 +#: ../../library/importlib.rst:1136 msgid "Path to the ``.fwork`` file for the extension module." msgstr "" -#: ../../library/importlib.rst:1306 +#: ../../library/importlib.rst:1140 msgid ":mod:`importlib.util` -- Utility code for importers" msgstr "" -#: ../../library/importlib.rst:1312 +#: ../../library/importlib.rst:1146 msgid "**Source code:** :source:`Lib/importlib/util.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/util.py`" -#: ../../library/importlib.rst:1316 +#: ../../library/importlib.rst:1150 msgid "" "This module contains the various objects that help in the construction of " "an :term:`importer`." msgstr "" -#: ../../library/importlib.rst:1321 +#: ../../library/importlib.rst:1155 msgid "" "The bytes which represent the bytecode version number. If you need help with " "loading/writing bytecode then consider :class:`importlib.abc.SourceLoader`." msgstr "" -#: ../../library/importlib.rst:1328 +#: ../../library/importlib.rst:1162 msgid "" "Return the :pep:`3147`/:pep:`488` path to the byte-compiled file associated " "with the source *path*. For example, if *path* is ``/foo/bar/baz.py`` the " @@ -1572,7 +1403,7 @@ msgid "" "`NotImplementedError` will be raised)." msgstr "" -#: ../../library/importlib.rst:1335 +#: ../../library/importlib.rst:1169 msgid "" "The *optimization* parameter is used to specify the optimization level of " "the bytecode file. An empty string represents no optimization, so ``/foo/bar/" @@ -1585,7 +1416,7 @@ msgid "" "be alphanumeric, else :exc:`ValueError` is raised." msgstr "" -#: ../../library/importlib.rst:1345 +#: ../../library/importlib.rst:1179 msgid "" "The *debug_override* parameter is deprecated and can be used to override the " "system's value for ``__debug__``. A ``True`` value is the equivalent of " @@ -1594,18 +1425,18 @@ msgid "" "are not ``None`` then :exc:`TypeError` is raised." msgstr "" -#: ../../library/importlib.rst:1353 +#: ../../library/importlib.rst:1187 msgid "" "The *optimization* parameter was added and the *debug_override* parameter " "was deprecated." msgstr "" -#: ../../library/importlib.rst:1357 ../../library/importlib.rst:1373 -#: ../../library/importlib.rst:1462 +#: ../../library/importlib.rst:1191 ../../library/importlib.rst:1207 +#: ../../library/importlib.rst:1296 msgid "Accepts a :term:`path-like object`." msgstr "接受一個 :term:`path-like object`。" -#: ../../library/importlib.rst:1363 +#: ../../library/importlib.rst:1197 msgid "" "Given the *path* to a :pep:`3147` file name, return the associated source " "code file path. For example, if *path* is ``/foo/bar/__pycache__/baz." @@ -1615,25 +1446,25 @@ msgid "" "cache_tag` is not defined, :exc:`NotImplementedError` is raised." msgstr "" -#: ../../library/importlib.rst:1378 +#: ../../library/importlib.rst:1212 msgid "" "Decode the given bytes representing source code and return it as a string " "with universal newlines (as required by :meth:`importlib.abc.InspectLoader." "get_source`)." msgstr "" -#: ../../library/importlib.rst:1386 +#: ../../library/importlib.rst:1220 msgid "Resolve a relative module name to an absolute one." msgstr "" -#: ../../library/importlib.rst:1388 +#: ../../library/importlib.rst:1222 msgid "" "If **name** has no leading dots, then **name** is simply returned. This " "allows for usage such as ``importlib.util.resolve_name('sys', __spec__." "parent)`` without doing a check to see if the **package** argument is needed." msgstr "" -#: ../../library/importlib.rst:1393 +#: ../../library/importlib.rst:1227 msgid "" ":exc:`ImportError` is raised if **name** is a relative module name but " "**package** is a false value (e.g. ``None`` or the empty string). :exc:" @@ -1641,13 +1472,13 @@ msgid "" "package (e.g. requesting ``..bacon`` from within the ``spam`` package)." msgstr "" -#: ../../library/importlib.rst:1401 +#: ../../library/importlib.rst:1235 msgid "" "To improve consistency with import statements, raise :exc:`ImportError` " "instead of :exc:`ValueError` for invalid relative import attempts." msgstr "" -#: ../../library/importlib.rst:1408 +#: ../../library/importlib.rst:1242 msgid "" "Find the :term:`spec ` for a module, optionally relative to the " "specified **package** name. If the module is in :data:`sys.modules`, then " @@ -1657,30 +1488,30 @@ msgid "" "if no spec is found." msgstr "" -#: ../../library/importlib.rst:1415 +#: ../../library/importlib.rst:1249 msgid "" "If **name** is for a submodule (contains a dot), the parent module is " "automatically imported." msgstr "" -#: ../../library/importlib.rst:1418 +#: ../../library/importlib.rst:1252 msgid "**name** and **package** work the same as for :func:`import_module`." msgstr "" -#: ../../library/importlib.rst:1422 +#: ../../library/importlib.rst:1256 msgid "" "Raises :exc:`ModuleNotFoundError` instead of :exc:`AttributeError` if " "**package** is in fact not a package (i.e. lacks a :attr:`~module.__path__` " "attribute)." msgstr "" -#: ../../library/importlib.rst:1429 +#: ../../library/importlib.rst:1263 msgid "" "Create a new module based on **spec** and :meth:`spec.loader.create_module " "`." msgstr "" -#: ../../library/importlib.rst:1432 +#: ../../library/importlib.rst:1266 msgid "" "If :meth:`spec.loader.create_module ` " "does not return ``None``, then any pre-existing attributes will not be " @@ -1688,14 +1519,14 @@ msgid "" "accessing **spec** or setting an attribute on the module." msgstr "" -#: ../../library/importlib.rst:1437 +#: ../../library/importlib.rst:1271 msgid "" "This function is preferred over using :class:`types.ModuleType` to create a " "new module as **spec** is used to set as many import-controlled attributes " "on the module as possible." msgstr "" -#: ../../library/importlib.rst:1445 +#: ../../library/importlib.rst:1279 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on a loader. The parameters have the same meaning as they do " @@ -1704,7 +1535,7 @@ msgid "" "spec." msgstr "" -#: ../../library/importlib.rst:1455 +#: ../../library/importlib.rst:1289 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on the path to a file. Missing information will be filled in " @@ -1712,14 +1543,14 @@ msgid "" "module will be file-based." msgstr "" -#: ../../library/importlib.rst:1467 +#: ../../library/importlib.rst:1301 msgid "" "Return the hash of *source_bytes* as bytes. A hash-based ``.pyc`` file " "embeds the :func:`source_hash` of the corresponding source file's contents " "in its header." msgstr "" -#: ../../library/importlib.rst:1475 +#: ../../library/importlib.rst:1309 msgid "" "A context manager that can temporarily skip the compatibility check for " "extension modules. By default the check is enabled and will fail when a " @@ -1728,14 +1559,14 @@ msgid "" "interpreter GIL, when imported in an interpreter with its own GIL." msgstr "" -#: ../../library/importlib.rst:1482 +#: ../../library/importlib.rst:1316 msgid "" "Note that this function is meant to accommodate an unusual case; one which " "is likely to eventually go away. There's is a pretty good chance this is " "not what you were looking for." msgstr "" -#: ../../library/importlib.rst:1486 +#: ../../library/importlib.rst:1320 msgid "" "You can get the same effect as this function by implementing the basic " "interface of multi-phase init (:pep:`489`) and lying about support for " @@ -1744,19 +1575,19 @@ msgstr "" "你可以透過實作多階段初始化的基本介面 (:pep:`489`) 並假稱有多個直譯器(或直譯" "器各別持有的 GIL)的支援,來達到與此函式相同的效果。" -#: ../../library/importlib.rst:1491 +#: ../../library/importlib.rst:1325 msgid "" "Using this function to disable the check can lead to unexpected behavior and " "even crashes. It should only be used during extension module development." msgstr "" -#: ../../library/importlib.rst:1499 +#: ../../library/importlib.rst:1333 msgid "" "A class which postpones the execution of the loader of a module until the " "module has an attribute accessed." msgstr "" -#: ../../library/importlib.rst:1502 +#: ../../library/importlib.rst:1336 msgid "" "This class **only** works with loaders that define :meth:`~importlib.abc." "Loader.exec_module` as control over what module type is used for the module " @@ -1769,7 +1600,7 @@ msgid "" "raised if such a substitution is detected." msgstr "" -#: ../../library/importlib.rst:1513 +#: ../../library/importlib.rst:1347 msgid "" "For projects where startup time is critical, this class allows for " "potentially minimizing the cost of loading a module if it is never used. For " @@ -1778,21 +1609,21 @@ msgid "" "postponed and thus occurring out of context." msgstr "" -#: ../../library/importlib.rst:1521 +#: ../../library/importlib.rst:1355 msgid "" "Began calling :meth:`~importlib.abc.Loader.create_module`, removing the " "compatibility warning for :class:`importlib.machinery.BuiltinImporter` and :" "class:`importlib.machinery.ExtensionFileLoader`." msgstr "" -#: ../../library/importlib.rst:1528 +#: ../../library/importlib.rst:1362 msgid "" "A class method which returns a callable that creates a lazy loader. This is " "meant to be used in situations where the loader is passed by class instead " "of by instance. ::" msgstr "" -#: ../../library/importlib.rst:1533 +#: ../../library/importlib.rst:1367 msgid "" "suffixes = importlib.machinery.SOURCE_SUFFIXES\n" "loader = importlib.machinery.SourceFileLoader\n" @@ -1804,20 +1635,20 @@ msgstr "" "lazy_loader = importlib.util.LazyLoader.factory(loader)\n" "finder = importlib.machinery.FileFinder(path, (lazy_loader, suffixes))" -#: ../../library/importlib.rst:1541 +#: ../../library/importlib.rst:1375 msgid "Examples" msgstr "範例" -#: ../../library/importlib.rst:1544 +#: ../../library/importlib.rst:1378 msgid "Importing programmatically" msgstr "" -#: ../../library/importlib.rst:1546 +#: ../../library/importlib.rst:1380 msgid "" "To programmatically import a module, use :func:`importlib.import_module`. ::" msgstr "" -#: ../../library/importlib.rst:1549 +#: ../../library/importlib.rst:1383 msgid "" "import importlib\n" "\n" @@ -1827,23 +1658,23 @@ msgstr "" "\n" "itertools = importlib.import_module('itertools')" -#: ../../library/importlib.rst:1555 +#: ../../library/importlib.rst:1389 msgid "Checking if a module can be imported" msgstr "" -#: ../../library/importlib.rst:1557 +#: ../../library/importlib.rst:1391 msgid "" "If you need to find out if a module can be imported without actually doing " "the import, then you should use :func:`importlib.util.find_spec`." msgstr "" -#: ../../library/importlib.rst:1560 +#: ../../library/importlib.rst:1394 msgid "" "Note that if ``name`` is a submodule (contains a dot), :func:`importlib.util." "find_spec` will import the parent module. ::" msgstr "" -#: ../../library/importlib.rst:1564 +#: ../../library/importlib.rst:1398 msgid "" "import importlib.util\n" "import sys\n" @@ -1863,11 +1694,11 @@ msgid "" " print(f\"can't find the {name!r} module\")" msgstr "" -#: ../../library/importlib.rst:1583 +#: ../../library/importlib.rst:1417 msgid "Importing a source file directly" msgstr "" -#: ../../library/importlib.rst:1585 +#: ../../library/importlib.rst:1419 msgid "" "This recipe should be used with caution: it is an approximation of an import " "statement where the file path is specified directly, rather than :data:`sys." @@ -1877,13 +1708,13 @@ msgid "" "file is appropriate." msgstr "" -#: ../../library/importlib.rst:1592 +#: ../../library/importlib.rst:1426 msgid "" "To import a Python source file directly from a path, use the following " "recipe::" msgstr "" -#: ../../library/importlib.rst:1594 +#: ../../library/importlib.rst:1428 msgid "" "import importlib.util\n" "import sys\n" @@ -1906,15 +1737,15 @@ msgid "" "json = import_from_path(module_name, file_path)" msgstr "" -#: ../../library/importlib.rst:1616 +#: ../../library/importlib.rst:1450 msgid "Implementing lazy imports" msgstr "" -#: ../../library/importlib.rst:1618 +#: ../../library/importlib.rst:1452 msgid "The example below shows how to implement lazy imports::" msgstr "" -#: ../../library/importlib.rst:1620 +#: ../../library/importlib.rst:1454 msgid "" ">>> import importlib.util\n" ">>> import sys\n" @@ -1950,11 +1781,11 @@ msgstr "" ">>> lazy_typing.TYPE_CHECKING\n" "False" -#: ../../library/importlib.rst:1639 +#: ../../library/importlib.rst:1473 msgid "Setting up an importer" msgstr "" -#: ../../library/importlib.rst:1641 +#: ../../library/importlib.rst:1475 msgid "" "For deep customizations of import, you typically want to implement an :term:" "`importer`. This means managing both the :term:`finder` and :term:`loader` " @@ -1968,7 +1799,7 @@ msgid "" "for the appropriate classes defined within this package)::" msgstr "" -#: ../../library/importlib.rst:1652 +#: ../../library/importlib.rst:1486 msgid "" "import importlib.machinery\n" "import sys\n" @@ -1992,11 +1823,11 @@ msgid "" "sys.path_hooks.append(SpamPathEntryFinder.path_hook(loader_details))" msgstr "" -#: ../../library/importlib.rst:1673 +#: ../../library/importlib.rst:1507 msgid "Approximating :func:`importlib.import_module`" msgstr "" -#: ../../library/importlib.rst:1675 +#: ../../library/importlib.rst:1509 msgid "" "Import itself is implemented in Python code, making it possible to expose " "most of the import machinery through importlib. The following helps " @@ -2004,7 +1835,7 @@ msgid "" "approximate implementation of :func:`importlib.import_module`::" msgstr "" -#: ../../library/importlib.rst:1681 +#: ../../library/importlib.rst:1515 msgid "" "import importlib.util\n" "import sys\n" @@ -2045,6 +1876,12 @@ msgstr "universal newlines" msgid "importlib.abc.InspectLoader.get_source method" msgstr "importlib.abc.InspectLoader.get_source 方法" +#~ msgid "Read contents of ``self`` as bytes." +#~ msgstr "以位元組讀取 ``self`` 的內容。" + +#~ msgid "Read contents of ``self`` as text." +#~ msgstr "以文字讀取 ``self`` 的內容。" + #~ msgid ":attr:`__cached__`" #~ msgstr ":attr:`__cached__`" diff --git a/library/inspect.po b/library/inspect.po index 1a82a11623..9444944dcd 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-29 00:16+0000\n" +"POT-Creation-Date: 2026-01-24 22:47+0000\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -794,7 +794,7 @@ msgid "" "Sync functions marked with :func:`markcoroutinefunction` now return ``True``." msgstr "" -#: ../../library/inspect.rst:455 ../../library/inspect.rst:525 +#: ../../library/inspect.rst:455 msgid "" "Functions wrapped in :func:`functools.partialmethod` now return ``True`` if " "the wrapped function is a :term:`coroutine function`." @@ -886,6 +886,12 @@ msgid "" "wrapped function is an :term:`asynchronous generator` function." msgstr "" +#: ../../library/inspect.rst:525 +msgid "" +"Functions wrapped in :func:`functools.partialmethod` now return ``True`` if " +"the wrapped function is a :term:`asynchronous generator` function." +msgstr "" + #: ../../library/inspect.rst:531 msgid "" "Return ``True`` if the object is an :term:`asynchronous generator iterator` " @@ -2195,6 +2201,7 @@ msgstr "GEN_CREATED:等待開始執行。" #: ../../library/inspect.rst:1601 msgid "GEN_RUNNING: Currently being executed by the interpreter." msgstr "GEN_RUNNING:目前正在被直譯器執行。" + #: ../../library/inspect.rst:1602 msgid "GEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index dc6419a7dc..024bd8d699 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-22 16:55+0000\n" +"POT-Creation-Date: 2026-01-24 22:47+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -875,7 +875,7 @@ msgid "" "new ABC for access to, opening, and reading *resources* inside packages. " "Resources are roughly similar to files inside packages, but they needn't be " "actual files on the physical file system. Module loaders can provide a :" -"meth:`!get_resource_reader` function which returns a :class:`importlib.abc." +"meth:`!get_resource_reader` function which returns a :class:`!importlib.abc." "ResourceReader` instance to support this new API. Built-in file path " "loaders and zip file loaders both support this." msgstr "" @@ -1500,7 +1500,7 @@ msgstr "importlib" #: ../../whatsnew/3.7.rst:1046 msgid "" -"The :class:`importlib.abc.ResourceReader` ABC was introduced to support the " +"The :class:`!importlib.abc.ResourceReader` ABC was introduced to support the " "loading of resources from packages. See also :ref:" "`whatsnew37_importlib_resources`. (Contributed by Barry Warsaw, Brett Cannon " "in :issue:`32248`.)" @@ -2911,7 +2911,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:2034 msgid "" "The :class:`importlib.abc.ResourceLoader` ABC has been deprecated in favour " -"of :class:`importlib.abc.ResourceReader`." +"of :class:`!importlib.abc.ResourceReader`." msgstr "" #: ../../whatsnew/3.7.rst:2041 From 8c0fd99f97c70eb46d6819e57b0585aa13cebc47 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 27 Jan 2026 00:18:31 +0000 Subject: [PATCH 03/11] sync with cpython c5b23ebc --- faq/programming.po | 262 ++++--- library/contextvars.po | 213 +++--- library/os.po | 4 +- library/pickle.po | 1084 ++++++++++++++------------- reference/datamodel.po | 1569 ++++++++++++++++++++-------------------- 5 files changed, 1579 insertions(+), 1553 deletions(-) diff --git a/faq/programming.po b/faq/programming.po index 2c133e52fc..e8379f7c40 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -9,7 +9,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-01-27 00:17+0000\n" "PO-Revision-Date: 2024-04-25 14:17+0800\n" "Last-Translator: KNChiu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -45,8 +45,8 @@ msgstr "有的。" #: ../../faq/programming.rst:19 msgid "" -"Several debuggers for Python are described below, and the built-in " -"function :func:`breakpoint` allows you to drop into any of them." +"Several debuggers for Python are described below, and the built-in function :" +"func:`breakpoint` allows you to drop into any of them." msgstr "" "下面描述了幾個 Python 除錯器,內建函式 :func:`breakpoint` 允許你進入其中任何" "一個。" @@ -177,9 +177,9 @@ msgid "" "standard Python modules." msgstr "" "一種是使用 freeze 工具,它位於 Python 原始碼樹中的 `Tools/freeze `_。它將 Python 位元組碼轉" -"換為 C 陣列;使用 C 編譯器,你可以將所有模組嵌入到一個新程式中,然後將其與標" -"準 Python 模組連結。" +"github.com/python/cpython/tree/main/Tools/freeze>`_。它將 Python 位元組碼轉換" +"為 C 陣列;使用 C 編譯器,你可以將所有模組嵌入到一個新程式中,然後將其與標準 " +"Python 模組連結。" #: ../../faq/programming.rst:87 #, fuzzy @@ -338,11 +338,10 @@ msgid "" "a component of an imported module. This clutter would defeat the usefulness " "of the ``global`` declaration for identifying side-effects." msgstr "" -"雖然起初有點令人驚訝,但稍加考慮就可以解釋這一點。一方面,要" -"求 :keyword:`global` 分配的變數可以防止意外的副作用。另一方面,如果所有全域參" -"照都需要 ``global``,那麼你將一直使用 ``global``。你必須將對內建函式或引入模" -"組的組件的每個參照聲明為全域。這種混亂會破壞用於識別副作用的 ``global`` 聲明" -"的有用性。" +"雖然起初有點令人驚訝,但稍加考慮就可以解釋這一點。一方面,要求 :keyword:" +"`global` 分配的變數可以防止意外的副作用。另一方面,如果所有全域參照都需要 " +"``global``,那麼你將一直使用 ``global``。你必須將對內建函式或引入模組的組件的" +"每個參照聲明為全域。這種混亂會破壞用於識別副作用的 ``global`` 聲明的有用性。" #: ../../faq/programming.rst:208 msgid "" @@ -555,8 +554,8 @@ msgstr "如果你按以下順序引入模組,這是一個很好的做法:" #: ../../faq/programming.rst:301 msgid "" -"standard library modules -- " -"e.g. :mod:`sys`, :mod:`os`, :mod:`argparse`, :mod:`re`" +"standard library modules -- e.g. :mod:`sys`, :mod:`os`, :mod:`argparse`, :" +"mod:`re`" msgstr "" "標準函式庫模組 —— 例如 :mod:`sys`、:mod:`os`、:mod:`argparse`、:mod:`re`" @@ -636,8 +635,8 @@ msgstr "" "入移動到局部範圍內,例如在函式定義內。如果根據程式的執行方式,許多引入是不必" "要的,則此技術特別有用。如果模組僅在該函式中使用,你可能還想將引入移動到該函" "式中。請注意,由於模組的一次性初始化,第一次載入模組可能很昂貴,但多次載入模" -"組實際上是免費的,只需幾次字典查詢。即使模組名稱超出範圍,該模組也可能" -"在 :data:`sys.modules` 中可用。" +"組實際上是免費的,只需幾次字典查詢。即使模組名稱超出範圍,該模組也可能在 :" +"data:`sys.modules` 中可用。" #: ../../faq/programming.rst:338 msgid "Why are default values shared between objects?" @@ -808,13 +807,13 @@ msgstr "引數 (arguments) 和參數 (parameters) 有什麼區別?" msgid "" ":term:`Parameters ` are defined by the names that appear in a " "function definition, whereas :term:`arguments ` are the values " -"actually passed to a function when calling it. Parameters define " -"what :term:`kind of arguments ` a function can accept. For " -"example, given the function definition::" +"actually passed to a function when calling it. Parameters define what :term:" +"`kind of arguments ` a function can accept. For example, given " +"the function definition::" msgstr "" ":term:`參數 `\\ 由出現在函式定義中的名稱定義,而\\ :term:`引數 " -"`\\ 是呼叫函式時實際傳遞給函式的值。參數定義函式可以接受的" -"\\ :term:`引數種類 `。例如,給定以下函式定義: ::" +"`\\ 是呼叫函式時實際傳遞給函式的值。參數定義函式可以接受的\\ :term:" +"`引數種類 `。例如,給定以下函式定義: ::" #: ../../faq/programming.rst:423 msgid "" @@ -956,9 +955,9 @@ msgstr "" "一些操作(例如 ``y.append(10)`` 和 ``y.sort()``)會改變物件,而表面上相似的操" "作(例如 ``y = y + [10]`` 和: func:`sorted(y) `) 建立一個新物件。通" "常在 Python 中(以及在標準函式庫中的所有情況下)改變物件的方法將回傳 " -"``None`` 以幫助避免混淆這兩種型別的操作。因此,如果你錯誤地編寫了 " -"``y.sort()``,認為它會為你提供 ``y`` 的排序副本,那麼你最終會得到 ``None``," -"這可能會導致你的程式生成一個容易診斷的錯誤。" +"``None`` 以幫助避免混淆這兩種型別的操作。因此,如果你錯誤地編寫了 ``y." +"sort()``,認為它會為你提供 ``y`` 的排序副本,那麼你最終會得到 ``None``,這可" +"能會導致你的程式生成一個容易診斷的錯誤。" #: ../../faq/programming.rst:488 #, fuzzy @@ -1292,8 +1291,8 @@ msgstr "" #: ../../faq/programming.rst:641 #, fuzzy msgid "" -"Some objects can be copied more easily. Dictionaries have " -"a :meth:`~dict.copy` method::" +"Some objects can be copied more easily. Dictionaries have a :meth:`~dict." +"copy` method::" msgstr "可以更輕鬆地複製某些物件。字典有一個 :meth:`~dict.copy` 方法: ::" #: ../../faq/programming.rst:644 @@ -1562,8 +1561,8 @@ msgid "" "only parameters. Its documentation looks like this::" msgstr "" "函式引數list中的斜線表示它前面的參數是位置參數。僅位置參數是沒有外部可用名稱" -"的參數。在呼叫接受僅位置參數的函式時,參數僅根據其位置對映到參數。例" -"如,:func:`divmod` 是一個只接受位置參數的函式。它的文件看起來像這樣: ::" +"的參數。在呼叫接受僅位置參數的函式時,參數僅根據其位置對映到參數。例如,:" +"func:`divmod` 是一個只接受位置參數的函式。它的文件看起來像這樣: ::" #: ../../faq/programming.rst:786 msgid "" @@ -1585,8 +1584,8 @@ msgid "" "positional-only. Thus, calling :func:`divmod` with keyword arguments would " "lead to an error::" msgstr "" -"參數串列最後的斜線表示兩個參數都是僅限位置參數。因此使用關鍵字引數呼" -"叫 :func:`divmod` 會導致錯誤: ::" +"參數串列最後的斜線表示兩個參數都是僅限位置參數。因此使用關鍵字引數呼叫 :func:" +"`divmod` 會導致錯誤: ::" #: ../../faq/programming.rst:796 msgid "" @@ -1701,8 +1700,8 @@ msgstr "如何取得 int 文字屬性而不是 SyntaxError?" #: ../../faq/programming.rst:850 msgid "" -"Trying to lookup an ``int`` literal attribute in the normal manner gives " -"a :exc:`SyntaxError` because the period is seen as a decimal point::" +"Trying to lookup an ``int`` literal attribute in the normal manner gives a :" +"exc:`SyntaxError` because the period is seen as a decimal point::" msgstr "" "嘗試以正常方式查找 ``int`` 字面值屬性會給出一個 :exc:`SyntaxError`,因為句點" "被視為小數點: ::" @@ -1738,8 +1737,8 @@ msgid "" "``int('144') == 144``. Similarly, :func:`float` converts to a floating-" "point number, e.g. ``float('144') == 144.0``." msgstr "" -"對於整數,使用內建的 int 型別建構函式,例如``int('144') == 144``。同" -"樣,:func:`float` 轉換為浮點數,例如``浮動('144')== 144.0``。" +"對於整數,使用內建的 int 型別建構函式,例如``int('144') == 144``。同樣,:" +"func:`float` 轉換為浮點數,例如``浮動('144')== 144.0``。" #: ../../faq/programming.rst:875 #, fuzzy @@ -1793,14 +1792,14 @@ msgid "" "in type constructor :func:`str`. If you want a hexadecimal or octal " "representation, use the built-in functions :func:`hex` or :func:`oct`. For " "fancy formatting, see the :ref:`f-strings` and :ref:`formatstrings` " -"sections, e.g. ``\"{:04d}\".format(144)`` yields ``'0144'`` and ``\"{:.3f}" -"\".format(1.0/3.0)`` yields ``'0.333'``." +"sections, e.g. ``\"{:04d}\".format(144)`` yields ``'0144'`` and ``\"{:.3f}\"." +"format(1.0/3.0)`` yields ``'0.333'``." msgstr "" -"例如,要將數字 ``144`` 轉換為字串 ``'144'``,請使用內建型別建構函" -"式 :func:`str`。如果你想要十六進製或八進製表示,請使用內建函式 :func:`hex` " -"或 :func:`oct`。對於精美的格式,請參閱:ref:`f-strings` " -"和:ref:`formatstrings` 部分,例如``\"{:04d}\".format(144)`` 產生 ``'0144'`` " -"和 ``\"{:.3f}\".format(1.0/3.0)`` 產生 ``'0.333'`` ." +"例如,要將數字 ``144`` 轉換為字串 ``'144'``,請使用內建型別建構函式 :func:" +"`str`。如果你想要十六進製或八進製表示,請使用內建函式 :func:`hex` 或 :func:" +"`oct`。對於精美的格式,請參閱:ref:`f-strings` 和:ref:`formatstrings` 部分,例" +"如``\"{:04d}\".format(144)`` 產生 ``'0144'`` 和 ``\"{:.3f}\"." +"format(1.0/3.0)`` 產生 ``'0.333'`` ." #: ../../faq/programming.rst:906 msgid "How do I modify a string in place?" @@ -2017,15 +2016,15 @@ msgstr "不是這樣的。" msgid "" "For simple input parsing, the easiest approach is usually to split the line " "into whitespace-delimited words using the :meth:`~str.split` method of " -"string objects and then convert decimal strings to numeric values " -"using :func:`int` or :func:`float`. :meth:`!split` supports an optional " -"\"sep\" parameter which is useful if the line uses something other than " -"whitespace as a separator." +"string objects and then convert decimal strings to numeric values using :" +"func:`int` or :func:`float`. :meth:`!split` supports an optional \"sep\" " +"parameter which is useful if the line uses something other than whitespace " +"as a separator." msgstr "" "對於簡單的輸入解析,最簡單的方法通常是使用字串物件的 :meth:`~str.split` 方法" -"將行拆分為以空格分隔的單詞,然後使用 :func:`int` 或將十進製字串轉換為數" -"值:func:`浮動`。 :meth:`!split` 支援可選的 \"sep\" 參數,如果該行使用空格以外" -"的其他內容作為分隔符,該參數很有用。" +"將行拆分為以空格分隔的單詞,然後使用 :func:`int` 或將十進製字串轉換為數值:" +"func:`浮動`。 :meth:`!split` 支援可選的 \"sep\" 參數,如果該行使用空格以外的" +"其他內容作為分隔符,該參數很有用。" #: ../../faq/programming.rst:1019 #, fuzzy @@ -2175,8 +2174,8 @@ msgid "" "You should always find the hot spots in your program *before* attempting to " "optimize any code (see the :mod:`profile` module)." msgstr "" -"在嘗試最佳化任何程式碼\\ *之前*,你應該始終找到程式中的熱點(請參" -"閱 :mod:`profile` 模組)。" +"在嘗試最佳化任何程式碼\\ *之前*,你應該始終找到程式中的熱點(請參閱 :mod:" +"`profile` 模組)。" #: ../../faq/programming.rst:1084 #, fuzzy @@ -2231,9 +2230,9 @@ msgid "" "When the standard library provides a primitive for doing something, it is " "likely (although not guaranteed) to be faster than any alternative you may " "come up with. This is doubly true for primitives written in C, such as " -"builtins and some extension types. For example, be sure to use either " -"the :meth:`list.sort` built-in method or the related :func:`sorted` function " -"to do sorting (and see the :ref:`sortinghowto` for examples of moderately " +"builtins and some extension types. For example, be sure to use either the :" +"meth:`list.sort` built-in method or the related :func:`sorted` function to " +"do sorting (and see the :ref:`sortinghowto` for examples of moderately " "advanced usage)." msgstr "" "當標準函式庫提供用於執行某些操作的原語時,它很可能(儘管不能保證)比你可能想" @@ -2269,8 +2268,8 @@ msgstr "" "如果你已經達到純 Python 所能允許的極限,可以使用一些工具讓你走得更遠。例如," "`Cython `_ 可以將稍微修改過的 Python 程式碼編譯成 C 擴" "充,並且可以在許多不同的平台上使用。Cython 可以利用編譯(和可選的型別註釋)使" -"你的程式碼比解釋時快得多。如果你對自己的 C 程式設計技能有信心,你也可以" -"\\ :ref:`自己編寫一個 C 擴充模組 `。" +"你的程式碼比解釋時快得多。如果你對自己的 C 程式設計技能有信心,你也可以\\ :" +"ref:`自己編寫一個 C 擴充模組 `。" #: ../../faq/programming.rst:1125 msgid "" @@ -2303,8 +2302,8 @@ msgid "" "To accumulate many :class:`str` objects, the recommended idiom is to place " "them into a list and call :meth:`str.join` at the end::" msgstr "" -"要累積許多 :class:`str` 物件,推薦的習慣用法是將它們放入list中並在末尾呼" -"叫 :meth:`str.join`: ::" +"要累積許多 :class:`str` 物件,推薦的習慣用法是將它們放入list中並在末尾呼叫 :" +"meth:`str.join`: ::" #: ../../faq/programming.rst:1141 msgid "" @@ -2476,8 +2475,8 @@ msgstr "" #: ../../faq/programming.rst:1220 msgid "" -"If all elements of the list may be used as set keys (i.e. they are " -"all :term:`hashable`) this is often faster ::" +"If all elements of the list may be used as set keys (i.e. they are all :term:" +"`hashable`) this is often faster ::" msgstr "" "如果串列的所有元素都可以做為集合的鍵(即它們都必須是 :term:`hashable`),那這" "通常會更快: ::" @@ -2493,7 +2492,8 @@ msgid "" msgstr "這會將串列轉換為一個集合,從而刪除重複項,然後再轉換回串列。" #: ../../faq/programming.rst:1230 -msgid "How do you remove multiple items from a list" +#, fuzzy +msgid "How do you remove multiple items from a list?" msgstr "如何從串列中刪除多個項目" #: ../../faq/programming.rst:1232 @@ -2502,7 +2502,7 @@ msgid "" "As with removing duplicates, explicitly iterating in reverse with a delete " "condition is one possibility. However, it is easier and faster to use slice " "replacement with an implicit or explicit forward iteration. Here are three " -"variations.::" +"variations::" msgstr "" "與刪除重複項一樣,使用刪除條件顯式反向疊代是一種可能性。但是,透過隱式或顯式" "前向疊代使用切片替換更容易和更快。這是三種變體: ::" @@ -2673,8 +2673,8 @@ msgstr "如何將方法或函式應用於物件序列?" #: ../../faq/programming.rst:1327 #, fuzzy msgid "" -"To call a method or function and accumulate the return values is a list, " -"a :term:`list comprehension` is an elegant solution::" +"To call a method or function and accumulate the return values is a list, a :" +"term:`list comprehension` is an elegant solution::" msgstr "" "呼叫一個方法或函式並累積回傳值是一個list,一個 :term:`list comprehension` 是" "一個優雅的解決方案: ::" @@ -2834,14 +2834,14 @@ msgid "" "augmented assignment is executed, and its return value is what gets used in " "the assignment statement; and (b) for lists, :meth:`!__iadd__` is equivalent " "to calling :meth:`~sequence.extend` on the list and returning the list. " -"That's why we say that for lists, ``+=`` is a \"shorthand\" " -"for :meth:`list.extend`::" +"That's why we say that for lists, ``+=`` is a \"shorthand\" for :meth:`list." +"extend`::" msgstr "" -"要了解為什麼會發生這種情況,你需要知道 (a) 如果一個物件實作了一" -"個 :meth:`~object.__iadd__` 魔術方法,它會在執行 ``+=`` 增廣賦值時被呼叫,並" -"且它的回傳value 是賦值陳述式中使用的值; (b) 對於list,:meth:`!__iadd__` 相當" -"於在list上呼叫 :meth:`!extend` 並回傳list。這就是為什麼我們說對於list," -"``+=`` 是 :meth:`!list.extend` 的「簡寫」: ::" +"要了解為什麼會發生這種情況,你需要知道 (a) 如果一個物件實作了一個 :meth:" +"`~object.__iadd__` 魔術方法,它會在執行 ``+=`` 增廣賦值時被呼叫,並且它的回傳" +"value 是賦值陳述式中使用的值; (b) 對於list,:meth:`!__iadd__` 相當於在list上" +"呼叫 :meth:`!extend` 並回傳list。這就是為什麼我們說對於list,``+=`` 是 :meth:" +"`!list.extend` 的「簡寫」: ::" #: ../../faq/programming.rst:1404 msgid "" @@ -3012,8 +3012,8 @@ msgstr "什麼是方法 (method)?" #: ../../faq/programming.rst:1481 #, fuzzy msgid "" -"A method is a function on some object ``x`` that you normally call as " -"``x.name(arguments...)``. Methods are defined as functions inside the class " +"A method is a function on some object ``x`` that you normally call as ``x." +"name(arguments...)``. Methods are defined as functions inside the class " "definition::" msgstr "" "方法是一些物件 ``x`` 上的函式,你通常將其稱為 ``x.name(arguments...)`` 。方法" @@ -3072,15 +3072,15 @@ msgstr "" #: ../../faq/programming.rst:1511 msgid "" -"Note that :func:`isinstance` also checks for virtual inheritance from " -"an :term:`abstract base class`. So, the test will return ``True`` for a " +"Note that :func:`isinstance` also checks for virtual inheritance from an :" +"term:`abstract base class`. So, the test will return ``True`` for a " "registered class even if hasn't directly or indirectly inherited from it. " "To test for \"true inheritance\", scan the :term:`MRO` of the class:" msgstr "" "請注意,:func:`isinstance` 還會檢查來自\\ :term:`抽象基底類別 (abstract base " "class) ` 的虛擬繼承。因此對已註冊類別的檢驗會回傳 " -"``True``,即使沒有直接或間接繼承自它。要測試「真正繼承」,請掃描該類別" -"的 :term:`MRO`:" +"``True``,即使沒有直接或間接繼承自它。要測試「真正繼承」,請掃描該類別的 :" +"term:`MRO`:" #: ../../faq/programming.rst:1516 msgid "" @@ -3249,29 +3249,29 @@ msgstr "" #, fuzzy msgid "" "Here the ``UpperOut`` class redefines the ``write()`` method to convert the " -"argument string to uppercase before calling the underlying " -"``self._outfile.write()`` method. All other methods are delegated to the " -"underlying ``self._outfile`` object. The delegation is accomplished via " -"the :meth:`~object.__getattr__` method; consult :ref:`the language reference " -"` for more information about controlling attribute access." +"argument string to uppercase before calling the underlying ``self._outfile." +"write()`` method. All other methods are delegated to the underlying ``self." +"_outfile`` object. The delegation is accomplished via the :meth:`~object." +"__getattr__` method; consult :ref:`the language reference ` for more information about controlling attribute access." msgstr "" -"這裡的 ``UpperOut`` 類別重新定義了``write()`` 方法,在呼叫底層的" -"``self._outfile.write()`` 方法之前將引數字串轉換為大寫。所有其他方法都委託給" -"底層的 ``self._outfile`` 物件。委託是透過 :meth:`~object.__getattr__` 方法完" -"成的;有關控制屬性存取的更多資訊,請參閱語言參考 。" +"這裡的 ``UpperOut`` 類別重新定義了``write()`` 方法,在呼叫底層的``self." +"_outfile.write()`` 方法之前將引數字串轉換為大寫。所有其他方法都委託給底層的 " +"``self._outfile`` 物件。委託是透過 :meth:`~object.__getattr__` 方法完成的;有" +"關控制屬性存取的更多資訊,請參閱語言參考 。" #: ../../faq/programming.rst:1605 #, fuzzy msgid "" "Note that for more general cases delegation can get trickier. When " -"attributes must be set as well as retrieved, the class must define " -"a :meth:`~object.__setattr__` method too, and it must do so carefully. The " -"basic implementation of :meth:`!__setattr__` is roughly equivalent to the " +"attributes must be set as well as retrieved, the class must define a :meth:" +"`~object.__setattr__` method too, and it must do so carefully. The basic " +"implementation of :meth:`!__setattr__` is roughly equivalent to the " "following::" msgstr "" "請注意,對於更一般的情況,委託可能會變得更加棘手。當必須設定和檢索屬性時,該" -"類別也必須定義一個 :meth:`~object.__setattr__` 方法,而且必須小心謹" -"慎。 :meth:`!__setattr__` 的基本實作大致等同於以下: ::" +"類別也必須定義一個 :meth:`~object.__setattr__` 方法,而且必須小心謹慎。 :" +"meth:`!__setattr__` 的基本實作大致等同於以下: ::" #: ../../faq/programming.rst:1610 msgid "" @@ -3289,9 +3289,8 @@ msgstr "" #: ../../faq/programming.rst:1616 msgid "" -"Many :meth:`~object.__setattr__` implementations call :meth:`!" -"object.__setattr__` to set an attribute on self without causing infinite " -"recursion::" +"Many :meth:`~object.__setattr__` implementations call :meth:`!object." +"__setattr__` to set an attribute on self without causing infinite recursion::" msgstr "" "許多 :meth:`~object.__setattr__` 的實作會呼叫 :meth:`!object.__setattr__` 以" "設定 self 的屬性,而不會導致無限遞迴。" @@ -3310,8 +3309,8 @@ msgstr "" #: ../../faq/programming.rst:1624 msgid "" -"Alternatively, it is possible to set attributes by inserting entries " -"into :attr:`self.__dict__ ` directly." +"Alternatively, it is possible to set attributes by inserting entries into :" +"attr:`self.__dict__ ` directly." msgstr "" #: ../../faq/programming.rst:1629 @@ -3630,9 +3629,9 @@ msgstr "這有幾個可能的原因。" #: ../../faq/programming.rst:1782 msgid "" -"The :keyword:`del` statement does not necessarily " -"call :meth:`~object.__del__` -- it simply decrements the object's reference " -"count, and if this reaches zero :meth:`!__del__` is called." +"The :keyword:`del` statement does not necessarily call :meth:`~object." +"__del__` -- it simply decrements the object's reference count, and if this " +"reaches zero :meth:`!__del__` is called." msgstr "" ":keyword:`del` 陳述式不一定會呼叫 :meth:`~object.__del__` -- 它只是減少物件的" "參照計數,如果達到零則呼叫 :meth:`!__del__`。" @@ -3691,8 +3690,8 @@ msgid "" "Finally, if your :meth:`!__del__` method raises an exception, a warning " "message is printed to :data:`sys.stderr`." msgstr "" -"最後,如果你的 :meth:`!__del__` 方法引發例外,則會將一條警告訊息印出" -"到 :data:`sys.stderr`。" +"最後,如果你的 :meth:`!__del__` 方法引發例外,則會將一條警告訊息印出到 :data:" +"`sys.stderr`。" #: ../../faq/programming.rst:1822 msgid "How do I get a list of all instances of a given class?" @@ -3871,8 +3870,8 @@ msgid "" "implement a method that behaves like :meth:`dict.pop`:" msgstr "" "當 ``None`` 是有效輸入值時,檢測可選引數可能會很棘手。在這些情況下,你可以建" -"立一個保證與其他物件不同的單例哨兵物件。例如,這裡是如何實作一個行為類似" -"於 :meth:`dict.pop` 的方法:" +"立一個保證與其他物件不同的單例哨兵物件。例如,這裡是如何實作一個行為類似於 :" +"meth:`dict.pop` 的方法:" #: ../../faq/programming.rst:1917 msgid "" @@ -3909,8 +3908,8 @@ msgstr "" #: ../../faq/programming.rst:1934 msgid "" -"For example, here is the implementation of :meth:`!" -"collections.abc.Sequence.__contains__`::" +"For example, here is the implementation of :meth:`!collections.abc.Sequence." +"__contains__`::" msgstr "" "例如,以下是 :meth:`!collections.abc.Sequence.__contains__` 的實作: ::" @@ -3941,9 +3940,9 @@ msgid "" "*after* an instance is created, which is too late to alter data in an " "immutable instance." msgstr "" -"當對不可變型別進行子類別化時,覆蓋 :meth:`~object.__new__` 方法而不" -"是 :meth:`~object.__init__` 方法。後者僅在*建立實例後*運行,這為時已晚,無法" -"更改不可變實例中的資料。" +"當對不可變型別進行子類別化時,覆蓋 :meth:`~object.__new__` 方法而不是 :meth:" +"`~object.__init__` 方法。後者僅在*建立實例後*運行,這為時已晚,無法更改不可變" +"實例中的資料。" #: ../../faq/programming.rst:1952 msgid "" @@ -4026,14 +4025,12 @@ msgstr "如何快取方法呼叫?" #: ../../faq/programming.rst:1997 #, fuzzy msgid "" -"The two principal tools for caching methods " -"are :func:`functools.cached_property` and :func:`functools.lru_cache`. The " -"former stores results at the instance level and the latter at the class " -"level." +"The two principal tools for caching methods are :func:`functools." +"cached_property` and :func:`functools.lru_cache`. The former stores results " +"at the instance level and the latter at the class level." msgstr "" -"快取方法的兩個主要工具是 func:`functools.cached_property` " -"和 :func:`functools.lru_cache`。前者在實例級別儲存結果,後者在類別級別儲存結" -"果。" +"快取方法的兩個主要工具是 func:`functools.cached_property` 和 :func:" +"`functools.lru_cache`。前者在實例級別儲存結果,後者在類別級別儲存結果。" #: ../../faq/programming.rst:2002 #, fuzzy @@ -4118,13 +4115,12 @@ msgstr "" #, fuzzy msgid "" "To make the *lru_cache* approach work when the *station_id* is mutable, the " -"class needs to define the :meth:`~object.__eq__` " -"and :meth:`~object.__hash__` methods so that the cache can detect relevant " -"attribute updates::" +"class needs to define the :meth:`~object.__eq__` and :meth:`~object." +"__hash__` methods so that the cache can detect relevant attribute updates::" msgstr "" -"要在 *station_id* 可變時使 *lru_cache* 方法起作用,該類別需要定" -"義 :meth:`~object.__eq__` 和 :meth:`~object.__hash__` 方法,以便快取可以檢測" -"相關屬性更新: ::" +"要在 *station_id* 可變時使 *lru_cache* 方法起作用,該類別需要定義 :meth:" +"`~object.__eq__` 和 :meth:`~object.__hash__` 方法,以便快取可以檢測相關屬性更" +"新: ::" #: ../../faq/programming.rst:2053 msgid "" @@ -4171,8 +4167,8 @@ msgstr "" "第一次引入模組時(或者源檔案自建立目前編譯檔案後發生更改時)應在 " "``__pycache__`` 的子目錄中建立包含編譯程式碼的 ``.pyc`` 檔案包含 .py 檔案的目" "錄。 ``.pyc`` 檔案的檔案名以與``.py`` 檔案相同的名稱開頭,以``.pyc`` 結尾,中" -"間部分依賴於特定的``python `` 建立它的二進製檔案。(有關詳細資訊,請參" -"閱 :pep:`3147`。)" +"間部分依賴於特定的``python `` 建立它的二進製檔案。(有關詳細資訊,請參閱 :" +"pep:`3147`。)" #: ../../faq/programming.rst:2088 #, fuzzy @@ -4203,10 +4199,10 @@ msgstr "" #: ../../faq/programming.rst:2098 #, fuzzy msgid "" -"Running Python on a top level script is not considered an import and no " -"``.pyc`` will be created. For example, if you have a top-level module " -"``foo.py`` that imports another module ``xyz.py``, when you run ``foo`` (by " -"typing ``python foo.py`` as a shell command), a ``.pyc`` will be created for " +"Running Python on a top level script is not considered an import and no ``." +"pyc`` will be created. For example, if you have a top-level module ``foo." +"py`` that imports another module ``xyz.py``, when you run ``foo`` (by typing " +"``python foo.py`` as a shell command), a ``.pyc`` will be created for " "``xyz`` because ``xyz`` is imported, but no ``.pyc`` file will be created " "for ``foo`` since ``foo.py`` isn't being imported." msgstr "" @@ -4217,9 +4213,9 @@ msgstr "" #: ../../faq/programming.rst:2105 msgid "" -"If you need to create a ``.pyc`` file for ``foo`` -- that is, to create a " -"``.pyc`` file for a module that is not imported -- you can, using " -"the :mod:`py_compile` and :mod:`compileall` modules." +"If you need to create a ``.pyc`` file for ``foo`` -- that is, to create a ``." +"pyc`` file for a module that is not imported -- you can, using the :mod:" +"`py_compile` and :mod:`compileall` modules." msgstr "" "如果你需要為 ``foo`` 建立一個 ``.pyc`` 檔案 —— 也就是說,要為一個未引入的模組" "建立一個 ``.pyc`` 檔案 —— 你可以使用 :mod:`py_compile` 和 :mod:`compileall` " @@ -4397,11 +4393,11 @@ msgstr "此問題有(至少)三種可能的解決方法。" #: ../../faq/programming.rst:2178 #, fuzzy msgid "" -"Guido van Rossum recommends avoiding all uses of ``from " -"import ...``, and placing all code inside functions. Initializations of " -"global variables and class variables should use constants or built-in " -"functions only. This means everything from an imported module is referenced " -"as ``.``." +"Guido van Rossum recommends avoiding all uses of ``from import ..." +"``, and placing all code inside functions. Initializations of global " +"variables and class variables should use constants or built-in functions " +"only. This means everything from an imported module is referenced as " +"``.``." msgstr "" "Guido van Rossum 建議避免使用``from import ...``,並將所有程式碼放在" "函式中。全域變數和類別變數的初始化應該只使用常數或內建函式。這意味著來自引入" diff --git a/library/contextvars.po b/library/contextvars.po index e696043c84..07ceff6807 100644 --- a/library/contextvars.po +++ b/library/contextvars.po @@ -4,7 +4,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-01-27 00:17+0000\n" "PO-Revision-Date: 2025-07-30 22:06+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,15 +28,15 @@ msgid "" "context in asynchronous frameworks." msgstr "" "本模組供 API 來管理、儲存及存取單一情境各自的狀態(context-local state)。 " -"用 :class:`~contextvars.ContextVar` 類別宣告和處理\\ *情境變數" -"*。 :func:`~contextvars.copy_context` 函式和 :class:`~contextvars.Context` 類" -"別應在非同步框架中管理目前的情境。" +"用 :class:`~contextvars.ContextVar` 類別宣告和處理\\ *情境變數*。 :func:" +"`~contextvars.copy_context` 函式和 :class:`~contextvars.Context` 類別應在非同" +"步框架中管理目前的情境。" #: ../../library/contextvars.rst:17 msgid "" -"Context managers that have state should use Context Variables instead " -"of :func:`threading.local` to prevent their state from bleeding to other " -"code unexpectedly, when used in concurrent code." +"Context managers that have state should use Context Variables instead of :" +"func:`threading.local` to prevent their state from bleeding to other code " +"unexpectedly, when used in concurrent code." msgstr "" "帶有狀態的 Context Manager 應該使用情境變數,而不是 :func:`threading.local`," "才能防止它們的狀態在並行(concurrent)程式碼中使用時意外外溢並干擾到其他程式" @@ -65,9 +65,9 @@ msgstr "必要參數 *name* 用於自我檢查(introspection)和除錯。" #: ../../library/contextvars.rst:38 msgid "" -"The optional keyword-only *default* parameter is returned " -"by :meth:`ContextVar.get` when no value for the variable is found in the " -"current context." +"The optional keyword-only *default* parameter is returned by :meth:" +"`ContextVar.get` when no value for the variable is found in the current " +"context." msgstr "" "當在目前的情境中找不到變數的值時,:meth:`ContextVar.get` 會回傳可選的僅限關鍵" "字參數 *default*。" @@ -127,20 +127,71 @@ msgid "" "Returns a :class:`~contextvars.Token` object that can be used to restore the " "variable to its previous value via the :meth:`ContextVar.reset` method." msgstr "" -"回傳一個 :class:`~contextvars.Token` 物件,該物件可透" -"過 :meth:`ContextVar.reset` 方法,用來將變數還原到之前的值。" +"回傳一個 :class:`~contextvars.Token` 物件,該物件可透過 :meth:`ContextVar." +"reset` 方法,用來將變數還原到之前的值。" -#: ../../library/contextvars.rst:82 +#: ../../library/contextvars.rst:80 msgid "" -"Reset the context variable to the value it had before " -"the :meth:`ContextVar.set` that created the *token* was used." +"For convenience, the token object can be used as a context manager to avoid " +"calling :meth:`ContextVar.reset` manually::" +msgstr "" + +#: ../../library/contextvars.rst:83 +msgid "" +"var = ContextVar('var', default='default value')\n" +"\n" +"with var.set('new value'):\n" +" assert var.get() == 'new value'\n" +"\n" +"assert var.get() == 'default value'" +msgstr "" +"var = ContextVar('var', default='default value')\n" +"\n" +"with var.set('new value'):\n" +" assert var.get() == 'new value'\n" +"\n" +"assert var.get() == 'default value'" + +#: ../../library/contextvars.rst:90 +msgid "It is a shorthand for::" +msgstr "" + +#: ../../library/contextvars.rst:92 +#, fuzzy +msgid "" +"var = ContextVar('var', default='default value')\n" +"\n" +"token = var.set('new value')\n" +"try:\n" +" assert var.get() == 'new value'\n" +"finally:\n" +" var.reset(token)\n" +"\n" +"assert var.get() == 'default value'" +msgstr "" +"var = ContextVar('var', default='default value')\n" +"\n" +"with var.set('new value'):\n" +" assert var.get() == 'new value'\n" +"\n" +"assert var.get() == 'default value'" + +#: ../../library/contextvars.rst:104 +#, fuzzy +msgid "Added support for using tokens as context managers." +msgstr "新增對用作情境管理器的支援。" + +#: ../../library/contextvars.rst:108 +msgid "" +"Reset the context variable to the value it had before the :meth:`ContextVar." +"set` that created the *token* was used." msgstr "將情境變數重設為使用 :meth:`ContextVar.set` 建立 *token* 前的值。" -#: ../../library/contextvars.rst:85 +#: ../../library/contextvars.rst:111 msgid "For example::" msgstr "舉例來說: ::" -#: ../../library/contextvars.rst:87 +#: ../../library/contextvars.rst:113 msgid "" "var = ContextVar('var')\n" "\n" @@ -160,78 +211,60 @@ msgstr "" "# 在重設呼叫之後,var 又沒有值了,所以\n" "# var.get() 會引發 LookupError。" -#: ../../library/contextvars.rst:99 +#: ../../library/contextvars.rst:125 msgid "" "*Token* objects are returned by the :meth:`ContextVar.set` method. They can " "be passed to the :meth:`ContextVar.reset` method to revert the value of the " "variable to what it was before the corresponding *set*." msgstr "" -"*Token* 物件由 :meth:`ContextVar.set` 方法回傳,可以傳遞" -"給 :meth:`ContextVar.reset` 方法,用以將變數的值還原為相對應的 *set* 之前的" -"值。" +"*Token* 物件由 :meth:`ContextVar.set` 方法回傳,可以傳遞給 :meth:`ContextVar." +"reset` 方法,用以將變數的值還原為相對應的 *set* 之前的值。" -#: ../../library/contextvars.rst:104 +#: ../../library/contextvars.rst:130 msgid "" -"The token supports :ref:`context manager protocol ` to " -"restore the corresponding context variable value at the exit " -"from :keyword:`with` block::" +"Tokens support the :ref:`context manager protocol ` to " +"automatically reset context variables. See :meth:`ContextVar.set`." msgstr "" -#: ../../library/contextvars.rst:108 -msgid "" -"var = ContextVar('var', default='default value')\n" -"\n" -"with var.set('new value'):\n" -" assert var.get() == 'new value'\n" -"\n" -"assert var.get() == 'default value'" -msgstr "" -"var = ContextVar('var', default='default value')\n" -"\n" -"with var.set('new value'):\n" -" assert var.get() == 'new value'\n" -"\n" -"assert var.get() == 'default value'" - -#: ../../library/contextvars.rst:117 +#: ../../library/contextvars.rst:135 msgid "Added support for usage as a context manager." msgstr "新增對用作情境管理器的支援。" -#: ../../library/contextvars.rst:121 +#: ../../library/contextvars.rst:139 msgid "" "A read-only property. Points to the :class:`ContextVar` object that created " "the token." msgstr "唯讀屬性。 指向建立 token 的 :class:`ContextVar` 物件。" -#: ../../library/contextvars.rst:126 +#: ../../library/contextvars.rst:144 msgid "" -"A read-only property. Set to the value the variable had before " -"the :meth:`ContextVar.set` method call that created the token. It points " -"to :attr:`Token.MISSING` if the variable was not set before the call." +"A read-only property. Set to the value the variable had before the :meth:" +"`ContextVar.set` method call that created the token. It points to :attr:" +"`Token.MISSING` if the variable was not set before the call." msgstr "" "唯讀屬性。 值為變數在呼叫 :meth:`ContextVar.set` 方法之前的值。如果變數在呼叫" "前沒有設定,則指向 :attr:`Token.MISSING`。" -#: ../../library/contextvars.rst:133 +#: ../../library/contextvars.rst:151 msgid "A marker object used by :attr:`Token.old_value`." msgstr "由 :attr:`Token.old_value` 使用的標記物件。" -#: ../../library/contextvars.rst:137 +#: ../../library/contextvars.rst:155 msgid "Manual Context Management" msgstr "手動情境管理" -#: ../../library/contextvars.rst:141 +#: ../../library/contextvars.rst:159 msgid "Returns a copy of the current :class:`~contextvars.Context` object." msgstr "回傳目前 :class:`~contextvars.Context` 物件的複本(copy)。" -#: ../../library/contextvars.rst:143 +#: ../../library/contextvars.rst:161 msgid "" "The following snippet gets a copy of the current context and prints all " "variables and their values that are set in it::" msgstr "" "以下程式碼片段會取得目前情境的複本,並顯示在其中設定的所有變數及其值:::" -#: ../../library/contextvars.rst:146 +#: ../../library/contextvars.rst:164 msgid "" "ctx: Context = copy_context()\n" "print(list(ctx.items()))" @@ -239,7 +272,7 @@ msgstr "" "ctx: Context = copy_context()\n" "print(list(ctx.items()))" -#: ../../library/contextvars.rst:149 +#: ../../library/contextvars.rst:167 msgid "" "The function has an *O*\\ (1) complexity, i.e. works equally fast for " "contexts with a few context variables and for contexts that have a lot of " @@ -248,30 +281,30 @@ msgstr "" "這個函式具有 *O*\\ (1) 的複雜度,也就是說,對於只有少許情境變數的情境和有大量" "情境變數的情境,速度都一樣快。" -#: ../../library/contextvars.rst:156 +#: ../../library/contextvars.rst:174 msgid "A mapping of :class:`ContextVars ` to their values." msgstr ":class:`ContextVars` 到其值的映射。" -#: ../../library/contextvars.rst:158 +#: ../../library/contextvars.rst:176 msgid "" "``Context()`` creates an empty context with no values in it. To get a copy " "of the current context use the :func:`~contextvars.copy_context` function." msgstr "" -"``Context()`` 會建立一個沒有值的空情境。要取得目前情境的複本,請使" -"用 :func:`~contextvars.copy_context` 函式。" +"``Context()`` 會建立一個沒有值的空情境。要取得目前情境的複本,請使用 :func:" +"`~contextvars.copy_context` 函式。" -#: ../../library/contextvars.rst:162 +#: ../../library/contextvars.rst:180 msgid "" -"Each thread has its own effective stack of :class:`!Context` objects. " -"The :term:`current context` is the :class:`!Context` object at the top of " -"the current thread's stack. All :class:`!Context` objects in the stacks are " +"Each thread has its own effective stack of :class:`!Context` objects. The :" +"term:`current context` is the :class:`!Context` object at the top of the " +"current thread's stack. All :class:`!Context` objects in the stacks are " "considered to be *entered*." msgstr "" -"每個執行緒都有自己的 :class:`!Context` 物件中目前主控中的堆疊" -"(stack)。:term:`current context` 是目前執行緒堆疊頂端的 :class:`!Context` " -"物件。 堆疊中的所有 :class:`!Context` 物件都被視為\\ *已進入*。" +"每個執行緒都有自己的 :class:`!Context` 物件中目前主控中的堆疊(stack)。:" +"term:`current context` 是目前執行緒堆疊頂端的 :class:`!Context` 物件。 堆疊" +"中的所有 :class:`!Context` 物件都被視為\\ *已進入*。" -#: ../../library/contextvars.rst:167 +#: ../../library/contextvars.rst:185 msgid "" "*Entering* a context, which can be done by calling its :meth:`~Context.run` " "method, makes the context the current context by pushing it onto the top of " @@ -280,7 +313,7 @@ msgstr "" "*進入*\\ 一個情境,可以藉由呼叫其 :meth:`~Context.run` 方法來完成,此\\ *進入" "*\\ 的動作會將一情境推到目前執行緒的情境堆疊的頂端,使該情境成為目前的情境。" -#: ../../library/contextvars.rst:171 +#: ../../library/contextvars.rst:189 msgid "" "*Exiting* from the current context, which can be done by returning from the " "callback passed to the :meth:`~Context.run` method, restores the current " @@ -291,28 +324,28 @@ msgstr "" "式回傳之後,就會自動\\ *退出*\\ 目前的情境,這會將目前的情境還原到進入情境之" "前的狀態,方法是將情境從情境堆疊的頂端彈出。" -#: ../../library/contextvars.rst:176 +#: ../../library/contextvars.rst:194 msgid "" "Since each thread has its own context stack, :class:`ContextVar` objects " "behave in a similar fashion to :func:`threading.local` when values are " "assigned in different threads." msgstr "" -"因為每個執行緒都有自己的情境堆疊,當值在不同的執行緒中被指定" -"時, :class:`ContextVar` 物件的行為與 :func:`threading.local` 相似。" +"因為每個執行緒都有自己的情境堆疊,當值在不同的執行緒中被指定時, :class:" +"`ContextVar` 物件的行為與 :func:`threading.local` 相似。" -#: ../../library/contextvars.rst:180 +#: ../../library/contextvars.rst:198 msgid "" "Attempting to enter an already entered context, including contexts entered " "in other threads, raises a :exc:`RuntimeError`." msgstr "" -"嘗試進入已進入的情境,包括在其他執行緒中進入的情境,會引" -"發 :exc:`RuntimeError`。" +"嘗試進入已進入的情境,包括在其他執行緒中進入的情境,會引發 :exc:" +"`RuntimeError`。" -#: ../../library/contextvars.rst:183 +#: ../../library/contextvars.rst:201 msgid "After exiting a context, it can later be re-entered (from any thread)." msgstr "退出情境後,之後可以重新進入(從任何執行緒)。" -#: ../../library/contextvars.rst:185 +#: ../../library/contextvars.rst:203 msgid "" "Any changes to :class:`ContextVar` values via the :meth:`ContextVar.set` " "method are recorded in the current context. The :meth:`ContextVar.get` " @@ -326,11 +359,11 @@ msgstr "" "實際造成的效果會像是將其在進入情境時對情境變數所做的任何變一一彈出並還原(如" "果需要,可以透過重新進入情境來還原值)。" -#: ../../library/contextvars.rst:192 +#: ../../library/contextvars.rst:210 msgid "Context implements the :class:`collections.abc.Mapping` interface." msgstr "情境(Context)實作了 :class:`collections.abc.Mapping` 介面。" -#: ../../library/contextvars.rst:196 +#: ../../library/contextvars.rst:214 msgid "" "Enters the Context, executes ``callable(*args, **kwargs)``, then exits the " "Context. Returns *callable*'s return value, or propagates an exception if " @@ -339,11 +372,11 @@ msgstr "" "進入 Context,執行 ``callable(*args, **kwargs)``,然後退出 Context。 回傳 " "*callable* 的回傳值,如果發生例外(exception),則傳播例外。" -#: ../../library/contextvars.rst:200 +#: ../../library/contextvars.rst:218 msgid "Example:" msgstr "例如:" -#: ../../library/contextvars.rst:202 +#: ../../library/contextvars.rst:220 msgid "" "import contextvars\n" "\n" @@ -407,18 +440,18 @@ msgstr "" "# 但是,在 'ctx' 外, 'var' 的值仍然是 'spam':\n" "print(var.get()) # 'spam'" -#: ../../library/contextvars.rst:248 +#: ../../library/contextvars.rst:266 msgid "Return a shallow copy of the context object." msgstr "回傳情境物件的淺層複本(shallow copy)。" -#: ../../library/contextvars.rst:252 +#: ../../library/contextvars.rst:270 msgid "" "Return ``True`` if the *context* has a value for *var* set; return ``False`` " "otherwise." msgstr "" "如果\\ *情境*\\ 裡面有 *var* 的值,則回傳 ``True``,否則回傳 ``False``。" -#: ../../library/contextvars.rst:257 +#: ../../library/contextvars.rst:275 msgid "" "Return the value of the *var* :class:`ContextVar` variable. If the variable " "is not set in the context object, a :exc:`KeyError` is raised." @@ -426,7 +459,7 @@ msgstr "" "回傳 *var* :class:`ContextVar` 變數的值。如果該變數並沒有在情境物件中設定,則" "會引發 :exc:`KeyError` 錯誤。" -#: ../../library/contextvars.rst:263 +#: ../../library/contextvars.rst:281 msgid "" "Return the value for *var* if *var* has the value in the context object. " "Return *default* otherwise. If *default* is not given, return ``None``." @@ -434,33 +467,33 @@ msgstr "" "如果 *var* 的值在情境物件中,則回傳 *var* 的值。否則回傳 *default*。如果沒有 " "*default* 值,則回傳 ``None``。" -#: ../../library/contextvars.rst:269 +#: ../../library/contextvars.rst:287 msgid "Return an iterator over the variables stored in the context object." msgstr "回傳儲存於情境物件中變數的疊代器。" -#: ../../library/contextvars.rst:274 +#: ../../library/contextvars.rst:292 msgid "Return the number of variables set in the context object." msgstr "回傳情境物件中的變數個數。" -#: ../../library/contextvars.rst:278 +#: ../../library/contextvars.rst:296 msgid "Return a list of all variables in the context object." msgstr "回傳情境物件中所有變數的串列。" -#: ../../library/contextvars.rst:282 +#: ../../library/contextvars.rst:300 msgid "Return a list of all variables' values in the context object." msgstr "回傳情境物件中所有變數的值的串列。" -#: ../../library/contextvars.rst:287 +#: ../../library/contextvars.rst:305 msgid "" "Return a list of 2-tuples containing all variables and their values in the " "context object." msgstr "回傳情境物件中所有變數與其值的 2-元組(2-tuples)的串列。" -#: ../../library/contextvars.rst:292 +#: ../../library/contextvars.rst:310 msgid "asyncio support" msgstr "對 asyncio 的支援" -#: ../../library/contextvars.rst:294 +#: ../../library/contextvars.rst:312 msgid "" "Context variables are natively supported in :mod:`asyncio` and are ready to " "be used without any extra configuration. For example, here is a simple echo " @@ -470,7 +503,7 @@ msgstr "" ":mod:`asyncio` 原生支援情境變數,不需任何額外設定。 舉例來說,以下是一個簡單" "的 echo 伺服器,使用情境變數讓遠端用戶端的位址在處理該用戶端的任務中可用:" -#: ../../library/contextvars.rst:300 +#: ../../library/contextvars.rst:318 msgid "" "import asyncio\n" "import contextvars\n" diff --git a/library/os.po b/library/os.po index f97093cb3c..4cfda9d099 100644 --- a/library/os.po +++ b/library/os.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-07 00:14+0000\n" +"POT-Creation-Date: 2026-01-27 00:17+0000\n" "PO-Revision-Date: 2024-04-29 15:24+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -4408,7 +4408,7 @@ msgid "" "import os\n" "\n" "# semaphore with start value '1'\n" -"fd = os.eventfd(1, os.EFD_SEMAPHORE | os.EFC_CLOEXEC)\n" +"fd = os.eventfd(1, os.EFD_SEMAPHORE | os.EFD_CLOEXEC)\n" "try:\n" " # acquire semaphore\n" " v = os.eventfd_read(fd)\n" diff --git a/library/pickle.po b/library/pickle.po index 035cdbf6eb..0aeb4c5403 100644 --- a/library/pickle.po +++ b/library/pickle.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-01-27 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -39,9 +39,9 @@ msgid "" "The :mod:`pickle` module implements binary protocols for serializing and de-" "serializing a Python object structure. *\"Pickling\"* is the process " "whereby a Python object hierarchy is converted into a byte stream, and " -"*\"unpickling\"* is the inverse operation, whereby a byte stream (from " -"a :term:`binary file` or :term:`bytes-like object`) is converted back into " -"an object hierarchy. Pickling (and unpickling) is alternatively known as " +"*\"unpickling\"* is the inverse operation, whereby a byte stream (from a :" +"term:`binary file` or :term:`bytes-like object`) is converted back into an " +"object hierarchy. Pickling (and unpickling) is alternatively known as " "\"serialization\", \"marshalling,\" [#]_ or \"flattening\"; however, to " "avoid confusion, the terms used here are \"pickling\" and \"unpickling\"." msgstr "" @@ -92,12 +92,12 @@ msgstr "和 ``marshal`` 的比較" msgid "" "Python has a more primitive serialization module called :mod:`marshal`, but " "in general :mod:`pickle` should always be the preferred way to serialize " -"Python objects. :mod:`marshal` exists primarily to support " -"Python's :file:`.pyc` files." +"Python objects. :mod:`marshal` exists primarily to support Python's :file:`." +"pyc` files." msgstr "" "Python 有另一個比較原始的序列化模組叫 :mod:`marshal`,不過其設計目的是為了支" -"援 Python 的預編譯功能 :file:`.pyc` 的運作。總地來說,請盡可能地使" -"用 :mod:`pickle`,沒事不要用 :mod:`marshal`。" +"援 Python 的預編譯功能 :file:`.pyc` 的運作。總地來說,請盡可能地使用 :mod:" +"`pickle`,沒事不要用 :mod:`marshal`。" #: ../../library/pickle.rst:57 msgid "" @@ -107,33 +107,6 @@ msgstr ":mod:`pickle` 和 :mod:`marshal` 有幾個明顯不同的地方:" #: ../../library/pickle.rst:59 msgid "" -"The :mod:`pickle` module keeps track of the objects it has already " -"serialized, so that later references to the same object won't be serialized " -"again. :mod:`marshal` doesn't do this." -msgstr "" -":mod:`pickle` 會記住哪些物件已經被序列化過了,稍後再次參照到這個物件的時候才" -"不會進行重複的序列化。:mod:`marshal` 沒有這個功能。" - -#: ../../library/pickle.rst:63 -msgid "" -"This has implications both for recursive objects and object sharing. " -"Recursive objects are objects that contain references to themselves. These " -"are not handled by marshal, and in fact, attempting to marshal recursive " -"objects will crash your Python interpreter. Object sharing happens when " -"there are multiple references to the same object in different places in the " -"object hierarchy being serialized. :mod:`pickle` stores such objects only " -"once, and ensures that all other references point to the master copy. " -"Shared objects remain shared, which can be very important for mutable " -"objects." -msgstr "" -"這對遞迴物件和物件共用都有影響。遞迴物件是指包含自我參照的物件。這些情況在 " -"marshal 模組中不會被處理,若嘗試使用 marshal 處理遞迴物件會導致 Python 直譯器" -"崩潰。物件共用發生在序列化的物件階層中、不同位置對同一物件有多個參照" -"時。:mod:`pickle` 只會儲存這個被參照的物件一次,並確保所有其他參照指向這個主" -"要的版本。共用的物件會保持共用,這對於可變(mutable)物件來說非常重要。" - -#: ../../library/pickle.rst:72 -msgid "" ":mod:`marshal` cannot be used to serialize user-defined classes and their " "instances. :mod:`pickle` can save and restore class instances " "transparently, however the class definition must be importable and live in " @@ -143,17 +116,17 @@ msgstr "" "者儲存並還原自訂的類別實例,前提是儲存時該類別的定義存在於與要被儲存的物件所" "在的模組中、且可以被引入(import)。" -#: ../../library/pickle.rst:77 +#: ../../library/pickle.rst:64 msgid "" "The :mod:`marshal` serialization format is not guaranteed to be portable " -"across Python versions. Because its primary job in life is to " -"support :file:`.pyc` files, the Python implementers reserve the right to " -"change the serialization format in non-backwards compatible ways should the " -"need arise. The :mod:`pickle` serialization format is guaranteed to be " -"backwards compatible across Python releases provided a compatible pickle " -"protocol is chosen and pickling and unpickling code deals with Python 2 to " -"Python 3 type differences if your data is crossing that unique breaking " -"change language boundary." +"across Python versions. Because its primary job in life is to support :file:" +"`.pyc` files, the Python implementers reserve the right to change the " +"serialization format in non-backwards compatible ways should the need arise. " +"The :mod:`pickle` serialization format is guaranteed to be backwards " +"compatible across Python releases provided a compatible pickle protocol is " +"chosen and pickling and unpickling code deals with Python 2 to Python 3 type " +"differences if your data is crossing that unique breaking change language " +"boundary." msgstr "" ":mod:`marshal` 序列化格式無法保證能在不同版本的 Python 之間移植。因為其主要的" "作用是支援 :file:`.pyc` 檔案的運作,Python 的實作人員會在需要時實作無法前向相" @@ -161,11 +134,11 @@ msgstr "" "3 之間的資料類型差異,:mod:`pickle` 序列化協定能保證在不同 Python 版本間的相" "容性。" -#: ../../library/pickle.rst:90 +#: ../../library/pickle.rst:77 msgid "Comparison with ``json``" msgstr "和 ``json`` 的比較" -#: ../../library/pickle.rst:92 +#: ../../library/pickle.rst:79 msgid "" "There are fundamental differences between the pickle protocols and `JSON " "(JavaScript Object Notation) `_:" @@ -173,7 +146,7 @@ msgstr "" "pickle 協定和 `JSON (JavaScript Object Notation) `_ 有一些" "根本上的不同:" -#: ../../library/pickle.rst:95 +#: ../../library/pickle.rst:82 msgid "" "JSON is a text serialization format (it outputs unicode text, although most " "of the time it is then encoded to ``utf-8``), while pickle is a binary " @@ -182,11 +155,11 @@ msgstr "" "JSON 以文字形式作為序列化的輸出(輸出 unicode 文字,但大多數又會被編碼為 " "``UTF-8``),而 pickle 則是以二進位形式作為序列化的輸出;" -#: ../../library/pickle.rst:99 +#: ../../library/pickle.rst:86 msgid "JSON is human-readable, while pickle is not;" msgstr "JSON 是人類可讀的,而 pickle 則無法;" -#: ../../library/pickle.rst:101 +#: ../../library/pickle.rst:88 msgid "" "JSON is interoperable and widely used outside of the Python ecosystem, while " "pickle is Python-specific;" @@ -200,19 +173,19 @@ msgstr "" # https://zh.wikipedia.org/wiki/%E5%86%85%E7%9C%81_(%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%A7%91%E5%AD%A6) # https://book.pythontips.com/en/latest/object_introspection.html # https://www.geeksforgeeks.org/code-introspection-in-python/ -#: ../../library/pickle.rst:104 +#: ../../library/pickle.rst:91 msgid "" "JSON, by default, can only represent a subset of the Python built-in types, " "and no custom classes; pickle can represent an extremely large number of " "Python types (many of them automatically, by clever usage of Python's " -"introspection facilities; complex cases can be tackled by " -"implementing :ref:`specific object APIs `);" +"introspection facilities; complex cases can be tackled by implementing :ref:" +"`specific object APIs `);" msgstr "" "預設狀態下的 JSON 只能紀錄一小部份的 Python 內建型別,且無法紀錄自訂類別;但" "透過 Python 的自省措施,pickle 可以紀錄絕大多數的 Python 型別(其他比較複雜的" "狀況也可以透過實作 :ref:`specific object APIs ` 來解決);" -#: ../../library/pickle.rst:110 +#: ../../library/pickle.rst:97 msgid "" "Unlike pickle, deserializing untrusted JSON does not in itself create an " "arbitrary code execution vulnerability." @@ -220,7 +193,7 @@ msgstr "" "去序列化不安全的 JSON 不會產生任意程式執行的風險,但去序列化不安全的 pickle " "會。" -#: ../../library/pickle.rst:114 +#: ../../library/pickle.rst:101 msgid "" "The :mod:`json` module: a standard library module allowing JSON " "serialization and deserialization." @@ -228,11 +201,11 @@ msgstr "" ":mod:`json` module: 是標準函式庫的一部分,可讓使用者進行 JSON 的序列化與去序" "列化。" -#: ../../library/pickle.rst:121 +#: ../../library/pickle.rst:108 msgid "Data stream format" msgstr "資料串流格式" -#: ../../library/pickle.rst:126 +#: ../../library/pickle.rst:113 msgid "" "The data format used by :mod:`pickle` is Python-specific. This has the " "advantage that there are no restrictions imposed by external standards such " @@ -243,7 +216,7 @@ msgstr "" "(像是 JSON,無法紀錄指標共用)的限制;不過這也代表其他不是 Python 的程式可能" "無法重建 pickle 封裝的 Python 物件。" -#: ../../library/pickle.rst:131 +#: ../../library/pickle.rst:118 msgid "" "By default, the :mod:`pickle` data format uses a relatively compact binary " "representation. If you need optimal size characteristics, you can " @@ -252,17 +225,16 @@ msgstr "" "以預設設定來說,:mod:`pickle` 使用相對緊湊的二進位形式來儲存資料。如果你需要" "盡可能地縮小檔案大小,你可以\\ :doc:`壓縮 `\\ 封裝的資料。" -#: ../../library/pickle.rst:135 +#: ../../library/pickle.rst:122 msgid "" "The module :mod:`pickletools` contains tools for analyzing data streams " "generated by :mod:`pickle`. :mod:`pickletools` source code has extensive " "comments about opcodes used by pickle protocols." msgstr "" -":mod:`pickletools` 含有工具可分析 :mod:`pickle` 所產生的資料" -"流。:mod:`pickletools` 的源始碼詳細地記載了所有 pickle 協定的操作碼" -"(opcode)。" +":mod:`pickletools` 含有工具可分析 :mod:`pickle` 所產生的資料流。:mod:" +"`pickletools` 的源始碼詳細地記載了所有 pickle 協定的操作碼(opcode)。" -#: ../../library/pickle.rst:139 +#: ../../library/pickle.rst:126 msgid "" "There are currently 6 different protocols which can be used for pickling. " "The higher the protocol used, the more recent the version of Python needed " @@ -271,20 +243,20 @@ msgstr "" "截至目前為止,共有六種不同版本的協定可用於封裝 pickle。數字越大版本代表你需要" "使用越新的 Python 版本來拆封相應的 pickle 封裝。" -#: ../../library/pickle.rst:143 +#: ../../library/pickle.rst:130 msgid "" "Protocol version 0 is the original \"human-readable\" protocol and is " "backwards compatible with earlier versions of Python." msgstr "" "版本 0 的協定是最初「人類可讀」的版本,且可以向前支援早期版本的 Python。" -#: ../../library/pickle.rst:146 +#: ../../library/pickle.rst:133 msgid "" "Protocol version 1 is an old binary format which is also compatible with " "earlier versions of Python." msgstr "版本 1 的協定使用舊的二進位格式,一樣能向前支援早期版本的 Python。" -#: ../../library/pickle.rst:149 +#: ../../library/pickle.rst:136 msgid "" "Protocol version 2 was introduced in Python 2.3. It provides much more " "efficient pickling of :term:`new-style classes `. Refer " @@ -294,27 +266,27 @@ msgstr "" "classes ` 封裝過程。請參閱 :pep:`307` 以了解版本 2 帶來的改" "進。" -#: ../../library/pickle.rst:153 +#: ../../library/pickle.rst:140 msgid "" -"Protocol version 3 was added in Python 3.0. It has explicit support " -"for :class:`bytes` objects and cannot be unpickled by Python 2.x. This was " -"the default protocol in Python 3.0--3.7." +"Protocol version 3 was added in Python 3.0. It has explicit support for :" +"class:`bytes` objects and cannot be unpickled by Python 2.x. This was the " +"default protocol in Python 3.0--3.7." msgstr "" "版本 3 的協定在 Python 3.0 被新增。現在能支援封裝 :class:`bytes` 的物件且無法" "被 2.x 版本的 Python 拆封。在 3.0~3.7 的 Python 預設使用 3 版協定。" -#: ../../library/pickle.rst:157 +#: ../../library/pickle.rst:144 msgid "" "Protocol version 4 was added in Python 3.4. It adds support for very large " "objects, pickling more kinds of objects, and some data format " -"optimizations. This was the default protocol in Python 3.8--3.13. Refer " -"to :pep:`3154` for information about improvements brought by protocol 4." +"optimizations. This was the default protocol in Python 3.8--3.13. Refer to :" +"pep:`3154` for information about improvements brought by protocol 4." msgstr "" "版本 4 的協定在 Python 3.4 被新增。現在能支援超大物件的封裝、更多種型別的物件" -"以及針對部份資料格式的儲存進行最佳化。從 Python 3.8 到 3.13,預設使用第 4 版協定。" -"請參閱 :pep:`3154` 以了解第 4 版協定改進的細節。" +"以及針對部份資料格式的儲存進行最佳化。從 Python 3.8 到 3.13,預設使用第 4 版" +"協定。請參閱 :pep:`3154` 以了解第 4 版協定改進的細節。" -#: ../../library/pickle.rst:163 +#: ../../library/pickle.rst:150 msgid "" "Protocol version 5 was added in Python 3.8. It adds support for out-of-band " "data and speedup for in-band data. It is the default protocol starting with " @@ -322,7 +294,8 @@ msgid "" "by protocol 5." msgstr "" "版本 5 的協定在 Python 3.8 被新增。現在能支援帶外資料(Out-of-band data)並加" -"速帶內資料的處理速度。自 3.14 起這是預設使用的協定。請參閱 :pep:`574` 以了解第 5 版協定改進的細節。" +"速帶內資料的處理速度。自 3.14 起這是預設使用的協定。請參閱 :pep:`574` 以了解" +"第 5 版協定改進的細節。" # SkyLull: [T] # persistent -> 持久 @@ -331,11 +304,11 @@ msgstr "" # tw/%E5%8F%AF%E6%8C%81%E4%B9%85%E5%8C%96%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84 # https://1fly2sky.wordpress.com/2016/04/05/%E6%8C%81%E4%B9%85%E5%B1%A4data- # persistence-layer/ -#: ../../library/pickle.rst:169 +#: ../../library/pickle.rst:156 msgid "" -"Serialization is a more primitive notion than persistence; " -"although :mod:`pickle` reads and writes file objects, it does not handle the " -"issue of naming persistent objects, nor the (even more complicated) issue of " +"Serialization is a more primitive notion than persistence; although :mod:" +"`pickle` reads and writes file objects, it does not handle the issue of " +"naming persistent objects, nor the (even more complicated) issue of " "concurrent access to persistent objects. The :mod:`pickle` module can " "transform a complex object into a byte stream and it can transform the byte " "stream into an object with the same internal structure. Perhaps the most " @@ -352,71 +325,70 @@ msgstr "" "提供了一個簡單的介面來讓使用者在 DBM 風格的資料庫檔案中對物件進行封裝和拆封的" "操作。" -#: ../../library/pickle.rst:182 +#: ../../library/pickle.rst:169 msgid "Module Interface" msgstr "模組介面" -#: ../../library/pickle.rst:184 +#: ../../library/pickle.rst:171 msgid "" "To serialize an object hierarchy, you simply call the :func:`dumps` " -"function. Similarly, to de-serialize a data stream, you call " -"the :func:`loads` function. However, if you want more control over " -"serialization and de-serialization, you can create a :class:`Pickler` or " -"an :class:`Unpickler` object, respectively." +"function. Similarly, to de-serialize a data stream, you call the :func:" +"`loads` function. However, if you want more control over serialization and " +"de-serialization, you can create a :class:`Pickler` or an :class:`Unpickler` " +"object, respectively." msgstr "" "想要序列化一個物件,你只需要呼叫 :func:`dumps` 函式。而當你想要去序列化一個資" "料流時,你只需要呼叫 :func:`loads` 即可。不過,若你希望能各自對序列化和去序列" -"化的過程中有更多的掌控度,你可以自訂一個 :class:`Pickler` " -"或 :class:`Unpickler` 物件。" +"化的過程中有更多的掌控度,你可以自訂一個 :class:`Pickler` 或 :class:" +"`Unpickler` 物件。" -#: ../../library/pickle.rst:189 +#: ../../library/pickle.rst:176 msgid "The :mod:`pickle` module provides the following constants:" msgstr ":mod:`pickle` 模組提供以下常數:" -#: ../../library/pickle.rst:194 +#: ../../library/pickle.rst:181 msgid "" "An integer, the highest :ref:`protocol version ` " -"available. This value can be passed as a *protocol* value to " -"functions :func:`dump` and :func:`dumps` as well as the :class:`Pickler` " -"constructor." +"available. This value can be passed as a *protocol* value to functions :" +"func:`dump` and :func:`dumps` as well as the :class:`Pickler` constructor." msgstr "" "一個整數,表示可使用的最高\\ :ref:`協定版本 `。這個值可作" -"為 *protocol* 的數值傳給 :func:`dump` 和 :func:`dumps` 函式以" -"及 :class:`Pickler` 建構式。" +"為 *protocol* 的數值傳給 :func:`dump` 和 :func:`dumps` 函式以及 :class:" +"`Pickler` 建構式。" -#: ../../library/pickle.rst:201 +#: ../../library/pickle.rst:188 msgid "" "An integer, the default :ref:`protocol version ` used for " "pickling. May be less than :data:`HIGHEST_PROTOCOL`. Currently the default " "protocol is 5, introduced in Python 3.8 and incompatible with previous " -"versions. This version introduces support for out-of-band buffers, " -"where :pep:`3118`-compatible data can be transmitted separately from the " -"main pickle stream." +"versions. This version introduces support for out-of-band buffers, where :" +"pep:`3118`-compatible data can be transmitted separately from the main " +"pickle stream." msgstr "" -"一個整數,用於 pickle 的預設 :ref:`協定版本 `。可能小於 " -":data:`HIGHEST_PROTOCOL`。目前預設協定是 5,在 Python 3.8 中引入,與之前的版本不相容。" -"此版本引入了對 out-of-band buffer 的支援,其中 :pep:`3118` 相容的資料可以與主要 " -"pickle 串流分開傳輸。" +"一個整數,用於 pickle 的預設 :ref:`協定版本 `。可能小於 :" +"data:`HIGHEST_PROTOCOL`。目前預設協定是 5,在 Python 3.8 中引入,與之前的版本" +"不相容。此版本引入了對 out-of-band buffer 的支援,其中 :pep:`3118` 相容的資料" +"可以與主要 pickle 串流分開傳輸。" -#: ../../library/pickle.rst:210 +#: ../../library/pickle.rst:197 msgid "The default protocol is 3." msgstr "預設協定版本為 3。" -#: ../../library/pickle.rst:214 +#: ../../library/pickle.rst:201 msgid "The default protocol is 4." msgstr "預設協定版本為 4。" -#: ../../library/pickle.rst:218 +#: ../../library/pickle.rst:205 msgid "The default protocol is 5." msgstr "預設協定是 5。" -#: ../../library/pickle.rst:220 +#: ../../library/pickle.rst:207 msgid "" "The :mod:`pickle` module provides the following functions to make the " "pickling process more convenient:" msgstr ":mod:`pickle` 模組提供下列函式來簡化封裝的過程:" -#: ../../library/pickle.rst:225 +#: ../../library/pickle.rst:212 msgid "" "Write the pickled representation of the object *obj* to the open :term:`file " "object` *file*. This is equivalent to ``Pickler(file, protocol).dump(obj)``." @@ -424,20 +396,20 @@ msgstr "" "將被封裝成 pickle 形式的物件 *obj* 寫入到已開啟的\\ :term:`file object` " "*file*。這等效於\\ ``Pickler(file, protocol).dump(obj)``。" -#: ../../library/pickle.rst:229 +#: ../../library/pickle.rst:216 msgid "" "Arguments *file*, *protocol*, *fix_imports* and *buffer_callback* have the " "same meaning as in the :class:`Pickler` constructor." msgstr "" -"引數 *file*、*protocol*、*fix_imports* 和 *buffer_callback* 的意義" -"與 :class:`Pickler` 建構式中的相同。" +"引數 *file*、*protocol*、*fix_imports* 和 *buffer_callback* 的意義與 :class:" +"`Pickler` 建構式中的相同。" -#: ../../library/pickle.rst:232 ../../library/pickle.rst:243 -#: ../../library/pickle.rst:335 +#: ../../library/pickle.rst:219 ../../library/pickle.rst:230 +#: ../../library/pickle.rst:322 msgid "The *buffer_callback* argument was added." msgstr "新增 *buffer_callback* 引數。" -#: ../../library/pickle.rst:237 +#: ../../library/pickle.rst:224 msgid "" "Return the pickled representation of the object *obj* as a :class:`bytes` " "object, instead of writing it to a file." @@ -445,15 +417,15 @@ msgstr "" "將被封裝為 pickle 形式的物件 *obj* 以 :class:`bytes` 類別回傳,而非寫入進檔" "案。" -#: ../../library/pickle.rst:240 +#: ../../library/pickle.rst:227 msgid "" "Arguments *protocol*, *fix_imports* and *buffer_callback* have the same " "meaning as in the :class:`Pickler` constructor." msgstr "" -"引數 *protocol*、*fix_imports* 和 *buffer_callback* 的意義" -"和 :class:`Pickler` 建構式中的相同。" +"引數 *protocol*、*fix_imports* 和 *buffer_callback* 的意義和 :class:" +"`Pickler` 建構式中的相同。" -#: ../../library/pickle.rst:248 +#: ../../library/pickle.rst:235 msgid "" "Read the pickled representation of an object from the open :term:`file " "object` *file* and return the reconstituted object hierarchy specified " @@ -462,7 +434,7 @@ msgstr "" "從已開啟的 :term:`檔案物件 ` *file* 中讀取已序列化的物件,並傳回" "其重建後的物件階層。這相當於呼叫 ``Unpickler(file).load()``。" -#: ../../library/pickle.rst:252 ../../library/pickle.rst:267 +#: ../../library/pickle.rst:239 ../../library/pickle.rst:254 msgid "" "The protocol version of the pickle is detected automatically, so no protocol " "argument is needed. Bytes past the pickled representation of the object are " @@ -471,7 +443,7 @@ msgstr "" "模組會自動偵測 pickle 封包所使用的協定版本,所以無須另外指定。超出 pickle 封" "包表示範圍的位元組將被忽略。" -#: ../../library/pickle.rst:256 +#: ../../library/pickle.rst:243 msgid "" "Arguments *file*, *fix_imports*, *encoding*, *errors*, *strict* and " "*buffers* have the same meaning as in the :class:`Unpickler` constructor." @@ -479,12 +451,12 @@ msgstr "" "引數 *file*、*fix_imports*、*encoding*、*errors*、*strict* 和 *buffers* 的意" "義和 :class:`Unpickler` 建構式中的相同。" -#: ../../library/pickle.rst:259 ../../library/pickle.rst:274 -#: ../../library/pickle.rst:449 +#: ../../library/pickle.rst:246 ../../library/pickle.rst:261 +#: ../../library/pickle.rst:436 msgid "The *buffers* argument was added." msgstr "新增 *buffer* 引數。" -#: ../../library/pickle.rst:264 +#: ../../library/pickle.rst:251 msgid "" "Return the reconstituted object hierarchy of the pickled representation " "*data* of an object. *data* must be a :term:`bytes-like object`." @@ -492,26 +464,26 @@ msgstr "" "回傳從 *data* 的 pickle 封包重建後的物件階層。*data* 必須是一個 :term:`bytes-" "like object`。" -#: ../../library/pickle.rst:271 +#: ../../library/pickle.rst:258 msgid "" "Arguments *fix_imports*, *encoding*, *errors*, *strict* and *buffers* have " "the same meaning as in the :class:`Unpickler` constructor." msgstr "" -"引數 *fix_imports*、*encoding*、*errors*、*strict* 和 *buffers* 的意義" -"與 :class:`Unpickler` 建構式所用的相同。" +"引數 *fix_imports*、*encoding*、*errors*、*strict* 和 *buffers* 的意義與 :" +"class:`Unpickler` 建構式所用的相同。" -#: ../../library/pickle.rst:278 +#: ../../library/pickle.rst:265 msgid "The :mod:`pickle` module defines three exceptions:" msgstr ":mod:`pickle` 模組定義了以下三種例外:" -#: ../../library/pickle.rst:282 +#: ../../library/pickle.rst:269 msgid "" -"Common base class for the other pickling exceptions. It inherits " -"from :exc:`Exception`." +"Common base class for the other pickling exceptions. It inherits from :exc:" +"`Exception`." msgstr "" "繼承 :exc:`Exception` 類別。一個在封裝或拆封時遭遇其他例外時通用的基底類別。" -#: ../../library/pickle.rst:287 +#: ../../library/pickle.rst:274 msgid "" "Error raised when an unpicklable object is encountered by :class:`Pickler`. " "It inherits from :exc:`PickleError`." @@ -519,21 +491,21 @@ msgstr "" "當 :class:`Pickler` 遭遇無法封裝物件時會引發的例外。繼承 :exc:`PickleError` " "類別。" -#: ../../library/pickle.rst:290 +#: ../../library/pickle.rst:277 msgid "" "Refer to :ref:`pickle-picklable` to learn what kinds of objects can be " "pickled." msgstr "請參閱 :ref:`pickle-picklable` 以了解哪些物件是可以被封裝的。" -#: ../../library/pickle.rst:295 +#: ../../library/pickle.rst:282 msgid "" "Error raised when there is a problem unpickling an object, such as a data " "corruption or a security violation. It inherits from :exc:`PickleError`." msgstr "" -"拆封物件時遇到問題(如資料毀損或違反安全性原則等)所引發的意外。繼承" -"自 :exc:`PickleError` 類別。" +"拆封物件時遇到問題(如資料毀損或違反安全性原則等)所引發的意外。繼承自 :exc:" +"`PickleError` 類別。" -#: ../../library/pickle.rst:298 +#: ../../library/pickle.rst:285 msgid "" "Note that other exceptions may also be raised during unpickling, including " "(but not necessarily limited to) AttributeError, EOFError, ImportError, and " @@ -542,19 +514,19 @@ msgstr "" "拆封的時候還是可能會遭遇其他不在此列的例外(例如:AttributeError、EOFError、" "ImportError、或 IndexError),請注意。" -#: ../../library/pickle.rst:303 +#: ../../library/pickle.rst:290 msgid "" -"The :mod:`pickle` module exports three " -"classes, :class:`Pickler`, :class:`Unpickler` and :class:`PickleBuffer`:" +"The :mod:`pickle` module exports three classes, :class:`Pickler`, :class:" +"`Unpickler` and :class:`PickleBuffer`:" msgstr "" -"引入模組 :mod:`pickle` 時會帶來三個類" -"別::class:`Pickler`、:class:`Unpickler` 和 :class:`PickleBuffer`:" +"引入模組 :mod:`pickle` 時會帶來三個類別::class:`Pickler`、:class:" +"`Unpickler` 和 :class:`PickleBuffer`:" -#: ../../library/pickle.rst:308 +#: ../../library/pickle.rst:295 msgid "This takes a binary file for writing a pickle data stream." msgstr "接受一個用以寫入 pickle 資料流的二進位檔案。" -#: ../../library/pickle.rst:310 +#: ../../library/pickle.rst:297 msgid "" "The optional *protocol* argument, an integer, tells the pickler to use the " "given protocol; supported protocols are 0 to :data:`HIGHEST_PROTOCOL`. If " @@ -562,22 +534,21 @@ msgid "" "number is specified, :data:`HIGHEST_PROTOCOL` is selected." msgstr "" "可選引數 *protocol* 接受整數,用來要求封裝器(pickler)使用指定的協定;支援" -"從 0 版起到 :data:`HIGHEST_PROTOCOL` 版的協定。如未指定,則預設" -"為 :data:`DEFAULT_PROTOCOL`。若指定了負數,則視為選" -"擇 :data:`HIGHEST_PROTOCOL`。" +"從 0 版起到 :data:`HIGHEST_PROTOCOL` 版的協定。如未指定,則預設為 :data:" +"`DEFAULT_PROTOCOL`。若指定了負數,則視為選擇 :data:`HIGHEST_PROTOCOL`。" -#: ../../library/pickle.rst:315 +#: ../../library/pickle.rst:302 msgid "" "The *file* argument must have a write() method that accepts a single bytes " -"argument. It can thus be an on-disk file opened for binary writing, " -"an :class:`io.BytesIO` instance, or any other custom object that meets this " +"argument. It can thus be an on-disk file opened for binary writing, an :" +"class:`io.BytesIO` instance, or any other custom object that meets this " "interface." msgstr "" "引數 *file* 必須支援可寫入單一位元組引數的 write() 方法。只要滿足此條件,傳入" "的物件可以是一個硬碟上二進位檔案、一個 :class:`io.BytesIO` 實例或任何其他滿足" "這個介面要求的物件。" -#: ../../library/pickle.rst:320 +#: ../../library/pickle.rst:307 msgid "" "If *fix_imports* is true and *protocol* is less than 3, pickle will try to " "map the new Python 3 names to the old module names used in Python 2, so that " @@ -591,7 +562,7 @@ msgstr "" # 應作何翻譯? # out-of-band 目前參考 https://kb.synology.com/zh- # tw/DSM/tutorial/Quick_Start_OOB_Management `帶外管理` 譯作 `帶外` -#: ../../library/pickle.rst:324 +#: ../../library/pickle.rst:311 msgid "" "If *buffer_callback* is ``None`` (the default), buffer views are serialized " "into *file* as part of the pickle stream." @@ -599,7 +570,7 @@ msgstr "" "如果 *buffer_callback* 是 ``None``\\ (預設值),緩衝區的視圖會作為 pickle 封" "裝串流的一部分被序列化進 *file* 中。" -#: ../../library/pickle.rst:327 +#: ../../library/pickle.rst:314 msgid "" "If *buffer_callback* is not ``None``, then it can be called any number of " "times with a buffer view. If the callback returns a false value (such as " @@ -611,7 +582,7 @@ msgstr "" "帶外資料 `;否則,該緩衝區將被視為 pickle 串流的帶內資料被序列" "化。" -#: ../../library/pickle.rst:332 +#: ../../library/pickle.rst:319 msgid "" "It is an error if *buffer_callback* is not ``None`` and *protocol* is " "``None`` or smaller than 5." @@ -619,19 +590,19 @@ msgstr "" "如果 *buffer_callback* 不是 ``None`` 且 *protocol* 是 ``None`` 或小於 5 則會" "報錯。" -#: ../../library/pickle.rst:340 +#: ../../library/pickle.rst:327 msgid "" "Write the pickled representation of *obj* to the open file object given in " "the constructor." msgstr "將已封裝(pickled)的 *obj* 寫入已在建構式中開啟的對應檔案。" -#: ../../library/pickle.rst:345 +#: ../../library/pickle.rst:332 msgid "Do nothing by default. This exists so a subclass can override it." msgstr "" "預設不進行任何動作。這是一種抽象方法,用於讓後續繼承這個類別的物件可以覆寫本" "方法函式。" -#: ../../library/pickle.rst:347 +#: ../../library/pickle.rst:334 msgid "" "If :meth:`persistent_id` returns ``None``, *obj* is pickled as usual. Any " "other value causes :class:`Pickler` to emit the returned value as a " @@ -644,14 +615,14 @@ msgstr "" "碼回傳。此永久識別碼的意義應由 :meth:`Unpickler.persistent_load` 定義。請注" "意 :meth:`persistent_id` 回傳的值本身不能擁有自己的永久識別碼。" -#: ../../library/pickle.rst:353 ../../library/pickle.rst:467 +#: ../../library/pickle.rst:340 ../../library/pickle.rst:454 msgid "See :ref:`pickle-persistent` for details and examples of uses." msgstr "關於細節與用法範例請見 :ref:`pickle-persistent`。" -#: ../../library/pickle.rst:355 +#: ../../library/pickle.rst:342 msgid "" -"Add the default implementation of this method in the C implementation " -"of :class:`!Pickler`." +"Add the default implementation of this method in the C implementation of :" +"class:`!Pickler`." msgstr "在 C 的 :class:`!Pickler` 實作中的增加了這個方法的預設實作。" # SkyLull: [T] @@ -661,7 +632,7 @@ msgstr "在 C 的 :class:`!Pickler` 實作中的增加了這個方法的預設 # reduction function -> 縮減函式 # 這個是指reduce()函式類型的運算,類似sql的aggregation類型運算,故參閱以下內文,譯為縮減 # https://support.google.com/docs/answer/12657238?hl=zh-Hant -#: ../../library/pickle.rst:361 +#: ../../library/pickle.rst:348 msgid "" "A pickler object's dispatch table is a registry of *reduction functions* of " "the kind which can be declared using :func:`copyreg.pickle`. It is a " @@ -674,15 +645,15 @@ msgstr "" "一個以類別為鍵、還原函式為值的映射表。縮減函式應準備接收一個對應類別的引數," "並應遵循與 :meth:`~object.__reduce__` 方法相同的介面。" -#: ../../library/pickle.rst:369 +#: ../../library/pickle.rst:356 msgid "" "By default, a pickler object will not have a :attr:`dispatch_table` " -"attribute, and it will instead use the global dispatch table managed by " -"the :mod:`copyreg` module. However, to customize the pickling for a specific " +"attribute, and it will instead use the global dispatch table managed by the :" +"mod:`copyreg` module. However, to customize the pickling for a specific " "pickler object one can set the :attr:`dispatch_table` attribute to a dict-" -"like object. Alternatively, if a subclass of :class:`Pickler` has " -"a :attr:`dispatch_table` attribute then this will be used as the default " -"dispatch table for instances of that class." +"like object. Alternatively, if a subclass of :class:`Pickler` has a :attr:" +"`dispatch_table` attribute then this will be used as the default dispatch " +"table for instances of that class." msgstr "" "預設情況下,封裝器(pickler)物件不會有 :attr:`dispatch_table` 屬性,而是會使" "用由 :mod:`copyreg` 模組管理的全域調度表。不過,若要自訂某個封裝器(pickler)" @@ -690,29 +661,29 @@ msgstr "" "如果 :class:`Pickler` 的子類別具有 :attr:`dispatch_table` 屬性,那麼這個屬性" "將作為該子類別實例的預設調度表。" -#: ../../library/pickle.rst:378 +#: ../../library/pickle.rst:365 msgid "See :ref:`pickle-dispatch` for usage examples." msgstr "關於用法範例請見 :ref:`pickle-dispatch`。" -#: ../../library/pickle.rst:384 +#: ../../library/pickle.rst:371 msgid "" "Special reducer that can be defined in :class:`Pickler` subclasses. This " "method has priority over any reducer in the :attr:`dispatch_table`. It " "should conform to the same interface as a :meth:`~object.__reduce__` method, " -"and can optionally return :data:`NotImplemented` to fallback " -"on :attr:`dispatch_table`-registered reducers to pickle ``obj``." +"and can optionally return :data:`NotImplemented` to fallback on :attr:" +"`dispatch_table`-registered reducers to pickle ``obj``." msgstr "" "一個可以在 :class:`Pickler` 子類別中被定義的縮減器(reducer)。這個方法的優先" -"度高於任何其他 :attr:`分派表 ` 中的縮減器。他應該要有" -"和 :meth:`~object.__reduce__` 方法相同的函式介面,且可以可選地回" -"傳 :data:`NotImplemented` 以後備(fallback)使用 :attr:`分派表 " -"` 中登錄的縮減方法來封裝 ``obj``。" +"度高於任何其他 :attr:`分派表 ` 中的縮減器。他應該要有和 :" +"meth:`~object.__reduce__` 方法相同的函式介面,且可以可選地回傳 :data:" +"`NotImplemented` 以後備(fallback)使用 :attr:`分派表 ` 中登" +"錄的縮減方法來封裝 ``obj``。" -#: ../../library/pickle.rst:390 +#: ../../library/pickle.rst:377 msgid "For a detailed example, see :ref:`reducer_override`." msgstr "請查閱 :ref:`reducer_override` 來參考其他較詳細的範例。" -#: ../../library/pickle.rst:396 +#: ../../library/pickle.rst:383 msgid "" "Deprecated. Enable fast mode if set to a true value. The fast mode disables " "the usage of memo, therefore speeding the pickling process by not generating " @@ -723,46 +694,46 @@ msgstr "" "過不產生多餘的 PUT 操作碼(OpCode)來加速封裝過程。它不應被用於自我參照物件," "否則將導致 :class:`Pickler` 陷入無限遞迴。" -#: ../../library/pickle.rst:402 +#: ../../library/pickle.rst:389 msgid "Use :func:`pickletools.optimize` if you need more compact pickles." msgstr "使用 :func:`pickletools.optimize` 以獲得更緊湊的 pickle 輸出。" -#: ../../library/pickle.rst:406 +#: ../../library/pickle.rst:393 msgid "Clears the pickler's \"memo\"." msgstr "" -#: ../../library/pickle.rst:408 +#: ../../library/pickle.rst:395 msgid "" "The memo is the data structure that remembers which objects the pickler has " "already seen, so that shared or recursive objects are pickled by reference " "and not by value. This method is useful when re-using picklers." msgstr "" -#: ../../library/pickle.rst:416 +#: ../../library/pickle.rst:403 msgid "This takes a binary file for reading a pickle data stream." msgstr "這個物件接受一個二進位檔案 *file* 來從中讀取 pickle 資料流。" -#: ../../library/pickle.rst:418 +#: ../../library/pickle.rst:405 msgid "" "The protocol version of the pickle is detected automatically, so no protocol " "argument is needed." msgstr "協定版本號會被自動偵測,所以不需要在這邊手動輸入。" -#: ../../library/pickle.rst:421 +#: ../../library/pickle.rst:408 msgid "" "The argument *file* must have three methods, a read() method that takes an " "integer argument, a readinto() method that takes a buffer argument and a " -"readline() method that requires no arguments, as in " -"the :class:`io.BufferedIOBase` interface. Thus *file* can be an on-disk " -"file opened for binary reading, an :class:`io.BytesIO` object, or any other " -"custom object that meets this interface." +"readline() method that requires no arguments, as in the :class:`io." +"BufferedIOBase` interface. Thus *file* can be an on-disk file opened for " +"binary reading, an :class:`io.BytesIO` object, or any other custom object " +"that meets this interface." msgstr "" "參數 *file* 必須擁有三個方法,分別是接受整數作為引數的 read() 方法、接受緩衝" -"區作為引數的 readinto() 方法以及不需要引數的 readline() 方法,如同" -"在 :class:`io.BufferedIOBase` 的介面一樣。因此,*file* 可以是一個以二進位讀取" -"模式開啟的檔案、一個 :class:`io.BytesIO` 物件、或任何符合此介面的自訂物件。" +"區作為引數的 readinto() 方法以及不需要引數的 readline() 方法,如同在 :class:" +"`io.BufferedIOBase` 的介面一樣。因此,*file* 可以是一個以二進位讀取模式開啟的" +"檔案、一個 :class:`io.BytesIO` 物件、或任何符合此介面的自訂物件。" -#: ../../library/pickle.rst:428 +#: ../../library/pickle.rst:415 msgid "" "The optional arguments *fix_imports*, *encoding* and *errors* are used to " "control compatibility support for pickle stream generated by Python 2. If " @@ -771,20 +742,20 @@ msgid "" "decode 8-bit string instances pickled by Python 2; these default to 'ASCII' " "and 'strict', respectively. The *encoding* can be 'bytes' to read these 8-" "bit string instances as bytes objects. Using ``encoding='latin1'`` is " -"required for unpickling NumPy arrays and instances " -"of :class:`~datetime.datetime`, :class:`~datetime.date` " -"and :class:`~datetime.time` pickled by Python 2." +"required for unpickling NumPy arrays and instances of :class:`~datetime." +"datetime`, :class:`~datetime.date` and :class:`~datetime.time` pickled by " +"Python 2." msgstr "" "可選引數 *fix_imports*、*encoding* 和 *errors* 用來控制 Python 2 pickle 資料" "的相容性支援。如果 *fix_imports* 為 true,則 pickle 模組會嘗試將舊的 Python " "2 模組名稱映射到 Python 3 中使用的新名稱。*encoding* 和 *errors* 告訴 pickle " "模組如何解碼由 Python 2 pickle 封裝的 8 位元字串實例;*encoding* 和 *errors* " "預設分別為 'ASCII' 和 'strict'。*encoding* 可以設定為 'bytes' 以將這些 8 位元" -"字串實例讀為位元組物件。而由 Python 2 封裝的 NumPy 陣" -"列、:class:`~datetime.datetime`、:class:`~datetime.date` " -"和 :class:`~datetime.time` 的實例則必須使用 ``encoding='latin1'`` 來拆封。" +"字串實例讀為位元組物件。而由 Python 2 封裝的 NumPy 陣列、:class:`~datetime." +"datetime`、:class:`~datetime.date` 和 :class:`~datetime.time` 的實例則必須使" +"用 ``encoding='latin1'`` 來拆封。" -#: ../../library/pickle.rst:439 +#: ../../library/pickle.rst:426 msgid "" "If *buffers* is ``None`` (the default), then all data necessary for " "deserialization must be contained in the pickle stream. This means that the " @@ -795,7 +766,7 @@ msgstr "" "包含在 pickle 串流中。這意味著當初在建立對應的 :class:`Pickler` 時(或在呼" "叫 :func:`dump` 或 :func:`dumps` 時)*buffer_callback* 引數必須為 ``None``。" -#: ../../library/pickle.rst:444 +#: ../../library/pickle.rst:431 msgid "" "If *buffers* is not ``None``, it should be an iterable of buffer-enabled " "objects that is consumed each time the pickle stream references an :ref:`out-" @@ -807,7 +778,7 @@ msgstr "" "將會被照順序消耗。這些緩衝資料當初建立時應已按照順序給定於 Pickler 物件中的 " "*buffer_callback*。" -#: ../../library/pickle.rst:454 +#: ../../library/pickle.rst:441 msgid "" "Read the pickled representation of an object from the open file object given " "in the constructor, and return the reconstituted object hierarchy specified " @@ -816,26 +787,26 @@ msgstr "" "開啟先前被傳入建構子的檔案,從中讀取一個被 pickle 封裝的物件,並回傳重建完成" "的物件階層。超過 pickle 表示範圍的位元組會被忽略。" -#: ../../library/pickle.rst:461 +#: ../../library/pickle.rst:448 msgid "Raise an :exc:`UnpicklingError` by default." msgstr "預設會引發 :exc:`UnpicklingError` 例外。" -#: ../../library/pickle.rst:463 +#: ../../library/pickle.rst:450 msgid "" "If defined, :meth:`persistent_load` should return the object specified by " -"the persistent ID *pid*. If an invalid persistent ID is encountered, " -"an :exc:`UnpicklingError` should be raised." +"the persistent ID *pid*. If an invalid persistent ID is encountered, an :" +"exc:`UnpicklingError` should be raised." msgstr "" "若有定義,則 :meth:`persistent_load` 將回傳符合持久化識別碼 *pid* 的物件。如" "果遭遇了無效的持久化識別碼,則會引發 :exc:`UnpicklingError`。" -#: ../../library/pickle.rst:469 +#: ../../library/pickle.rst:456 msgid "" -"Add the default implementation of this method in the C implementation " -"of :class:`!Unpickler`." +"Add the default implementation of this method in the C implementation of :" +"class:`!Unpickler`." msgstr "在 C 的 :class:`!Unpickler` 實作中的增加了這個方法的預設實作。" -#: ../../library/pickle.rst:475 +#: ../../library/pickle.rst:462 msgid "" "Import *module* if necessary and return the object called *name* from it, " "where the *module* and *name* arguments are :class:`str` objects. Note, " @@ -843,19 +814,19 @@ msgid "" "functions." msgstr "" "如有需要將引入 *module*,並從中回傳名為 *name* 的物件,這裡的 *module* 和 " -"*name* 引數接受的輸入是 :class:`str` 物件。注意,雖然名稱上看起來不像," -"但 :meth:`find_class` 亦可被用於尋找其他函式。" +"*name* 引數接受的輸入是 :class:`str` 物件。注意,雖然名稱上看起來不像,但 :" +"meth:`find_class` 亦可被用於尋找其他函式。" -#: ../../library/pickle.rst:480 +#: ../../library/pickle.rst:467 msgid "" "Subclasses may override this to gain control over what type of objects and " -"how they can be loaded, potentially reducing security risks. Refer " -"to :ref:`pickle-restrict` for details." +"how they can be loaded, potentially reducing security risks. Refer to :ref:" +"`pickle-restrict` for details." msgstr "" "子類別可以覆寫此方法以控制可以載入哪些類型的物件、以及如何載入它們,從而潛在" "地降低安全性風險。詳情請參考\\ :ref:`pickle-restrict`。" -#: ../../library/pickle.rst:484 +#: ../../library/pickle.rst:471 msgid "" "Raises an :ref:`auditing event ` ``pickle.find_class`` with " "arguments ``module``, ``name``." @@ -866,26 +837,26 @@ msgstr "" # SkyLull: [T] # 參見 #729 # wrapper -> 包裝器 -#: ../../library/pickle.rst:488 +#: ../../library/pickle.rst:475 msgid "" -"A wrapper for a buffer representing picklable data. *buffer* must be " -"a :ref:`buffer-providing ` object, such as a :term:`bytes-" -"like object` or a N-dimensional array." +"A wrapper for a buffer representing picklable data. *buffer* must be a :ref:" +"`buffer-providing ` object, such as a :term:`bytes-like " +"object` or a N-dimensional array." msgstr "" "一個表示了含有可封裝資料緩衝區的包裝函式(wrapper function)。*buffer* 必須是" "一個 :ref:`提供緩衝區 ` 的物件,例如一個 :term:`類位元組物件 " "` 或 N 維陣列。" -#: ../../library/pickle.rst:492 +#: ../../library/pickle.rst:479 msgid "" ":class:`PickleBuffer` is itself a buffer provider, therefore it is possible " -"to pass it to other APIs expecting a buffer-providing object, such " -"as :class:`memoryview`." +"to pass it to other APIs expecting a buffer-providing object, such as :class:" +"`memoryview`." msgstr "" ":class:`PickleBuffer` 本身就是一個提供緩衝區的物件,所以是能夠將其提供給其它" "「預期收到含有緩衝物件的 API」的,比如 :class:`memoryview`。" -#: ../../library/pickle.rst:496 +#: ../../library/pickle.rst:483 msgid "" ":class:`PickleBuffer` objects can only be serialized using pickle protocol 5 " "or higher. They are eligible for :ref:`out-of-band serialization 限定名稱 -#: ../../library/pickle.rst:545 +#: ../../library/pickle.rst:532 msgid "" -"Note that functions (built-in and user-defined) are pickled by " -"fully :term:`qualified name`, not by value. [#]_ This means that only the " -"function name is pickled, along with the name of the containing module and " -"classes. Neither the function's code, nor any of its function attributes " -"are pickled. Thus the defining module must be importable in the unpickling " +"Note that functions (built-in and user-defined) are pickled by fully :term:" +"`qualified name`, not by value. [#]_ This means that only the function name " +"is pickled, along with the name of the containing module and classes. " +"Neither the function's code, nor any of its function attributes are " +"pickled. Thus the defining module must be importable in the unpickling " "environment, and the module must contain the named object, otherwise an " "exception will be raised. [#]_" msgstr "" @@ -997,7 +967,7 @@ msgstr "" "拆封該物件的環境中,定義此函式的模組必須可被引入,且該模組必須包含具此命名之" "物件,否則將引發例外。 [#]_" -#: ../../library/pickle.rst:552 +#: ../../library/pickle.rst:539 msgid "" "Similarly, classes are pickled by fully qualified name, so the same " "restrictions in the unpickling environment apply. Note that none of the " @@ -1008,7 +978,7 @@ msgstr "" "上的限制。類別中的程式碼或資料皆不會被封裝,因此在以下範例中,注意到類別屬性 " "``attr`` 在拆封的環境中不會被還原::" -#: ../../library/pickle.rst:557 +#: ../../library/pickle.rst:544 msgid "" "class Foo:\n" " attr = 'A class attribute'\n" @@ -1020,13 +990,13 @@ msgstr "" "\n" "picklestring = pickle.dumps(Foo)" -#: ../../library/pickle.rst:562 +#: ../../library/pickle.rst:549 msgid "" "These restrictions are why picklable functions and classes must be defined " "at the top level of a module." msgstr "這些限制就是可封裝的函式和類別必須被定義在模組頂層的原因。" -#: ../../library/pickle.rst:565 +#: ../../library/pickle.rst:552 msgid "" "Similarly, when class instances are pickled, their class's code and data are " "not pickled along with them. Only the instance data are pickled. This is " @@ -1034,8 +1004,8 @@ msgid "" "and still load objects that were created with an earlier version of the " "class. If you plan to have long-lived objects that will see many versions " "of a class, it may be worthwhile to put a version number in the objects so " -"that suitable conversions can be made by the " -"class's :meth:`~object.__setstate__` method." +"that suitable conversions can be made by the class's :meth:`~object." +"__setstate__` method." msgstr "" "同樣地,當類別實例被封裝時,它所屬類別具有的程式碼和資料不會被一起封裝。只有" "實例資料本身會被封裝。這是有意而為的,因為如此你才可以在類別中修正錯誤或新增" @@ -1043,11 +1013,11 @@ msgstr "" "計將有長期存在的物件、且該物件將經歷許多版本的更替,你可以在物件中存放一個版" "本號,以便未來能透過 :meth:`~object.__setstate__` 方法來進行適當的版本轉換。" -#: ../../library/pickle.rst:577 +#: ../../library/pickle.rst:564 msgid "Pickling Class Instances" msgstr "Pickling 類別實例" -#: ../../library/pickle.rst:581 +#: ../../library/pickle.rst:568 msgid "" "In this section, we describe the general mechanisms available to you to " "define, customize, and control how class instances are pickled and unpickled." @@ -1055,22 +1025,21 @@ msgstr "" "在這一個章節,我們會講述如何封裝或拆封一個物件實例的相關機制,以方便你進行自" "訂。" -#: ../../library/pickle.rst:584 +#: ../../library/pickle.rst:571 msgid "" "In most cases, no additional code is needed to make instances picklable. By " "default, pickle will retrieve the class and the attributes of an instance " -"via introspection. When a class instance is unpickled, " -"its :meth:`~object.__init__` method is usually *not* invoked. The default " -"behaviour first creates an uninitialized instance and then restores the " -"saved attributes. The following code shows an implementation of this " -"behaviour::" +"via introspection. When a class instance is unpickled, its :meth:`~object." +"__init__` method is usually *not* invoked. The default behaviour first " +"creates an uninitialized instance and then restores the saved attributes. " +"The following code shows an implementation of this behaviour::" msgstr "" "大部分的實例不需要額外的程式碼就已經是可封裝的了。在這樣的預設狀況中,pickle " -"模組透過自省機制來取得類別及其實例的屬性。當類別實例被拆封時," -"其 :meth:`~object.__init__` 方法通常\\ *不會*\\ 被呼叫。預設行為首先會建立一" -"個未初始化的實例,然後還原紀錄中的屬性。以下程式碼的實作展示了前述行為: ::" +"模組透過自省機制來取得類別及其實例的屬性。當類別實例被拆封時,其 :meth:" +"`~object.__init__` 方法通常\\ *不會*\\ 被呼叫。預設行為首先會建立一個未初始化" +"的實例,然後還原紀錄中的屬性。以下程式碼的實作展示了前述行為: ::" -#: ../../library/pickle.rst:591 +#: ../../library/pickle.rst:578 msgid "" "def save(obj):\n" " return (obj.__class__, obj.__dict__)\n" @@ -1088,28 +1057,28 @@ msgstr "" " obj.__dict__.update(attributes)\n" " return obj" -#: ../../library/pickle.rst:599 +#: ../../library/pickle.rst:586 msgid "" "Classes can alter the default behaviour by providing one or several special " "methods:" msgstr "" "被封裝的目標類別可以提供一個或數個下列特殊方法來改變 pickle 的預設行為:" -#: ../../library/pickle.rst:604 +#: ../../library/pickle.rst:591 msgid "" -"In protocols 2 and newer, classes that implements " -"the :meth:`__getnewargs_ex__` method can dictate the values passed to " -"the :meth:`__new__` method upon unpickling. The method must return a pair " -"``(args, kwargs)`` where *args* is a tuple of positional arguments and " -"*kwargs* a dictionary of named arguments for constructing the object. Those " -"will be passed to the :meth:`__new__` method upon unpickling." +"In protocols 2 and newer, classes that implements the :meth:" +"`__getnewargs_ex__` method can dictate the values passed to the :meth:" +"`__new__` method upon unpickling. The method must return a pair ``(args, " +"kwargs)`` where *args* is a tuple of positional arguments and *kwargs* a " +"dictionary of named arguments for constructing the object. Those will be " +"passed to the :meth:`__new__` method upon unpickling." msgstr "" "在第 2 版協定或更新的版本中,有實作 :meth:`__getnewargs_ex__` 方法的類別,可" "以決定在拆封時要傳遞給 :meth:`__new__` 方法的值。該方法必須回傳一個 ``(args, " "kwargs)`` 的組合,其中 *args* 是一個位置引數的元組(tuple),*kwargs* 是一個" "用於建構物件的命名引數字典。這些資訊將在拆封時傳遞給 :meth:`__new__` 方法。" -#: ../../library/pickle.rst:612 +#: ../../library/pickle.rst:599 msgid "" "You should implement this method if the :meth:`__new__` method of your class " "requires keyword-only arguments. Otherwise, it is recommended for " @@ -1118,36 +1087,36 @@ msgstr "" "如果目標類別的方法 :meth:`__new__` 需要僅限關鍵字的參數時,你應該實作此方法。" "否則,為了提高相容性,建議你改為實作 :meth:`__getnewargs__`。" -#: ../../library/pickle.rst:616 +#: ../../library/pickle.rst:603 msgid ":meth:`__getnewargs_ex__` is now used in protocols 2 and 3." msgstr "在第 2、3 版的協定中現在改為使用 :meth:`__getnewargs_ex__`。" -#: ../../library/pickle.rst:622 +#: ../../library/pickle.rst:609 msgid "" "This method serves a similar purpose as :meth:`__getnewargs_ex__`, but " "supports only positional arguments. It must return a tuple of arguments " "``args`` which will be passed to the :meth:`__new__` method upon unpickling." msgstr "" "此方法與 :meth:`__getnewargs_ex__` 的目的一樣,但僅支援位置參數。它必須回傳一" -"個由傳入引數所組成的元組(tuple)\\ ``args``,這些引數會在拆封時傳遞" -"給 :meth:`__new__` 方法。" +"個由傳入引數所組成的元組(tuple)\\ ``args``,這些引數會在拆封時傳遞給 :meth:" +"`__new__` 方法。" -#: ../../library/pickle.rst:626 +#: ../../library/pickle.rst:613 msgid "" ":meth:`__getnewargs__` will not be called if :meth:`__getnewargs_ex__` is " "defined." msgstr "" "當有定義 :meth:`__getnewargs_ex__` 的時候便不會呼叫 :meth:`__getnewargs__`。" -#: ../../library/pickle.rst:629 +#: ../../library/pickle.rst:616 msgid "" -"Before Python 3.6, :meth:`__getnewargs__` was called instead " -"of :meth:`__getnewargs_ex__` in protocols 2 and 3." +"Before Python 3.6, :meth:`__getnewargs__` was called instead of :meth:" +"`__getnewargs_ex__` in protocols 2 and 3." msgstr "" "在 Python 3.6 之前、版本 2 和版本 3 的協定中,會呼叫 :meth:`__getnewargs__` " "而非 :meth:`__getnewargs_ex__`。" -#: ../../library/pickle.rst:636 +#: ../../library/pickle.rst:623 msgid "" "Classes can further influence how their instances are pickled by overriding " "the method :meth:`__getstate__`. It is called and the returned object is " @@ -1158,52 +1127,52 @@ msgstr "" "封裝時,呼叫該方法所回傳的物件將作為該實例的內容被封裝、而非一個預設狀態。以" "下列出幾種預設狀態:" -#: ../../library/pickle.rst:641 +#: ../../library/pickle.rst:628 msgid "" -"For a class that has no instance :attr:`~object.__dict__` and " -"no :attr:`~object.__slots__`, the default state is ``None``." +"For a class that has no instance :attr:`~object.__dict__` and no :attr:" +"`~object.__slots__`, the default state is ``None``." msgstr "" "沒有 :attr:`~object.__dict__` 和 :attr:`~object.__slots__` 實例的類別,其預設" "狀態為 ``None``。" -#: ../../library/pickle.rst:644 +#: ../../library/pickle.rst:631 msgid "" -"For a class that has an instance :attr:`~object.__dict__` and " -"no :attr:`~object.__slots__`, the default state is ``self.__dict__``." +"For a class that has an instance :attr:`~object.__dict__` and no :attr:" +"`~object.__slots__`, the default state is ``self.__dict__``." msgstr "" "有 :attr:`~object.__dict__` 實例、但沒有 :attr:`~object.__slots__` 實例的類" "別,其預設狀態為 ``self.__dict__``。" -#: ../../library/pickle.rst:647 +#: ../../library/pickle.rst:634 msgid "" -"For a class that has an instance :attr:`~object.__dict__` " -"and :attr:`~object.__slots__`, the default state is a tuple consisting of " -"two dictionaries: ``self.__dict__``, and a dictionary mapping slot names to " -"slot values. Only slots that have a value are included in the latter." +"For a class that has an instance :attr:`~object.__dict__` and :attr:`~object." +"__slots__`, the default state is a tuple consisting of two dictionaries: " +"``self.__dict__``, and a dictionary mapping slot names to slot values. Only " +"slots that have a value are included in the latter." msgstr "" "有 :attr:`~object.__dict__` 和 :attr:`~object.__slots__` 實例的類別,其預設狀" "態是一個含有兩個字典的元組(tuple),該二字典分別為 ``self.__dict__`` 本身," "和紀錄欄位(slot)名稱和值對應關係的字典(只有含有值的欄位(slot)會被紀錄其" "中)。" -#: ../../library/pickle.rst:653 +#: ../../library/pickle.rst:640 msgid "" -"For a class that has :attr:`~object.__slots__` and no " -"instance :attr:`~object.__dict__`, the default state is a tuple whose first " -"item is ``None`` and whose second item is a dictionary mapping slot names to " -"slot values described in the previous bullet." +"For a class that has :attr:`~object.__slots__` and no instance :attr:" +"`~object.__dict__`, the default state is a tuple whose first item is " +"``None`` and whose second item is a dictionary mapping slot names to slot " +"values described in the previous bullet." msgstr "" "沒有 :attr:`~object.__dict__` 但有 :attr:`~object.__slots__` 實例的類別,其預" "設狀態是一個二元組(tuple),元組中的第一個值是 ``None``,第二個值則是紀錄欄" "位(slot)名稱和值對應關係的字典(與前一項提到的字典是同一個)。" -#: ../../library/pickle.rst:658 +#: ../../library/pickle.rst:645 msgid "" -"Added the default implementation of the ``__getstate__()`` method in " -"the :class:`object` class." +"Added the default implementation of the ``__getstate__()`` method in the :" +"class:`object` class." msgstr "在 :class:`object` 類別中增加預設的 ``__getstate__()`` 實作。" -#: ../../library/pickle.rst:665 +#: ../../library/pickle.rst:652 msgid "" "Upon unpickling, if the class defines :meth:`__setstate__`, it is called " "with the unpickled state. In that case, there is no requirement for the " @@ -1214,68 +1183,65 @@ msgstr "" "這種情況下,紀錄狀態的物件不需要是字典(dictionary)。否則,封裝時的狀態紀錄" "必須是一個字典,其紀錄的項目將被賦值給新實例的字典。" -#: ../../library/pickle.rst:672 +#: ../../library/pickle.rst:659 msgid "" -"If :meth:`__reduce__` returns a state with value ``None`` at pickling, " -"the :meth:`__setstate__` method will not be called upon unpickling." +"If :meth:`__reduce__` returns a state with value ``None`` at pickling, the :" +"meth:`__setstate__` method will not be called upon unpickling." msgstr "" -"如果 :meth:`__reduce__` 在封裝時回傳了 ``None`` 狀態,則拆封時就不會去呼" -"叫 :meth:`__setstate__`。" +"如果 :meth:`__reduce__` 在封裝時回傳了 ``None`` 狀態,則拆封時就不會去呼叫 :" +"meth:`__setstate__`。" -#: ../../library/pickle.rst:676 +#: ../../library/pickle.rst:663 msgid "" "Refer to the section :ref:`pickle-state` for more information about how to " -"use the methods :meth:`~object.__getstate__` " -"and :meth:`~object.__setstate__`." +"use the methods :meth:`~object.__getstate__` and :meth:`~object." +"__setstate__`." msgstr "" -"參閱 :ref:`pickle-state` 以了解 :meth:`~object.__getstate__` " -"和 :meth:`~object.__setstate__` 的使用方法。" +"參閱 :ref:`pickle-state` 以了解 :meth:`~object.__getstate__` 和 :meth:" +"`~object.__setstate__` 的使用方法。" -#: ../../library/pickle.rst:681 +#: ../../library/pickle.rst:668 msgid "" -"At unpickling time, some methods " -"like :meth:`~object.__getattr__`, :meth:`~object.__getattribute__`, " -"or :meth:`~object.__setattr__` may be called upon the instance. In case " -"those methods rely on some internal invariant being true, the type should " -"implement :meth:`~object.__new__` to establish such an invariant, " -"as :meth:`~object.__init__` is not called when unpickling an instance." +"At unpickling time, some methods like :meth:`~object.__getattr__`, :meth:" +"`~object.__getattribute__`, or :meth:`~object.__setattr__` may be called " +"upon the instance. In case those methods rely on some internal invariant " +"being true, the type should implement :meth:`~object.__new__` to establish " +"such an invariant, as :meth:`~object.__init__` is not called when unpickling " +"an instance." msgstr "" -"在拆封時,某些方法" -"如 :meth:`~object.__getattr__`、:meth:`~object.__getattribute__` " -"或 :meth:`~object.__setattr__` 可能會在建立實例時被呼叫。如果這些方法依賴了某" -"些實例內部的不變性,則應實作 :meth:`~object.__new__` 以建立此不變性,因為在拆" -"封實例時不會呼叫 :meth:`~object.__init__`。" +"在拆封時,某些方法如 :meth:`~object.__getattr__`、:meth:`~object." +"__getattribute__` 或 :meth:`~object.__setattr__` 可能會在建立實例時被呼叫。如" +"果這些方法依賴了某些實例內部的不變性,則應實作 :meth:`~object.__new__` 以建立" +"此不變性,因為在拆封實例時不會呼叫 :meth:`~object.__init__`。" -#: ../../library/pickle.rst:690 +#: ../../library/pickle.rst:677 msgid "" "As we shall see, pickle does not use directly the methods described above. " -"In fact, these methods are part of the copy protocol which implements " -"the :meth:`~object.__reduce__` special method. The copy protocol provides a " +"In fact, these methods are part of the copy protocol which implements the :" +"meth:`~object.__reduce__` special method. The copy protocol provides a " "unified interface for retrieving the data necessary for pickling and copying " "objects. [#]_" msgstr "" -"如稍後所演示,pickle 並不直接使用上述方法。這些方法實際上是實作" -"了 :meth:`~object.__reduce__` 特殊方法的拷貝協定(copy protocol)。拷貝協定提" -"供了統一的介面,以檢索進行封裝及複製物件時所需的資料。 [#]_" +"如稍後所演示,pickle 並不直接使用上述方法。這些方法實際上是實作了 :meth:" +"`~object.__reduce__` 特殊方法的拷貝協定(copy protocol)。拷貝協定提供了統一" +"的介面,以檢索進行封裝及複製物件時所需的資料。 [#]_" -#: ../../library/pickle.rst:696 +#: ../../library/pickle.rst:683 msgid "" "Although powerful, implementing :meth:`~object.__reduce__` directly in your " "classes is error prone. For this reason, class designers should use the " -"high-level interface " -"(i.e., :meth:`~object.__getnewargs_ex__`, :meth:`~object.__getstate__` " -"and :meth:`~object.__setstate__`) whenever possible. We will show, however, " -"cases where using :meth:`!__reduce__` is the only option or leads to more " -"efficient pickling or both." +"high-level interface (i.e., :meth:`~object.__getnewargs_ex__`, :meth:" +"`~object.__getstate__` and :meth:`~object.__setstate__`) whenever possible. " +"We will show, however, cases where using :meth:`!__reduce__` is the only " +"option or leads to more efficient pickling or both." msgstr "" "直接在類別中實作 :meth:`~object.__reduce__` 雖然功能強大但卻容易導致出錯。因" -"此,設計類別者應盡可能使用高階介面(例" -"如,:meth:`~object.__getnewargs_ex__`、:meth:`~object.__getstate__` " -"和 :meth:`~object.__setstate__`)。不過,我們也將展示一些特例狀況,在這些狀況" -"中,使用 :meth:`!__reduce__` 可能是唯一的選擇、是更有效率的封裝方法或二者兼" -"備。" +"此,設計類別者應盡可能使用高階介面(例如,:meth:`~object." +"__getnewargs_ex__`、:meth:`~object.__getstate__` 和 :meth:`~object." +"__setstate__`)。不過,我們也將展示一些特例狀況,在這些狀況中,使用 :meth:`!" +"__reduce__` 可能是唯一的選擇、是更有效率的封裝方法或二者兼備。" -#: ../../library/pickle.rst:705 +#: ../../library/pickle.rst:692 msgid "" "The interface is currently defined as follows. The :meth:`__reduce__` " "method takes no argument and shall return either a string or preferably a " @@ -1284,7 +1250,7 @@ msgstr "" "目前的介面定義如下。 :meth:`__reduce__` 方法不接受引數,且應回傳一個字串或一" "個元組(元組一般而言是較佳的選擇;所回傳的物件通常稱為「縮減值」)。" -#: ../../library/pickle.rst:709 +#: ../../library/pickle.rst:696 msgid "" "If a string is returned, the string should be interpreted as the name of a " "global variable. It should be the object's local name relative to its " @@ -1295,7 +1261,7 @@ msgstr "" "模組的本地名稱;pickle 模組會在模組命名空間中尋找,以確定該物件所在的模組。這" "種行為通常對於單例物件特別有用。" -#: ../../library/pickle.rst:714 +#: ../../library/pickle.rst:701 msgid "" "When a tuple is returned, it must be between two and six items long. " "Optional items can either be omitted, or ``None`` can be provided as their " @@ -1304,13 +1270,13 @@ msgstr "" "當回傳一個元組時,其長度必須介於兩至六項元素之間。可選項可以被省略,或者其值" "可以被設為 ``None``。各項物件的語意依序為:" -#: ../../library/pickle.rst:720 +#: ../../library/pickle.rst:707 msgid "" "A callable object that will be called to create the initial version of the " "object." msgstr "一個將會被呼叫來建立初始版本物件的可呼叫物件。" -#: ../../library/pickle.rst:723 +#: ../../library/pickle.rst:710 msgid "" "A tuple of arguments for the callable object. An empty tuple must be given " "if the callable does not accept any argument." @@ -1318,39 +1284,39 @@ msgstr "" "一個用於傳遞引數給前述物件的元組。如果前述物件不接受引數輸入,則你仍應在這裡" "給定一個空元組。" -#: ../../library/pickle.rst:726 +#: ../../library/pickle.rst:713 msgid "" -"Optionally, the object's state, which will be passed to the " -"object's :meth:`__setstate__` method as previously described. If the object " -"has no such method then, the value must be a dictionary and it will be added " -"to the object's :attr:`~object.__dict__` attribute." +"Optionally, the object's state, which will be passed to the object's :meth:" +"`__setstate__` method as previously described. If the object has no such " +"method then, the value must be a dictionary and it will be added to the " +"object's :attr:`~object.__dict__` attribute." msgstr "" "可選項。物件狀態。如前所述,會被傳遞給該物件的 :meth:`__setstate__` 方法。如" -"果該物件沒有實作此方法,則本值必須是一個字典,且其將會被新增到物件" -"的 :attr:`~object.__dict__` 屬性中。" +"果該物件沒有實作此方法,則本值必須是一個字典,且其將會被新增到物件的 :attr:" +"`~object.__dict__` 屬性中。" # SkyLull: [T] # signature: https://jo-jo.medium.com/c-c-%E5%B9%BC%E5%B9%BC%E7%8F%AD-%E7%B0%BD%E7%AB%A0signature-fa9b04e1a3e2 -#: ../../library/pickle.rst:731 +#: ../../library/pickle.rst:718 msgid "" "Optionally, an iterator (and not a sequence) yielding successive items. " "These items will be appended to the object either using ``obj.append(item)`` " "or, in batch, using ``obj.extend(list_of_items)``. This is primarily used " -"for list subclasses, but may be used by other classes as long as they " -"have :meth:`~sequence.append` and :meth:`~sequence.extend` methods with the " +"for list subclasses, but may be used by other classes as long as they have :" +"meth:`~sequence.append` and :meth:`~sequence.extend` methods with the " "appropriate signature. (Whether :meth:`!append` or :meth:`!extend` is used " "depends on which pickle protocol version is used as well as the number of " "items to append, so both must be supported.)" msgstr "" -"可選項。一個用來提供連續項目的疊代器(而非序列)。這些項目將個別透過 " -"``obj.append(item)`` 方法或成批次地透過 ``obj.extend(list_of_items)`` 方法被" -"附加到物件中。主要用於串列(list)子類別,但只要其他類別具有相應" -"的 :meth:`~sequence.append` 和 :meth:`~sequence.extend` 方法以及相同的函式簽章" +"可選項。一個用來提供連續項目的疊代器(而非序列)。這些項目將個別透過 ``obj." +"append(item)`` 方法或成批次地透過 ``obj.extend(list_of_items)`` 方法被附加到" +"物件中。主要用於串列(list)子類別,但只要其他類別具有相應的 :meth:" +"`~sequence.append` 和 :meth:`~sequence.extend` 方法以及相同的函式簽章" "(signature)就也可以使用。 (是否會呼叫 :meth:`!append` 或 :meth:`!extend` " "方法將取決於所選用的 pickle 協定版本以及要附加的項目數量,因此必須同時支援這" "兩種方法。)" -#: ../../library/pickle.rst:741 +#: ../../library/pickle.rst:728 msgid "" "Optionally, an iterator (not a sequence) yielding successive key-value " "pairs. These items will be stored to the object using ``obj[key] = " @@ -1361,43 +1327,42 @@ msgstr "" "value`` 方式被儲存到物件中。主要用於字典(dictionary)子類別,但只要有實現" "了 :meth:`__setitem__` 的其他類別也可以使用。" -#: ../../library/pickle.rst:746 +#: ../../library/pickle.rst:733 msgid "" "Optionally, a callable with a ``(obj, state)`` signature. This callable " "allows the user to programmatically control the state-updating behavior of a " "specific object, instead of using ``obj``'s static :meth:`__setstate__` " -"method. If not ``None``, this callable will have priority over " -"``obj``'s :meth:`__setstate__`." +"method. If not ``None``, this callable will have priority over ``obj``'s :" +"meth:`__setstate__`." msgstr "" "可選項。一個具有 ``(obj, state)`` 函式簽章(signature)的可呼叫物件。該物件允" "許使用者以可編寫的邏輯,而不是物件 ``obj`` 預設的 :meth:`__setstate__` 靜態方" "法去控制特定物件的狀態更新方式。如果這個物件不是 ``None``,這個物件的呼叫優先" "權將優於物件 ``obj`` 的 :meth:`__setstate__`。" -#: ../../library/pickle.rst:752 +#: ../../library/pickle.rst:739 msgid "The optional sixth tuple item, ``(obj, state)``, was added." msgstr "加入第六個可選項(一個 ``(obj, state)`` 元組)。" -#: ../../library/pickle.rst:758 +#: ../../library/pickle.rst:745 msgid "" "Alternatively, a :meth:`__reduce_ex__` method may be defined. The only " "difference is this method should take a single integer argument, the " -"protocol version. When defined, pickle will prefer it over " -"the :meth:`__reduce__` method. In addition, :meth:`__reduce__` " -"automatically becomes a synonym for the extended version. The main use for " -"this method is to provide backwards-compatible reduce values for older " -"Python releases." +"protocol version. When defined, pickle will prefer it over the :meth:" +"`__reduce__` method. In addition, :meth:`__reduce__` automatically becomes " +"a synonym for the extended version. The main use for this method is to " +"provide backwards-compatible reduce values for older Python releases." msgstr "" "另外,你也可以定義一個 :meth:`__reduce_ex__` 方法。唯一的不同的地方是此方法只" -"接受協定版本(整數)作為參數。當有定義本方法時,pickle 會優先呼叫它而不" -"是 :meth:`__reduce__` 。此外,呼叫 :meth:`__reduce__` 時也會自動變成呼叫這個" -"變體版本。此方法主要是為了向後相容的舊的 Python 版本而存在。" +"接受協定版本(整數)作為參數。當有定義本方法時,pickle 會優先呼叫它而不是 :" +"meth:`__reduce__` 。此外,呼叫 :meth:`__reduce__` 時也會自動變成呼叫這個變體" +"版本。此方法主要是為了向後相容的舊的 Python 版本而存在。" -#: ../../library/pickle.rst:770 +#: ../../library/pickle.rst:757 msgid "Persistence of External Objects" msgstr "外部物件持久化" -#: ../../library/pickle.rst:776 +#: ../../library/pickle.rst:763 msgid "" "For the benefit of object persistence, the :mod:`pickle` module supports the " "notion of a reference to an object outside the pickled data stream. Such " @@ -1410,18 +1375,18 @@ msgstr "" "(alphanumeric)組成的字串(協定 0) [#]_ 或者是任意的物件(任何較新的協" "定)。" -#: ../../library/pickle.rst:782 +#: ../../library/pickle.rst:769 msgid "" "The resolution of such persistent IDs is not defined by the :mod:`pickle` " "module; it will delegate this resolution to the user-defined methods on the " -"pickler and unpickler, :meth:`~Pickler.persistent_id` " -"and :meth:`~Unpickler.persistent_load` respectively." +"pickler and unpickler, :meth:`~Pickler.persistent_id` and :meth:`~Unpickler." +"persistent_load` respectively." msgstr "" ":mod:`pickle` 沒有定義要如何解決或分派這個持久化 ID 的問題;故其處理方式有賴" "使用者自行定義在封裝器(pickler)以及拆封器(unpickler)中。方法的名稱各自" "為 :meth:`~Pickler.persistent_id` 和 :meth:`~Unpickler.persistent_load`。" -#: ../../library/pickle.rst:787 +#: ../../library/pickle.rst:774 msgid "" "To pickle objects that have an external persistent ID, the pickler must have " "a custom :meth:`~Pickler.persistent_id` method that takes an object as an " @@ -1431,30 +1396,29 @@ msgid "" "object, along with a marker so that the unpickler will recognize it as a " "persistent ID." msgstr "" -"要封裝具有外部持久化 ID 的物件,封裝器(pickler)必須擁有一個自訂的方" -"法 :meth:`~Pickler.persistent_id`,這個方法將接收一個物件作為參數,並回傳 " +"要封裝具有外部持久化 ID 的物件,封裝器(pickler)必須擁有一個自訂的方法 :" +"meth:`~Pickler.persistent_id`,這個方法將接收一個物件作為參數,並回傳 " "``None`` 或該物件的持久化 ID。當回傳 ``None`` 時,封裝器會正常地封裝該物件。" "當回傳一個持久化 ID 字串時,封裝器會封裝該物件並加上一個標記,讓拆封器" "(unpickler)能識別它是一個持久化 ID。" -#: ../../library/pickle.rst:794 +#: ../../library/pickle.rst:781 msgid "" -"To unpickle external objects, the unpickler must have a " -"custom :meth:`~Unpickler.persistent_load` method that takes a persistent ID " -"object and returns the referenced object." +"To unpickle external objects, the unpickler must have a custom :meth:" +"`~Unpickler.persistent_load` method that takes a persistent ID object and " +"returns the referenced object." msgstr "" -"要拆封外部物件,拆封器(unpickler)必須有一個自訂" -"的 :meth:`~Unpickler.persistent_load` 方法,該方法應接受一個持久化 ID 物件," -"並回傳相對應的物件。" +"要拆封外部物件,拆封器(unpickler)必須有一個自訂的 :meth:`~Unpickler." +"persistent_load` 方法,該方法應接受一個持久化 ID 物件,並回傳相對應的物件。" -#: ../../library/pickle.rst:798 +#: ../../library/pickle.rst:785 msgid "" "Here is a comprehensive example presenting how persistent ID can be used to " "pickle external objects by reference." msgstr "" "以下是一個完整的範例,用以說明如何使用持久化 ID 來封裝具外部參照的物件。" -#: ../../library/pickle.rst:801 +#: ../../library/pickle.rst:788 msgid "" "# Simple example presenting how persistent ID can be used to pickle\n" "# external objects by reference.\n" @@ -1517,8 +1481,8 @@ msgid "" " # Initialize and populate our database.\n" " conn = sqlite3.connect(\":memory:\")\n" " cursor = conn.cursor()\n" -" cursor.execute(\"CREATE TABLE memos(key INTEGER PRIMARY KEY, task TEXT)" -"\")\n" +" cursor.execute(\"CREATE TABLE memos(key INTEGER PRIMARY KEY, task " +"TEXT)\")\n" " tasks = (\n" " 'give food to fish',\n" " 'prepare group meeting',\n" @@ -1604,8 +1568,8 @@ msgstr "" " # 初始化資料庫。\n" " conn = sqlite3.connect(\":memory:\")\n" " cursor = conn.cursor()\n" -" cursor.execute(\"CREATE TABLE memos(key INTEGER PRIMARY KEY, task TEXT)" -"\")\n" +" cursor.execute(\"CREATE TABLE memos(key INTEGER PRIMARY KEY, task " +"TEXT)\")\n" " tasks = (\n" " 'give food to fish',\n" " 'prepare group meeting',\n" @@ -1638,11 +1602,11 @@ msgstr "" "if __name__ == '__main__':\n" " main()\n" -#: ../../library/pickle.rst:806 +#: ../../library/pickle.rst:793 msgid "Dispatch Tables" msgstr "調度表" -#: ../../library/pickle.rst:808 +#: ../../library/pickle.rst:795 msgid "" "If one wants to customize pickling of some classes without disturbing any " "other code which depends on pickling, then one can create a pickler with a " @@ -1651,7 +1615,7 @@ msgstr "" "如果你希望在不干擾其他物件正常封裝的前提下建立一個針對特定物件的封裝器,你可" "建立一個有私密調度表的封裝器。" -#: ../../library/pickle.rst:812 +#: ../../library/pickle.rst:799 msgid "" "The global dispatch table managed by the :mod:`copyreg` module is available " "as :data:`!copyreg.dispatch_table`. Therefore, one may choose to use a " @@ -1661,11 +1625,11 @@ msgstr "" "叫。你可以透過這個方式來基於原始 :data:`!copyreg.dispatch_table` 建立一個修改" "過的版本,作為你的專屬用途的調度表。" -#: ../../library/pickle.rst:817 +#: ../../library/pickle.rst:804 msgid "For example ::" msgstr "舉例來說: ::" -#: ../../library/pickle.rst:819 +#: ../../library/pickle.rst:806 msgid "" "f = io.BytesIO()\n" "p = pickle.Pickler(f)\n" @@ -1677,7 +1641,7 @@ msgstr "" "p.dispatch_table = copyreg.dispatch_table.copy()\n" "p.dispatch_table[SomeClass] = reduce_SomeClass" -#: ../../library/pickle.rst:824 +#: ../../library/pickle.rst:811 msgid "" "creates an instance of :class:`pickle.Pickler` with a private dispatch table " "which handles the ``SomeClass`` class specially. Alternatively, the code ::" @@ -1685,7 +1649,7 @@ msgstr "" "建立了一個 :class:`pickle.Pickler`,其中含有專門處裡 ``SomeClass`` 類別的專屬" "調度表。此外,你也可以寫作:::" -#: ../../library/pickle.rst:828 +#: ../../library/pickle.rst:815 msgid "" "class MyPickler(pickle.Pickler):\n" " dispatch_table = copyreg.dispatch_table.copy()\n" @@ -1699,7 +1663,7 @@ msgstr "" "f = io.BytesIO()\n" "p = MyPickler(f)" -#: ../../library/pickle.rst:834 +#: ../../library/pickle.rst:821 msgid "" "does the same but all instances of ``MyPickler`` will by default share the " "private dispatch table. On the other hand, the code ::" @@ -1707,7 +1671,7 @@ msgstr "" "這樣可產生相似的結果,唯一不同的是往後所有 ``MyPickler`` 預設都會使用這個專屬" "調度表。最後,如果將程式寫為:::" -#: ../../library/pickle.rst:837 +#: ../../library/pickle.rst:824 msgid "" "copyreg.pickle(SomeClass, reduce_SomeClass)\n" "f = io.BytesIO()\n" @@ -1717,17 +1681,17 @@ msgstr "" "f = io.BytesIO()\n" "p = pickle.Pickler(f)" -#: ../../library/pickle.rst:841 +#: ../../library/pickle.rst:828 msgid "" "modifies the global dispatch table shared by all users of the :mod:`copyreg` " "module." msgstr "則會改變 :mod:`copyreg` 模組內建、所有使用者共通的調度表。" -#: ../../library/pickle.rst:846 +#: ../../library/pickle.rst:833 msgid "Handling Stateful Objects" msgstr "處裡紀錄大量狀態的物件" -#: ../../library/pickle.rst:852 +#: ../../library/pickle.rst:839 msgid "" "Here's an example that shows how to modify pickling behavior for a class. " "The :class:`!TextReader` class below opens a text file, and returns the line " @@ -1745,7 +1709,7 @@ msgstr "" "上次的位置繼續讀取。這個行為的達成是透過 :meth:`!__setstate__` 和 :meth:`!" "__getstate__` 方法來實作的。::" -#: ../../library/pickle.rst:860 +#: ../../library/pickle.rst:847 msgid "" "class TextReader:\n" " \"\"\"Print and number lines in a text file.\"\"\"\n" @@ -1820,11 +1784,11 @@ msgstr "" " # 存檔。\n" " self.file = file" -#: ../../library/pickle.rst:898 +#: ../../library/pickle.rst:885 msgid "A sample usage might be something like this::" msgstr "可以這樣實際使用:::" -#: ../../library/pickle.rst:900 +#: ../../library/pickle.rst:887 msgid "" ">>> reader = TextReader(\"hello.txt\")\n" ">>> reader.readline()\n" @@ -1844,11 +1808,11 @@ msgstr "" ">>> new_reader.readline()\n" "'3: Goodbye!'" -#: ../../library/pickle.rst:912 +#: ../../library/pickle.rst:899 msgid "Custom Reduction for Types, Functions, and Other Objects" msgstr "針對型別、函式或特定物件定製縮減函式" -#: ../../library/pickle.rst:916 +#: ../../library/pickle.rst:903 msgid "" "Sometimes, :attr:`~Pickler.dispatch_table` may not be flexible enough. In " "particular we may want to customize pickling based on another criterion than " @@ -1859,7 +1823,7 @@ msgstr "" "用型別以外的方式來判斷如何使用自訂封裝、或者我們想要自訂特定函式和類別的封裝" "方法時。" -#: ../../library/pickle.rst:921 +#: ../../library/pickle.rst:908 msgid "" "For those cases, it is possible to subclass from the :class:`Pickler` class " "and implement a :meth:`~Pickler.reducer_override` method. This method can " @@ -1867,40 +1831,39 @@ msgid "" "alternatively return :data:`NotImplemented` to fallback to the traditional " "behavior." msgstr "" -"如果是這樣的話,可以繼承 :class:`Pickler` 類別並實作一" -"個 :meth:`~Pickler.reducer_override` 方法。此方法可以回傳任意的縮減元組(參" -"閱 :meth:`~object.__reduce__`)、也可以回傳 :data:`NotImplemented` 以使用後備" -"的原始行為方案。" +"如果是這樣的話,可以繼承 :class:`Pickler` 類別並實作一個 :meth:`~Pickler." +"reducer_override` 方法。此方法可以回傳任意的縮減元組(參閱 :meth:`~object." +"__reduce__`)、也可以回傳 :data:`NotImplemented` 以使用後備的原始行為方案。" -#: ../../library/pickle.rst:926 +#: ../../library/pickle.rst:913 msgid "" -"If both the :attr:`~Pickler.dispatch_table` " -"and :meth:`~Pickler.reducer_override` are defined, " -"then :meth:`~Pickler.reducer_override` method takes priority." +"If both the :attr:`~Pickler.dispatch_table` and :meth:`~Pickler." +"reducer_override` are defined, then :meth:`~Pickler.reducer_override` method " +"takes priority." msgstr "" "如果 :attr:`~Pickler.dispatch_table` 和 :meth:`~Pickler.reducer_override` 都" "被定義了的話,:meth:`~Pickler.reducer_override` 的優先度較高。" -#: ../../library/pickle.rst:931 +#: ../../library/pickle.rst:918 msgid "" "For performance reasons, :meth:`~Pickler.reducer_override` may not be called " "for the following objects: ``None``, ``True``, ``False``, and exact " -"instances " -"of :class:`int`, :class:`float`, :class:`bytes`, :class:`str`, :class:`dict`, :class:`set`, :class:`frozenset`, :class:`list` " -"and :class:`tuple`." +"instances of :class:`int`, :class:`float`, :class:`bytes`, :class:`str`, :" +"class:`dict`, :class:`set`, :class:`frozenset`, :class:`list` and :class:" +"`tuple`." msgstr "" "出於效能考量,處裡以下物件可能不會呼叫 :meth:`~Pickler.reducer_override`:" -"``None``、``True``、``False``,以" -"及 :class:`int`、:class:`float`、:class:`bytes`、:class:`str`、:class:`dict`、:class:`set`、:class:`frozenset`、:class:`list` " -"和 :class:`tuple` 的實例。" +"``None``、``True``、``False``,以及 :class:`int`、:class:`float`、:class:" +"`bytes`、:class:`str`、:class:`dict`、:class:`set`、:class:`frozenset`、:" +"class:`list` 和 :class:`tuple` 的實例。" -#: ../../library/pickle.rst:937 +#: ../../library/pickle.rst:924 msgid "" "Here is a simple example where we allow pickling and reconstructing a given " "class::" msgstr "以下是一個簡單的例子,我們示範如何允許封裝和重建給定的類別:::" -#: ../../library/pickle.rst:940 +#: ../../library/pickle.rst:927 msgid "" "import io\n" "import pickle\n" @@ -1958,11 +1921,11 @@ msgstr "" "assert unpickled_class.__name__ == \"MyClass\"\n" "assert unpickled_class.my_attribute == 1\n" -#: ../../library/pickle.rst:972 +#: ../../library/pickle.rst:959 msgid "Out-of-band Buffers" msgstr "帶外(Out-of-band)資料緩衝區" -#: ../../library/pickle.rst:976 +#: ../../library/pickle.rst:963 msgid "" "In some contexts, the :mod:`pickle` module is used to transfer massive " "amounts of data. Therefore, it can be important to minimize the number of " @@ -1976,7 +1939,7 @@ msgstr "" "的圖狀結構(graph-like structure)轉換為連續的位元組串流時,本質上就涉及將資" "料複製到封裝流以及從封裝流複製資料。" -#: ../../library/pickle.rst:983 +#: ../../library/pickle.rst:970 msgid "" "This constraint can be eschewed if both the *provider* (the implementation " "of the object types to be transferred) and the *consumer* (the " @@ -1987,23 +1950,22 @@ msgstr "" "實作)都支援由 pickle 協定 5 或更高版本提供的帶外傳輸功能,則可以避免此一先天" "限制。" -#: ../../library/pickle.rst:989 +#: ../../library/pickle.rst:976 msgid "Provider API" msgstr "供給者 API" -#: ../../library/pickle.rst:991 +#: ../../library/pickle.rst:978 msgid "" -"The large data objects to be pickled must implement " -"a :meth:`~object.__reduce_ex__` method specialized for protocol 5 and " -"higher, which returns a :class:`PickleBuffer` instance (instead of e.g. " -"a :class:`bytes` object) for any large data." +"The large data objects to be pickled must implement a :meth:`~object." +"__reduce_ex__` method specialized for protocol 5 and higher, which returns " +"a :class:`PickleBuffer` instance (instead of e.g. a :class:`bytes` object) " +"for any large data." msgstr "" -"要封裝的大型資料物件,則必須實作一個針對 5 版協定及以上" -"的 :meth:`~object.__reduce_ex__` 方法,該方法應回傳一" -"個 :class:`PickleBuffer` 實例來處理任何大型資料(而非回傳如 :class:`bytes` 物" -"件)。" +"要封裝的大型資料物件,則必須實作一個針對 5 版協定及以上的 :meth:`~object." +"__reduce_ex__` 方法,該方法應回傳一個 :class:`PickleBuffer` 實例來處理任何大" +"型資料(而非回傳如 :class:`bytes` 物件)。" -#: ../../library/pickle.rst:996 +#: ../../library/pickle.rst:983 msgid "" "A :class:`PickleBuffer` object *signals* that the underlying buffer is " "eligible for out-of-band data transfer. Those objects remain compatible " @@ -2015,50 +1977,49 @@ msgstr "" "資料傳輸。這些物件仍然相容 :mod:`pickle` 模組的一般使用方式。消費者程式也可以" "選擇介入,指示 :mod:`pickle` 他們將自行處理這些緩衝區。" -#: ../../library/pickle.rst:1003 +#: ../../library/pickle.rst:990 msgid "Consumer API" msgstr "消費者 API" -#: ../../library/pickle.rst:1005 +#: ../../library/pickle.rst:992 msgid "" -"A communications system can enable custom handling of " -"the :class:`PickleBuffer` objects generated when serializing an object graph." +"A communications system can enable custom handling of the :class:" +"`PickleBuffer` objects generated when serializing an object graph." msgstr "" "一個資訊交換系統可以決定要自行處裡序列化物件圖時產生的 :class:`PickleBuffer` " "物件。" -#: ../../library/pickle.rst:1008 +#: ../../library/pickle.rst:995 msgid "" -"On the sending side, it needs to pass a *buffer_callback* argument " -"to :class:`Pickler` (or to the :func:`dump` or :func:`dumps` function), " -"which will be called with each :class:`PickleBuffer` generated while " -"pickling the object graph. Buffers accumulated by the *buffer_callback* " -"will not see their data copied into the pickle stream, only a cheap marker " -"will be inserted." +"On the sending side, it needs to pass a *buffer_callback* argument to :class:" +"`Pickler` (or to the :func:`dump` or :func:`dumps` function), which will be " +"called with each :class:`PickleBuffer` generated while pickling the object " +"graph. Buffers accumulated by the *buffer_callback* will not see their data " +"copied into the pickle stream, only a cheap marker will be inserted." msgstr "" -"傳送端需要傳遞一個呼叫緩衝區的回呼函式給 :class:`Pickler`\\ " -"(或 :func:`dump` 或 :func:`dumps` 函式)的 *buffer_callback* 引數,使每次生" -"成 :class:`PickleBuffer` 時,該物件在處理物件圖時能被呼叫。除了一個簡易標記以" -"外,由 *buffer_callback* 累積的緩衝區資料不會被複製到 pickle 串流中。" +"傳送端需要傳遞一個呼叫緩衝區的回呼函式給 :class:`Pickler`\\ (或 :func:" +"`dump` 或 :func:`dumps` 函式)的 *buffer_callback* 引數,使每次生成 :class:" +"`PickleBuffer` 時,該物件在處理物件圖時能被呼叫。除了一個簡易標記以外,由 " +"*buffer_callback* 累積的緩衝區資料不會被複製到 pickle 串流中。" -#: ../../library/pickle.rst:1015 +#: ../../library/pickle.rst:1002 msgid "" -"On the receiving side, it needs to pass a *buffers* argument " -"to :class:`Unpickler` (or to the :func:`load` or :func:`loads` function), " -"which is an iterable of the buffers which were passed to *buffer_callback*. " -"That iterable should produce buffers in the same order as they were passed " -"to *buffer_callback*. Those buffers will provide the data expected by the " -"reconstructors of the objects whose pickling produced the " -"original :class:`PickleBuffer` objects." +"On the receiving side, it needs to pass a *buffers* argument to :class:" +"`Unpickler` (or to the :func:`load` or :func:`loads` function), which is an " +"iterable of the buffers which were passed to *buffer_callback*. That " +"iterable should produce buffers in the same order as they were passed to " +"*buffer_callback*. Those buffers will provide the data expected by the " +"reconstructors of the objects whose pickling produced the original :class:" +"`PickleBuffer` objects." msgstr "" -"接收端需要傳遞一個緩衝區物件給 :class:`Unpickler`\\ (或 :func:`load` " -"或 :func:`loads` 函式)的 *buffers* 引數。該物件須是一個可疊代的(iterable)" -"緩衝區(buffer)物件,其中包含傳遞給 *buffer_callback* 的緩衝區物件。這個可疊" -"代物件的緩衝區順序應該與它們當初被封裝時傳遞給 *buffer_callback* 的順序相同。" -"這些緩衝區將提供物件重建所需的資料,以使重建器能還原出那個當時產生" -"了 :class:`PickleBuffer` 的物件。" +"接收端需要傳遞一個緩衝區物件給 :class:`Unpickler`\\ (或 :func:`load` 或 :" +"func:`loads` 函式)的 *buffers* 引數。該物件須是一個可疊代的(iterable)緩衝" +"區(buffer)物件,其中包含傳遞給 *buffer_callback* 的緩衝區物件。這個可疊代物" +"件的緩衝區順序應該與它們當初被封裝時傳遞給 *buffer_callback* 的順序相同。這些" +"緩衝區將提供物件重建所需的資料,以使重建器能還原出那個當時產生了 :class:" +"`PickleBuffer` 的物件。" -#: ../../library/pickle.rst:1023 +#: ../../library/pickle.rst:1010 msgid "" "Between the sending side and the receiving side, the communications system " "is free to implement its own transfer mechanism for out-of-band buffers. " @@ -2068,19 +2029,19 @@ msgstr "" "在傳送與接收端之間,通訊系統可以自由實作轉移帶外緩衝區資料的機制。該機制可能" "可以利用共用記憶體機制或根據資料類型特定的壓縮方式來最佳化執行速度。" -#: ../../library/pickle.rst:1029 +#: ../../library/pickle.rst:1016 msgid "Example" msgstr "範例" -#: ../../library/pickle.rst:1031 +#: ../../library/pickle.rst:1018 msgid "" "Here is a trivial example where we implement a :class:`bytearray` subclass " "able to participate in out-of-band buffer pickling::" msgstr "" -"這一個簡單的範例展示了如何實作一個可以參與帶外緩衝區封裝" -"的 :class:`bytearray` 子類別:::" +"這一個簡單的範例展示了如何實作一個可以參與帶外緩衝區封裝的 :class:" +"`bytearray` 子類別:::" -#: ../../library/pickle.rst:1034 +#: ../../library/pickle.rst:1021 msgid "" "class ZeroCopyByteArray(bytearray):\n" "\n" @@ -2123,7 +2084,7 @@ msgstr "" " else:\n" " return cls(obj)" -#: ../../library/pickle.rst:1055 +#: ../../library/pickle.rst:1042 msgid "" "The reconstructor (the ``_reconstruct`` class method) returns the buffer's " "providing object if it has the right type. This is an easy way to simulate " @@ -2132,7 +2093,7 @@ msgstr "" "如果型別正確,重建器(``_reconstruct`` 類別方法)會回傳當時提供緩衝區的物件。" "這個簡易實作可以模擬一個無複製行為的重建器。" -#: ../../library/pickle.rst:1059 +#: ../../library/pickle.rst:1046 msgid "" "On the consumer side, we can pickle those objects the usual way, which when " "unserialized will give us a copy of the original object::" @@ -2140,7 +2101,7 @@ msgstr "" "在使用端,我們可以用一般的方式封裝這些物件,當我們拆封時會得到一個原始物件的" "副本:::" -#: ../../library/pickle.rst:1062 +#: ../../library/pickle.rst:1049 msgid "" "b = ZeroCopyByteArray(b\"abc\")\n" "data = pickle.dumps(b, protocol=5)\n" @@ -2154,7 +2115,7 @@ msgstr "" "print(b == new_b) # True\n" "print(b is new_b) # False: 曾進行過複製運算" -#: ../../library/pickle.rst:1068 +#: ../../library/pickle.rst:1055 msgid "" "But if we pass a *buffer_callback* and then give back the accumulated " "buffers when unserializing, we are able to get back the original object::" @@ -2162,7 +2123,7 @@ msgstr "" "但如果我們傳一個 *buffer_callback* 並在去序列化時正確回傳積累的緩衝資料,我們" "就能拿回原始的物件:::" -#: ../../library/pickle.rst:1071 +#: ../../library/pickle.rst:1058 msgid "" "b = ZeroCopyByteArray(b\"abc\")\n" "buffers = []\n" @@ -2178,7 +2139,7 @@ msgstr "" "print(b == new_b) # True\n" "print(b is new_b) # True: 沒有進行過複製" -#: ../../library/pickle.rst:1078 +#: ../../library/pickle.rst:1065 msgid "" "This example is limited by the fact that :class:`bytearray` allocates its " "own memory: you cannot create a :class:`bytearray` instance that is backed " @@ -2192,15 +2153,15 @@ msgstr "" "則可能沒有這個限制,而允許在不同程序或系統之間傳輸資料時使用零拷貝封裝(或儘" "可能地減少拷貝次數)。" -#: ../../library/pickle.rst:1085 +#: ../../library/pickle.rst:1072 msgid ":pep:`574` -- Pickle protocol 5 with out-of-band data" msgstr ":pep:`574` -- 第 5 版 Pickle 協定的帶外資料(out-of-band data)處裡" -#: ../../library/pickle.rst:1091 +#: ../../library/pickle.rst:1078 msgid "Restricting Globals" msgstr "限制全域物件" -#: ../../library/pickle.rst:1096 +#: ../../library/pickle.rst:1083 msgid "" "By default, unpickling will import any class or function that it finds in " "the pickle data. For many applications, this behaviour is unacceptable as " @@ -2211,7 +2172,7 @@ msgstr "" "用程式來說,這種行為是不可接受的,因為它讓拆封器能夠引入並執行任意程式碼。請" "參見以下 pickle 資料流在載入時的行為:::" -#: ../../library/pickle.rst:1101 +#: ../../library/pickle.rst:1088 msgid "" ">>> import pickle\n" ">>> pickle.loads(b\"cos\\nsystem\\n(S'echo hello world'\\ntR.\")\n" @@ -2223,7 +2184,7 @@ msgstr "" "hello world\n" "0" -#: ../../library/pickle.rst:1106 +#: ../../library/pickle.rst:1093 msgid "" "In this example, the unpickler imports the :func:`os.system` function and " "then apply the string argument \"echo hello world\". Although this example " @@ -2234,28 +2195,28 @@ msgstr "" "world」。雖然這個例子是無害的,但不難想像可以這個方式輕易執行任意可能對系統造" "成損害的命令。" -#: ../../library/pickle.rst:1110 +#: ../../library/pickle.rst:1097 msgid "" -"For this reason, you may want to control what gets unpickled by " -"customizing :meth:`Unpickler.find_class`. Unlike its name " -"suggests, :meth:`Unpickler.find_class` is called whenever a global (i.e., a " -"class or a function) is requested. Thus it is possible to either completely " -"forbid globals or restrict them to a safe subset." +"For this reason, you may want to control what gets unpickled by customizing :" +"meth:`Unpickler.find_class`. Unlike its name suggests, :meth:`Unpickler." +"find_class` is called whenever a global (i.e., a class or a function) is " +"requested. Thus it is possible to either completely forbid globals or " +"restrict them to a safe subset." msgstr "" "基於以上原因,你可能會希望透過自訂 :meth:`Unpickler.find_class` 來控制哪些是" "能夠被拆封的內容。與其名稱字面意義暗示的不同,實際上每當你請求一個全域物件" "(例如,類別或函式)時,就會呼叫 :meth:`Unpickler.find_class`。因此,可以透過" "這個方法完全禁止全域物件或將其限制在安全的子集合。" -#: ../../library/pickle.rst:1116 +#: ../../library/pickle.rst:1103 msgid "" -"Here is an example of an unpickler allowing only few safe classes from " -"the :mod:`builtins` module to be loaded::" +"Here is an example of an unpickler allowing only few safe classes from the :" +"mod:`builtins` module to be loaded::" msgstr "" "以下是一個僅允許從 :mod:`builtins` 模組中載入少數安全類別的拆封器" "(unpickler)的例子:::" -#: ../../library/pickle.rst:1119 +#: ../../library/pickle.rst:1106 msgid "" "import builtins\n" "import io\n" @@ -2309,11 +2270,11 @@ msgstr "" " \"\"\"一個模擬 pickle.loads() 的輔助函式\"\"\"\n" " return RestrictedUnpickler(io.BytesIO(s)).load()" -#: ../../library/pickle.rst:1145 +#: ../../library/pickle.rst:1132 msgid "A sample usage of our unpickler working as intended::" msgstr "我們剛才實作的的拆封器範例正常運作的樣子:::" -#: ../../library/pickle.rst:1147 +#: ../../library/pickle.rst:1134 msgid "" ">>> restricted_loads(pickle.dumps([1, 2, range(15)]))\n" "[1, 2, range(0, 15)]\n" @@ -2341,7 +2302,7 @@ msgstr "" " ...\n" "pickle.UnpicklingError: global 'builtins.eval' is forbidden" -#: ../../library/pickle.rst:1164 +#: ../../library/pickle.rst:1151 msgid "" "As our examples shows, you have to be careful with what you allow to be " "unpickled. Therefore if security is a concern, you may want to consider " @@ -2352,11 +2313,11 @@ msgstr "" "心安全性,你可能需要考慮其他選擇,例如 :mod:`xmlrpc.client` 中的 marshalling " "API 或其他第三方解決方案。" -#: ../../library/pickle.rst:1171 +#: ../../library/pickle.rst:1158 msgid "Performance" msgstr "效能" -#: ../../library/pickle.rst:1173 +#: ../../library/pickle.rst:1160 msgid "" "Recent versions of the pickle protocol (from protocol 2 and upwards) feature " "efficient binary encodings for several common features and built-in types. " @@ -2366,16 +2327,16 @@ msgstr "" "率的二進位編碼。此外,:mod:`pickle` 模組還具備一個透明化的、以 C 語言編寫的最" "佳化工具。" -#: ../../library/pickle.rst:1181 +#: ../../library/pickle.rst:1168 msgid "Examples" msgstr "範例" -#: ../../library/pickle.rst:1183 +#: ../../library/pickle.rst:1170 msgid "" "For the simplest code, use the :func:`dump` and :func:`load` functions. ::" msgstr "最簡單的使用方式,呼叫 :func:`dump` 和 :func:`load` 函式。::" -#: ../../library/pickle.rst:1185 +#: ../../library/pickle.rst:1172 msgid "" "import pickle\n" "\n" @@ -2403,11 +2364,11 @@ msgstr "" " # 使用可用的最高協定來封裝 'data' 字典。\n" " pickle.dump(data, f, pickle.HIGHEST_PROTOCOL)\n" -#: ../../library/pickle.rst:1199 +#: ../../library/pickle.rst:1186 msgid "The following example reads the resulting pickled data. ::" msgstr "以下範例可以讀取前述程式所封裝的 pickle 資料。::" -#: ../../library/pickle.rst:1201 +#: ../../library/pickle.rst:1188 msgid "" "import pickle\n" "\n" @@ -2422,81 +2383,81 @@ msgstr "" " # 會自動檢測資料使用的協定版本,因此我們不需要手動指定。\n" " data = pickle.load(f)" -#: ../../library/pickle.rst:1216 +#: ../../library/pickle.rst:1203 msgid "Command-line interface" msgstr "命令列介面" -#: ../../library/pickle.rst:1218 +#: ../../library/pickle.rst:1205 msgid "" "The :mod:`pickle` module can be invoked as a script from the command line, " "it will display contents of the pickle files. However, when the pickle file " "that you want to examine comes from an untrusted source, ``-m pickletools`` " -"is a safer option because it does not execute pickle bytecode, " -"see :ref:`pickletools CLI usage `." +"is a safer option because it does not execute pickle bytecode, see :ref:" +"`pickletools CLI usage `." msgstr "" -#: ../../library/pickle.rst:1224 +#: ../../library/pickle.rst:1211 msgid "python -m pickle pickle_file [pickle_file ...]" msgstr "python -m pickle pickle_file [pickle_file ...]" -#: ../../library/pickle.rst:1228 +#: ../../library/pickle.rst:1215 msgid "The following option is accepted:" msgstr "接受以下選項:" -#: ../../library/pickle.rst:1234 +#: ../../library/pickle.rst:1221 msgid "" "A pickle file to read, or ``-`` to indicate reading from standard input." msgstr "" -#: ../../library/pickle.rst:1239 +#: ../../library/pickle.rst:1226 msgid "Module :mod:`copyreg`" msgstr ":mod:`copyreg` 模組" -#: ../../library/pickle.rst:1240 +#: ../../library/pickle.rst:1227 msgid "Pickle interface constructor registration for extension types." msgstr "註冊擴充型別的 Pickle 介面建構子。" -#: ../../library/pickle.rst:1242 +#: ../../library/pickle.rst:1229 msgid "Module :mod:`pickletools`" msgstr ":mod:`pickletools` 模組" -#: ../../library/pickle.rst:1243 +#: ../../library/pickle.rst:1230 msgid "Tools for working with and analyzing pickled data." msgstr "用於分析或處裡被封裝資料的工具。" -#: ../../library/pickle.rst:1245 +#: ../../library/pickle.rst:1232 msgid "Module :mod:`shelve`" msgstr ":mod:`shelve` 模組" -#: ../../library/pickle.rst:1246 +#: ../../library/pickle.rst:1233 msgid "Indexed databases of objects; uses :mod:`pickle`." msgstr "索引式資料庫;使用 :mod:`pickle` 實作。" -#: ../../library/pickle.rst:1248 +#: ../../library/pickle.rst:1235 msgid "Module :mod:`copy`" msgstr ":mod:`copy` 模組" -#: ../../library/pickle.rst:1249 +#: ../../library/pickle.rst:1236 msgid "Shallow and deep object copying." msgstr "物件的淺層或深度拷貝。" -#: ../../library/pickle.rst:1251 +#: ../../library/pickle.rst:1238 msgid "Module :mod:`marshal`" msgstr ":mod:`marshal` 模組" -#: ../../library/pickle.rst:1252 +#: ../../library/pickle.rst:1239 msgid "High-performance serialization of built-in types." msgstr "內建型別的高效能序列化。" -#: ../../library/pickle.rst:1256 +#: ../../library/pickle.rst:1243 msgid "Footnotes" msgstr "註解" -#: ../../library/pickle.rst:1257 +#: ../../library/pickle.rst:1244 msgid "Don't confuse this with the :mod:`marshal` module" msgstr "不要將此模組與 :mod:`marshal` 模組混淆" -#: ../../library/pickle.rst:1259 +#: ../../library/pickle.rst:1246 msgid "" "This is why :keyword:`lambda` functions cannot be pickled: all :keyword:`!" "lambda` functions share the same name: ````." @@ -2504,21 +2465,21 @@ msgstr "" "這就是為什麼 :keyword:`lambda` 函式無法被封裝:所有 :keyword:`!lambda` 函式共" "享相同的名稱:````。" -#: ../../library/pickle.rst:1262 +#: ../../library/pickle.rst:1249 msgid "" -"The exception raised will likely be an :exc:`ImportError` or " -"an :exc:`AttributeError` but it could be something else." +"The exception raised will likely be an :exc:`ImportError` or an :exc:" +"`AttributeError` but it could be something else." msgstr "" "引發的例外應該是 :exc:`ImportError` 或 :exc:`AttributeError`,但也可能是其他" "例外。" -#: ../../library/pickle.rst:1265 +#: ../../library/pickle.rst:1252 msgid "" "The :mod:`copy` module uses this protocol for shallow and deep copying " "operations." msgstr ":mod:`copy` 模組使用此協定進行淺層及深層複製操作。" -#: ../../library/pickle.rst:1268 +#: ../../library/pickle.rst:1255 msgid "" "The limitation on alphanumeric characters is due to the fact that persistent " "IDs in protocol 0 are delimited by the newline character. Therefore if any " @@ -2557,34 +2518,59 @@ msgstr "flattening(攤平)" msgid "pickling" msgstr "pickling" -#: ../../library/pickle.rst:123 +#: ../../library/pickle.rst:110 msgid "External Data Representation" msgstr "External Data Representation(外部資料表現)" -#: ../../library/pickle.rst:688 +#: ../../library/pickle.rst:675 msgid "copy" msgstr "copy(複製)" -#: ../../library/pickle.rst:688 +#: ../../library/pickle.rst:675 msgid "protocol" msgstr "protocol(協定)" -#: ../../library/pickle.rst:772 +#: ../../library/pickle.rst:759 msgid "persistent_id (pickle protocol)" msgstr "persistent_id(pickle 協定)" -#: ../../library/pickle.rst:772 +#: ../../library/pickle.rst:759 msgid "persistent_load (pickle protocol)" msgstr "persistent_load(pickle 協定)" -#: ../../library/pickle.rst:848 +#: ../../library/pickle.rst:835 msgid "__getstate__() (copy protocol)" msgstr "__getstate__()(copy 協定)" -#: ../../library/pickle.rst:848 +#: ../../library/pickle.rst:835 msgid "__setstate__() (copy protocol)" msgstr "__setstate__()(copy 協定)" -#: ../../library/pickle.rst:1093 +#: ../../library/pickle.rst:1080 msgid "find_class() (pickle protocol)" msgstr "find_class()(pickle 協定)" + +#~ msgid "" +#~ "The :mod:`pickle` module keeps track of the objects it has already " +#~ "serialized, so that later references to the same object won't be " +#~ "serialized again. :mod:`marshal` doesn't do this." +#~ msgstr "" +#~ ":mod:`pickle` 會記住哪些物件已經被序列化過了,稍後再次參照到這個物件的時候" +#~ "才不會進行重複的序列化。:mod:`marshal` 沒有這個功能。" + +#~ msgid "" +#~ "This has implications both for recursive objects and object sharing. " +#~ "Recursive objects are objects that contain references to themselves. " +#~ "These are not handled by marshal, and in fact, attempting to marshal " +#~ "recursive objects will crash your Python interpreter. Object sharing " +#~ "happens when there are multiple references to the same object in " +#~ "different places in the object hierarchy being serialized. :mod:`pickle` " +#~ "stores such objects only once, and ensures that all other references " +#~ "point to the master copy. Shared objects remain shared, which can be " +#~ "very important for mutable objects." +#~ msgstr "" +#~ "這對遞迴物件和物件共用都有影響。遞迴物件是指包含自我參照的物件。這些情況" +#~ "在 marshal 模組中不會被處理,若嘗試使用 marshal 處理遞迴物件會導致 Python " +#~ "直譯器崩潰。物件共用發生在序列化的物件階層中、不同位置對同一物件有多個參照" +#~ "時。:mod:`pickle` 只會儲存這個被參照的物件一次,並確保所有其他參照指向這個" +#~ "主要的版本。共用的物件會保持共用,這對於可變(mutable)物件來說非常重要。" diff --git a/reference/datamodel.po b/reference/datamodel.po index 2485b3b16e..4165a4ab6e 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-08 07:22+0000\n" +"POT-Creation-Date: 2026-01-27 00:17+0000\n" "PO-Revision-Date: 2024-09-24 19:03+0900\n" "Last-Translator: Kisaragi Hiu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -670,91 +670,97 @@ msgid "" "containing the same number of items as the function's formal parameter list." msgstr "" -#: ../../reference/datamodel.rst:546 ../../reference/datamodel.rst:1447 -#: ../../reference/datamodel.rst:1648 +#: ../../reference/datamodel.rst:546 ../../reference/datamodel.rst:1454 +#: ../../reference/datamodel.rst:1655 msgid "Special read-only attributes" msgstr "特殊唯讀屬性" -#: ../../reference/datamodel.rst:556 ../../reference/datamodel.rst:592 -#: ../../reference/datamodel.rst:1195 +#: ../../reference/datamodel.rst:557 ../../reference/datamodel.rst:599 +#: ../../reference/datamodel.rst:1202 msgid "Attribute" msgstr "屬性" -#: ../../reference/datamodel.rst:557 ../../reference/datamodel.rst:593 -#: ../../reference/datamodel.rst:1196 +#: ../../reference/datamodel.rst:558 ../../reference/datamodel.rst:600 +#: ../../reference/datamodel.rst:1203 msgid "Meaning" msgstr "含義" -#: ../../reference/datamodel.rst:560 +#: ../../reference/datamodel.rst:561 +msgid "" +"A reference to the :class:`dictionary ` that holds the function's " +"builtins namespace." +msgstr "" + +#: ../../reference/datamodel.rst:567 msgid "" "A reference to the :class:`dictionary ` that holds the function's :ref:" "`global variables ` -- the global namespace of the module in which " "the function was defined." msgstr "" -#: ../../reference/datamodel.rst:565 +#: ../../reference/datamodel.rst:572 msgid "" "``None`` or a :class:`tuple` of cells that contain bindings for the names " "specified in the :attr:`~codeobject.co_freevars` attribute of the " "function's :attr:`code object `." msgstr "" -#: ../../reference/datamodel.rst:569 +#: ../../reference/datamodel.rst:576 msgid "" "A cell object has the attribute ``cell_contents``. This can be used to get " "the value of the cell, as well as set the value." msgstr "" -#: ../../reference/datamodel.rst:573 ../../reference/datamodel.rst:1696 +#: ../../reference/datamodel.rst:580 ../../reference/datamodel.rst:1703 msgid "Special writable attributes" msgstr "特殊可寫屬性" -#: ../../reference/datamodel.rst:587 +#: ../../reference/datamodel.rst:594 msgid "Most of these attributes check the type of the assigned value:" msgstr "" -#: ../../reference/datamodel.rst:596 +#: ../../reference/datamodel.rst:603 msgid "The function's documentation string, or ``None`` if unavailable." msgstr "函式的文件字串,若不可用則為 ``None``。" -#: ../../reference/datamodel.rst:599 +#: ../../reference/datamodel.rst:606 msgid "" "The function's name. See also: :attr:`__name__ attributes `." msgstr "" -#: ../../reference/datamodel.rst:603 +#: ../../reference/datamodel.rst:610 msgid "" "The function's :term:`qualified name`. See also: :attr:`__qualname__ " "attributes `." msgstr "" -#: ../../reference/datamodel.rst:609 +#: ../../reference/datamodel.rst:616 msgid "" "The name of the module the function was defined in, or ``None`` if " "unavailable." msgstr "" -#: ../../reference/datamodel.rst:613 +#: ../../reference/datamodel.rst:620 msgid "" "A :class:`tuple` containing default :term:`parameter` values for those " "parameters that have defaults, or ``None`` if no parameters have a default " "value." msgstr "" -#: ../../reference/datamodel.rst:618 +#: ../../reference/datamodel.rst:625 msgid "" "The :ref:`code object ` representing the compiled function " "body." msgstr "代表編譯函式主體的\\ :ref:`程式碼物件 `。" -#: ../../reference/datamodel.rst:622 +#: ../../reference/datamodel.rst:629 msgid "" "The namespace supporting arbitrary function attributes. See also: :attr:" "`__dict__ attributes `." msgstr "" -#: ../../reference/datamodel.rst:626 +#: ../../reference/datamodel.rst:633 msgid "" "A :class:`dictionary ` containing annotations of :term:`parameters " "`. The keys of the dictionary are the parameter names, and " @@ -762,101 +768,101 @@ msgid "" "__annotations__`." msgstr "" -#: ../../reference/datamodel.rst:632 ../../reference/datamodel.rst:1101 -#: ../../reference/datamodel.rst:1253 +#: ../../reference/datamodel.rst:639 ../../reference/datamodel.rst:1108 +#: ../../reference/datamodel.rst:1260 msgid "" "Annotations are now :ref:`lazily evaluated `. See :pep:" "`649`." msgstr "" -#: ../../reference/datamodel.rst:637 +#: ../../reference/datamodel.rst:644 msgid "" "The :term:`annotate function` for this function, or ``None`` if the function " "has no annotations. See :attr:`object.__annotate__`." msgstr "" -#: ../../reference/datamodel.rst:643 +#: ../../reference/datamodel.rst:650 msgid "" "A :class:`dictionary ` containing defaults for keyword-only :term:" "`parameters `." msgstr "" -#: ../../reference/datamodel.rst:647 +#: ../../reference/datamodel.rst:654 msgid "" "A :class:`tuple` containing the :ref:`type parameters ` of a :" "ref:`generic function `." msgstr "" -#: ../../reference/datamodel.rst:652 +#: ../../reference/datamodel.rst:659 msgid "" "Function objects also support getting and setting arbitrary attributes, " "which can be used, for example, to attach metadata to functions. Regular " "attribute dot-notation is used to get and set such attributes." msgstr "" -#: ../../reference/datamodel.rst:658 +#: ../../reference/datamodel.rst:665 msgid "" "CPython's current implementation only supports function attributes on user-" "defined functions. Function attributes on :ref:`built-in functions ` may be supported in the future." msgstr "" -#: ../../reference/datamodel.rst:663 +#: ../../reference/datamodel.rst:670 msgid "" "Additional information about a function's definition can be retrieved from " "its :ref:`code object ` (accessible via the :attr:`~function." "__code__` attribute)." msgstr "" -#: ../../reference/datamodel.rst:671 +#: ../../reference/datamodel.rst:678 msgid "Instance methods" msgstr "實例方法" -#: ../../reference/datamodel.rst:678 +#: ../../reference/datamodel.rst:685 msgid "" "An instance method object combines a class, a class instance and any " "callable object (normally a user-defined function)." msgstr "" -#: ../../reference/datamodel.rst:688 ../../reference/datamodel.rst:1792 +#: ../../reference/datamodel.rst:695 ../../reference/datamodel.rst:1799 msgid "Special read-only attributes:" msgstr "特殊唯讀屬性:" -#: ../../reference/datamodel.rst:693 +#: ../../reference/datamodel.rst:700 msgid "" "Refers to the class instance object to which the method is :ref:`bound " "`" msgstr "" -#: ../../reference/datamodel.rst:697 +#: ../../reference/datamodel.rst:704 msgid "Refers to the original :ref:`function object `" msgstr "" -#: ../../reference/datamodel.rst:700 +#: ../../reference/datamodel.rst:707 msgid "" "The method's documentation (same as :attr:`method.__func__.__doc__ `). A :class:`string ` if the original function had a " "docstring, else ``None``." msgstr "" -#: ../../reference/datamodel.rst:706 +#: ../../reference/datamodel.rst:713 msgid "" "The name of the method (same as :attr:`method.__func__.__name__ `)" msgstr "" -#: ../../reference/datamodel.rst:710 +#: ../../reference/datamodel.rst:717 msgid "" "The name of the module the method was defined in, or ``None`` if unavailable." msgstr "" -#: ../../reference/datamodel.rst:713 +#: ../../reference/datamodel.rst:720 msgid "" "Methods also support accessing (but not setting) the arbitrary function " "attributes on the underlying :ref:`function object `." msgstr "" -#: ../../reference/datamodel.rst:716 +#: ../../reference/datamodel.rst:723 msgid "" "User-defined method objects may be created when getting an attribute of a " "class (perhaps via an instance of that class), if that attribute is a user-" @@ -864,7 +870,7 @@ msgid "" "`classmethod` object." msgstr "" -#: ../../reference/datamodel.rst:723 +#: ../../reference/datamodel.rst:730 msgid "" "When an instance method object is created by retrieving a user-defined :ref:" "`function object ` from a class via one of its " @@ -873,7 +879,7 @@ msgid "" "__func__` attribute is the original function object." msgstr "" -#: ../../reference/datamodel.rst:729 +#: ../../reference/datamodel.rst:736 msgid "" "When an instance method object is created by retrieving a :class:" "`classmethod` object from a class or instance, its :attr:`~method.__self__` " @@ -881,7 +887,7 @@ msgid "" "the function object underlying the class method." msgstr "" -#: ../../reference/datamodel.rst:734 +#: ../../reference/datamodel.rst:741 msgid "" "When an instance method object is called, the underlying function (:attr:" "`~method.__func__`) is called, inserting the class instance (:attr:`~method." @@ -891,7 +897,7 @@ msgid "" "f(x, 1)``." msgstr "" -#: ../../reference/datamodel.rst:741 +#: ../../reference/datamodel.rst:748 msgid "" "When an instance method object is derived from a :class:`classmethod` " "object, the \"class instance\" stored in :attr:`~method.__self__` will " @@ -900,18 +906,18 @@ msgid "" "function." msgstr "" -#: ../../reference/datamodel.rst:746 +#: ../../reference/datamodel.rst:753 msgid "" "It is important to note that user-defined functions which are attributes of " "a class instance are not converted to bound methods; this *only* happens " "when the function is an attribute of the class." msgstr "" -#: ../../reference/datamodel.rst:753 +#: ../../reference/datamodel.rst:760 msgid "Generator functions" msgstr "產生器函式" -#: ../../reference/datamodel.rst:759 +#: ../../reference/datamodel.rst:766 msgid "" "A function or method which uses the :keyword:`yield` statement (see section :" "ref:`yield`) is called a :dfn:`generator function`. Such a function, when " @@ -924,11 +930,11 @@ msgid "" "values to be returned." msgstr "" -#: ../../reference/datamodel.rst:771 +#: ../../reference/datamodel.rst:778 msgid "Coroutine functions" msgstr "Coroutine(協程)函式" -#: ../../reference/datamodel.rst:776 +#: ../../reference/datamodel.rst:783 msgid "" "A function or method which is defined using :keyword:`async def` is called " "a :dfn:`coroutine function`. Such a function, when called, returns a :term:" @@ -937,11 +943,11 @@ msgid "" "ref:`coroutine-objects` section." msgstr "" -#: ../../reference/datamodel.rst:784 +#: ../../reference/datamodel.rst:791 msgid "Asynchronous generator functions" msgstr "非同步產生器函式" -#: ../../reference/datamodel.rst:790 +#: ../../reference/datamodel.rst:797 msgid "" "A function or method which is defined using :keyword:`async def` and which " "uses the :keyword:`yield` statement is called a :dfn:`asynchronous generator " @@ -950,7 +956,7 @@ msgid "" "execute the body of the function." msgstr "" -#: ../../reference/datamodel.rst:796 +#: ../../reference/datamodel.rst:803 msgid "" "Calling the asynchronous iterator's :meth:`aiterator.__anext__ ` method will return an :term:`awaitable` which when awaited will " @@ -961,11 +967,11 @@ msgid "" "yielded." msgstr "" -#: ../../reference/datamodel.rst:809 +#: ../../reference/datamodel.rst:816 msgid "Built-in functions" msgstr "內建函式" -#: ../../reference/datamodel.rst:816 +#: ../../reference/datamodel.rst:823 msgid "" "A built-in function object is a wrapper around a C function. Examples of " "built-in functions are :func:`len` and :func:`math.sin` (:mod:`math` is a " @@ -976,7 +982,7 @@ msgstr "" "func:`math.sin`\\ (\\ :mod:`math` 是一個標準的內建模組)。內建函式的引數數量" "與其型別由其包裝的 C 函式所決定。特殊唯讀屬性:" -#: ../../reference/datamodel.rst:821 +#: ../../reference/datamodel.rst:828 msgid "" ":attr:`!__doc__` is the function's documentation string, or ``None`` if " "unavailable. See :attr:`function.__doc__`." @@ -984,26 +990,26 @@ msgstr "" ":attr:`!__doc__` 是函式的文件字串,若不可用則為 ``None``。請見 :attr:" "`function.__doc__`。" -#: ../../reference/datamodel.rst:823 +#: ../../reference/datamodel.rst:830 msgid "" ":attr:`!__name__` is the function's name. See :attr:`function.__name__`." msgstr ":attr:`!__name__` 是函式的名稱。請見 :attr:`function.__name__`。" -#: ../../reference/datamodel.rst:824 +#: ../../reference/datamodel.rst:831 msgid ":attr:`!__self__` is set to ``None`` (but see the next item)." msgstr "" -#: ../../reference/datamodel.rst:825 +#: ../../reference/datamodel.rst:832 msgid "" ":attr:`!__module__` is the name of the module the function was defined in or " "``None`` if unavailable. See :attr:`function.__module__`." msgstr "" -#: ../../reference/datamodel.rst:833 +#: ../../reference/datamodel.rst:840 msgid "Built-in methods" msgstr "內建方法" -#: ../../reference/datamodel.rst:840 +#: ../../reference/datamodel.rst:847 msgid "" "This is really a different disguise of a built-in function, this time " "containing an object passed to the C function as an implicit extra " @@ -1014,11 +1020,11 @@ msgid "" "__self__>`.)" msgstr "" -#: ../../reference/datamodel.rst:850 +#: ../../reference/datamodel.rst:857 msgid "Classes" msgstr "" -#: ../../reference/datamodel.rst:852 +#: ../../reference/datamodel.rst:859 msgid "" "Classes are callable. These objects normally act as factories for new " "instances of themselves, but variations are possible for class types that " @@ -1027,21 +1033,21 @@ msgid "" "initialize the new instance." msgstr "" -#: ../../reference/datamodel.rst:860 +#: ../../reference/datamodel.rst:867 msgid "Class Instances" msgstr "類別實例" -#: ../../reference/datamodel.rst:862 +#: ../../reference/datamodel.rst:869 msgid "" "Instances of arbitrary classes can be made callable by defining a :meth:" "`~object.__call__` method in their class." msgstr "" -#: ../../reference/datamodel.rst:869 +#: ../../reference/datamodel.rst:876 msgid "Modules" msgstr "模組" -#: ../../reference/datamodel.rst:875 +#: ../../reference/datamodel.rst:882 msgid "" "Modules are a basic organizational unit of Python code, and are created by " "the :ref:`import system ` as invoked either by the :keyword:" @@ -1056,17 +1062,17 @@ msgid "" "done)." msgstr "" -#: ../../reference/datamodel.rst:888 +#: ../../reference/datamodel.rst:895 msgid "" "Attribute assignment updates the module's namespace dictionary, e.g., ``m.x " "= 1`` is equivalent to ``m.__dict__[\"x\"] = 1``." msgstr "" -#: ../../reference/datamodel.rst:907 +#: ../../reference/datamodel.rst:914 msgid "Import-related attributes on module objects" msgstr "" -#: ../../reference/datamodel.rst:909 +#: ../../reference/datamodel.rst:916 msgid "" "Module objects have the following attributes that relate to the :ref:`import " "system `. When a module is created using the machinery " @@ -1075,7 +1081,7 @@ msgid "" "and loads the module." msgstr "" -#: ../../reference/datamodel.rst:915 +#: ../../reference/datamodel.rst:922 msgid "" "To create a module dynamically rather than using the import system, it's " "recommended to use :func:`importlib.util.module_from_spec`, which will set " @@ -1086,7 +1092,7 @@ msgid "" "approach." msgstr "" -#: ../../reference/datamodel.rst:925 +#: ../../reference/datamodel.rst:932 msgid "" "With the exception of :attr:`~module.__name__`, it is **strongly** " "recommended that you rely on :attr:`~module.__spec__` and its attributes " @@ -1095,7 +1101,7 @@ msgid "" "corresponding attribute on the module itself:" msgstr "" -#: ../../reference/datamodel.rst:931 +#: ../../reference/datamodel.rst:938 msgid "" ">>> import typing\n" ">>> typing.__name__, typing.__spec__.name\n" @@ -1117,34 +1123,34 @@ msgstr "" ">>> typing.__name__, typing.__spec__.name\n" "('keyboard_smashing', 'spelling')" -#: ../../reference/datamodel.rst:945 +#: ../../reference/datamodel.rst:952 msgid "" "The name used to uniquely identify the module in the import system. For a " "directly executed module, this will be set to ``\"__main__\"``." msgstr "" -#: ../../reference/datamodel.rst:948 +#: ../../reference/datamodel.rst:955 msgid "" "This attribute must be set to the fully qualified name of the module. It is " "expected to match the value of :attr:`module.__spec__.name `." msgstr "" -#: ../../reference/datamodel.rst:954 +#: ../../reference/datamodel.rst:961 msgid "A record of the module's import-system-related state." msgstr "" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:963 msgid "" "Set to the :class:`module spec ` that was " "used when importing the module. See :ref:`module-specs` for more details." msgstr "" -#: ../../reference/datamodel.rst:963 +#: ../../reference/datamodel.rst:970 msgid "The :term:`package` a module belongs to." msgstr "" -#: ../../reference/datamodel.rst:965 +#: ../../reference/datamodel.rst:972 msgid "" "If the module is top-level (that is, not a part of any specific package) " "then the attribute should be set to ``''`` (the empty string). Otherwise, it " @@ -1153,7 +1159,7 @@ msgid "" "for further details." msgstr "" -#: ../../reference/datamodel.rst:971 +#: ../../reference/datamodel.rst:978 msgid "" "This attribute is used instead of :attr:`~module.__name__` to calculate " "explicit relative imports for main modules. It defaults to ``None`` for " @@ -1162,7 +1168,7 @@ msgid "" "is set to a :class:`str`." msgstr "" -#: ../../reference/datamodel.rst:977 +#: ../../reference/datamodel.rst:984 msgid "" "It is **strongly** recommended that you use :attr:`module.__spec__.parent " "` instead of :attr:`!module." @@ -1170,14 +1176,14 @@ msgid "" "__spec__.parent` is not set, and this fallback path is deprecated." msgstr "" -#: ../../reference/datamodel.rst:983 ../../reference/datamodel.rst:1024 +#: ../../reference/datamodel.rst:990 ../../reference/datamodel.rst:1031 msgid "" "This attribute now defaults to ``None`` for modules created dynamically " "using the :class:`types.ModuleType` constructor. Previously the attribute " "was optional." msgstr "" -#: ../../reference/datamodel.rst:988 +#: ../../reference/datamodel.rst:995 msgid "" "The value of :attr:`!__package__` is expected to be the same as :attr:" "`__spec__.parent `. :attr:" @@ -1185,38 +1191,38 @@ msgid "" "attr:`!__spec__.parent` is not defined." msgstr "" -#: ../../reference/datamodel.rst:994 +#: ../../reference/datamodel.rst:1001 msgid "" ":exc:`ImportWarning` is raised if an import resolution falls back to :attr:`!" "__package__` instead of :attr:`__spec__.parent `." msgstr "" -#: ../../reference/datamodel.rst:999 +#: ../../reference/datamodel.rst:1006 msgid "" "Raise :exc:`DeprecationWarning` instead of :exc:`ImportWarning` when falling " "back to :attr:`!__package__` during import resolution." msgstr "" -#: ../../reference/datamodel.rst:1003 +#: ../../reference/datamodel.rst:1010 msgid "" ":attr:`!__package__` will cease to be set or taken into consideration by the " "import system or standard library." msgstr "" -#: ../../reference/datamodel.rst:1009 +#: ../../reference/datamodel.rst:1016 msgid "" "The :term:`loader` object that the import machinery used to load the module." msgstr "" -#: ../../reference/datamodel.rst:1011 +#: ../../reference/datamodel.rst:1018 msgid "" "This attribute is mostly useful for introspection, but can be used for " "additional loader-specific functionality, for example getting data " "associated with a loader." msgstr "" -#: ../../reference/datamodel.rst:1015 +#: ../../reference/datamodel.rst:1022 msgid "" ":attr:`!__loader__` defaults to ``None`` for modules created dynamically " "using the :class:`types.ModuleType` constructor; use :func:`importlib.util." @@ -1224,14 +1230,14 @@ msgid "" "object." msgstr "" -#: ../../reference/datamodel.rst:1020 +#: ../../reference/datamodel.rst:1027 msgid "" "It is **strongly** recommended that you use :attr:`module.__spec__.loader " "` instead of :attr:`!module." "__loader__`." msgstr "" -#: ../../reference/datamodel.rst:1029 +#: ../../reference/datamodel.rst:1036 msgid "" "Setting :attr:`!__loader__` on a module while failing to set :attr:`!" "__spec__.loader` is deprecated. In Python 3.16, :attr:`!__loader__` will " @@ -1242,7 +1248,7 @@ msgstr "" "被棄用。在 Python 3.16 中,引入系統或標準函式庫將不再設定或考慮 :attr:`!" "__loader__`。" -#: ../../reference/datamodel.rst:1037 +#: ../../reference/datamodel.rst:1044 msgid "" "A (possibly empty) :term:`sequence` of strings enumerating the locations " "where the package's submodules will be found. Non-package modules should not " @@ -1250,21 +1256,21 @@ msgid "" "details." msgstr "" -#: ../../reference/datamodel.rst:1042 +#: ../../reference/datamodel.rst:1049 msgid "" "It is **strongly** recommended that you use :attr:`module.__spec__." "submodule_search_locations ` instead of :attr:`!module.__path__`." msgstr "" -#: ../../reference/datamodel.rst:1049 +#: ../../reference/datamodel.rst:1056 msgid "" ":attr:`!__file__` and :attr:`!__cached__` are both optional attributes that " "may or may not be set. Both attributes should be a :class:`str` when they " "are available." msgstr "" -#: ../../reference/datamodel.rst:1053 +#: ../../reference/datamodel.rst:1060 msgid "" ":attr:`!__file__` indicates the pathname of the file from which the module " "was loaded (if loaded from a file), or the pathname of the shared library " @@ -1275,7 +1281,7 @@ msgid "" "example, a module loaded from a database)." msgstr "" -#: ../../reference/datamodel.rst:1061 +#: ../../reference/datamodel.rst:1068 msgid "" "If :attr:`!__file__` is set then the :attr:`!__cached__` attribute might " "also be set, which is the path to any compiled version of the code (for " @@ -1284,7 +1290,7 @@ msgid "" "exist (see :pep:`3147`)." msgstr "" -#: ../../reference/datamodel.rst:1067 +#: ../../reference/datamodel.rst:1074 msgid "" "Note that :attr:`!__cached__` may be set even if :attr:`!__file__` is not " "set. However, that scenario is quite atypical. Ultimately, the :term:" @@ -1294,14 +1300,14 @@ msgid "" "file, that atypical scenario may be appropriate." msgstr "" -#: ../../reference/datamodel.rst:1074 +#: ../../reference/datamodel.rst:1081 msgid "" "It is **strongly** recommended that you use :attr:`module.__spec__.cached " "` instead of :attr:`!module." "__cached__`." msgstr "" -#: ../../reference/datamodel.rst:1078 +#: ../../reference/datamodel.rst:1085 msgid "" "Setting :attr:`!__cached__` on a module while failing to set :attr:`!" "__spec__.cached` is deprecated. In Python 3.15, :attr:`!__cached__` will " @@ -1309,17 +1315,17 @@ msgid "" "library." msgstr "" -#: ../../reference/datamodel.rst:1085 +#: ../../reference/datamodel.rst:1092 msgid "Other writable attributes on module objects" msgstr "模組物件的其他可寫入屬性" -#: ../../reference/datamodel.rst:1087 +#: ../../reference/datamodel.rst:1094 msgid "" "As well as the import-related attributes listed above, module objects also " "have the following writable attributes:" msgstr "" -#: ../../reference/datamodel.rst:1092 +#: ../../reference/datamodel.rst:1099 msgid "" "The module's documentation string, or ``None`` if unavailable. See also: :" "attr:`__doc__ attributes `." @@ -1327,35 +1333,35 @@ msgstr "" "模組的文件字串,若不可用則為 ``None``。請見 :attr:`__doc__ attributes " "`。" -#: ../../reference/datamodel.rst:1097 +#: ../../reference/datamodel.rst:1104 msgid "" "A dictionary containing :term:`variable annotations ` " "collected during module body execution. For best practices on working with :" "attr:`!__annotations__`, see :mod:`annotationlib`." msgstr "" -#: ../../reference/datamodel.rst:1107 +#: ../../reference/datamodel.rst:1114 msgid "" "The :term:`annotate function` for this module, or ``None`` if the module has " "no annotations. See also: :attr:`~object.__annotate__` attributes." msgstr "" -#: ../../reference/datamodel.rst:1113 +#: ../../reference/datamodel.rst:1120 msgid "Module dictionaries" msgstr "模組字典" -#: ../../reference/datamodel.rst:1115 +#: ../../reference/datamodel.rst:1122 msgid "Module objects also have the following special read-only attribute:" msgstr "" -#: ../../reference/datamodel.rst:1120 +#: ../../reference/datamodel.rst:1127 msgid "" "The module's namespace as a dictionary object. Uniquely among the attributes " "listed here, :attr:`!__dict__` cannot be accessed as a global variable from " "within a module; it can only be accessed as an attribute on module objects." msgstr "" -#: ../../reference/datamodel.rst:1126 +#: ../../reference/datamodel.rst:1133 msgid "" "Because of the way CPython clears module dictionaries, the module dictionary " "will be cleared when the module falls out of scope even if the dictionary " @@ -1363,11 +1369,11 @@ msgid "" "module around while using its dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:1135 +#: ../../reference/datamodel.rst:1142 msgid "Custom classes" msgstr "" -#: ../../reference/datamodel.rst:1137 +#: ../../reference/datamodel.rst:1144 msgid "" "Custom class types are typically created by class definitions (see section :" "ref:`class`). A class has a namespace implemented by a dictionary object. " @@ -1382,7 +1388,7 @@ msgid "" "found at :ref:`python_2.3_mro`." msgstr "" -#: ../../reference/datamodel.rst:1158 +#: ../../reference/datamodel.rst:1165 msgid "" "When a class attribute reference (for class :class:`!C`, say) would yield a " "class method object, it is transformed into an instance method object whose :" @@ -1393,80 +1399,80 @@ msgid "" "contained in its :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:1169 +#: ../../reference/datamodel.rst:1176 msgid "" "Class attribute assignments update the class's dictionary, never the " "dictionary of a base class." msgstr "" -#: ../../reference/datamodel.rst:1174 +#: ../../reference/datamodel.rst:1181 msgid "" "A class object can be called (see above) to yield a class instance (see " "below)." msgstr "" -#: ../../reference/datamodel.rst:1177 ../../reference/datamodel.rst:1353 +#: ../../reference/datamodel.rst:1184 ../../reference/datamodel.rst:1360 msgid "Special attributes" msgstr "特殊屬性" -#: ../../reference/datamodel.rst:1199 +#: ../../reference/datamodel.rst:1206 msgid "" "The class's name. See also: :attr:`__name__ attributes `." msgstr "" -#: ../../reference/datamodel.rst:1203 +#: ../../reference/datamodel.rst:1210 msgid "" "The class's :term:`qualified name`. See also: :attr:`__qualname__ attributes " "`." msgstr "" -#: ../../reference/datamodel.rst:1207 +#: ../../reference/datamodel.rst:1214 msgid "The name of the module in which the class was defined." msgstr "" -#: ../../reference/datamodel.rst:1210 +#: ../../reference/datamodel.rst:1217 msgid "" "A :class:`mapping proxy ` providing a read-only view " "of the class's namespace. See also: :attr:`__dict__ attributes `." msgstr "" -#: ../../reference/datamodel.rst:1215 +#: ../../reference/datamodel.rst:1222 msgid "" "A :class:`tuple` containing the class's bases. In most cases, for a class " "defined as ``class X(A, B, C)``, ``X.__bases__`` will be exactly equal to " "``(A, B, C)``." msgstr "" -#: ../../reference/datamodel.rst:1222 +#: ../../reference/datamodel.rst:1229 msgid "" "The single base class in the inheritance chain that is responsible for the " "memory layout of instances. This attribute corresponds to :c:member:" "`~PyTypeObject.tp_base` at the C level." msgstr "" -#: ../../reference/datamodel.rst:1227 +#: ../../reference/datamodel.rst:1234 msgid "" "The class's documentation string, or ``None`` if undefined. Not inherited by " "subclasses." msgstr "" -#: ../../reference/datamodel.rst:1231 +#: ../../reference/datamodel.rst:1238 msgid "" "A dictionary containing :term:`variable annotations ` " "collected during class body execution. See also: :attr:`__annotations__ " "attributes `." msgstr "" -#: ../../reference/datamodel.rst:1236 +#: ../../reference/datamodel.rst:1243 msgid "" "For best practices on working with :attr:`~object.__annotations__`, please " "see :mod:`annotationlib`. Use :func:`annotationlib.get_annotations` instead " "of accessing this attribute directly." msgstr "" -#: ../../reference/datamodel.rst:1243 +#: ../../reference/datamodel.rst:1250 msgid "" "Accessing the :attr:`!__annotations__` attribute directly on a class object " "may return annotations for the wrong class, specifically in certain cases " @@ -1475,69 +1481,69 @@ msgid "" "details." msgstr "" -#: ../../reference/datamodel.rst:1249 +#: ../../reference/datamodel.rst:1256 msgid "" "This attribute does not exist on certain builtin classes. On user-defined " "classes without ``__annotations__``, it is an empty dictionary." msgstr "" -#: ../../reference/datamodel.rst:1258 +#: ../../reference/datamodel.rst:1265 msgid "" "The :term:`annotate function` for this class, or ``None`` if the class has " "no annotations. See also: :attr:`__annotate__ attributes `." msgstr "" -#: ../../reference/datamodel.rst:1265 +#: ../../reference/datamodel.rst:1272 msgid "" "A :class:`tuple` containing the :ref:`type parameters ` of a :" "ref:`generic class `." msgstr "" -#: ../../reference/datamodel.rst:1271 +#: ../../reference/datamodel.rst:1278 msgid "" "A :class:`tuple` containing names of attributes of this class which are " "assigned through ``self.X`` from any function in its body." msgstr "" -#: ../../reference/datamodel.rst:1277 +#: ../../reference/datamodel.rst:1284 msgid "" "The line number of the first line of the class definition, including " "decorators. Setting the :attr:`~type.__module__` attribute removes the :attr:" "`!__firstlineno__` item from the type's dictionary." msgstr "" -#: ../../reference/datamodel.rst:1285 +#: ../../reference/datamodel.rst:1292 msgid "" "The :class:`tuple` of classes that are considered when looking for base " "classes during method resolution." msgstr "" -#: ../../reference/datamodel.rst:1290 +#: ../../reference/datamodel.rst:1297 msgid "Special methods" msgstr "特殊方法" -#: ../../reference/datamodel.rst:1292 +#: ../../reference/datamodel.rst:1299 msgid "" "In addition to the special attributes described above, all Python classes " "also have the following two methods available:" msgstr "" -#: ../../reference/datamodel.rst:1297 +#: ../../reference/datamodel.rst:1304 msgid "" "This method can be overridden by a metaclass to customize the method " "resolution order for its instances. It is called at class instantiation, " "and its result is stored in :attr:`~type.__mro__`." msgstr "" -#: ../../reference/datamodel.rst:1303 +#: ../../reference/datamodel.rst:1310 msgid "" "Each class keeps a list of weak references to its immediate subclasses. This " "method returns a list of all those references still alive. The list is in " "definition order. Example:" msgstr "" -#: ../../reference/datamodel.rst:1307 +#: ../../reference/datamodel.rst:1314 msgid "" ">>> class A: pass\n" ">>> class B(A): pass\n" @@ -1549,11 +1555,11 @@ msgstr "" ">>> A.__subclasses__()\n" "[]" -#: ../../reference/datamodel.rst:1315 +#: ../../reference/datamodel.rst:1322 msgid "Class instances" msgstr "類別實例" -#: ../../reference/datamodel.rst:1323 +#: ../../reference/datamodel.rst:1330 msgid "" "A class instance is created by calling a class object (see above). A class " "instance has a namespace implemented as a dictionary which is the first " @@ -1570,7 +1576,7 @@ msgid "" "__getattr__` method, that is called to satisfy the lookup." msgstr "" -#: ../../reference/datamodel.rst:1339 +#: ../../reference/datamodel.rst:1346 msgid "" "Attribute assignments and deletions update the instance's dictionary, never " "a class's dictionary. If the class has a :meth:`~object.__setattr__` or :" @@ -1578,28 +1584,28 @@ msgid "" "instance dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:1349 +#: ../../reference/datamodel.rst:1356 msgid "" "Class instances can pretend to be numbers, sequences, or mappings if they " "have methods with certain special names. See section :ref:`specialnames`." msgstr "" -#: ../../reference/datamodel.rst:1361 +#: ../../reference/datamodel.rst:1368 msgid "The class to which a class instance belongs." msgstr "" -#: ../../reference/datamodel.rst:1365 +#: ../../reference/datamodel.rst:1372 msgid "" "A dictionary or other mapping object used to store an object's (writable) " "attributes. Not all instances have a :attr:`!__dict__` attribute; see the " "section on :ref:`slots` for more details." msgstr "" -#: ../../reference/datamodel.rst:1371 +#: ../../reference/datamodel.rst:1378 msgid "I/O objects (also known as file objects)" msgstr "" -#: ../../reference/datamodel.rst:1386 +#: ../../reference/datamodel.rst:1393 msgid "" "A :term:`file object` represents an open file. Various shortcuts are " "available to create file objects: the :func:`open` built-in function, and " @@ -1608,7 +1614,7 @@ msgid "" "methods provided by extension modules)." msgstr "" -#: ../../reference/datamodel.rst:1392 +#: ../../reference/datamodel.rst:1399 msgid "" "The objects ``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` are initialized " "to file objects corresponding to the interpreter's standard input, output " @@ -1616,22 +1622,22 @@ msgid "" "interface defined by the :class:`io.TextIOBase` abstract class." msgstr "" -#: ../../reference/datamodel.rst:1400 +#: ../../reference/datamodel.rst:1407 msgid "Internal types" msgstr "" -#: ../../reference/datamodel.rst:1406 +#: ../../reference/datamodel.rst:1413 msgid "" "A few types used internally by the interpreter are exposed to the user. " "Their definitions may change with future versions of the interpreter, but " "they are mentioned here for completeness." msgstr "" -#: ../../reference/datamodel.rst:1414 +#: ../../reference/datamodel.rst:1421 msgid "Code objects" msgstr "程式碼物件" -#: ../../reference/datamodel.rst:1418 +#: ../../reference/datamodel.rst:1425 msgid "" "Code objects represent *byte-compiled* executable Python code, or :term:" "`bytecode`. The difference between a code object and a function object is " @@ -1643,111 +1649,111 @@ msgid "" "no references (directly or indirectly) to mutable objects." msgstr "" -#: ../../reference/datamodel.rst:1452 +#: ../../reference/datamodel.rst:1459 msgid "The function name" msgstr "函式名稱" -#: ../../reference/datamodel.rst:1455 +#: ../../reference/datamodel.rst:1462 msgid "The fully qualified function name" msgstr "" -#: ../../reference/datamodel.rst:1460 +#: ../../reference/datamodel.rst:1467 msgid "" "The total number of positional :term:`parameters ` (including " "positional-only parameters and parameters with default values) that the " "function has" msgstr "" -#: ../../reference/datamodel.rst:1465 +#: ../../reference/datamodel.rst:1472 msgid "" "The number of positional-only :term:`parameters ` (including " "arguments with default values) that the function has" msgstr "" -#: ../../reference/datamodel.rst:1469 +#: ../../reference/datamodel.rst:1476 msgid "" "The number of keyword-only :term:`parameters ` (including " "arguments with default values) that the function has" msgstr "" -#: ../../reference/datamodel.rst:1473 +#: ../../reference/datamodel.rst:1480 msgid "" "The number of :ref:`local variables ` used by the function " "(including parameters)" msgstr "" -#: ../../reference/datamodel.rst:1477 +#: ../../reference/datamodel.rst:1484 msgid "" "A :class:`tuple` containing the names of the local variables in the function " "(starting with the parameter names)" msgstr "" -#: ../../reference/datamodel.rst:1481 +#: ../../reference/datamodel.rst:1488 msgid "" "A :class:`tuple` containing the names of :ref:`local variables ` " "that are referenced from at least one :term:`nested scope` inside the " "function" msgstr "" -#: ../../reference/datamodel.rst:1485 +#: ../../reference/datamodel.rst:1492 msgid "" "A :class:`tuple` containing the names of :term:`free (closure) variables " "` that a :term:`nested scope` references in an outer " "scope. See also :attr:`function.__closure__`." msgstr "" -#: ../../reference/datamodel.rst:1489 +#: ../../reference/datamodel.rst:1496 msgid "Note: references to global and builtin names are *not* included." msgstr "" -#: ../../reference/datamodel.rst:1492 +#: ../../reference/datamodel.rst:1499 msgid "" "A string representing the sequence of :term:`bytecode` instructions in the " "function" msgstr "" -#: ../../reference/datamodel.rst:1496 +#: ../../reference/datamodel.rst:1503 msgid "" "A :class:`tuple` containing the literals used by the :term:`bytecode` in the " "function" msgstr "" -#: ../../reference/datamodel.rst:1500 +#: ../../reference/datamodel.rst:1507 msgid "" "A :class:`tuple` containing the names used by the :term:`bytecode` in the " "function" msgstr "" -#: ../../reference/datamodel.rst:1504 +#: ../../reference/datamodel.rst:1511 msgid "The name of the file from which the code was compiled" msgstr "" -#: ../../reference/datamodel.rst:1507 +#: ../../reference/datamodel.rst:1514 msgid "The line number of the first line of the function" msgstr "" -#: ../../reference/datamodel.rst:1510 +#: ../../reference/datamodel.rst:1517 msgid "" "A string encoding the mapping from :term:`bytecode` offsets to line numbers. " "For details, see the source code of the interpreter." msgstr "" -#: ../../reference/datamodel.rst:1513 +#: ../../reference/datamodel.rst:1520 msgid "" "This attribute of code objects is deprecated, and may be removed in Python " "3.15." msgstr "" -#: ../../reference/datamodel.rst:1518 +#: ../../reference/datamodel.rst:1525 msgid "The required stack size of the code object" msgstr "" -#: ../../reference/datamodel.rst:1521 +#: ../../reference/datamodel.rst:1528 msgid "" "An :class:`integer ` encoding a number of flags for the interpreter." msgstr "" -#: ../../reference/datamodel.rst:1526 +#: ../../reference/datamodel.rst:1533 msgid "" "The following flag bits are defined for :attr:`~codeobject.co_flags`: bit " "``0x04`` is set if the function uses the ``*arguments`` syntax to accept an " @@ -1758,7 +1764,7 @@ msgid "" "might be present." msgstr "" -#: ../../reference/datamodel.rst:1534 +#: ../../reference/datamodel.rst:1541 msgid "" "Future feature declarations (for example, ``from __future__ import " "division``) also use bits in :attr:`~codeobject.co_flags` to indicate " @@ -1766,12 +1772,12 @@ msgid "" "attr:`~__future__._Feature.compiler_flag`." msgstr "" -#: ../../reference/datamodel.rst:1538 +#: ../../reference/datamodel.rst:1545 msgid "" "Other bits in :attr:`~codeobject.co_flags` are reserved for internal use." msgstr "" -#: ../../reference/datamodel.rst:1542 +#: ../../reference/datamodel.rst:1549 msgid "" "If a code object represents a function and has a docstring, the :data:" "`~inspect.CO_HAS_DOCSTRING` bit is set in :attr:`~codeobject.co_flags` and " @@ -1779,17 +1785,17 @@ msgid "" "function." msgstr "" -#: ../../reference/datamodel.rst:1548 +#: ../../reference/datamodel.rst:1555 msgid "Methods on code objects" msgstr "用於程式碼物件的方法" -#: ../../reference/datamodel.rst:1552 +#: ../../reference/datamodel.rst:1559 msgid "" "Returns an iterable over the source code positions of each :term:`bytecode` " "instruction in the code object." msgstr "" -#: ../../reference/datamodel.rst:1555 +#: ../../reference/datamodel.rst:1562 msgid "" "The iterator returns :class:`tuple`\\s containing the ``(start_line, " "end_line, start_column, end_column)``. The *i-th* tuple corresponds to the " @@ -1797,37 +1803,37 @@ msgid "" "information is 0-indexed utf-8 byte offsets on the given source line." msgstr "" -#: ../../reference/datamodel.rst:1561 +#: ../../reference/datamodel.rst:1568 msgid "" "This positional information can be missing. A non-exhaustive lists of cases " "where this may happen:" msgstr "" -#: ../../reference/datamodel.rst:1564 +#: ../../reference/datamodel.rst:1571 msgid "Running the interpreter with :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1565 +#: ../../reference/datamodel.rst:1572 msgid "" "Loading a pyc file compiled while using :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1566 +#: ../../reference/datamodel.rst:1573 msgid "Position tuples corresponding to artificial instructions." msgstr "" -#: ../../reference/datamodel.rst:1567 +#: ../../reference/datamodel.rst:1574 msgid "" "Line and column numbers that can't be represented due to implementation " "specific limitations." msgstr "" -#: ../../reference/datamodel.rst:1570 +#: ../../reference/datamodel.rst:1577 msgid "" "When this occurs, some or all of the tuple elements can be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:1576 +#: ../../reference/datamodel.rst:1583 msgid "" "This feature requires storing column positions in code objects which may " "result in a small increase of disk usage of compiled Python files or " @@ -1837,100 +1843,100 @@ msgid "" "environment variable can be used." msgstr "" -#: ../../reference/datamodel.rst:1585 +#: ../../reference/datamodel.rst:1592 msgid "" "Returns an iterator that yields information about successive ranges of :term:" "`bytecode`\\s. Each item yielded is a ``(start, end, lineno)`` :class:" "`tuple`:" msgstr "" -#: ../../reference/datamodel.rst:1589 +#: ../../reference/datamodel.rst:1596 msgid "" "``start`` (an :class:`int`) represents the offset (inclusive) of the start " "of the :term:`bytecode` range" msgstr "" -#: ../../reference/datamodel.rst:1591 +#: ../../reference/datamodel.rst:1598 msgid "" "``end`` (an :class:`int`) represents the offset (exclusive) of the end of " "the :term:`bytecode` range" msgstr "" -#: ../../reference/datamodel.rst:1593 +#: ../../reference/datamodel.rst:1600 msgid "" "``lineno`` is an :class:`int` representing the line number of the :term:" "`bytecode` range, or ``None`` if the bytecodes in the given range have no " "line number" msgstr "" -#: ../../reference/datamodel.rst:1597 +#: ../../reference/datamodel.rst:1604 msgid "The items yielded will have the following properties:" msgstr "" -#: ../../reference/datamodel.rst:1599 +#: ../../reference/datamodel.rst:1606 msgid "The first range yielded will have a ``start`` of 0." msgstr "" -#: ../../reference/datamodel.rst:1600 +#: ../../reference/datamodel.rst:1607 msgid "" "The ``(start, end)`` ranges will be non-decreasing and consecutive. That is, " "for any pair of :class:`tuple`\\s, the ``start`` of the second will be equal " "to the ``end`` of the first." msgstr "" -#: ../../reference/datamodel.rst:1603 +#: ../../reference/datamodel.rst:1610 msgid "No range will be backwards: ``end >= start`` for all triples." msgstr "" -#: ../../reference/datamodel.rst:1604 +#: ../../reference/datamodel.rst:1611 msgid "" "The last :class:`tuple` yielded will have ``end`` equal to the size of the :" "term:`bytecode`." msgstr "" -#: ../../reference/datamodel.rst:1607 +#: ../../reference/datamodel.rst:1614 msgid "" "Zero-width ranges, where ``start == end``, are allowed. Zero-width ranges " "are used for lines that are present in the source code, but have been " "eliminated by the :term:`bytecode` compiler." msgstr "" -#: ../../reference/datamodel.rst:1615 +#: ../../reference/datamodel.rst:1622 msgid ":pep:`626` - Precise line numbers for debugging and other tools." msgstr "" -#: ../../reference/datamodel.rst:1616 +#: ../../reference/datamodel.rst:1623 msgid "The PEP that introduced the :meth:`!co_lines` method." msgstr "" -#: ../../reference/datamodel.rst:1620 +#: ../../reference/datamodel.rst:1627 msgid "" "Return a copy of the code object with new values for the specified fields." msgstr "" -#: ../../reference/datamodel.rst:1622 +#: ../../reference/datamodel.rst:1629 msgid "" "Code objects are also supported by the generic function :func:`copy.replace`." msgstr "" -#: ../../reference/datamodel.rst:1630 +#: ../../reference/datamodel.rst:1637 msgid "Frame objects" msgstr "" -#: ../../reference/datamodel.rst:1634 +#: ../../reference/datamodel.rst:1641 msgid "" "Frame objects represent execution frames. They may occur in :ref:`traceback " "objects `, and are also passed to registered trace " "functions." msgstr "" -#: ../../reference/datamodel.rst:1653 +#: ../../reference/datamodel.rst:1660 msgid "" "Points to the previous stack frame (towards the caller), or ``None`` if this " "is the bottom stack frame" msgstr "" -#: ../../reference/datamodel.rst:1657 +#: ../../reference/datamodel.rst:1664 msgid "" "The :ref:`code object ` being executed in this frame. " "Accessing this attribute raises an :ref:`auditing event ` ``object." @@ -1940,61 +1946,61 @@ msgstr "" "這個屬性會引發一個附帶引數 ``obj`` 與 ``\"f_code\"`` 的\\ :ref:`稽核事件 " "` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1662 +#: ../../reference/datamodel.rst:1669 msgid "" "The mapping used by the frame to look up :ref:`local variables `. If " "the frame refers to an :term:`optimized scope`, this may return a write-" "through proxy object." msgstr "" -#: ../../reference/datamodel.rst:1667 +#: ../../reference/datamodel.rst:1674 msgid "Return a proxy for optimized scopes." msgstr "" -#: ../../reference/datamodel.rst:1671 +#: ../../reference/datamodel.rst:1678 msgid "" "The dictionary used by the frame to look up :ref:`global variables `" msgstr "" -#: ../../reference/datamodel.rst:1675 +#: ../../reference/datamodel.rst:1682 msgid "" "The dictionary used by the frame to look up :ref:`built-in (intrinsic) names " "`" msgstr "" -#: ../../reference/datamodel.rst:1679 +#: ../../reference/datamodel.rst:1686 msgid "" "The \"precise instruction\" of the frame object (this is an index into the :" "term:`bytecode` string of the :ref:`code object `)" msgstr "" -#: ../../reference/datamodel.rst:1684 +#: ../../reference/datamodel.rst:1691 msgid "" "The :term:`generator` or :term:`coroutine` object that owns this frame, or " "``None`` if the frame is a normal function." msgstr "" -#: ../../reference/datamodel.rst:1701 +#: ../../reference/datamodel.rst:1708 msgid "" "If not ``None``, this is a function called for various events during code " "execution (this is used by debuggers). Normally an event is triggered for " "each new source line (see :attr:`~frame.f_trace_lines`)." msgstr "" -#: ../../reference/datamodel.rst:1706 +#: ../../reference/datamodel.rst:1713 msgid "" "Set this attribute to :const:`False` to disable triggering a tracing event " "for each source line." msgstr "" -#: ../../reference/datamodel.rst:1710 +#: ../../reference/datamodel.rst:1717 msgid "" "Set this attribute to :const:`True` to allow per-opcode events to be " "requested. Note that this may lead to undefined interpreter behaviour if " "exceptions raised by the trace function escape to the function being traced." msgstr "" -#: ../../reference/datamodel.rst:1716 +#: ../../reference/datamodel.rst:1723 msgid "" "The current line number of the frame -- writing to this from within a trace " "function jumps to the given line (only for the bottom-most frame). A " @@ -2002,15 +2008,15 @@ msgid "" "this attribute." msgstr "" -#: ../../reference/datamodel.rst:1722 +#: ../../reference/datamodel.rst:1729 msgid "Frame object methods" msgstr "" -#: ../../reference/datamodel.rst:1724 +#: ../../reference/datamodel.rst:1731 msgid "Frame objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1728 +#: ../../reference/datamodel.rst:1735 msgid "" "This method clears all references to :ref:`local variables ` held by " "the frame. Also, if the frame belonged to a :term:`generator`, the " @@ -2019,34 +2025,34 @@ msgid "" "and storing its :ref:`traceback ` for later use)." msgstr "" -#: ../../reference/datamodel.rst:1734 +#: ../../reference/datamodel.rst:1741 msgid "" ":exc:`RuntimeError` is raised if the frame is currently executing or " "suspended." msgstr "" -#: ../../reference/datamodel.rst:1739 +#: ../../reference/datamodel.rst:1746 msgid "" "Attempting to clear a suspended frame raises :exc:`RuntimeError` (as has " "always been the case for executing frames)." msgstr "" -#: ../../reference/datamodel.rst:1747 +#: ../../reference/datamodel.rst:1754 msgid "Traceback objects" msgstr "" -#: ../../reference/datamodel.rst:1760 +#: ../../reference/datamodel.rst:1767 msgid "" "Traceback objects represent the stack trace of an :ref:`exception `. A traceback object is implicitly created when an exception occurs, " "and may also be explicitly created by calling :class:`types.TracebackType`." msgstr "" -#: ../../reference/datamodel.rst:1765 +#: ../../reference/datamodel.rst:1772 msgid "Traceback objects can now be explicitly instantiated from Python code." msgstr "" -#: ../../reference/datamodel.rst:1768 +#: ../../reference/datamodel.rst:1775 msgid "" "For implicitly created tracebacks, when the search for an exception handler " "unwinds the execution stack, at each unwound level a traceback object is " @@ -2057,7 +2063,7 @@ msgid "" "the caught exception." msgstr "" -#: ../../reference/datamodel.rst:1777 +#: ../../reference/datamodel.rst:1784 msgid "" "When the program contains no suitable handler, the stack trace is written " "(nicely formatted) to the standard error stream; if the interpreter is " @@ -2065,19 +2071,19 @@ msgid "" "last_traceback`." msgstr "" -#: ../../reference/datamodel.rst:1782 +#: ../../reference/datamodel.rst:1789 msgid "" "For explicitly created tracebacks, it is up to the creator of the traceback " "to determine how the :attr:`~traceback.tb_next` attributes should be linked " "to form a full stack trace." msgstr "" -#: ../../reference/datamodel.rst:1797 +#: ../../reference/datamodel.rst:1804 msgid "" "Points to the execution :ref:`frame ` of the current level." msgstr "" -#: ../../reference/datamodel.rst:1800 +#: ../../reference/datamodel.rst:1807 msgid "" "Accessing this attribute raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." @@ -2085,15 +2091,15 @@ msgstr "" "存取此屬性會引發一個附帶引數 ``obj`` 與 ``\"tb_frame\"`` 的\\ :ref:`稽核事件 " "` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1805 +#: ../../reference/datamodel.rst:1812 msgid "Gives the line number where the exception occurred" msgstr "" -#: ../../reference/datamodel.rst:1808 +#: ../../reference/datamodel.rst:1815 msgid "Indicates the \"precise instruction\"." msgstr "" -#: ../../reference/datamodel.rst:1810 +#: ../../reference/datamodel.rst:1817 msgid "" "The line number and last instruction in the traceback may differ from the " "line number of its :ref:`frame object ` if the exception " @@ -2101,39 +2107,39 @@ msgid "" "with a :keyword:`finally` clause." msgstr "" -#: ../../reference/datamodel.rst:1821 +#: ../../reference/datamodel.rst:1828 msgid "" "The special writable attribute :attr:`!tb_next` is the next level in the " "stack trace (towards the frame where the exception occurred), or ``None`` if " "there is no next level." msgstr "" -#: ../../reference/datamodel.rst:1825 +#: ../../reference/datamodel.rst:1832 msgid "This attribute is now writable" msgstr "此屬性現在可寫入" -#: ../../reference/datamodel.rst:1830 +#: ../../reference/datamodel.rst:1837 msgid "Slice objects" msgstr "" -#: ../../reference/datamodel.rst:1834 +#: ../../reference/datamodel.rst:1841 msgid "" "Slice objects are used to represent slices for :meth:`~object.__getitem__` " "methods. They are also created by the built-in :func:`slice` function." msgstr "" -#: ../../reference/datamodel.rst:1843 +#: ../../reference/datamodel.rst:1850 msgid "" "Special read-only attributes: :attr:`~slice.start` is the lower bound; :attr:" "`~slice.stop` is the upper bound; :attr:`~slice.step` is the step value; " "each is ``None`` if omitted. These attributes can have any type." msgstr "" -#: ../../reference/datamodel.rst:1847 +#: ../../reference/datamodel.rst:1854 msgid "Slice objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1851 +#: ../../reference/datamodel.rst:1858 msgid "" "This method takes a single integer argument *length* and computes " "information about the slice that the slice object would describe if applied " @@ -2143,11 +2149,11 @@ msgid "" "a manner consistent with regular slices." msgstr "" -#: ../../reference/datamodel.rst:1860 +#: ../../reference/datamodel.rst:1867 msgid "Static method objects" msgstr "" -#: ../../reference/datamodel.rst:1862 +#: ../../reference/datamodel.rst:1869 msgid "" "Static method objects provide a way of defeating the transformation of " "function objects to method objects described above. A static method object " @@ -2158,11 +2164,11 @@ msgid "" "method objects are created by the built-in :func:`staticmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1872 +#: ../../reference/datamodel.rst:1879 msgid "Class method objects" msgstr "" -#: ../../reference/datamodel.rst:1874 +#: ../../reference/datamodel.rst:1881 msgid "" "A class method object, like a static method object, is a wrapper around " "another object that alters the way in which that object is retrieved from " @@ -2172,11 +2178,11 @@ msgid "" "`classmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1884 +#: ../../reference/datamodel.rst:1891 msgid "Special method names" msgstr "" -#: ../../reference/datamodel.rst:1890 +#: ../../reference/datamodel.rst:1897 msgid "" "A class can implement certain operations that are invoked by special syntax " "(such as arithmetic operations or subscripting and slicing) by defining " @@ -2190,7 +2196,7 @@ msgid "" "`TypeError`)." msgstr "" -#: ../../reference/datamodel.rst:1901 +#: ../../reference/datamodel.rst:1908 msgid "" "Setting a special method to ``None`` indicates that the corresponding " "operation is not available. For example, if a class sets :meth:`~object." @@ -2199,7 +2205,7 @@ msgid "" "`~object.__getitem__`). [#]_" msgstr "" -#: ../../reference/datamodel.rst:1907 +#: ../../reference/datamodel.rst:1914 msgid "" "When implementing a class that emulates any built-in type, it is important " "that the emulation only be implemented to the degree that it makes sense for " @@ -2209,11 +2215,11 @@ msgid "" "in the W3C's Document Object Model.)" msgstr "" -#: ../../reference/datamodel.rst:1918 +#: ../../reference/datamodel.rst:1925 msgid "Basic customization" msgstr "" -#: ../../reference/datamodel.rst:1924 +#: ../../reference/datamodel.rst:1931 msgid "" "Called to create a new instance of class *cls*. :meth:`__new__` is a static " "method (special-cased so you need not declare it as such) that takes the " @@ -2223,7 +2229,7 @@ msgid "" "new object instance (usually an instance of *cls*)." msgstr "" -#: ../../reference/datamodel.rst:1931 +#: ../../reference/datamodel.rst:1938 msgid "" "Typical implementations create a new instance of the class by invoking the " "superclass's :meth:`__new__` method using ``super().__new__(cls[, ...])`` " @@ -2231,7 +2237,7 @@ msgid "" "necessary before returning it." msgstr "" -#: ../../reference/datamodel.rst:1936 +#: ../../reference/datamodel.rst:1943 msgid "" "If :meth:`__new__` is invoked during object construction and it returns an " "instance of *cls*, then the new instance’s :meth:`__init__` method will be " @@ -2240,13 +2246,13 @@ msgid "" "constructor." msgstr "" -#: ../../reference/datamodel.rst:1941 +#: ../../reference/datamodel.rst:1948 msgid "" "If :meth:`__new__` does not return an instance of *cls*, then the new " "instance's :meth:`__init__` method will not be invoked." msgstr "" -#: ../../reference/datamodel.rst:1944 +#: ../../reference/datamodel.rst:1951 msgid "" ":meth:`__new__` is intended mainly to allow subclasses of immutable types " "(like int, str, or tuple) to customize instance creation. It is also " @@ -2254,7 +2260,7 @@ msgid "" "creation." msgstr "" -#: ../../reference/datamodel.rst:1953 +#: ../../reference/datamodel.rst:1960 msgid "" "Called after the instance has been created (by :meth:`__new__`), but before " "it is returned to the caller. The arguments are those passed to the class " @@ -2264,7 +2270,7 @@ msgid "" "example: ``super().__init__([args...])``." msgstr "" -#: ../../reference/datamodel.rst:1960 +#: ../../reference/datamodel.rst:1967 msgid "" "Because :meth:`__new__` and :meth:`__init__` work together in constructing " "objects (:meth:`__new__` to create it, and :meth:`__init__` to customize " @@ -2272,7 +2278,7 @@ msgid "" "will cause a :exc:`TypeError` to be raised at runtime." msgstr "" -#: ../../reference/datamodel.rst:1973 +#: ../../reference/datamodel.rst:1980 msgid "" "Called when the instance is about to be destroyed. This is also called a " "finalizer or (improperly) a destructor. If a base class has a :meth:" @@ -2281,7 +2287,7 @@ msgid "" "instance." msgstr "" -#: ../../reference/datamodel.rst:1979 +#: ../../reference/datamodel.rst:1986 msgid "" "It is possible (though not recommended!) for the :meth:`__del__` method to " "postpone destruction of the instance by creating a new reference to it. " @@ -2291,7 +2297,7 @@ msgid "" "it once." msgstr "" -#: ../../reference/datamodel.rst:1986 +#: ../../reference/datamodel.rst:1993 msgid "" "It is not guaranteed that :meth:`__del__` methods are called for objects " "that still exist when the interpreter exits. :class:`weakref.finalize` " @@ -2299,14 +2305,14 @@ msgid "" "when an object is garbage collected." msgstr "" -#: ../../reference/datamodel.rst:1993 +#: ../../reference/datamodel.rst:2000 msgid "" "``del x`` doesn't directly call ``x.__del__()`` --- the former decrements " "the reference count for ``x`` by one, and the latter is only called when " "``x``'s reference count reaches zero." msgstr "" -#: ../../reference/datamodel.rst:1998 +#: ../../reference/datamodel.rst:2005 msgid "" "It is possible for a reference cycle to prevent the reference count of an " "object from going to zero. In this case, the cycle will be later detected " @@ -2317,18 +2323,18 @@ msgid "" "caught in the traceback." msgstr "" -#: ../../reference/datamodel.rst:2008 +#: ../../reference/datamodel.rst:2015 msgid "Documentation for the :mod:`gc` module." msgstr ":mod:`gc` 模組的文件。" -#: ../../reference/datamodel.rst:2012 +#: ../../reference/datamodel.rst:2019 msgid "" "Due to the precarious circumstances under which :meth:`__del__` methods are " "invoked, exceptions that occur during their execution are ignored, and a " "warning is printed to ``sys.stderr`` instead. In particular:" msgstr "" -#: ../../reference/datamodel.rst:2016 +#: ../../reference/datamodel.rst:2023 msgid "" ":meth:`__del__` can be invoked when arbitrary code is being executed, " "including from any arbitrary thread. If :meth:`__del__` needs to take a " @@ -2337,7 +2343,7 @@ msgid "" "`__del__`." msgstr "" -#: ../../reference/datamodel.rst:2022 +#: ../../reference/datamodel.rst:2029 msgid "" ":meth:`__del__` can be executed during interpreter shutdown. As a " "consequence, the global variables it needs to access (including other " @@ -2348,7 +2354,7 @@ msgid "" "still available at the time when the :meth:`__del__` method is called." msgstr "" -#: ../../reference/datamodel.rst:2037 +#: ../../reference/datamodel.rst:2044 msgid "" "Called by the :func:`repr` built-in function to compute the \"official\" " "string representation of an object. If at all possible, this should look " @@ -2360,14 +2366,14 @@ msgid "" "an \"informal\" string representation of instances of that class is required." msgstr "" -#: ../../reference/datamodel.rst:2046 +#: ../../reference/datamodel.rst:2053 msgid "" "This is typically used for debugging, so it is important that the " "representation is information-rich and unambiguous. A default implementation " "is provided by the :class:`object` class itself." msgstr "" -#: ../../reference/datamodel.rst:2058 +#: ../../reference/datamodel.rst:2065 msgid "" "Called by :func:`str(object) `, the default :meth:`__format__` " "implementation, and the built-in function :func:`print`, to compute the " @@ -2375,27 +2381,27 @@ msgid "" "return value must be a :ref:`str ` object." msgstr "" -#: ../../reference/datamodel.rst:2063 +#: ../../reference/datamodel.rst:2070 msgid "" "This method differs from :meth:`object.__repr__` in that there is no " "expectation that :meth:`__str__` return a valid Python expression: a more " "convenient or concise representation can be used." msgstr "" -#: ../../reference/datamodel.rst:2067 +#: ../../reference/datamodel.rst:2074 msgid "" "The default implementation defined by the built-in type :class:`object` " "calls :meth:`object.__repr__`." msgstr "" -#: ../../reference/datamodel.rst:2077 +#: ../../reference/datamodel.rst:2084 msgid "" "Called by :ref:`bytes ` to compute a byte-string representation " "of an object. This should return a :class:`bytes` object. The :class:" "`object` class itself does not provide this method." msgstr "" -#: ../../reference/datamodel.rst:2089 +#: ../../reference/datamodel.rst:2096 msgid "" "Called by the :func:`format` built-in function, and by extension, evaluation " "of :ref:`formatted string literals ` and the :meth:`str.format` " @@ -2407,34 +2413,34 @@ msgid "" "formatting option syntax." msgstr "" -#: ../../reference/datamodel.rst:2099 +#: ../../reference/datamodel.rst:2106 msgid "" "See :ref:`formatspec` for a description of the standard formatting syntax." msgstr "" -#: ../../reference/datamodel.rst:2101 +#: ../../reference/datamodel.rst:2108 msgid "The return value must be a string object." msgstr "回傳值必須是個字串物件。" -#: ../../reference/datamodel.rst:2103 +#: ../../reference/datamodel.rst:2110 msgid "" "The default implementation by the :class:`object` class should be given an " "empty *format_spec* string. It delegates to :meth:`__str__`." msgstr "" -#: ../../reference/datamodel.rst:2106 +#: ../../reference/datamodel.rst:2113 msgid "" "The __format__ method of ``object`` itself raises a :exc:`TypeError` if " "passed any non-empty string." msgstr "" -#: ../../reference/datamodel.rst:2110 +#: ../../reference/datamodel.rst:2117 msgid "" "``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than " "``format(str(x), '')``." msgstr "" -#: ../../reference/datamodel.rst:2126 +#: ../../reference/datamodel.rst:2133 msgid "" "These are the so-called \"rich comparison\" methods. The correspondence " "between operator symbols and method names is as follows: ``x.__hash__``." msgstr "" -#: ../../reference/datamodel.rst:2224 +#: ../../reference/datamodel.rst:2231 msgid "" "If a class that does not override :meth:`__eq__` wishes to suppress hash " "support, it should include ``__hash__ = None`` in the class definition. A " @@ -2578,7 +2584,7 @@ msgid "" "``isinstance(obj, collections.abc.Hashable)`` call." msgstr "" -#: ../../reference/datamodel.rst:2233 +#: ../../reference/datamodel.rst:2240 msgid "" "By default, the :meth:`__hash__` values of str and bytes objects are " "\"salted\" with an unpredictable random value. Although they remain " @@ -2586,7 +2592,7 @@ msgid "" "between repeated invocations of Python." msgstr "" -#: ../../reference/datamodel.rst:2238 +#: ../../reference/datamodel.rst:2245 msgid "" "This is intended to provide protection against a denial-of-service caused by " "carefully chosen inputs that exploit the worst case performance of a dict " @@ -2594,22 +2600,22 @@ msgid "" "advisories/ocert-2011-003.html for details." msgstr "" -#: ../../reference/datamodel.rst:2243 +#: ../../reference/datamodel.rst:2250 msgid "" "Changing hash values affects the iteration order of sets. Python has never " "made guarantees about this ordering (and it typically varies between 32-bit " "and 64-bit builds)." msgstr "" -#: ../../reference/datamodel.rst:2247 +#: ../../reference/datamodel.rst:2254 msgid "See also :envvar:`PYTHONHASHSEED`." msgstr "另請參閱 :envvar:`PYTHONHASHSEED`。" -#: ../../reference/datamodel.rst:2249 +#: ../../reference/datamodel.rst:2256 msgid "Hash randomization is enabled by default." msgstr "" -#: ../../reference/datamodel.rst:2257 +#: ../../reference/datamodel.rst:2264 msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " @@ -2619,18 +2625,18 @@ msgid "" "class itself), all its instances are considered true." msgstr "" -#: ../../reference/datamodel.rst:2268 +#: ../../reference/datamodel.rst:2275 msgid "Customizing attribute access" msgstr "" -#: ../../reference/datamodel.rst:2270 +#: ../../reference/datamodel.rst:2277 msgid "" "The following methods can be defined to customize the meaning of attribute " "access (use of, assignment to, or deletion of ``x.name``) for class " "instances." msgstr "" -#: ../../reference/datamodel.rst:2278 +#: ../../reference/datamodel.rst:2285 msgid "" "Called when the default attribute access fails with an :exc:`AttributeError` " "(either :meth:`__getattribute__` raises an :exc:`AttributeError` because " @@ -2641,7 +2647,7 @@ msgid "" "`object` class itself does not provide this method." msgstr "" -#: ../../reference/datamodel.rst:2286 +#: ../../reference/datamodel.rst:2293 msgid "" "Note that if the attribute is found through the normal mechanism, :meth:" "`__getattr__` is not called. (This is an intentional asymmetry between :" @@ -2654,7 +2660,7 @@ msgid "" "actually get total control over attribute access." msgstr "" -#: ../../reference/datamodel.rst:2299 +#: ../../reference/datamodel.rst:2306 msgid "" "Called unconditionally to implement attribute accesses for instances of the " "class. If the class also defines :meth:`__getattr__`, the latter will not be " @@ -2666,64 +2672,64 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" -#: ../../reference/datamodel.rst:2310 +#: ../../reference/datamodel.rst:2317 msgid "" "This method may still be bypassed when looking up special methods as the " "result of implicit invocation via language syntax or :ref:`built-in " "functions `. See :ref:`special-lookup`." msgstr "" -#: ../../reference/datamodel.rst:2315 ../../reference/datamodel.rst:2317 +#: ../../reference/datamodel.rst:2322 ../../reference/datamodel.rst:2324 msgid "" "For certain sensitive attribute accesses, raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:2324 +#: ../../reference/datamodel.rst:2331 msgid "" "Called when an attribute assignment is attempted. This is called instead of " "the normal mechanism (i.e. store the value in the instance dictionary). " "*name* is the attribute name, *value* is the value to be assigned to it." msgstr "" -#: ../../reference/datamodel.rst:2328 +#: ../../reference/datamodel.rst:2335 msgid "" "If :meth:`__setattr__` wants to assign to an instance attribute, it should " "call the base class method with the same name, for example, ``object." "__setattr__(self, name, value)``." msgstr "" -#: ../../reference/datamodel.rst:2332 ../../reference/datamodel.rst:2334 +#: ../../reference/datamodel.rst:2339 ../../reference/datamodel.rst:2341 msgid "" "For certain sensitive attribute assignments, raises an :ref:`auditing event " "` ``object.__setattr__`` with arguments ``obj``, ``name``, " "``value``." msgstr "" -#: ../../reference/datamodel.rst:2341 +#: ../../reference/datamodel.rst:2348 msgid "" "Like :meth:`__setattr__` but for attribute deletion instead of assignment. " "This should only be implemented if ``del obj.name`` is meaningful for the " "object." msgstr "" -#: ../../reference/datamodel.rst:2344 ../../reference/datamodel.rst:2346 +#: ../../reference/datamodel.rst:2351 ../../reference/datamodel.rst:2353 msgid "" "For certain sensitive attribute deletions, raises an :ref:`auditing event " "` ``object.__delattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:2353 +#: ../../reference/datamodel.rst:2360 msgid "" "Called when :func:`dir` is called on the object. An iterable must be " "returned. :func:`dir` converts the returned iterable to a list and sorts it." msgstr "" -#: ../../reference/datamodel.rst:2358 +#: ../../reference/datamodel.rst:2365 msgid "Customizing module attribute access" msgstr "" -#: ../../reference/datamodel.rst:2368 +#: ../../reference/datamodel.rst:2375 msgid "" "Special names ``__getattr__`` and ``__dir__`` can be also used to customize " "access to module attributes. The ``__getattr__`` function at the module " @@ -2735,21 +2741,21 @@ msgid "" "with the attribute name and the result is returned." msgstr "" -#: ../../reference/datamodel.rst:2377 +#: ../../reference/datamodel.rst:2384 msgid "" "The ``__dir__`` function should accept no arguments, and return an iterable " "of strings that represents the names accessible on module. If present, this " "function overrides the standard :func:`dir` search on a module." msgstr "" -#: ../../reference/datamodel.rst:2383 +#: ../../reference/datamodel.rst:2390 msgid "" "For a more fine grained customization of the module behavior (setting " "attributes, properties, etc.), one can set the ``__class__`` attribute of a " "module object to a subclass of :class:`types.ModuleType`. For example::" msgstr "" -#: ../../reference/datamodel.rst:2387 +#: ../../reference/datamodel.rst:2394 msgid "" "import sys\n" "from types import ModuleType\n" @@ -2777,7 +2783,7 @@ msgstr "" "\n" "sys.modules[__name__].__class__ = VerboseModule" -#: ../../reference/datamodel.rst:2401 +#: ../../reference/datamodel.rst:2408 msgid "" "Defining module ``__getattr__`` and setting module ``__class__`` only affect " "lookups made using the attribute access syntax -- directly accessing the " @@ -2785,27 +2791,27 @@ msgid "" "module's globals dictionary) is unaffected." msgstr "" -#: ../../reference/datamodel.rst:2406 +#: ../../reference/datamodel.rst:2413 msgid "``__class__`` module attribute is now writable." msgstr "``__class__`` 模組屬性現在是可寫入的。" -#: ../../reference/datamodel.rst:2409 +#: ../../reference/datamodel.rst:2416 msgid "``__getattr__`` and ``__dir__`` module attributes." msgstr "``__getattr__`` 和 ``__dir__`` 模組屬性。" -#: ../../reference/datamodel.rst:2414 +#: ../../reference/datamodel.rst:2421 msgid ":pep:`562` - Module __getattr__ and __dir__" msgstr ":pep:`562` - 模組 __getattr__ 和 __dir__" -#: ../../reference/datamodel.rst:2415 +#: ../../reference/datamodel.rst:2422 msgid "Describes the ``__getattr__`` and ``__dir__`` functions on modules." msgstr "" -#: ../../reference/datamodel.rst:2421 +#: ../../reference/datamodel.rst:2428 msgid "Implementing Descriptors" msgstr "實作描述器" -#: ../../reference/datamodel.rst:2423 +#: ../../reference/datamodel.rst:2430 msgid "" "The following methods only apply when an instance of the class containing " "the method (a so-called *descriptor* class) appears in an *owner* class (the " @@ -2816,7 +2822,7 @@ msgid "" "does not implement any of these protocols." msgstr "" -#: ../../reference/datamodel.rst:2433 +#: ../../reference/datamodel.rst:2440 msgid "" "Called to get the attribute of the owner class (class attribute access) or " "of an instance of that class (instance attribute access). The optional " @@ -2825,13 +2831,13 @@ msgid "" "accessed through the *owner*." msgstr "" -#: ../../reference/datamodel.rst:2439 +#: ../../reference/datamodel.rst:2446 msgid "" "This method should return the computed attribute value or raise an :exc:" "`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:2442 +#: ../../reference/datamodel.rst:2449 msgid "" ":PEP:`252` specifies that :meth:`__get__` is callable with one or two " "arguments. Python's own built-in descriptors support this specification; " @@ -2841,31 +2847,31 @@ msgid "" "not." msgstr "" -#: ../../reference/datamodel.rst:2451 +#: ../../reference/datamodel.rst:2458 msgid "" "Called to set the attribute on an instance *instance* of the owner class to " "a new value, *value*." msgstr "" -#: ../../reference/datamodel.rst:2454 +#: ../../reference/datamodel.rst:2461 msgid "" "Note, adding :meth:`__set__` or :meth:`__delete__` changes the kind of " "descriptor to a \"data descriptor\". See :ref:`descriptor-invocation` for " "more details." msgstr "" -#: ../../reference/datamodel.rst:2460 +#: ../../reference/datamodel.rst:2467 msgid "" "Called to delete the attribute on an instance *instance* of the owner class." msgstr "" -#: ../../reference/datamodel.rst:2462 +#: ../../reference/datamodel.rst:2469 msgid "" "Instances of descriptors may also have the :attr:`!__objclass__` attribute " "present:" msgstr "" -#: ../../reference/datamodel.rst:2467 +#: ../../reference/datamodel.rst:2474 msgid "" "The attribute :attr:`!__objclass__` is interpreted by the :mod:`inspect` " "module as specifying the class where this object was defined (setting this " @@ -2876,11 +2882,11 @@ msgid "" "are implemented in C)." msgstr "" -#: ../../reference/datamodel.rst:2478 +#: ../../reference/datamodel.rst:2485 msgid "Invoking Descriptors" msgstr "" -#: ../../reference/datamodel.rst:2480 +#: ../../reference/datamodel.rst:2487 msgid "" "In general, a descriptor is an object attribute with \"binding behavior\", " "one whose attribute access has been overridden by methods in the descriptor " @@ -2889,7 +2895,7 @@ msgid "" "is said to be a descriptor." msgstr "" -#: ../../reference/datamodel.rst:2486 +#: ../../reference/datamodel.rst:2493 msgid "" "The default behavior for attribute access is to get, set, or delete the " "attribute from an object's dictionary. For instance, ``a.x`` has a lookup " @@ -2897,7 +2903,7 @@ msgid "" "continuing through the base classes of ``type(a)`` excluding metaclasses." msgstr "" -#: ../../reference/datamodel.rst:2491 +#: ../../reference/datamodel.rst:2498 msgid "" "However, if the looked-up value is an object defining one of the descriptor " "methods, then Python may override the default behavior and invoke the " @@ -2905,54 +2911,54 @@ msgid "" "depends on which descriptor methods were defined and how they were called." msgstr "" -#: ../../reference/datamodel.rst:2496 +#: ../../reference/datamodel.rst:2503 msgid "" "The starting point for descriptor invocation is a binding, ``a.x``. How the " "arguments are assembled depends on ``a``:" msgstr "" -#: ../../reference/datamodel.rst:2499 +#: ../../reference/datamodel.rst:2506 msgid "Direct Call" msgstr "直接呼叫" -#: ../../reference/datamodel.rst:2500 +#: ../../reference/datamodel.rst:2507 msgid "" "The simplest and least common call is when user code directly invokes a " "descriptor method: ``x.__get__(a)``." msgstr "" -#: ../../reference/datamodel.rst:2503 +#: ../../reference/datamodel.rst:2510 msgid "Instance Binding" msgstr "" -#: ../../reference/datamodel.rst:2504 +#: ../../reference/datamodel.rst:2511 msgid "" "If binding to an object instance, ``a.x`` is transformed into the call: " "``type(a).__dict__['x'].__get__(a, type(a))``." msgstr "" -#: ../../reference/datamodel.rst:2507 +#: ../../reference/datamodel.rst:2514 msgid "Class Binding" msgstr "" -#: ../../reference/datamodel.rst:2508 +#: ../../reference/datamodel.rst:2515 msgid "" "If binding to a class, ``A.x`` is transformed into the call: ``A." "__dict__['x'].__get__(None, A)``." msgstr "" -#: ../../reference/datamodel.rst:2511 +#: ../../reference/datamodel.rst:2518 msgid "Super Binding" msgstr "" -#: ../../reference/datamodel.rst:2512 +#: ../../reference/datamodel.rst:2519 msgid "" "A dotted lookup such as ``super(A, a).x`` searches ``a.__class__.__mro__`` " "for a base class ``B`` following ``A`` and then returns ``B.__dict__['x']." "__get__(a, A)``. If not a descriptor, ``x`` is returned unchanged." msgstr "" -#: ../../reference/datamodel.rst:2549 +#: ../../reference/datamodel.rst:2556 msgid "" "For instance bindings, the precedence of descriptor invocation depends on " "which descriptor methods are defined. A descriptor can define any " @@ -2970,7 +2976,7 @@ msgid "" "instances." msgstr "" -#: ../../reference/datamodel.rst:2564 +#: ../../reference/datamodel.rst:2571 msgid "" "Python methods (including those decorated with :deco:`staticmethod` and :" "deco:`classmethod`) are implemented as non-data descriptors. Accordingly, " @@ -2979,30 +2985,30 @@ msgid "" "class." msgstr "" -#: ../../reference/datamodel.rst:2570 +#: ../../reference/datamodel.rst:2577 msgid "" "The :func:`property` function is implemented as a data descriptor. " "Accordingly, instances cannot override the behavior of a property." msgstr "" -#: ../../reference/datamodel.rst:2577 +#: ../../reference/datamodel.rst:2584 msgid "__slots__" msgstr "__slots__" -#: ../../reference/datamodel.rst:2579 +#: ../../reference/datamodel.rst:2586 msgid "" "*__slots__* allow us to explicitly declare data members (like properties) " "and deny the creation of :attr:`~object.__dict__` and *__weakref__* (unless " "explicitly declared in *__slots__* or available in a parent.)" msgstr "" -#: ../../reference/datamodel.rst:2583 +#: ../../reference/datamodel.rst:2590 msgid "" "The space saved over using :attr:`~object.__dict__` can be significant. " "Attribute lookup speed can be significantly improved as well." msgstr "" -#: ../../reference/datamodel.rst:2588 +#: ../../reference/datamodel.rst:2595 msgid "" "This class variable can be assigned a string, iterable, or sequence of " "strings with variable names used by instances. *__slots__* reserves space " @@ -3010,18 +3016,18 @@ msgid "" "`~object.__dict__` and *__weakref__* for each instance." msgstr "" -#: ../../reference/datamodel.rst:2597 +#: ../../reference/datamodel.rst:2604 msgid "Notes on using *__slots__*:" msgstr "" -#: ../../reference/datamodel.rst:2599 +#: ../../reference/datamodel.rst:2606 msgid "" "When inheriting from a class without *__slots__*, the :attr:`~object." "__dict__` and *__weakref__* attribute of the instances will always be " "accessible." msgstr "" -#: ../../reference/datamodel.rst:2603 +#: ../../reference/datamodel.rst:2610 msgid "" "Without a :attr:`~object.__dict__` variable, instances cannot be assigned " "new variables not listed in the *__slots__* definition. Attempts to assign " @@ -3030,7 +3036,7 @@ msgid "" "sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2610 +#: ../../reference/datamodel.rst:2617 msgid "" "Without a *__weakref__* variable for each instance, classes defining " "*__slots__* do not support :mod:`weak references ` to its " @@ -3038,7 +3044,7 @@ msgid "" "to the sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2616 +#: ../../reference/datamodel.rst:2623 msgid "" "*__slots__* are implemented at the class level by creating :ref:`descriptors " "` for each variable name. As a result, class attributes cannot " @@ -3046,7 +3052,7 @@ msgid "" "otherwise, the class attribute would overwrite the descriptor assignment." msgstr "" -#: ../../reference/datamodel.rst:2622 +#: ../../reference/datamodel.rst:2629 msgid "" "The action of a *__slots__* declaration is not limited to the class where it " "is defined. *__slots__* declared in parents are available in child classes. " @@ -3055,7 +3061,7 @@ msgid "" "only contain names of any *additional* slots)." msgstr "" -#: ../../reference/datamodel.rst:2628 +#: ../../reference/datamodel.rst:2635 msgid "" "If a class defines a slot also defined in a base class, the instance " "variable defined by the base class slot is inaccessible (except by " @@ -3064,7 +3070,7 @@ msgid "" "prevent this." msgstr "" -#: ../../reference/datamodel.rst:2633 +#: ../../reference/datamodel.rst:2640 msgid "" ":exc:`TypeError` will be raised if nonempty *__slots__* are defined for a " "class derived from a :c:member:`\"variable-length\" built-in type " @@ -3072,11 +3078,11 @@ msgid "" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:2638 +#: ../../reference/datamodel.rst:2645 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2640 +#: ../../reference/datamodel.rst:2647 msgid "" "If a :class:`dictionary ` is used to assign *__slots__*, the " "dictionary keys will be used as the slot names. The values of the dictionary " @@ -3084,13 +3090,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:2645 +#: ../../reference/datamodel.rst:2652 msgid "" ":attr:`~object.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2648 +#: ../../reference/datamodel.rst:2655 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -3098,18 +3104,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2654 +#: ../../reference/datamodel.rst:2661 msgid "" "If an :term:`iterator` is used for *__slots__* then a :term:`descriptor` is " "created for each of the iterator's values. However, the *__slots__* " "attribute will be an empty iterator." msgstr "" -#: ../../reference/datamodel.rst:2662 +#: ../../reference/datamodel.rst:2669 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:2664 +#: ../../reference/datamodel.rst:2671 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -3119,14 +3125,14 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:2673 +#: ../../reference/datamodel.rst:2680 msgid "" "This method is called whenever the containing class is subclassed. *cls* is " "then the new subclass. If defined as a normal instance method, this method " "is implicitly converted to a class method." msgstr "" -#: ../../reference/datamodel.rst:2677 +#: ../../reference/datamodel.rst:2684 msgid "" "Keyword arguments which are given to a new class are passed to the parent " "class's ``__init_subclass__``. For compatibility with other classes using " @@ -3134,7 +3140,7 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2683 +#: ../../reference/datamodel.rst:2690 msgid "" "class Philosopher:\n" " def __init_subclass__(cls, /, default_name, **kwargs):\n" @@ -3152,13 +3158,13 @@ msgstr "" "class AustralianPhilosopher(Philosopher, default_name=\"Bruce\"):\n" " pass" -#: ../../reference/datamodel.rst:2691 +#: ../../reference/datamodel.rst:2698 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2696 +#: ../../reference/datamodel.rst:2703 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -3166,19 +3172,19 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2704 +#: ../../reference/datamodel.rst:2711 msgid "" "When a class is created, :meth:`!type.__new__` scans the class variables and " "makes callbacks to those with a :meth:`~object.__set_name__` hook." msgstr "" -#: ../../reference/datamodel.rst:2709 +#: ../../reference/datamodel.rst:2716 msgid "" "Automatically called at the time the owning class *owner* is created. The " "object has been assigned to *name* in that class::" msgstr "" -#: ../../reference/datamodel.rst:2712 +#: ../../reference/datamodel.rst:2719 msgid "" "class A:\n" " x = C() # Automatically calls: x.__set_name__(A, 'x')" @@ -3186,14 +3192,14 @@ msgstr "" "class A:\n" " x = C() # 自動呼叫:x.__set_name__(A, 'x')" -#: ../../reference/datamodel.rst:2715 +#: ../../reference/datamodel.rst:2722 msgid "" "If the class variable is assigned after the class is created, :meth:" "`__set_name__` will not be called automatically. If needed, :meth:" "`__set_name__` can be called directly::" msgstr "" -#: ../../reference/datamodel.rst:2719 +#: ../../reference/datamodel.rst:2726 msgid "" "class A:\n" " pass\n" @@ -3203,22 +3209,22 @@ msgid "" "c.__set_name__(A, 'x') # Manually invoke the hook" msgstr "" -#: ../../reference/datamodel.rst:2726 +#: ../../reference/datamodel.rst:2733 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`。" -#: ../../reference/datamodel.rst:2734 +#: ../../reference/datamodel.rst:2741 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2741 +#: ../../reference/datamodel.rst:2748 msgid "" "By default, classes are constructed using :func:`type`. The class body is " "executed in a new namespace and the class name is bound locally to the " "result of ``type(name, bases, namespace)``." msgstr "" -#: ../../reference/datamodel.rst:2745 +#: ../../reference/datamodel.rst:2752 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -3226,7 +3232,7 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2750 +#: ../../reference/datamodel.rst:2757 msgid "" "class Meta(type):\n" " pass\n" @@ -3246,41 +3252,41 @@ msgstr "" "class MySubclass(MyClass):\n" " pass" -#: ../../reference/datamodel.rst:2759 +#: ../../reference/datamodel.rst:2766 msgid "" "Any other keyword arguments that are specified in the class definition are " "passed through to all metaclass operations described below." msgstr "" -#: ../../reference/datamodel.rst:2762 +#: ../../reference/datamodel.rst:2769 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2764 +#: ../../reference/datamodel.rst:2771 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2765 +#: ../../reference/datamodel.rst:2772 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2766 +#: ../../reference/datamodel.rst:2773 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2767 +#: ../../reference/datamodel.rst:2774 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2768 +#: ../../reference/datamodel.rst:2775 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2772 +#: ../../reference/datamodel.rst:2779 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2776 +#: ../../reference/datamodel.rst:2783 msgid "" "If a base that appears in a class definition is not an instance of :class:" "`type`, then an :meth:`!__mro_entries__` method is searched on the base. If " @@ -3292,59 +3298,59 @@ msgid "" "is ignored." msgstr "" -#: ../../reference/datamodel.rst:2787 +#: ../../reference/datamodel.rst:2794 msgid ":func:`types.resolve_bases`" msgstr ":func:`types.resolve_bases`" -#: ../../reference/datamodel.rst:2788 +#: ../../reference/datamodel.rst:2795 msgid "Dynamically resolve bases that are not instances of :class:`type`." msgstr "" -#: ../../reference/datamodel.rst:2790 +#: ../../reference/datamodel.rst:2797 msgid ":func:`types.get_original_bases`" msgstr ":func:`types.get_original_bases`" -#: ../../reference/datamodel.rst:2791 +#: ../../reference/datamodel.rst:2798 msgid "" "Retrieve a class's \"original bases\" prior to modifications by :meth:" "`~object.__mro_entries__`." msgstr "" -#: ../../reference/datamodel.rst:2794 +#: ../../reference/datamodel.rst:2801 msgid ":pep:`560`" msgstr ":pep:`560`" -#: ../../reference/datamodel.rst:2795 +#: ../../reference/datamodel.rst:2802 msgid "Core support for typing module and generic types." msgstr "" -#: ../../reference/datamodel.rst:2799 +#: ../../reference/datamodel.rst:2806 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2803 +#: ../../reference/datamodel.rst:2810 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2805 +#: ../../reference/datamodel.rst:2812 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2806 +#: ../../reference/datamodel.rst:2813 msgid "" "if an explicit metaclass is given and it is *not* an instance of :func:" "`type`, then it is used directly as the metaclass;" msgstr "" -#: ../../reference/datamodel.rst:2808 +#: ../../reference/datamodel.rst:2815 msgid "" "if an instance of :func:`type` is given as the explicit metaclass, or bases " "are defined, then the most derived metaclass is used." msgstr "" -#: ../../reference/datamodel.rst:2811 +#: ../../reference/datamodel.rst:2818 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -3353,11 +3359,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2821 +#: ../../reference/datamodel.rst:2828 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2826 +#: ../../reference/datamodel.rst:2833 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -3369,25 +3375,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2835 +#: ../../reference/datamodel.rst:2842 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2840 +#: ../../reference/datamodel.rst:2847 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2841 +#: ../../reference/datamodel.rst:2848 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2845 +#: ../../reference/datamodel.rst:2852 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2850 +#: ../../reference/datamodel.rst:2857 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -3396,7 +3402,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2856 +#: ../../reference/datamodel.rst:2863 msgid "" "However, even when the class definition occurs inside the function, methods " "defined inside the class still cannot see names defined at the class scope. " @@ -3405,11 +3411,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2865 +#: ../../reference/datamodel.rst:2872 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2872 +#: ../../reference/datamodel.rst:2879 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -3417,7 +3423,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2877 +#: ../../reference/datamodel.rst:2884 msgid "" "This class object is the one that will be referenced by the zero-argument " "form of :func:`super`. ``__class__`` is an implicit closure reference " @@ -3428,7 +3434,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2887 +#: ../../reference/datamodel.rst:2894 msgid "" "In CPython 3.6 and later, the ``__class__`` cell is passed to the metaclass " "as a ``__classcell__`` entry in the class namespace. If present, this must " @@ -3437,39 +3443,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2893 +#: ../../reference/datamodel.rst:2900 msgid "" "When using the default metaclass :class:`type`, or any metaclass that " "ultimately calls ``type.__new__``, the following additional customization " "steps are invoked after creating the class object:" msgstr "" -#: ../../reference/datamodel.rst:2897 +#: ../../reference/datamodel.rst:2904 msgid "" "The ``type.__new__`` method collects all of the attributes in the class " "namespace that define a :meth:`~object.__set_name__` method;" msgstr "" -#: ../../reference/datamodel.rst:2899 +#: ../../reference/datamodel.rst:2906 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2901 +#: ../../reference/datamodel.rst:2908 msgid "" "The :meth:`~object.__init_subclass__` hook is called on the immediate parent " "of the new class in its method resolution order." msgstr "" -#: ../../reference/datamodel.rst:2904 +#: ../../reference/datamodel.rst:2911 msgid "" "After the class object is created, it is passed to the class decorators " "included in the class definition (if any) and the resulting object is bound " "in the local namespace as the defined class." msgstr "" -#: ../../reference/datamodel.rst:2908 +#: ../../reference/datamodel.rst:2915 msgid "" "When a new class is created by ``type.__new__``, the object provided as the " "namespace parameter is copied to a new ordered mapping and the original " @@ -3477,19 +3483,19 @@ msgid "" "becomes the :attr:`~type.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2915 +#: ../../reference/datamodel.rst:2922 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2916 +#: ../../reference/datamodel.rst:2923 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2920 +#: ../../reference/datamodel.rst:2927 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2922 +#: ../../reference/datamodel.rst:2929 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -3497,17 +3503,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2929 +#: ../../reference/datamodel.rst:2936 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2931 +#: ../../reference/datamodel.rst:2938 msgid "" "The following methods are used to override the default behavior of the :func:" "`isinstance` and :func:`issubclass` built-in functions." msgstr "" -#: ../../reference/datamodel.rst:2934 +#: ../../reference/datamodel.rst:2941 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -3515,21 +3521,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2941 +#: ../../reference/datamodel.rst:2948 msgid "" "Return true if *instance* should be considered a (direct or indirect) " "instance of *class*. If defined, called to implement ``isinstance(instance, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2948 +#: ../../reference/datamodel.rst:2955 msgid "" "Return true if *subclass* should be considered a (direct or indirect) " "subclass of *class*. If defined, called to implement ``issubclass(subclass, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2953 +#: ../../reference/datamodel.rst:2960 msgid "" "Note that these methods are looked up on the type (metaclass) of a class. " "They cannot be defined as class methods in the actual class. This is " @@ -3537,11 +3543,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2960 +#: ../../reference/datamodel.rst:2967 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2961 +#: ../../reference/datamodel.rst:2968 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~type.__instancecheck__` and :meth:" @@ -3550,11 +3556,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2969 +#: ../../reference/datamodel.rst:2976 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2971 +#: ../../reference/datamodel.rst:2978 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -3562,65 +3568,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2978 +#: ../../reference/datamodel.rst:2985 msgid ":pep:`484` - Type Hints" msgstr ":pep:`484` - 型別提示" -#: ../../reference/datamodel.rst:2979 +#: ../../reference/datamodel.rst:2986 msgid "Introducing Python's framework for type annotations" msgstr "引入 Python 的型別註釋框架" -#: ../../reference/datamodel.rst:2981 +#: ../../reference/datamodel.rst:2988 msgid ":ref:`Generic Alias Types`" msgstr ":ref:`泛型別名型別 `" -#: ../../reference/datamodel.rst:2982 +#: ../../reference/datamodel.rst:2989 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2984 +#: ../../reference/datamodel.rst:2991 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2985 +#: ../../reference/datamodel.rst:2992 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2988 +#: ../../reference/datamodel.rst:2995 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2993 +#: ../../reference/datamodel.rst:3000 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2996 +#: ../../reference/datamodel.rst:3003 msgid "" "When defined on a class, ``__class_getitem__()`` is automatically a class " "method. As such, there is no need for it to be decorated with :deco:" "`classmethod` when it is defined." msgstr "" -#: ../../reference/datamodel.rst:3002 +#: ../../reference/datamodel.rst:3009 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:3004 +#: ../../reference/datamodel.rst:3011 msgid "" "The purpose of :meth:`~object.__class_getitem__` is to allow runtime " "parameterization of standard-library generic classes in order to more easily " "apply :term:`type hints` to these classes." msgstr "" -#: ../../reference/datamodel.rst:3008 +#: ../../reference/datamodel.rst:3015 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -3629,7 +3635,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:3014 +#: ../../reference/datamodel.rst:3021 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -3637,11 +3643,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:3024 +#: ../../reference/datamodel.rst:3031 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:3026 +#: ../../reference/datamodel.rst:3033 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -3651,14 +3657,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:3033 +#: ../../reference/datamodel.rst:3040 msgid "" "Presented with the :term:`expression` ``obj[x]``, the Python interpreter " "follows something like the following process to decide whether :meth:" "`~object.__getitem__` or :meth:`~object.__class_getitem__` should be called::" msgstr "" -#: ../../reference/datamodel.rst:3038 +#: ../../reference/datamodel.rst:3045 msgid "" "from inspect import isclass\n" "\n" @@ -3684,7 +3690,7 @@ msgid "" " )" msgstr "" -#: ../../reference/datamodel.rst:3061 +#: ../../reference/datamodel.rst:3068 msgid "" "In Python, all classes are themselves instances of other classes. The class " "of a class is known as that class's :term:`metaclass`, and most classes have " @@ -3694,7 +3700,7 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:3068 +#: ../../reference/datamodel.rst:3075 msgid "" ">>> # list has class \"type\" as its metaclass, like most classes:\n" ">>> type(list)\n" @@ -3709,14 +3715,14 @@ msgid "" "" msgstr "" -#: ../../reference/datamodel.rst:3080 +#: ../../reference/datamodel.rst:3087 msgid "" "However, if a class has a custom metaclass that defines :meth:`~object." "__getitem__`, subscribing the class may result in different behaviour. An " "example of this can be found in the :mod:`enum` module::" msgstr "" -#: ../../reference/datamodel.rst:3084 +#: ../../reference/datamodel.rst:3091 msgid "" ">>> from enum import Enum\n" ">>> class Menu(Enum):\n" @@ -3736,33 +3742,33 @@ msgid "" "" msgstr "" -#: ../../reference/datamodel.rst:3103 +#: ../../reference/datamodel.rst:3110 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:3104 +#: ../../reference/datamodel.rst:3111 msgid "" "Introducing :meth:`~object.__class_getitem__`, and outlining when a :ref:" "`subscription` results in ``__class_getitem__()`` being " "called instead of :meth:`~object.__getitem__`" msgstr "" -#: ../../reference/datamodel.rst:3112 +#: ../../reference/datamodel.rst:3119 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:3119 +#: ../../reference/datamodel.rst:3126 msgid "" "Called when the instance is \"called\" as a function; if this method is " "defined, ``x(arg1, arg2, ...)`` roughly translates to ``type(x).__call__(x, " "arg1, ...)``. The :class:`object` class itself does not provide this method." msgstr "" -#: ../../reference/datamodel.rst:3127 +#: ../../reference/datamodel.rst:3134 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:3129 +#: ../../reference/datamodel.rst:3136 msgid "" "The following methods can be defined to implement container objects. None of " "them are provided by the :class:`object` class itself. Containers usually " @@ -3783,7 +3789,7 @@ msgid "" "__setitem__`, :meth:`~object.__delitem__`, and :meth:`!keys`." msgstr "" -#: ../../reference/datamodel.rst:3148 +#: ../../reference/datamodel.rst:3155 msgid "" "Mutable sequences should provide methods :meth:`~sequence.append`, :meth:" "`~sequence.clear`, :meth:`~sequence.count`, :meth:`~sequence.extend`, :meth:" @@ -3797,7 +3803,7 @@ msgid "" "numerical operators." msgstr "" -#: ../../reference/datamodel.rst:3160 +#: ../../reference/datamodel.rst:3167 msgid "" "It is recommended that both mappings and sequences implement the :meth:" "`~object.__contains__` method to allow efficient use of the ``in`` operator; " @@ -3809,7 +3815,7 @@ msgid "" "iterate through the values." msgstr "" -#: ../../reference/datamodel.rst:3175 +#: ../../reference/datamodel.rst:3182 msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " @@ -3817,7 +3823,7 @@ msgid "" "returns zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:3182 +#: ../../reference/datamodel.rst:3189 msgid "" "In CPython, the length is required to be at most :data:`sys.maxsize`. If the " "length is larger than :data:`!sys.maxsize` some features (such as :func:" @@ -3826,7 +3832,7 @@ msgid "" "`~object.__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:3191 +#: ../../reference/datamodel.rst:3198 msgid "" "Called to implement :func:`operator.length_hint`. Should return an estimated " "length for the object (which may be greater or less than the actual length). " @@ -3836,28 +3842,28 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:3205 +#: ../../reference/datamodel.rst:3212 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:3207 +#: ../../reference/datamodel.rst:3214 msgid "a[1:2] = b" msgstr "a[1:2] = b" -#: ../../reference/datamodel.rst:3209 +#: ../../reference/datamodel.rst:3216 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:3211 +#: ../../reference/datamodel.rst:3218 msgid "a[slice(1, 2, None)] = b" msgstr "a[slice(1, 2, None)] = b" -#: ../../reference/datamodel.rst:3213 +#: ../../reference/datamodel.rst:3220 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:3218 +#: ../../reference/datamodel.rst:3225 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers. Optionally, they may support :class:" @@ -3869,20 +3875,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:3230 +#: ../../reference/datamodel.rst:3237 msgid "" ":keyword:`for` loops expect that an :exc:`IndexError` will be raised for " "illegal indexes to allow proper detection of the end of the sequence." msgstr "" -#: ../../reference/datamodel.rst:3235 +#: ../../reference/datamodel.rst:3242 msgid "" "When :ref:`subscripting` a *class*, the special class method :" "meth:`~object.__class_getitem__` may be called instead of ``__getitem__()``. " "See :ref:`classgetitem-versus-getitem` for more details." msgstr "" -#: ../../reference/datamodel.rst:3243 +#: ../../reference/datamodel.rst:3250 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3891,7 +3897,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:3252 +#: ../../reference/datamodel.rst:3259 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3900,13 +3906,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:3261 +#: ../../reference/datamodel.rst:3268 msgid "" "Called by :class:`dict`\\ .\\ :meth:`__getitem__` to implement ``self[key]`` " "for dict subclasses when key is not in the dictionary." msgstr "" -#: ../../reference/datamodel.rst:3267 +#: ../../reference/datamodel.rst:3274 msgid "" "This method is called when an :term:`iterator` is required for a container. " "This method should return a new iterator object that can iterate over all " @@ -3914,14 +3920,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:3275 +#: ../../reference/datamodel.rst:3282 msgid "" "Called (if present) by the :func:`reversed` built-in to implement reverse " "iteration. It should return a new iterator object that iterates over all " "the objects in the container in reverse order." msgstr "" -#: ../../reference/datamodel.rst:3279 +#: ../../reference/datamodel.rst:3286 msgid "" "If the :meth:`__reversed__` method is not provided, the :func:`reversed` " "built-in will fall back to using the sequence protocol (:meth:`__len__` and :" @@ -3930,7 +3936,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:3286 +#: ../../reference/datamodel.rst:3293 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3938,14 +3944,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:3293 +#: ../../reference/datamodel.rst:3300 msgid "" "Called to implement membership test operators. Should return true if *item* " "is in *self*, false otherwise. For mapping objects, this should consider " "the keys of the mapping rather than the values or the key-item pairs." msgstr "" -#: ../../reference/datamodel.rst:3297 +#: ../../reference/datamodel.rst:3304 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3953,11 +3959,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:3306 +#: ../../reference/datamodel.rst:3313 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:3308 +#: ../../reference/datamodel.rst:3315 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3965,7 +3971,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:3334 +#: ../../reference/datamodel.rst:3341 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3979,13 +3985,13 @@ msgid "" "`pow` function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:3345 +#: ../../reference/datamodel.rst:3352 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return :data:`NotImplemented`." msgstr "" -#: ../../reference/datamodel.rst:3368 +#: ../../reference/datamodel.rst:3375 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3999,21 +4005,21 @@ msgid "" "`NotImplemented` or ``type(y)`` is a subclass of ``type(x)``. [#]_" msgstr "" -#: ../../reference/datamodel.rst:3379 +#: ../../reference/datamodel.rst:3386 msgid "" "Note that :meth:`__rpow__` should be defined to accept an optional third " "argument if the three-argument version of the built-in :func:`pow` function " "is to be supported." msgstr "" -#: ../../reference/datamodel.rst:3385 +#: ../../reference/datamodel.rst:3392 msgid "" "Three-argument :func:`pow` now try calling :meth:`~object.__rpow__` if " "necessary. Previously it was only called in two-argument :func:`!pow` and " "the binary power operator." msgstr "" -#: ../../reference/datamodel.rst:3391 +#: ../../reference/datamodel.rst:3398 msgid "" "If the right operand's type is a subclass of the left operand's type and " "that subclass provides a different implementation of the reflected method " @@ -4022,7 +4028,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:3411 +#: ../../reference/datamodel.rst:3418 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -4040,19 +4046,19 @@ msgid "" "data model." msgstr "" -#: ../../reference/datamodel.rst:3434 +#: ../../reference/datamodel.rst:3441 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:3447 +#: ../../reference/datamodel.rst:3454 msgid "" "Called to implement the built-in functions :func:`complex`, :func:`int` and :" "func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:3454 +#: ../../reference/datamodel.rst:3461 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -4061,14 +4067,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:3460 +#: ../../reference/datamodel.rst:3467 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:3472 +#: ../../reference/datamodel.rst:3479 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -4077,16 +4083,16 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:3478 +#: ../../reference/datamodel.rst:3485 msgid "" ":func:`int` no longer delegates to the :meth:`~object.__trunc__` method." msgstr "" -#: ../../reference/datamodel.rst:3485 +#: ../../reference/datamodel.rst:3492 msgid "With Statement Context Managers" msgstr "With 陳述式的情境管理器" -#: ../../reference/datamodel.rst:3487 +#: ../../reference/datamodel.rst:3494 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -4096,34 +4102,34 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:3498 +#: ../../reference/datamodel.rst:3505 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:3501 +#: ../../reference/datamodel.rst:3508 msgid "" "For more information on context managers, see :ref:`typecontextmanager`. " "The :class:`object` class itself does not provide the context manager " "methods." msgstr "" -#: ../../reference/datamodel.rst:3507 +#: ../../reference/datamodel.rst:3514 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:3514 +#: ../../reference/datamodel.rst:3521 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:3518 +#: ../../reference/datamodel.rst:3525 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -4131,27 +4137,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:3522 +#: ../../reference/datamodel.rst:3529 msgid "" "Note that :meth:`~object.__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:3528 +#: ../../reference/datamodel.rst:3535 msgid ":pep:`343` - The \"with\" statement" msgstr ":pep:`343` - \"with\" 陳述式" -#: ../../reference/datamodel.rst:3529 +#: ../../reference/datamodel.rst:3536 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3536 +#: ../../reference/datamodel.rst:3543 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:3538 +#: ../../reference/datamodel.rst:3545 msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " @@ -4159,7 +4165,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:3545 +#: ../../reference/datamodel.rst:3552 msgid "" "This class variable can be assigned a tuple of strings. When this class is " "used in a class pattern with positional arguments, each positional argument " @@ -4168,7 +4174,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:3551 +#: ../../reference/datamodel.rst:3558 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -4178,19 +4184,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:3561 +#: ../../reference/datamodel.rst:3568 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:3562 +#: ../../reference/datamodel.rst:3569 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:3568 +#: ../../reference/datamodel.rst:3575 msgid "Emulating buffer types" msgstr "" -#: ../../reference/datamodel.rst:3570 +#: ../../reference/datamodel.rst:3577 msgid "" "The :ref:`buffer protocol ` provides a way for Python objects " "to expose efficient access to a low-level memory array. This protocol is " @@ -4198,13 +4204,13 @@ msgid "" "and third-party libraries may define additional buffer types." msgstr "" -#: ../../reference/datamodel.rst:3575 +#: ../../reference/datamodel.rst:3582 msgid "" "While buffer types are usually implemented in C, it is also possible to " "implement the protocol in Python." msgstr "" -#: ../../reference/datamodel.rst:3580 +#: ../../reference/datamodel.rst:3587 msgid "" "Called when a buffer is requested from *self* (for example, by the :class:" "`memoryview` constructor). The *flags* argument is an integer representing " @@ -4214,7 +4220,7 @@ msgid "" "`memoryview` object." msgstr "" -#: ../../reference/datamodel.rst:3589 +#: ../../reference/datamodel.rst:3596 msgid "" "Called when a buffer is no longer needed. The *buffer* argument is a :class:" "`memoryview` object that was previously returned by :meth:`~object." @@ -4223,35 +4229,35 @@ msgid "" "to perform any cleanup are not required to implement this method." msgstr "" -#: ../../reference/datamodel.rst:3600 +#: ../../reference/datamodel.rst:3607 msgid ":pep:`688` - Making the buffer protocol accessible in Python" msgstr "" -#: ../../reference/datamodel.rst:3601 +#: ../../reference/datamodel.rst:3608 msgid "" "Introduces the Python ``__buffer__`` and ``__release_buffer__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3603 +#: ../../reference/datamodel.rst:3610 msgid ":class:`collections.abc.Buffer`" msgstr ":class:`collections.abc.Buffer`" -#: ../../reference/datamodel.rst:3604 +#: ../../reference/datamodel.rst:3611 msgid "ABC for buffer types." msgstr "" -#: ../../reference/datamodel.rst:3607 +#: ../../reference/datamodel.rst:3614 msgid "Annotations" msgstr "" -#: ../../reference/datamodel.rst:3609 +#: ../../reference/datamodel.rst:3616 msgid "" "Functions, classes, and modules may contain :term:`annotations " "`, which are a way to associate information (usually :term:`type " "hints `) with a symbol." msgstr "" -#: ../../reference/datamodel.rst:3615 +#: ../../reference/datamodel.rst:3622 msgid "" "This attribute contains the annotations for an object. It is :ref:`lazily " "evaluated `, so accessing the attribute may execute " @@ -4259,24 +4265,24 @@ msgid "" "attribute is set to a dictionary mapping from variable names to annotations." msgstr "" -#: ../../reference/datamodel.rst:3620 +#: ../../reference/datamodel.rst:3627 msgid "Annotations are now lazily evaluated." msgstr "" -#: ../../reference/datamodel.rst:3625 +#: ../../reference/datamodel.rst:3632 msgid "" "An :term:`annotate function`. Returns a new dictionary object mapping " "attribute/parameter names to their annotation values." msgstr "" -#: ../../reference/datamodel.rst:3628 +#: ../../reference/datamodel.rst:3635 msgid "" "Takes a format parameter specifying the format in which annotations values " "should be provided. It must be a member of the :class:`annotationlib.Format` " "enum, or an integer with a value corresponding to a member of the enum." msgstr "" -#: ../../reference/datamodel.rst:3632 +#: ../../reference/datamodel.rst:3639 msgid "" "If an annotate function doesn't support the requested format, it must raise :" "exc:`NotImplementedError`. Annotate functions must always support :attr:" @@ -4284,34 +4290,34 @@ msgid "" "`NotImplementedError()` when called with this format." msgstr "" -#: ../../reference/datamodel.rst:3637 +#: ../../reference/datamodel.rst:3644 msgid "" "When called with :attr:`~annotationlib.Format.VALUE` format, an annotate " "function may raise :exc:`NameError`; it must not raise :exc:`!NameError` " "when called requesting any other format." msgstr "" -#: ../../reference/datamodel.rst:3640 +#: ../../reference/datamodel.rst:3647 msgid "" "If an object does not have any annotations, :attr:`~object.__annotate__` " "should preferably be set to ``None`` (it can’t be deleted), rather than set " "to a function that returns an empty dict." msgstr "" -#: ../../reference/datamodel.rst:3647 +#: ../../reference/datamodel.rst:3654 msgid ":pep:`649` --- Deferred evaluation of annotation using descriptors" msgstr "" -#: ../../reference/datamodel.rst:3648 +#: ../../reference/datamodel.rst:3655 msgid "" "Introduces lazy evaluation of annotations and the ``__annotate__`` function." msgstr "" -#: ../../reference/datamodel.rst:3654 +#: ../../reference/datamodel.rst:3661 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:3656 +#: ../../reference/datamodel.rst:3663 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -4319,7 +4325,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:3661 +#: ../../reference/datamodel.rst:3668 msgid "" ">>> class C:\n" "... pass\n" @@ -4341,7 +4347,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: object of type 'C' has no len()" -#: ../../reference/datamodel.rst:3671 +#: ../../reference/datamodel.rst:3678 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -4350,7 +4356,7 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:3678 +#: ../../reference/datamodel.rst:3685 msgid "" ">>> 1 .__hash__() == hash(1)\n" "True\n" @@ -4366,14 +4372,14 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: descriptor '__hash__' of 'int' object needs an argument" -#: ../../reference/datamodel.rst:3685 +#: ../../reference/datamodel.rst:3692 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:3689 +#: ../../reference/datamodel.rst:3696 msgid "" ">>> type(1).__hash__(1) == hash(1)\n" "True\n" @@ -4385,14 +4391,14 @@ msgstr "" ">>> type(int).__hash__(int) == hash(int)\n" "True" -#: ../../reference/datamodel.rst:3694 +#: ../../reference/datamodel.rst:3701 msgid "" "In addition to bypassing any instance attributes in the interest of " "correctness, implicit special method lookup generally also bypasses the :" "meth:`~object.__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:3698 +#: ../../reference/datamodel.rst:3705 msgid "" ">>> class Meta(type):\n" "... def __getattribute__(*args):\n" @@ -4417,7 +4423,7 @@ msgid "" "10" msgstr "" -#: ../../reference/datamodel.rst:3720 +#: ../../reference/datamodel.rst:3727 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -4426,29 +4432,29 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:3731 +#: ../../reference/datamodel.rst:3738 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:3735 +#: ../../reference/datamodel.rst:3742 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:3737 +#: ../../reference/datamodel.rst:3744 msgid "" "An :term:`awaitable` object generally implements an :meth:`~object." "__await__` method. :term:`Coroutine objects ` returned from :" "keyword:`async def` functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:3743 +#: ../../reference/datamodel.rst:3750 msgid "" "The :term:`generator iterator` objects returned from generators decorated " "with :func:`types.coroutine` are also awaitable, but they do not implement :" "meth:`~object.__await__`." msgstr "" -#: ../../reference/datamodel.rst:3749 +#: ../../reference/datamodel.rst:3756 msgid "" "Must return an :term:`iterator`. Should be used to implement :term:" "`awaitable` objects. For instance, :class:`asyncio.Future` implements this " @@ -4456,7 +4462,7 @@ msgid "" "`object` class itself is not awaitable and does not provide this method." msgstr "" -#: ../../reference/datamodel.rst:3757 +#: ../../reference/datamodel.rst:3764 msgid "" "The language doesn't place any restriction on the type or value of the " "objects yielded by the iterator returned by ``__await__``, as this is " @@ -4464,15 +4470,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:3765 +#: ../../reference/datamodel.rst:3772 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:3771 +#: ../../reference/datamodel.rst:3778 msgid "Coroutine Objects" msgstr "協程物件" -#: ../../reference/datamodel.rst:3773 +#: ../../reference/datamodel.rst:3780 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -4483,18 +4489,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:3781 +#: ../../reference/datamodel.rst:3788 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:3785 +#: ../../reference/datamodel.rst:3792 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:3791 +#: ../../reference/datamodel.rst:3798 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -4505,7 +4511,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3802 +#: ../../reference/datamodel.rst:3809 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -4516,13 +4522,13 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3813 +#: ../../reference/datamodel.rst:3820 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:3818 +#: ../../reference/datamodel.rst:3825 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -4532,46 +4538,46 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3826 +#: ../../reference/datamodel.rst:3833 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3832 +#: ../../reference/datamodel.rst:3839 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3834 +#: ../../reference/datamodel.rst:3841 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3837 +#: ../../reference/datamodel.rst:3844 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3839 ../../reference/datamodel.rst:3888 +#: ../../reference/datamodel.rst:3846 ../../reference/datamodel.rst:3895 msgid "The :class:`object` class itself does not provide these methods." msgstr "" -#: ../../reference/datamodel.rst:3844 +#: ../../reference/datamodel.rst:3851 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3848 +#: ../../reference/datamodel.rst:3855 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:3851 +#: ../../reference/datamodel.rst:3858 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3853 +#: ../../reference/datamodel.rst:3860 msgid "" "class Reader:\n" " async def readline(self):\n" @@ -4599,53 +4605,53 @@ msgstr "" " raise StopAsyncIteration\n" " return val" -#: ../../reference/datamodel.rst:3868 +#: ../../reference/datamodel.rst:3875 msgid "" "Prior to Python 3.7, :meth:`~object.__aiter__` could return an *awaitable* " "that would resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:3873 +#: ../../reference/datamodel.rst:3880 msgid "" "Starting with Python 3.7, :meth:`~object.__aiter__` must return an " "asynchronous iterator object. Returning anything else will result in a :exc:" "`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:3881 +#: ../../reference/datamodel.rst:3888 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3883 +#: ../../reference/datamodel.rst:3890 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3886 +#: ../../reference/datamodel.rst:3893 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3892 +#: ../../reference/datamodel.rst:3899 msgid "" "Semantically similar to :meth:`~object.__enter__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3897 +#: ../../reference/datamodel.rst:3904 msgid "" "Semantically similar to :meth:`~object.__exit__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3900 +#: ../../reference/datamodel.rst:3907 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3902 +#: ../../reference/datamodel.rst:3909 msgid "" "class AsyncContextManager:\n" " async def __aenter__(self):\n" @@ -4661,18 +4667,18 @@ msgstr "" " async def __aexit__(self, exc_type, exc, tb):\n" " await log('exiting context')" -#: ../../reference/datamodel.rst:3913 +#: ../../reference/datamodel.rst:3920 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3914 +#: ../../reference/datamodel.rst:3921 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:3918 +#: ../../reference/datamodel.rst:3925 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, :meth:`~object.__contains__`, :meth:`~object." @@ -4681,7 +4687,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3925 +#: ../../reference/datamodel.rst:3932 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns :data:`NotImplemented`. Do not set the method to ``None`` if " @@ -4689,14 +4695,14 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3931 +#: ../../reference/datamodel.rst:3938 msgid "" "For operands of the same type, it is assumed that if the non-reflected " "method (such as :meth:`~object.__add__`) fails then the operation is not " "supported, which is why the reflected method is not called." msgstr "" -#: ../../reference/datamodel.rst:3935 +#: ../../reference/datamodel.rst:3942 msgid "" "If the right operand's type is a subclass of the left operand's type, the " "reflected method having precedence allows subclasses to override their " @@ -4713,13 +4719,13 @@ msgstr "" #: ../../reference/datamodel.rst:428 ../../reference/datamodel.rst:448 #: ../../reference/datamodel.rst:456 ../../reference/datamodel.rst:467 #: ../../reference/datamodel.rst:484 ../../reference/datamodel.rst:520 -#: ../../reference/datamodel.rst:535 ../../reference/datamodel.rst:673 -#: ../../reference/datamodel.rst:811 ../../reference/datamodel.rst:835 -#: ../../reference/datamodel.rst:871 ../../reference/datamodel.rst:1149 -#: ../../reference/datamodel.rst:1317 ../../reference/datamodel.rst:1344 -#: ../../reference/datamodel.rst:1416 ../../reference/datamodel.rst:1524 -#: ../../reference/datamodel.rst:1632 ../../reference/datamodel.rst:1749 -#: ../../reference/datamodel.rst:2174 ../../reference/datamodel.rst:3201 +#: ../../reference/datamodel.rst:535 ../../reference/datamodel.rst:680 +#: ../../reference/datamodel.rst:818 ../../reference/datamodel.rst:842 +#: ../../reference/datamodel.rst:878 ../../reference/datamodel.rst:1156 +#: ../../reference/datamodel.rst:1324 ../../reference/datamodel.rst:1351 +#: ../../reference/datamodel.rst:1423 ../../reference/datamodel.rst:1531 +#: ../../reference/datamodel.rst:1639 ../../reference/datamodel.rst:1756 +#: ../../reference/datamodel.rst:2181 ../../reference/datamodel.rst:3208 msgid "object" msgstr "object(物件)" @@ -4729,13 +4735,13 @@ msgstr "data(資料)" #: ../../reference/datamodel.rst:22 ../../reference/datamodel.rst:297 #: ../../reference/datamodel.rst:344 ../../reference/datamodel.rst:428 -#: ../../reference/datamodel.rst:467 ../../reference/datamodel.rst:811 -#: ../../reference/datamodel.rst:1373 ../../reference/datamodel.rst:1832 -#: ../../reference/datamodel.rst:2075 ../../reference/datamodel.rst:2081 -#: ../../reference/datamodel.rst:2174 ../../reference/datamodel.rst:2736 -#: ../../reference/datamodel.rst:3171 ../../reference/datamodel.rst:3329 -#: ../../reference/datamodel.rst:3364 ../../reference/datamodel.rst:3432 -#: ../../reference/datamodel.rst:3442 ../../reference/datamodel.rst:3470 +#: ../../reference/datamodel.rst:467 ../../reference/datamodel.rst:818 +#: ../../reference/datamodel.rst:1380 ../../reference/datamodel.rst:1839 +#: ../../reference/datamodel.rst:2082 ../../reference/datamodel.rst:2088 +#: ../../reference/datamodel.rst:2181 ../../reference/datamodel.rst:2743 +#: ../../reference/datamodel.rst:3178 ../../reference/datamodel.rst:3336 +#: ../../reference/datamodel.rst:3371 ../../reference/datamodel.rst:3439 +#: ../../reference/datamodel.rst:3449 ../../reference/datamodel.rst:3477 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -4744,7 +4750,7 @@ msgid "id" msgstr "id" #: ../../reference/datamodel.rst:22 ../../reference/datamodel.rst:122 -#: ../../reference/datamodel.rst:2736 +#: ../../reference/datamodel.rst:2743 msgid "type" msgstr "type(型別)" @@ -4780,7 +4786,7 @@ msgstr "reference counting(參照計數)" msgid "unreachable object" msgstr "unreachable object(不可達物件)" -#: ../../reference/datamodel.rst:91 ../../reference/datamodel.rst:1149 +#: ../../reference/datamodel.rst:91 ../../reference/datamodel.rst:1156 msgid "container" msgstr "container(容器)" @@ -4794,24 +4800,24 @@ msgstr "extension(擴充)" #: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:401 #: ../../reference/datamodel.rst:402 ../../reference/datamodel.rst:503 -#: ../../reference/datamodel.rst:871 ../../reference/datamodel.rst:891 -#: ../../reference/datamodel.rst:1373 +#: ../../reference/datamodel.rst:878 ../../reference/datamodel.rst:898 +#: ../../reference/datamodel.rst:1380 msgid "module" msgstr "module(模組)" #: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:266 -#: ../../reference/datamodel.rst:811 +#: ../../reference/datamodel.rst:818 msgid "C" msgstr "C" #: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:266 -#: ../../reference/datamodel.rst:811 +#: ../../reference/datamodel.rst:818 msgid "language" msgstr "language(語言)" -#: ../../reference/datamodel.rst:135 ../../reference/datamodel.rst:1149 -#: ../../reference/datamodel.rst:1167 ../../reference/datamodel.rst:1317 -#: ../../reference/datamodel.rst:1337 +#: ../../reference/datamodel.rst:135 ../../reference/datamodel.rst:1156 +#: ../../reference/datamodel.rst:1174 ../../reference/datamodel.rst:1324 +#: ../../reference/datamodel.rst:1344 msgid "attribute" msgstr "attribute(屬性)" @@ -4831,7 +4837,7 @@ msgstr "..." msgid "ellipsis literal" msgstr "ellipsis literal(刪節號字面值)" -#: ../../reference/datamodel.rst:195 ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:195 ../../reference/datamodel.rst:1351 msgid "numeric" msgstr "numeric(數值)" @@ -4868,16 +4874,16 @@ msgstr "number(數字)" msgid "Java" msgstr "Java" -#: ../../reference/datamodel.rst:284 ../../reference/datamodel.rst:3442 +#: ../../reference/datamodel.rst:284 ../../reference/datamodel.rst:3449 msgid "complex" msgstr "complex(複數)" #: ../../reference/datamodel.rst:297 ../../reference/datamodel.rst:428 -#: ../../reference/datamodel.rst:467 ../../reference/datamodel.rst:3171 +#: ../../reference/datamodel.rst:467 ../../reference/datamodel.rst:3178 msgid "len" msgstr "len" -#: ../../reference/datamodel.rst:297 ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:297 ../../reference/datamodel.rst:1351 msgid "sequence" msgstr "sequence(序列)" @@ -4906,8 +4912,8 @@ msgstr "immutable sequence(不可變序列)" msgid "immutable" msgstr "immutable(不可變)" -#: ../../reference/datamodel.rst:340 ../../reference/datamodel.rst:2050 -#: ../../reference/datamodel.rst:2081 +#: ../../reference/datamodel.rst:340 ../../reference/datamodel.rst:2057 +#: ../../reference/datamodel.rst:2088 msgid "string" msgstr "string(字串)" @@ -4943,7 +4949,7 @@ msgstr "singleton(單例)" msgid "empty" msgstr "empty(空的)" -#: ../../reference/datamodel.rst:377 ../../reference/datamodel.rst:2075 +#: ../../reference/datamodel.rst:377 ../../reference/datamodel.rst:2082 msgid "bytes" msgstr "bytes(位元組)" @@ -4959,14 +4965,14 @@ msgstr "mutable sequence(可變序列)" msgid "mutable" msgstr "mutable(可變的)" -#: ../../reference/datamodel.rst:389 ../../reference/datamodel.rst:1167 -#: ../../reference/datamodel.rst:1337 +#: ../../reference/datamodel.rst:389 ../../reference/datamodel.rst:1174 +#: ../../reference/datamodel.rst:1344 msgid "assignment" msgstr "assignment(賦值)" -#: ../../reference/datamodel.rst:389 ../../reference/datamodel.rst:871 -#: ../../reference/datamodel.rst:1786 ../../reference/datamodel.rst:1968 -#: ../../reference/datamodel.rst:3494 +#: ../../reference/datamodel.rst:389 ../../reference/datamodel.rst:878 +#: ../../reference/datamodel.rst:1793 ../../reference/datamodel.rst:1975 +#: ../../reference/datamodel.rst:3501 msgid "statement" msgstr "statement(陳述式)" @@ -4998,12 +5004,12 @@ msgstr "set(集合)" msgid "frozenset" msgstr "frozenset(凍結集合)" -#: ../../reference/datamodel.rst:467 ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:467 ../../reference/datamodel.rst:1351 msgid "mapping" msgstr "mapping(對映)" -#: ../../reference/datamodel.rst:484 ../../reference/datamodel.rst:1149 -#: ../../reference/datamodel.rst:2174 +#: ../../reference/datamodel.rst:484 ../../reference/datamodel.rst:1156 +#: ../../reference/datamodel.rst:2181 msgid "dictionary" msgstr "dictionary(字典)" @@ -5020,13 +5026,13 @@ msgid "callable" msgstr "callable(可呼叫物件)" #: ../../reference/datamodel.rst:520 ../../reference/datamodel.rst:535 -#: ../../reference/datamodel.rst:755 ../../reference/datamodel.rst:773 -#: ../../reference/datamodel.rst:786 ../../reference/datamodel.rst:811 +#: ../../reference/datamodel.rst:762 ../../reference/datamodel.rst:780 +#: ../../reference/datamodel.rst:793 ../../reference/datamodel.rst:818 msgid "function" msgstr "function (函式)" -#: ../../reference/datamodel.rst:520 ../../reference/datamodel.rst:1149 -#: ../../reference/datamodel.rst:1172 ../../reference/datamodel.rst:3117 +#: ../../reference/datamodel.rst:520 ../../reference/datamodel.rst:1156 +#: ../../reference/datamodel.rst:1179 ../../reference/datamodel.rst:3124 msgid "call" msgstr "call(呼叫)" @@ -5038,7 +5044,7 @@ msgstr "invocation(呼叫)" msgid "argument" msgstr "argument(引數)" -#: ../../reference/datamodel.rst:535 ../../reference/datamodel.rst:673 +#: ../../reference/datamodel.rst:535 ../../reference/datamodel.rst:680 msgid "user-defined" msgstr "user-defined(使用者定義)" @@ -5046,6 +5052,11 @@ msgstr "user-defined(使用者定義)" msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" +#: ../../reference/datamodel.rst:548 +#, fuzzy +msgid "__builtins__ (function attribute)" +msgstr "__defaults__ (函式屬性)" + #: ../../reference/datamodel.rst:548 msgid "__closure__ (function attribute)" msgstr "__closure__ (函式屬性)" @@ -5058,646 +5069,646 @@ msgstr "__globals__ (函式屬性)" msgid "global" msgstr "global(全域)" -#: ../../reference/datamodel.rst:548 ../../reference/datamodel.rst:891 +#: ../../reference/datamodel.rst:548 ../../reference/datamodel.rst:898 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../reference/datamodel.rst:575 +#: ../../reference/datamodel.rst:582 msgid "__doc__ (function attribute)" msgstr "__doc__ (函式屬性)" -#: ../../reference/datamodel.rst:575 +#: ../../reference/datamodel.rst:582 msgid "__name__ (function attribute)" msgstr "__name__ (函式屬性)" -#: ../../reference/datamodel.rst:575 +#: ../../reference/datamodel.rst:582 msgid "__module__ (function attribute)" msgstr "__module__ (函式屬性)" -#: ../../reference/datamodel.rst:575 +#: ../../reference/datamodel.rst:582 msgid "__dict__ (function attribute)" msgstr "__dict__ (函式屬性)" -#: ../../reference/datamodel.rst:575 +#: ../../reference/datamodel.rst:582 msgid "__defaults__ (function attribute)" msgstr "__defaults__ (函式屬性)" -#: ../../reference/datamodel.rst:575 +#: ../../reference/datamodel.rst:582 msgid "__code__ (function attribute)" msgstr "__code__ (函式屬性)" -#: ../../reference/datamodel.rst:575 +#: ../../reference/datamodel.rst:582 msgid "__annotations__ (function attribute)" msgstr "__annotations__ (函式屬性)" -#: ../../reference/datamodel.rst:575 +#: ../../reference/datamodel.rst:582 msgid "__annotate__ (function attribute)" msgstr "__annotate__ (函式屬性)" -#: ../../reference/datamodel.rst:575 +#: ../../reference/datamodel.rst:582 msgid "__kwdefaults__ (function attribute)" msgstr "__kwdefaults__ (函式屬性)" -#: ../../reference/datamodel.rst:575 +#: ../../reference/datamodel.rst:582 msgid "__type_params__ (function attribute)" msgstr "__type_params__ (函式屬性)" -#: ../../reference/datamodel.rst:673 ../../reference/datamodel.rst:835 +#: ../../reference/datamodel.rst:680 ../../reference/datamodel.rst:842 msgid "method" msgstr "method(方法)" -#: ../../reference/datamodel.rst:673 +#: ../../reference/datamodel.rst:680 msgid "user-defined method" msgstr "user-defined method(使用者定義方法)" -#: ../../reference/datamodel.rst:681 +#: ../../reference/datamodel.rst:688 msgid "__func__ (method attribute)" msgstr "__func__ (方法屬性)" -#: ../../reference/datamodel.rst:681 +#: ../../reference/datamodel.rst:688 msgid "__self__ (method attribute)" msgstr "__self__ (方法屬性)" -#: ../../reference/datamodel.rst:681 +#: ../../reference/datamodel.rst:688 msgid "__doc__ (method attribute)" msgstr "__doc__ (方法屬性)" -#: ../../reference/datamodel.rst:681 +#: ../../reference/datamodel.rst:688 msgid "__name__ (method attribute)" msgstr "__name__ (方法屬性)" -#: ../../reference/datamodel.rst:681 +#: ../../reference/datamodel.rst:688 msgid "__module__ (method attribute)" msgstr "__module__ (方法屬性)" -#: ../../reference/datamodel.rst:755 ../../reference/datamodel.rst:1524 +#: ../../reference/datamodel.rst:762 ../../reference/datamodel.rst:1531 msgid "generator" msgstr "generator(產生器)" -#: ../../reference/datamodel.rst:755 +#: ../../reference/datamodel.rst:762 msgid "iterator" msgstr "itorator(疊代器)" -#: ../../reference/datamodel.rst:773 ../../reference/datamodel.rst:3727 +#: ../../reference/datamodel.rst:780 ../../reference/datamodel.rst:3734 msgid "coroutine" msgstr "coroutine(協程)" -#: ../../reference/datamodel.rst:786 +#: ../../reference/datamodel.rst:793 msgid "asynchronous generator" msgstr "asynchronous generator(非同步產生器)" -#: ../../reference/datamodel.rst:786 +#: ../../reference/datamodel.rst:793 msgid "asynchronous iterator" msgstr "asynchronous iterator(非同步疊代器)" -#: ../../reference/datamodel.rst:835 +#: ../../reference/datamodel.rst:842 msgid "built-in method" msgstr "built-in method(內建方法)" -#: ../../reference/datamodel.rst:835 +#: ../../reference/datamodel.rst:842 msgid "built-in" msgstr "built-in(內建)" -#: ../../reference/datamodel.rst:871 +#: ../../reference/datamodel.rst:878 msgid "import" msgstr "import(引入)" -#: ../../reference/datamodel.rst:891 +#: ../../reference/datamodel.rst:898 msgid "__name__ (module attribute)" msgstr "__name__ (模組屬性)" -#: ../../reference/datamodel.rst:891 +#: ../../reference/datamodel.rst:898 msgid "__spec__ (module attribute)" msgstr "__spec__ (模組屬性)" -#: ../../reference/datamodel.rst:891 +#: ../../reference/datamodel.rst:898 msgid "__package__ (module attribute)" msgstr "__package__ (模組屬性)" -#: ../../reference/datamodel.rst:891 +#: ../../reference/datamodel.rst:898 msgid "__loader__ (module attribute)" msgstr "__loader__ (模組屬性)" -#: ../../reference/datamodel.rst:891 +#: ../../reference/datamodel.rst:898 msgid "__path__ (module attribute)" msgstr "__path__ (模組屬性)" -#: ../../reference/datamodel.rst:891 +#: ../../reference/datamodel.rst:898 msgid "__file__ (module attribute)" msgstr "__file__ (模組屬性)" -#: ../../reference/datamodel.rst:891 +#: ../../reference/datamodel.rst:898 msgid "__cached__ (module attribute)" msgstr "__cached__ (模組屬性)" -#: ../../reference/datamodel.rst:891 +#: ../../reference/datamodel.rst:898 msgid "__doc__ (module attribute)" msgstr "__doc__ (模組屬性)" -#: ../../reference/datamodel.rst:891 +#: ../../reference/datamodel.rst:898 msgid "__annotations__ (module attribute)" msgstr "__annotations__ (模組屬性)" -#: ../../reference/datamodel.rst:891 +#: ../../reference/datamodel.rst:898 msgid "__annotate__ (module attribute)" msgstr "__annotate__ (模組屬性)" -#: ../../reference/datamodel.rst:1117 +#: ../../reference/datamodel.rst:1124 msgid "__dict__ (module attribute)" msgstr "__dict__ (模組屬性)" -#: ../../reference/datamodel.rst:1149 ../../reference/datamodel.rst:1167 -#: ../../reference/datamodel.rst:1317 ../../reference/datamodel.rst:1951 -#: ../../reference/datamodel.rst:2847 +#: ../../reference/datamodel.rst:1156 ../../reference/datamodel.rst:1174 +#: ../../reference/datamodel.rst:1324 ../../reference/datamodel.rst:1958 +#: ../../reference/datamodel.rst:2854 msgid "class" msgstr "class(類別)" -#: ../../reference/datamodel.rst:1149 ../../reference/datamodel.rst:1317 -#: ../../reference/datamodel.rst:1337 +#: ../../reference/datamodel.rst:1156 ../../reference/datamodel.rst:1324 +#: ../../reference/datamodel.rst:1344 msgid "class instance" msgstr "class instance(類別實例)" -#: ../../reference/datamodel.rst:1149 ../../reference/datamodel.rst:1317 -#: ../../reference/datamodel.rst:3117 +#: ../../reference/datamodel.rst:1156 ../../reference/datamodel.rst:1324 +#: ../../reference/datamodel.rst:3124 msgid "instance" msgstr "instance(實例)" -#: ../../reference/datamodel.rst:1149 ../../reference/datamodel.rst:1172 +#: ../../reference/datamodel.rst:1156 ../../reference/datamodel.rst:1179 msgid "class object" msgstr "class object(類別物件)" -#: ../../reference/datamodel.rst:1179 +#: ../../reference/datamodel.rst:1186 msgid "__name__ (class attribute)" msgstr "__name__ (類別屬性)" -#: ../../reference/datamodel.rst:1179 +#: ../../reference/datamodel.rst:1186 msgid "__module__ (class attribute)" msgstr "__module__ (類別屬性)" -#: ../../reference/datamodel.rst:1179 +#: ../../reference/datamodel.rst:1186 msgid "__dict__ (class attribute)" msgstr "__dict__ (類別屬性)" -#: ../../reference/datamodel.rst:1179 +#: ../../reference/datamodel.rst:1186 msgid "__bases__ (class attribute)" msgstr "__bases__ (類別屬性)" -#: ../../reference/datamodel.rst:1179 +#: ../../reference/datamodel.rst:1186 msgid "__base__ (class attribute)" msgstr "__base__ (類別屬性)" -#: ../../reference/datamodel.rst:1179 +#: ../../reference/datamodel.rst:1186 msgid "__doc__ (class attribute)" msgstr "__doc__ (類別屬性)" -#: ../../reference/datamodel.rst:1179 +#: ../../reference/datamodel.rst:1186 msgid "__annotations__ (class attribute)" msgstr "__annotations__ (類別屬性)" -#: ../../reference/datamodel.rst:1179 +#: ../../reference/datamodel.rst:1186 msgid "__annotate__ (class attribute)" msgstr "__annotate__ (類別屬性)" -#: ../../reference/datamodel.rst:1179 +#: ../../reference/datamodel.rst:1186 msgid "__type_params__ (class attribute)" msgstr "__type_params__ (類別屬性)" -#: ../../reference/datamodel.rst:1179 +#: ../../reference/datamodel.rst:1186 msgid "__static_attributes__ (class attribute)" msgstr "__static_attributes__ (類別屬性)" -#: ../../reference/datamodel.rst:1179 +#: ../../reference/datamodel.rst:1186 msgid "__firstlineno__ (class attribute)" msgstr "__firstlineno__ (類別屬性)" -#: ../../reference/datamodel.rst:1355 +#: ../../reference/datamodel.rst:1362 msgid "__dict__ (instance attribute)" msgstr "__dict__ (實例屬性)" -#: ../../reference/datamodel.rst:1355 +#: ../../reference/datamodel.rst:1362 msgid "__class__ (instance attribute)" msgstr "__class__ (實例屬性)" -#: ../../reference/datamodel.rst:1373 +#: ../../reference/datamodel.rst:1380 msgid "open" msgstr "open" -#: ../../reference/datamodel.rst:1373 +#: ../../reference/datamodel.rst:1380 msgid "io" msgstr "io" -#: ../../reference/datamodel.rst:1373 +#: ../../reference/datamodel.rst:1380 msgid "popen() (in module os)" msgstr "popen() (於 os 模組中)" -#: ../../reference/datamodel.rst:1373 +#: ../../reference/datamodel.rst:1380 msgid "makefile() (socket method)" msgstr "makefile() (socket 方法)" -#: ../../reference/datamodel.rst:1373 +#: ../../reference/datamodel.rst:1380 msgid "sys.stdin" msgstr "sys.stdin" -#: ../../reference/datamodel.rst:1373 +#: ../../reference/datamodel.rst:1380 msgid "sys.stdout" msgstr "sys.stdout" -#: ../../reference/datamodel.rst:1373 +#: ../../reference/datamodel.rst:1380 msgid "sys.stderr" msgstr "sys.stderr" -#: ../../reference/datamodel.rst:1373 +#: ../../reference/datamodel.rst:1380 msgid "stdio" msgstr "stdio" -#: ../../reference/datamodel.rst:1373 +#: ../../reference/datamodel.rst:1380 msgid "stdin (in module sys)" msgstr "stdin (sys 模組中)" -#: ../../reference/datamodel.rst:1373 +#: ../../reference/datamodel.rst:1380 msgid "stdout (in module sys)" msgstr "stdout (sys 模組中)" -#: ../../reference/datamodel.rst:1373 +#: ../../reference/datamodel.rst:1380 msgid "stderr (in module sys)" msgstr "stderr (sys 模組中)" -#: ../../reference/datamodel.rst:1402 +#: ../../reference/datamodel.rst:1409 msgid "internal type" msgstr "internal type(內部型別)" -#: ../../reference/datamodel.rst:1402 +#: ../../reference/datamodel.rst:1409 msgid "types, internal" msgstr "types(型別), internal(內部)" -#: ../../reference/datamodel.rst:1416 +#: ../../reference/datamodel.rst:1423 msgid "bytecode" msgstr "bytecode(位元組碼)" -#: ../../reference/datamodel.rst:1416 +#: ../../reference/datamodel.rst:1423 msgid "code" msgstr "code(程式碼)" -#: ../../reference/datamodel.rst:1416 +#: ../../reference/datamodel.rst:1423 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../reference/datamodel.rst:1427 +#: ../../reference/datamodel.rst:1434 msgid "co_argcount (code object attribute)" msgstr "co_argcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1427 +#: ../../reference/datamodel.rst:1434 msgid "co_posonlyargcount (code object attribute)" msgstr "co_posonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1427 +#: ../../reference/datamodel.rst:1434 msgid "co_kwonlyargcount (code object attribute)" msgstr "co_kwonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1427 +#: ../../reference/datamodel.rst:1434 msgid "co_code (code object attribute)" msgstr "co_code (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1427 +#: ../../reference/datamodel.rst:1434 msgid "co_consts (code object attribute)" msgstr "co_consts (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1427 +#: ../../reference/datamodel.rst:1434 msgid "co_filename (code object attribute)" msgstr "co_filename (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1427 +#: ../../reference/datamodel.rst:1434 msgid "co_firstlineno (code object attribute)" msgstr "co_firstlineno (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1427 +#: ../../reference/datamodel.rst:1434 msgid "co_flags (code object attribute)" msgstr "co_flags (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1427 +#: ../../reference/datamodel.rst:1434 msgid "co_lnotab (code object attribute)" msgstr "co_lnotab (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1427 +#: ../../reference/datamodel.rst:1434 msgid "co_name (code object attribute)" msgstr "co_name (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1427 +#: ../../reference/datamodel.rst:1434 msgid "co_names (code object attribute)" msgstr "co_names (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1427 +#: ../../reference/datamodel.rst:1434 msgid "co_nlocals (code object attribute)" msgstr "co_nlocals (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1427 +#: ../../reference/datamodel.rst:1434 msgid "co_stacksize (code object attribute)" msgstr "co_stacksize (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1427 +#: ../../reference/datamodel.rst:1434 msgid "co_varnames (code object attribute)" msgstr "co_varnames (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1427 +#: ../../reference/datamodel.rst:1434 msgid "co_cellvars (code object attribute)" msgstr "co_cellvars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1427 +#: ../../reference/datamodel.rst:1434 msgid "co_freevars (code object attribute)" msgstr "co_freevars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1427 +#: ../../reference/datamodel.rst:1434 msgid "co_qualname (code object attribute)" msgstr "co_qualname (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1540 +#: ../../reference/datamodel.rst:1547 msgid "documentation string" msgstr "documentation string(文件字串)" -#: ../../reference/datamodel.rst:1632 +#: ../../reference/datamodel.rst:1639 msgid "frame" msgstr "frame" -#: ../../reference/datamodel.rst:1638 +#: ../../reference/datamodel.rst:1645 msgid "f_back (frame attribute)" msgstr "f_back (frame 屬性)" -#: ../../reference/datamodel.rst:1638 +#: ../../reference/datamodel.rst:1645 msgid "f_code (frame attribute)" msgstr "f_code (frame 屬性)" -#: ../../reference/datamodel.rst:1638 +#: ../../reference/datamodel.rst:1645 msgid "f_globals (frame attribute)" msgstr "f_globals (frame 屬性)" -#: ../../reference/datamodel.rst:1638 +#: ../../reference/datamodel.rst:1645 msgid "f_locals (frame attribute)" msgstr "f_locals (frame 屬性)" -#: ../../reference/datamodel.rst:1638 +#: ../../reference/datamodel.rst:1645 msgid "f_lasti (frame attribute)" msgstr "f_lasti (frame 屬性)" -#: ../../reference/datamodel.rst:1638 +#: ../../reference/datamodel.rst:1645 msgid "f_builtins (frame attribute)" msgstr "f_builtins (frame 屬性)" -#: ../../reference/datamodel.rst:1638 +#: ../../reference/datamodel.rst:1645 msgid "f_generator (frame attribute)" msgstr "f_generator (frame 屬性)" -#: ../../reference/datamodel.rst:1689 +#: ../../reference/datamodel.rst:1696 msgid "f_trace (frame attribute)" msgstr "f_trace (frame 屬性)" -#: ../../reference/datamodel.rst:1689 +#: ../../reference/datamodel.rst:1696 msgid "f_trace_lines (frame attribute)" msgstr "f_trace_lines (frame 屬性)" -#: ../../reference/datamodel.rst:1689 +#: ../../reference/datamodel.rst:1696 msgid "f_trace_opcodes (frame attribute)" msgstr "f_trace_opcodes (frame 屬性)" -#: ../../reference/datamodel.rst:1689 +#: ../../reference/datamodel.rst:1696 msgid "f_lineno (frame attribute)" msgstr "f_lineno (frame 屬性)" -#: ../../reference/datamodel.rst:1749 +#: ../../reference/datamodel.rst:1756 msgid "traceback" msgstr "traceback" -#: ../../reference/datamodel.rst:1749 +#: ../../reference/datamodel.rst:1756 msgid "stack" msgstr "stack(堆疊)" -#: ../../reference/datamodel.rst:1749 +#: ../../reference/datamodel.rst:1756 msgid "trace" msgstr "trace(追蹤)" -#: ../../reference/datamodel.rst:1749 +#: ../../reference/datamodel.rst:1756 msgid "exception" msgstr "exception(例外)" -#: ../../reference/datamodel.rst:1749 +#: ../../reference/datamodel.rst:1756 msgid "handler" msgstr "handler(處理器)" -#: ../../reference/datamodel.rst:1749 +#: ../../reference/datamodel.rst:1756 msgid "execution" msgstr "execution(執行)" -#: ../../reference/datamodel.rst:1749 +#: ../../reference/datamodel.rst:1756 msgid "exc_info (in module sys)" msgstr "exc_info (sys 模組中)" -#: ../../reference/datamodel.rst:1749 +#: ../../reference/datamodel.rst:1756 msgid "last_traceback (in module sys)" msgstr "last_traceback (sys 模組中)" -#: ../../reference/datamodel.rst:1749 +#: ../../reference/datamodel.rst:1756 msgid "sys.exc_info" msgstr "sys.exc_info" -#: ../../reference/datamodel.rst:1749 +#: ../../reference/datamodel.rst:1756 msgid "sys.exception" msgstr "sys.exception" -#: ../../reference/datamodel.rst:1749 +#: ../../reference/datamodel.rst:1756 msgid "sys.last_traceback" msgstr "sys.last_traceback" -#: ../../reference/datamodel.rst:1786 +#: ../../reference/datamodel.rst:1793 msgid "tb_frame (traceback attribute)" msgstr "tb_frame (traceback 屬性)" -#: ../../reference/datamodel.rst:1786 +#: ../../reference/datamodel.rst:1793 msgid "tb_lineno (traceback attribute)" msgstr "tb_lineno (traceback 屬性)" -#: ../../reference/datamodel.rst:1786 +#: ../../reference/datamodel.rst:1793 msgid "tb_lasti (traceback attribute)" msgstr "tb_lasti (traceback 屬性)" -#: ../../reference/datamodel.rst:1786 +#: ../../reference/datamodel.rst:1793 msgid "try" msgstr "try" -#: ../../reference/datamodel.rst:1816 +#: ../../reference/datamodel.rst:1823 msgid "tb_next (traceback attribute)" msgstr "tb_next (traceback 屬性)" -#: ../../reference/datamodel.rst:1832 ../../reference/datamodel.rst:3201 +#: ../../reference/datamodel.rst:1839 ../../reference/datamodel.rst:3208 msgid "slice" msgstr "slice(切片)" -#: ../../reference/datamodel.rst:1838 +#: ../../reference/datamodel.rst:1845 msgid "start (slice object attribute)" msgstr "start (slice 物件屬性)" -#: ../../reference/datamodel.rst:1838 +#: ../../reference/datamodel.rst:1845 msgid "stop (slice object attribute)" msgstr "stop (slice 物件屬性)" -#: ../../reference/datamodel.rst:1838 +#: ../../reference/datamodel.rst:1845 msgid "step (slice object attribute)" msgstr "step (slice 物件屬性)" -#: ../../reference/datamodel.rst:1886 +#: ../../reference/datamodel.rst:1893 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/datamodel.rst:1886 +#: ../../reference/datamodel.rst:1893 msgid "overloading" msgstr "overloading(多載)" -#: ../../reference/datamodel.rst:1886 +#: ../../reference/datamodel.rst:1893 msgid "__getitem__() (mapping object method)" msgstr "__getitem__() (對映物件方法)" -#: ../../reference/datamodel.rst:1922 +#: ../../reference/datamodel.rst:1929 msgid "subclassing" msgstr "subclassing(子類別化)" -#: ../../reference/datamodel.rst:1922 +#: ../../reference/datamodel.rst:1929 msgid "immutable types" msgstr "immutable types(不可變型別)" -#: ../../reference/datamodel.rst:1951 +#: ../../reference/datamodel.rst:1958 msgid "constructor" msgstr "constructor(建構函式)" -#: ../../reference/datamodel.rst:1968 +#: ../../reference/datamodel.rst:1975 msgid "destructor" msgstr "destructor(解構函式)" -#: ../../reference/datamodel.rst:1968 +#: ../../reference/datamodel.rst:1975 msgid "finalizer" msgstr "finalizer(終結函式)" -#: ../../reference/datamodel.rst:1968 +#: ../../reference/datamodel.rst:1975 msgid "del" msgstr "del" -#: ../../reference/datamodel.rst:2032 +#: ../../reference/datamodel.rst:2039 msgid "repr() (built-in function)" msgstr "repr() (內建函式)" -#: ../../reference/datamodel.rst:2032 +#: ../../reference/datamodel.rst:2039 msgid "__repr__() (object method)" msgstr "__repr__() (物件方法)" -#: ../../reference/datamodel.rst:2050 +#: ../../reference/datamodel.rst:2057 msgid "__str__() (object method)" msgstr "__str__() (物件方法)" -#: ../../reference/datamodel.rst:2050 +#: ../../reference/datamodel.rst:2057 msgid "format() (built-in function)" msgstr "format() (內建函式)" -#: ../../reference/datamodel.rst:2050 +#: ../../reference/datamodel.rst:2057 msgid "print() (built-in function)" msgstr "print() (內建函式)" -#: ../../reference/datamodel.rst:2081 +#: ../../reference/datamodel.rst:2088 msgid "__format__() (object method)" msgstr "__format__() (物件方法)" -#: ../../reference/datamodel.rst:2081 +#: ../../reference/datamodel.rst:2088 msgid "conversion" msgstr "conversion" -#: ../../reference/datamodel.rst:2081 +#: ../../reference/datamodel.rst:2088 msgid "print" msgstr "print" -#: ../../reference/datamodel.rst:2123 +#: ../../reference/datamodel.rst:2130 msgid "comparisons" msgstr "comparison(比較)" -#: ../../reference/datamodel.rst:2174 +#: ../../reference/datamodel.rst:2181 msgid "hash" msgstr "hash(雜湊)" -#: ../../reference/datamodel.rst:2255 +#: ../../reference/datamodel.rst:2262 msgid "__len__() (mapping object method)" msgstr "__len__() (對映物件方法)" -#: ../../reference/datamodel.rst:2360 +#: ../../reference/datamodel.rst:2367 msgid "__getattr__ (module attribute)" msgstr "__getattr__ (模組屬性)" -#: ../../reference/datamodel.rst:2360 +#: ../../reference/datamodel.rst:2367 msgid "__dir__ (module attribute)" msgstr "__dir__ (模組屬性)" -#: ../../reference/datamodel.rst:2360 +#: ../../reference/datamodel.rst:2367 msgid "__class__ (module attribute)" msgstr "__class__ (模組屬性)" -#: ../../reference/datamodel.rst:2736 +#: ../../reference/datamodel.rst:2743 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../reference/datamodel.rst:2736 +#: ../../reference/datamodel.rst:2743 msgid "= (equals)" msgstr "= (等號)" -#: ../../reference/datamodel.rst:2736 +#: ../../reference/datamodel.rst:2743 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/datamodel.rst:2800 +#: ../../reference/datamodel.rst:2807 msgid "metaclass hint" msgstr "metaclass hint(元類別提示)" -#: ../../reference/datamodel.rst:2823 +#: ../../reference/datamodel.rst:2830 msgid "__prepare__ (metaclass method)" msgstr "__prepare__ (元類別方法)" -#: ../../reference/datamodel.rst:2847 +#: ../../reference/datamodel.rst:2854 msgid "body" msgstr "body" -#: ../../reference/datamodel.rst:2867 +#: ../../reference/datamodel.rst:2874 msgid "__class__ (method cell)" msgstr "__class__ (方法 cell)" -#: ../../reference/datamodel.rst:2867 +#: ../../reference/datamodel.rst:2874 msgid "__classcell__ (class namespace entry)" msgstr "__classcell__ (類別命名空間項目)" -#: ../../reference/datamodel.rst:3171 +#: ../../reference/datamodel.rst:3178 msgid "__bool__() (object method)" msgstr "__bool__() (物件方法)" -#: ../../reference/datamodel.rst:3329 ../../reference/datamodel.rst:3364 +#: ../../reference/datamodel.rst:3336 ../../reference/datamodel.rst:3371 msgid "divmod" msgstr "divmod" -#: ../../reference/datamodel.rst:3329 ../../reference/datamodel.rst:3364 +#: ../../reference/datamodel.rst:3336 ../../reference/datamodel.rst:3371 msgid "pow" msgstr "pow" -#: ../../reference/datamodel.rst:3432 +#: ../../reference/datamodel.rst:3439 msgid "abs" msgstr "abs" -#: ../../reference/datamodel.rst:3442 +#: ../../reference/datamodel.rst:3449 msgid "int" msgstr "int" -#: ../../reference/datamodel.rst:3442 +#: ../../reference/datamodel.rst:3449 msgid "float" msgstr "float" -#: ../../reference/datamodel.rst:3470 +#: ../../reference/datamodel.rst:3477 msgid "round" msgstr "round" -#: ../../reference/datamodel.rst:3494 +#: ../../reference/datamodel.rst:3501 msgid "with" msgstr "with" -#: ../../reference/datamodel.rst:3494 +#: ../../reference/datamodel.rst:3501 msgid "context manager" msgstr "context manager(情境管理器)" From f221102dc9277c9b86346530c972d5f32e76bf28 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 28 Jan 2026 00:17:51 +0000 Subject: [PATCH 04/11] sync with cpython b82b12bc --- c-api/module.po | 31 +++++++++------- library/contextvars.po | 82 ++++++++++++++++++++++-------------------- 2 files changed, 62 insertions(+), 51 deletions(-) diff --git a/c-api/module.po b/c-api/module.po index 71f6d4b155..deb712e7be 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-27 00:14+0000\n" +"POT-Creation-Date: 2026-01-28 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -784,7 +784,12 @@ msgid "" "``PyModule_FromDefAndSpec``)." msgstr "" -#: ../../c-api/module.rst:682 +#: ../../c-api/module.rst:678 +#, fuzzy +msgid "Return ``0`` on success. Return ``-1`` with an exception set on error." +msgstr "在失敗時回傳 ``NULL`` 並設定例外。" + +#: ../../c-api/module.rst:685 msgid "" "Indicate that *module* does or does not support running without the global " "interpreter lock (GIL), using one of the values from :c:macro:`Py_mod_gil`. " @@ -796,11 +801,11 @@ msgid "" "on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:696 +#: ../../c-api/module.rst:699 msgid "Module lookup (single-phase initialization)" msgstr "" -#: ../../c-api/module.rst:698 +#: ../../c-api/module.rst:701 msgid "" "The legacy :ref:`single-phase initialization ` " "initialization scheme creates singleton modules that can be looked up in the " @@ -808,14 +813,14 @@ msgid "" "retrieved later with only a reference to the module definition." msgstr "" -#: ../../c-api/module.rst:703 +#: ../../c-api/module.rst:706 msgid "" "These functions will not work on modules created using multi-phase " "initialization, since multiple such modules can be created from a single " "definition." msgstr "" -#: ../../c-api/module.rst:708 +#: ../../c-api/module.rst:711 msgid "" "Returns the module object that was created from *def* for the current " "interpreter. This method requires that the module object has been attached " @@ -824,18 +829,18 @@ msgid "" "to the interpreter state yet, it returns ``NULL``." msgstr "" -#: ../../c-api/module.rst:715 +#: ../../c-api/module.rst:718 msgid "" "Attaches the module object passed to the function to the interpreter state. " "This allows the module object to be accessible via :c:func:" "`PyState_FindModule`." msgstr "" -#: ../../c-api/module.rst:718 +#: ../../c-api/module.rst:721 msgid "Only effective on modules created using single-phase initialization." msgstr "" -#: ../../c-api/module.rst:720 +#: ../../c-api/module.rst:723 msgid "" "Python calls ``PyState_AddModule`` automatically after importing a module " "that uses :ref:`single-phase initialization `, " @@ -847,21 +852,21 @@ msgid "" "state updates)." msgstr "" -#: ../../c-api/module.rst:729 +#: ../../c-api/module.rst:732 msgid "" "If a module was attached previously using the same *def*, it is replaced by " "the new *module*." msgstr "" -#: ../../c-api/module.rst:732 ../../c-api/module.rst:743 +#: ../../c-api/module.rst:735 ../../c-api/module.rst:746 msgid "The caller must have an :term:`attached thread state`." msgstr "" -#: ../../c-api/module.rst:734 +#: ../../c-api/module.rst:737 msgid "Return ``-1`` with an exception set on error, ``0`` on success." msgstr "成功時回傳 ``0``,在失敗時回傳 ``-1`` 並設定例外。" -#: ../../c-api/module.rst:740 +#: ../../c-api/module.rst:743 msgid "" "Removes the module object created from *def* from the interpreter state. " "Return ``-1`` with an exception set on error, ``0`` on success." diff --git a/library/contextvars.po b/library/contextvars.po index 07ceff6807..a08a492ef6 100644 --- a/library/contextvars.po +++ b/library/contextvars.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-27 00:17+0000\n" +"POT-Creation-Date: 2026-01-28 00:16+0000\n" "PO-Revision-Date: 2025-07-30 22:06+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -211,32 +211,38 @@ msgstr "" "# 在重設呼叫之後,var 又沒有值了,所以\n" "# var.get() 會引發 LookupError。" -#: ../../library/contextvars.rst:125 +#: ../../library/contextvars.rst:122 +msgid "The same *token* cannot be used twice." +msgstr "" + +#: ../../library/contextvars.rst:127 +#, fuzzy msgid "" "*Token* objects are returned by the :meth:`ContextVar.set` method. They can " "be passed to the :meth:`ContextVar.reset` method to revert the value of the " -"variable to what it was before the corresponding *set*." +"variable to what it was before the corresponding *set*. A single token " +"cannot reset a context variable more than once." msgstr "" "*Token* 物件由 :meth:`ContextVar.set` 方法回傳,可以傳遞給 :meth:`ContextVar." "reset` 方法,用以將變數的值還原為相對應的 *set* 之前的值。" -#: ../../library/contextvars.rst:130 +#: ../../library/contextvars.rst:132 msgid "" "Tokens support the :ref:`context manager protocol ` to " "automatically reset context variables. See :meth:`ContextVar.set`." msgstr "" -#: ../../library/contextvars.rst:135 +#: ../../library/contextvars.rst:137 msgid "Added support for usage as a context manager." msgstr "新增對用作情境管理器的支援。" -#: ../../library/contextvars.rst:139 +#: ../../library/contextvars.rst:141 msgid "" "A read-only property. Points to the :class:`ContextVar` object that created " "the token." msgstr "唯讀屬性。 指向建立 token 的 :class:`ContextVar` 物件。" -#: ../../library/contextvars.rst:144 +#: ../../library/contextvars.rst:146 msgid "" "A read-only property. Set to the value the variable had before the :meth:" "`ContextVar.set` method call that created the token. It points to :attr:" @@ -245,26 +251,26 @@ msgstr "" "唯讀屬性。 值為變數在呼叫 :meth:`ContextVar.set` 方法之前的值。如果變數在呼叫" "前沒有設定,則指向 :attr:`Token.MISSING`。" -#: ../../library/contextvars.rst:151 +#: ../../library/contextvars.rst:153 msgid "A marker object used by :attr:`Token.old_value`." msgstr "由 :attr:`Token.old_value` 使用的標記物件。" -#: ../../library/contextvars.rst:155 +#: ../../library/contextvars.rst:157 msgid "Manual Context Management" msgstr "手動情境管理" -#: ../../library/contextvars.rst:159 +#: ../../library/contextvars.rst:161 msgid "Returns a copy of the current :class:`~contextvars.Context` object." msgstr "回傳目前 :class:`~contextvars.Context` 物件的複本(copy)。" -#: ../../library/contextvars.rst:161 +#: ../../library/contextvars.rst:163 msgid "" "The following snippet gets a copy of the current context and prints all " "variables and their values that are set in it::" msgstr "" "以下程式碼片段會取得目前情境的複本,並顯示在其中設定的所有變數及其值:::" -#: ../../library/contextvars.rst:164 +#: ../../library/contextvars.rst:166 msgid "" "ctx: Context = copy_context()\n" "print(list(ctx.items()))" @@ -272,7 +278,7 @@ msgstr "" "ctx: Context = copy_context()\n" "print(list(ctx.items()))" -#: ../../library/contextvars.rst:167 +#: ../../library/contextvars.rst:169 msgid "" "The function has an *O*\\ (1) complexity, i.e. works equally fast for " "contexts with a few context variables and for contexts that have a lot of " @@ -281,11 +287,11 @@ msgstr "" "這個函式具有 *O*\\ (1) 的複雜度,也就是說,對於只有少許情境變數的情境和有大量" "情境變數的情境,速度都一樣快。" -#: ../../library/contextvars.rst:174 +#: ../../library/contextvars.rst:176 msgid "A mapping of :class:`ContextVars ` to their values." msgstr ":class:`ContextVars` 到其值的映射。" -#: ../../library/contextvars.rst:176 +#: ../../library/contextvars.rst:178 msgid "" "``Context()`` creates an empty context with no values in it. To get a copy " "of the current context use the :func:`~contextvars.copy_context` function." @@ -293,7 +299,7 @@ msgstr "" "``Context()`` 會建立一個沒有值的空情境。要取得目前情境的複本,請使用 :func:" "`~contextvars.copy_context` 函式。" -#: ../../library/contextvars.rst:180 +#: ../../library/contextvars.rst:182 msgid "" "Each thread has its own effective stack of :class:`!Context` objects. The :" "term:`current context` is the :class:`!Context` object at the top of the " @@ -304,7 +310,7 @@ msgstr "" "term:`current context` 是目前執行緒堆疊頂端的 :class:`!Context` 物件。 堆疊" "中的所有 :class:`!Context` 物件都被視為\\ *已進入*。" -#: ../../library/contextvars.rst:185 +#: ../../library/contextvars.rst:187 msgid "" "*Entering* a context, which can be done by calling its :meth:`~Context.run` " "method, makes the context the current context by pushing it onto the top of " @@ -313,7 +319,7 @@ msgstr "" "*進入*\\ 一個情境,可以藉由呼叫其 :meth:`~Context.run` 方法來完成,此\\ *進入" "*\\ 的動作會將一情境推到目前執行緒的情境堆疊的頂端,使該情境成為目前的情境。" -#: ../../library/contextvars.rst:189 +#: ../../library/contextvars.rst:191 msgid "" "*Exiting* from the current context, which can be done by returning from the " "callback passed to the :meth:`~Context.run` method, restores the current " @@ -324,7 +330,7 @@ msgstr "" "式回傳之後,就會自動\\ *退出*\\ 目前的情境,這會將目前的情境還原到進入情境之" "前的狀態,方法是將情境從情境堆疊的頂端彈出。" -#: ../../library/contextvars.rst:194 +#: ../../library/contextvars.rst:196 msgid "" "Since each thread has its own context stack, :class:`ContextVar` objects " "behave in a similar fashion to :func:`threading.local` when values are " @@ -333,7 +339,7 @@ msgstr "" "因為每個執行緒都有自己的情境堆疊,當值在不同的執行緒中被指定時, :class:" "`ContextVar` 物件的行為與 :func:`threading.local` 相似。" -#: ../../library/contextvars.rst:198 +#: ../../library/contextvars.rst:200 msgid "" "Attempting to enter an already entered context, including contexts entered " "in other threads, raises a :exc:`RuntimeError`." @@ -341,11 +347,11 @@ msgstr "" "嘗試進入已進入的情境,包括在其他執行緒中進入的情境,會引發 :exc:" "`RuntimeError`。" -#: ../../library/contextvars.rst:201 +#: ../../library/contextvars.rst:203 msgid "After exiting a context, it can later be re-entered (from any thread)." msgstr "退出情境後,之後可以重新進入(從任何執行緒)。" -#: ../../library/contextvars.rst:203 +#: ../../library/contextvars.rst:205 msgid "" "Any changes to :class:`ContextVar` values via the :meth:`ContextVar.set` " "method are recorded in the current context. The :meth:`ContextVar.get` " @@ -359,11 +365,11 @@ msgstr "" "實際造成的效果會像是將其在進入情境時對情境變數所做的任何變一一彈出並還原(如" "果需要,可以透過重新進入情境來還原值)。" -#: ../../library/contextvars.rst:210 +#: ../../library/contextvars.rst:212 msgid "Context implements the :class:`collections.abc.Mapping` interface." msgstr "情境(Context)實作了 :class:`collections.abc.Mapping` 介面。" -#: ../../library/contextvars.rst:214 +#: ../../library/contextvars.rst:216 msgid "" "Enters the Context, executes ``callable(*args, **kwargs)``, then exits the " "Context. Returns *callable*'s return value, or propagates an exception if " @@ -372,11 +378,11 @@ msgstr "" "進入 Context,執行 ``callable(*args, **kwargs)``,然後退出 Context。 回傳 " "*callable* 的回傳值,如果發生例外(exception),則傳播例外。" -#: ../../library/contextvars.rst:218 +#: ../../library/contextvars.rst:220 msgid "Example:" msgstr "例如:" -#: ../../library/contextvars.rst:220 +#: ../../library/contextvars.rst:222 msgid "" "import contextvars\n" "\n" @@ -440,18 +446,18 @@ msgstr "" "# 但是,在 'ctx' 外, 'var' 的值仍然是 'spam':\n" "print(var.get()) # 'spam'" -#: ../../library/contextvars.rst:266 +#: ../../library/contextvars.rst:268 msgid "Return a shallow copy of the context object." msgstr "回傳情境物件的淺層複本(shallow copy)。" -#: ../../library/contextvars.rst:270 +#: ../../library/contextvars.rst:272 msgid "" "Return ``True`` if the *context* has a value for *var* set; return ``False`` " "otherwise." msgstr "" "如果\\ *情境*\\ 裡面有 *var* 的值,則回傳 ``True``,否則回傳 ``False``。" -#: ../../library/contextvars.rst:275 +#: ../../library/contextvars.rst:277 msgid "" "Return the value of the *var* :class:`ContextVar` variable. If the variable " "is not set in the context object, a :exc:`KeyError` is raised." @@ -459,7 +465,7 @@ msgstr "" "回傳 *var* :class:`ContextVar` 變數的值。如果該變數並沒有在情境物件中設定,則" "會引發 :exc:`KeyError` 錯誤。" -#: ../../library/contextvars.rst:281 +#: ../../library/contextvars.rst:283 msgid "" "Return the value for *var* if *var* has the value in the context object. " "Return *default* otherwise. If *default* is not given, return ``None``." @@ -467,33 +473,33 @@ msgstr "" "如果 *var* 的值在情境物件中,則回傳 *var* 的值。否則回傳 *default*。如果沒有 " "*default* 值,則回傳 ``None``。" -#: ../../library/contextvars.rst:287 +#: ../../library/contextvars.rst:289 msgid "Return an iterator over the variables stored in the context object." msgstr "回傳儲存於情境物件中變數的疊代器。" -#: ../../library/contextvars.rst:292 +#: ../../library/contextvars.rst:294 msgid "Return the number of variables set in the context object." msgstr "回傳情境物件中的變數個數。" -#: ../../library/contextvars.rst:296 +#: ../../library/contextvars.rst:298 msgid "Return a list of all variables in the context object." msgstr "回傳情境物件中所有變數的串列。" -#: ../../library/contextvars.rst:300 +#: ../../library/contextvars.rst:302 msgid "Return a list of all variables' values in the context object." msgstr "回傳情境物件中所有變數的值的串列。" -#: ../../library/contextvars.rst:305 +#: ../../library/contextvars.rst:307 msgid "" "Return a list of 2-tuples containing all variables and their values in the " "context object." msgstr "回傳情境物件中所有變數與其值的 2-元組(2-tuples)的串列。" -#: ../../library/contextvars.rst:310 +#: ../../library/contextvars.rst:312 msgid "asyncio support" msgstr "對 asyncio 的支援" -#: ../../library/contextvars.rst:312 +#: ../../library/contextvars.rst:314 msgid "" "Context variables are natively supported in :mod:`asyncio` and are ready to " "be used without any extra configuration. For example, here is a simple echo " @@ -503,7 +509,7 @@ msgstr "" ":mod:`asyncio` 原生支援情境變數,不需任何額外設定。 舉例來說,以下是一個簡單" "的 echo 伺服器,使用情境變數讓遠端用戶端的位址在處理該用戶端的任務中可用:" -#: ../../library/contextvars.rst:318 +#: ../../library/contextvars.rst:320 msgid "" "import asyncio\n" "import contextvars\n" From 6f2560b90587096ac5074fd742f7a0befb5837ff Mon Sep 17 00:00:00 2001 From: "Matt.Wang" Date: Mon, 2 Feb 2026 02:53:18 +0700 Subject: [PATCH 05/11] fix fuzzy entries --- c-api/bytes.po | 3 +-- c-api/module.po | 3 +-- c-api/typeobj.po | 3 +-- faq/programming.po | 12 ++++-------- library/base64.po | 6 ++---- library/contextvars.po | 21 ++++++++++++--------- library/http.cookies.po | 5 ++--- library/stdtypes.po | 6 ++---- reference/datamodel.po | 3 +-- using/windows.po | 12 +++++------- 10 files changed, 31 insertions(+), 43 deletions(-) diff --git a/c-api/bytes.po b/c-api/bytes.po index c931a1c3d1..0186c931cc 100644 --- a/c-api/bytes.po +++ b/c-api/bytes.po @@ -159,9 +159,8 @@ msgid "``%zd``" msgstr "``%zd``" #: ../../c-api/bytes.rst:84 -#, fuzzy msgid ":c:type:`\\ Py_ssize_t`" -msgstr ":c:type:` Py_ssize_t`" +msgstr ":c:type:`\\ Py_ssize_t`" #: ../../c-api/bytes.rst:84 msgid "Equivalent to ``printf(\"%zd\")``. [1]_" diff --git a/c-api/module.po b/c-api/module.po index deb712e7be..573e2f5c8f 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -785,9 +785,8 @@ msgid "" msgstr "" #: ../../c-api/module.rst:678 -#, fuzzy msgid "Return ``0`` on success. Return ``-1`` with an exception set on error." -msgstr "在失敗時回傳 ``NULL`` 並設定例外。" +msgstr "成功時回傳 ``0``。在失敗時回傳 ``-1`` 並設定例外。" #: ../../c-api/module.rst:685 msgid "" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index e18b0c311b..69b4349bec 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -1117,9 +1117,8 @@ msgid ":c:func:`releasebufferproc`" msgstr ":c:func:`releasebufferproc`" #: ../../c-api/typeobj.rst:330 -#, fuzzy msgid "__release_\\ buffer\\__" -msgstr "__release_ buffer\\__" +msgstr "__release_\\ buffer\\__" #: ../../c-api/typeobj.rst:337 msgid "slot typedefs" diff --git a/faq/programming.po b/faq/programming.po index e8379f7c40..065139b57e 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -768,7 +768,6 @@ msgid "" msgstr "你可以使用包含字典的全域變數而不是預設值;這取決於喜好。" #: ../../faq/programming.rst:394 -#, fuzzy msgid "" "How can I pass optional or keyword parameters from one function to another?" msgstr "如何將可選參數或關鍵字參數從一個函式傳遞到另一個函式?" @@ -892,13 +891,12 @@ msgid "" msgstr "list 是 :term:`mutable`,這意味著你可以變更它們的內容。" #: ../../faq/programming.rst:457 -#, fuzzy msgid "" "After the call to :meth:`~sequence.append`, the content of the mutable " "object has changed from ``[]`` to ``[10]``. Since both the variables refer " "to the same object, using either name accesses the modified value ``[10]``." msgstr "" -"在呼叫 :meth:`!append` 之後,可變物件的內容從 ``[]`` 變成了 ``[10]``。由於這" +"在呼叫 :meth:`~sequence.append` 之後,可變物件的內容從 ``[]`` 變成了 ``[10]``。由於這" "兩個變數都參照同一個物件,因此使用任一名稱都可以存取修改後的值 ``[10]``。" #: ../../faq/programming.rst:461 @@ -1001,13 +999,12 @@ msgstr "" "新物件。" #: ../../faq/programming.rst:505 -#, fuzzy msgid "" "If you want to know if two variables refer to the same object or not, you " "can use the :keyword:`is` operator, or the built-in function :func:`id`." msgstr "" -"如果你想知道兩個變數是否參照同一個物件,你可以使用 :keyword:`is` 運算子,或內" -"置函式 :func:`id`。" +"如果你想知道兩個變數是否參照同一個物件,你可以使用 :keyword:`is` 運算子或內" +"建函式 :func:`id`。" #: ../../faq/programming.rst:510 msgid "How do I write a function with output parameters (call by reference)?" @@ -1427,12 +1424,11 @@ msgstr "" "(False, 'a')" #: ../../faq/programming.rst:708 -#, fuzzy msgid "" "Since the comma is not an operator, but a separator between expressions the " "above is evaluated as if you had entered::" msgstr "" -"由於逗號不是運算子,而是運算式之間的分隔符,因此上面的計算就像你輸入的那" +"由於逗號不是運算子,而是運算式之間的分隔符,因此上面的計算就會像你輸入的那" "樣: ::" #: ../../faq/programming.rst:711 diff --git a/library/base64.po b/library/base64.po index c68ba96752..cfc898bb5c 100644 --- a/library/base64.po +++ b/library/base64.po @@ -407,15 +407,13 @@ msgstr "" "``~>``)。" #: ../../library/base64.rst:242 -#, fuzzy msgid "" "*ignorechars* should be a byte string containing characters to ignore from " "the input. This should only contain whitespace characters, and by default " "contains all whitespace characters in ASCII." msgstr "" -"*ignorechars* 是一個包含要從輸入中忽略的字元的\\ :term:`類位元組物件 `\\ 或 ASCII 字串。這只包含空格字元,預設情況下包含 ASCII 中的所" -"有空格字元。" +"*ignorechars* 應是一個包含要從輸入中忽略的字元的位元組字串。這只包含空格字元,預設情況下" +"包含 ASCII 中的所有空格字元。" #: ../../library/base64.rst:251 msgid "" diff --git a/library/contextvars.po b/library/contextvars.po index a08a492ef6..bc72ad080b 100644 --- a/library/contextvars.po +++ b/library/contextvars.po @@ -134,7 +134,7 @@ msgstr "" msgid "" "For convenience, the token object can be used as a context manager to avoid " "calling :meth:`ContextVar.reset` manually::" -msgstr "" +msgstr "為了方便起見,token 物件可以用作情境管理器,以避免手動呼叫 :meth:`ContextVar.reset`: ::" #: ../../library/contextvars.rst:83 msgid "" @@ -154,10 +154,9 @@ msgstr "" #: ../../library/contextvars.rst:90 msgid "It is a shorthand for::" -msgstr "" +msgstr "它是以下程式碼的簡寫: ::" #: ../../library/contextvars.rst:92 -#, fuzzy msgid "" "var = ContextVar('var', default='default value')\n" "\n" @@ -171,15 +170,17 @@ msgid "" msgstr "" "var = ContextVar('var', default='default value')\n" "\n" -"with var.set('new value'):\n" +"token = var.set('new value')\n" +"try:\n" " assert var.get() == 'new value'\n" +"finally:\n" +" var.reset(token)\n" "\n" "assert var.get() == 'default value'" #: ../../library/contextvars.rst:104 -#, fuzzy msgid "Added support for using tokens as context managers." -msgstr "新增對用作情境管理器的支援。" +msgstr "新增對將 token 用作情境管理器的支援。" #: ../../library/contextvars.rst:108 msgid "" @@ -213,10 +214,9 @@ msgstr "" #: ../../library/contextvars.rst:122 msgid "The same *token* cannot be used twice." -msgstr "" +msgstr "同一個 *token* 不能被使用兩次。" #: ../../library/contextvars.rst:127 -#, fuzzy msgid "" "*Token* objects are returned by the :meth:`ContextVar.set` method. They can " "be passed to the :meth:`ContextVar.reset` method to revert the value of the " @@ -224,13 +224,16 @@ msgid "" "cannot reset a context variable more than once." msgstr "" "*Token* 物件由 :meth:`ContextVar.set` 方法回傳,可以傳遞給 :meth:`ContextVar." -"reset` 方法,用以將變數的值還原為相對應的 *set* 之前的值。" +"reset` 方法,用以將變數的值還原為相對應的 *set* 之前的值。單一 token 不能重設" +"情境變數超過一次。" #: ../../library/contextvars.rst:132 msgid "" "Tokens support the :ref:`context manager protocol ` to " "automatically reset context variables. See :meth:`ContextVar.set`." msgstr "" +"Token 支援\\ :ref:`情境管理器協定 `,可自動重設情境變數。" +"請參閱 :meth:`ContextVar.set`。" #: ../../library/contextvars.rst:137 msgid "Added support for usage as a context manager." diff --git a/library/http.cookies.po b/library/http.cookies.po index 79839e666f..c5989efd59 100644 --- a/library/http.cookies.po +++ b/library/http.cookies.po @@ -370,7 +370,6 @@ msgid "" msgstr "以下範例示範如何使用 :mod:`http.cookies` 模組。" #: ../../library/http.cookies.rst:269 -#, fuzzy msgid "" ">>> from http import cookies\n" ">>> C = cookies.SimpleCookie()\n" @@ -442,9 +441,9 @@ msgstr "" "Set-Cookie: chips=ahoy\n" "Set-Cookie: vienna=finger\n" ">>> C = cookies.SimpleCookie()\n" -">>> C.load('keebler=\"E=everybody; L=\\\\\"Loves\\\\\"; fudge=\\\\012;\";')\n" +">>> C.load('keebler=\"E=everybody; L=\\\\\"Loves\\\\\"; fudge=;\";')\n" ">>> print(C)\n" -"Set-Cookie: keebler=\"E=everybody; L=\\\"Loves\\\"; fudge=\\012;\"\n" +"Set-Cookie: keebler=\"E=everybody; L=\\\"Loves\\\"; fudge=;\"\n" ">>> C = cookies.SimpleCookie()\n" ">>> C[\"oreo\"] = \"doublestuff\"\n" ">>> C[\"oreo\"][\"path\"] = \"/\"\n" diff --git a/library/stdtypes.po b/library/stdtypes.po index a710385440..66e203edd7 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -697,9 +697,8 @@ msgstr "" "算:" #: ../../library/stdtypes.rst:376 -#, fuzzy msgid ":func:`math.trunc(\\ x) `" -msgstr ":func:`math.trunc( x) `" +msgstr ":func:`math.trunc(\\ x) `" #: ../../library/stdtypes.rst:376 msgid "*x* truncated to :class:`~numbers.Integral`" @@ -716,9 +715,8 @@ msgid "" msgstr "*x* 進位至小數點後第 *n* 位,使用偶數捨入法。若省略 *n* ,則預設為 0。" #: ../../library/stdtypes.rst:383 -#, fuzzy msgid ":func:`math.floor(\\ x) `" -msgstr ":func:`math.floor( x) `" +msgstr ":func:`math.floor(\\ x) `" #: ../../library/stdtypes.rst:383 msgid "the greatest :class:`~numbers.Integral` <= *x*" diff --git a/reference/datamodel.po b/reference/datamodel.po index 4165a4ab6e..271faf793f 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -5053,9 +5053,8 @@ msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" #: ../../reference/datamodel.rst:548 -#, fuzzy msgid "__builtins__ (function attribute)" -msgstr "__defaults__ (函式屬性)" +msgstr "__builtins__ (函式屬性)" #: ../../reference/datamodel.rst:548 msgid "__closure__ (function attribute)" diff --git a/using/windows.po b/using/windows.po index cdb1cc0ba1..ae5977a0aa 100644 --- a/using/windows.po +++ b/using/windows.po @@ -2339,13 +2339,12 @@ msgid "The default installation directory for all-user installs" msgstr "" #: ../../using/windows.rst:1452 -#, fuzzy msgid "" ":file:`%ProgramFiles%\\\\\\ Python X.Y` or :file:`\\ %ProgramFiles(x86)%\\\\" "\\ Python X.Y`" msgstr "" -":file:`%ProgramFiles%\\\\ Python X.Y` or :file:` %ProgramFiles(x86)%\\\\ " -"Python X.Y`" +":file:`%ProgramFiles%\\\\\\ Python X.Y` or :file:`\\ %ProgramFiles(x86)%\\\\" +"\\ Python X.Y`" #: ../../using/windows.rst:1457 msgid "DefaultJustForMeTargetDir" @@ -2356,15 +2355,14 @@ msgid "The default install directory for just-for-me installs" msgstr "" #: ../../using/windows.rst:1457 -#, fuzzy msgid "" ":file:`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY` or :file:" "`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY-32` or :file:" "`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY-64`" msgstr "" -":file:`%LocalAppData%\\\\ Programs\\\\Python\\\\ PythonXY` 或 :file:" -"`%LocalAppData%\\\\ Programs\\\\Python\\\\ PythonXY-32` 或 :file:" -"`%LocalAppData%\\\\ Programs\\\\Python\\\\ PythonXY-64`" +":file:`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY` 或 :file:" +"`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY-32` 或 :file:" +"`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY-64`" #: ../../using/windows.rst:1467 msgid "DefaultCustomTargetDir" From dbfee6f3944a24497cda30fb0b70211d09eb55c6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 3 Feb 2026 00:21:37 +0000 Subject: [PATCH 06/11] sync with cpython f68d634d --- c-api/object.po | 16 +- c-api/refcounting.po | 78 +++-- glossary.po | 668 ++++++++++++++++++++++--------------------- library/ctypes.po | 8 +- library/site.po | 4 +- using/configure.po | 4 +- 6 files changed, 396 insertions(+), 382 deletions(-) diff --git a/c-api/object.po b/c-api/object.po index 5cdde8ebd5..76d98cf41c 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-05 00:16+0000\n" +"POT-Creation-Date: 2026-02-03 00:20+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -821,14 +821,14 @@ msgstr "" #: ../../c-api/object.rst:668 msgid "" ":c:func:`PyUnstable_EnableTryIncRef` must have been called earlier on *obj* " -"or this function may spuriously return ``0`` in the :term:`free threading` " -"build." +"or this function may spuriously return ``0`` in the :term:`free-threaded " +"build`." msgstr "" #: ../../c-api/object.rst:672 msgid "" "This function is logically equivalent to the following C code, except that " -"it behaves atomically in the :term:`free threading` build::" +"it behaves atomically in the :term:`free-threaded build`::" msgstr "" #: ../../c-api/object.rst:675 @@ -922,10 +922,10 @@ msgstr "" #: ../../c-api/object.rst:750 msgid "" -"On a :term:`free threaded ` build, this checks if *op*'s :" -"term:`reference count` is equal to one and additionally checks if *op* is " -"only used by this thread. :c:expr:`Py_REFCNT(op) == 1` is **not** thread-" -"safe on free threaded builds; prefer this function." +"On a :term:`free-threaded build`, this checks if *op*'s :term:`reference " +"count` is equal to one and additionally checks if *op* is only used by this " +"thread. :c:expr:`Py_REFCNT(op) == 1` is **not** thread-safe on free-threaded " +"builds; prefer this function." msgstr "" #: ../../c-api/object.rst:755 diff --git a/c-api/refcounting.po b/c-api/refcounting.po index 3ad5095d4d..168fb2024b 100644 --- a/c-api/refcounting.po +++ b/c-api/refcounting.po @@ -8,7 +8,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-02-03 00:20+0000\n" "PO-Revision-Date: 2023-08-06 14:19+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,10 +37,10 @@ msgstr "取得物件 *o* 的參照計數。" #: ../../c-api/refcounting.rst:18 msgid "" "Note that the returned value may not actually reflect how many references to " -"the object are actually held. For example, some objects " -"are :term:`immortal` and have a very high refcount that does not reflect the " -"actual number of references. Consequently, do not rely on the returned " -"value to be accurate, other than a value of 0 or 1." +"the object are actually held. For example, some objects are :term:" +"`immortal` and have a very high refcount that does not reflect the actual " +"number of references. Consequently, do not rely on the returned value to be " +"accurate, other than a value of 0 or 1." msgstr "" "請注意,回傳的值可能實際上並不反映實際保存了多少對該物件的參照。例如,某些物" "件是「:term:`不滅的 (immortal) `」,並且具有非常高的參照計數,不能" @@ -53,7 +53,7 @@ msgstr "使用 :c:func:`Py_SET_REFCNT()` 函式設定物件參照計數。" #: ../../c-api/refcounting.rst:28 msgid "" -"On :term:`free threaded ` builds of Python, returning 1 " +"On :term:`free-threaded builds ` of Python, returning 1 " "isn't sufficient to determine if it's safe to treat *o* as having no access " "by other threads. Use :c:func:`PyUnstable_Object_IsUniquelyReferenced` for " "that instead." @@ -61,8 +61,8 @@ msgstr "" #: ../../c-api/refcounting.rst:33 msgid "" -"See also the " -"function :c:func:`PyUnstable_Object_IsUniqueReferencedTemporary()`." +"See also the function :c:func:" +"`PyUnstable_Object_IsUniqueReferencedTemporary()`." msgstr "" #: ../../c-api/refcounting.rst:35 @@ -106,8 +106,8 @@ msgstr "" #: ../../c-api/refcounting.rst:64 msgid "" -"This function is usually used to convert a :term:`borrowed reference` to " -"a :term:`strong reference` in-place. The :c:func:`Py_NewRef` function can be " +"This function is usually used to convert a :term:`borrowed reference` to a :" +"term:`strong reference` in-place. The :c:func:`Py_NewRef` function can be " "used to create a new :term:`strong reference`." msgstr "" "此函式通常用於將\\ :term:`借用參照 `\\ 原地 (in-place) 轉" @@ -123,13 +123,13 @@ msgid "" "The object must not be ``NULL``; if you aren't sure that it isn't ``NULL``, " "use :c:func:`Py_XINCREF`." msgstr "" -"該物件不能為 ``NULL``;如果你不確定它不是 ``NULL``,請使" -"用 :c:func:`Py_XINCREF`。" +"該物件不能為 ``NULL``;如果你不確定它不是 ``NULL``,請使用 :c:func:" +"`Py_XINCREF`。" #: ../../c-api/refcounting.rst:73 msgid "" -"Do not expect this function to actually modify *o* in any way. For at " -"least :pep:`some objects <0683>`, this function has no effect." +"Do not expect this function to actually modify *o* in any way. For at least :" +"pep:`some objects <0683>`, this function has no effect." msgstr "" "不要期望此函式會以任何方式實際修改 *o*,至少對於\\ :pep:`某些物件 <0683>`\\ " "來說,此函式沒有任何效果。" @@ -151,24 +151,24 @@ msgid "" "Create a new :term:`strong reference` to an object: call :c:func:`Py_INCREF` " "on *o* and return the object *o*." msgstr "" -"建立對物件的新\\ :term:`強參照 `:於 *o* 呼" -"叫 :c:func:`Py_INCREF` 並回傳物件 *o*。" +"建立對物件的新\\ :term:`強參照 `:於 *o* 呼叫 :c:func:" +"`Py_INCREF` 並回傳物件 *o*。" #: ../../c-api/refcounting.rst:94 msgid "" "When the :term:`strong reference` is no longer needed, :c:func:`Py_DECREF` " "should be called on it to release the reference." msgstr "" -"當不再需要\\ :term:`強參照 `\\ 時,應對其呼" -"叫 :c:func:`Py_DECREF` 以釋放該參照。" +"當不再需要\\ :term:`強參照 `\\ 時,應對其呼叫 :c:func:" +"`Py_DECREF` 以釋放該參照。" #: ../../c-api/refcounting.rst:97 msgid "" "The object *o* must not be ``NULL``; use :c:func:`Py_XNewRef` if *o* can be " "``NULL``." msgstr "" -"物件 *o* 不能為 ``NULL``;如果 *o* 可以為 ``NULL``,則使" -"用 :c:func:`Py_XNewRef`。" +"物件 *o* 不能為 ``NULL``;如果 *o* 可以為 ``NULL``,則使用 :c:func:" +"`Py_XNewRef`。" #: ../../c-api/refcounting.rst:100 msgid "For example::" @@ -232,21 +232,21 @@ msgid "" "The object must not be ``NULL``; if you aren't sure that it isn't ``NULL``, " "use :c:func:`Py_XDECREF`." msgstr "" -"該物件不能為 ``NULL``;如果你不確定它不是 ``NULL``,請改" -"用 :c:func:`Py_XDECREF`。" +"該物件不能為 ``NULL``;如果你不確定它不是 ``NULL``,請改用 :c:func:" +"`Py_XDECREF`。" #: ../../c-api/refcounting.rst:141 msgid "" -"Do not expect this function to actually modify *o* in any way. For at " -"least :pep:`some objects <683>`, this function has no effect." +"Do not expect this function to actually modify *o* in any way. For at least :" +"pep:`some objects <683>`, this function has no effect." msgstr "" "不要期望此函式會以任何方式實際修改 *o*,至少對於\\ :pep:`某些物件 <683>`\\ 來" "說,此函式沒有任何效果。" #: ../../c-api/refcounting.rst:147 msgid "" -"The deallocation function can cause arbitrary Python code to be invoked " -"(e.g. when a class instance with a :meth:`~object.__del__` method is " +"The deallocation function can cause arbitrary Python code to be invoked (e." +"g. when a class instance with a :meth:`~object.__del__` method is " "deallocated). While exceptions in such code are not propagated, the " "executed code has free access to all Python global variables. This means " "that any object that is reachable from a global variable should be in a " @@ -255,12 +255,12 @@ msgid "" "object in a temporary variable, update the list data structure, and then " "call :c:func:`Py_DECREF` for the temporary variable." msgstr "" -"釋放函式可以導致任意 Python 程式碼被叫用(例如,當釋放具" -"有 :meth:`~object.__del__` 方法的類別實例時)。雖然此類程式碼中的例外不會被傳" -"遞出來,但​​執行的程式碼可以自由存取所有 Python 全域變數。這意味著在叫" -"用 :c:func:`Py_DECREF` 之前,可從全域變數存取的任何物件都應處於一致狀態。例" -"如,從 list 中刪除物件的程式碼應將已刪除物件的參照複製到臨時變數中,更新 " -"list 資料結構,然後為臨時變數呼叫 :c:func:`Py_DECREF`。" +"釋放函式可以導致任意 Python 程式碼被叫用(例如,當釋放具有 :meth:`~object." +"__del__` 方法的類別實例時)。雖然此類程式碼中的例外不會被傳遞出來,但​​執行的程" +"式碼可以自由存取所有 Python 全域變數。這意味著在叫用 :c:func:`Py_DECREF` 之" +"前,可從全域變數存取的任何物件都應處於一致狀態。例如,從 list 中刪除物件的程" +"式碼應將已刪除物件的參照複製到臨時變數中,更新 list 資料結構,然後為臨時變數" +"呼叫 :c:func:`Py_DECREF`。" #: ../../c-api/refcounting.rst:162 msgid "" @@ -307,15 +307,13 @@ msgid "" "version of :c:func:`Py_XINCREF`. It can be used for runtime dynamic " "embedding of Python." msgstr "" -"代表取得對於物件 *o* 的\\ :term:`強參照 `。:c:func:`Py_XINCREF` 的函式版本。它可用於 Python 的 runtime 動態" -"嵌入。" +"代表取得對於物件 *o* 的\\ :term:`強參照 `。:c:func:" +"`Py_XINCREF` 的函式版本。它可用於 Python 的 runtime 動態嵌入。" #: ../../c-api/refcounting.rst:194 msgid "" -"Release a :term:`strong reference` to object *o*. A function version " -"of :c:func:`Py_XDECREF`. It can be used for runtime dynamic embedding of " -"Python." +"Release a :term:`strong reference` to object *o*. A function version of :c:" +"func:`Py_XDECREF`. It can be used for runtime dynamic embedding of Python." msgstr "" "釋放對物件 *o* 的\\ :term:`強參照 `。:c:func:`Py_XDECREF` " "的函式版本。它可用於 Python 的 runtime 動態嵌入。" @@ -369,5 +367,5 @@ msgid "" "Variant of :c:macro:`Py_SETREF` macro that uses :c:func:`Py_XDECREF` instead " "of :c:func:`Py_DECREF`." msgstr "" -":c:macro:`Py_SETREF` 巨集的變體,請改用 :c:func:`Py_XDECREF` 而" -"非 :c:func:`Py_DECREF`。" +":c:macro:`Py_SETREF` 巨集的變體,請改用 :c:func:`Py_XDECREF` 而非 :c:func:" +"`Py_DECREF`。" diff --git a/glossary.po b/glossary.po index adfd51e065..51123960cf 100644 --- a/glossary.po +++ b/glossary.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-17 17:02+0000\n" +"POT-Creation-Date: 2026-02-03 00:20+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -358,8 +358,8 @@ msgid "" "On most builds of Python, having an attached thread state implies that the " "caller holds the :term:`GIL` for the current interpreter, so only one OS " "thread can have an attached thread state at a given moment. In :term:`free-" -"threaded ` builds of Python, threads can concurrently hold " -"an attached thread state, allowing for true parallelism of the bytecode " +"threaded builds ` of Python, threads can concurrently " +"hold an attached thread state, allowing for true parallelism of the bytecode " "interpreter." msgstr "" @@ -1293,10 +1293,25 @@ msgstr "" "一個執行緒執行 Python 位元組碼。請參閱 :pep:`703`。" #: ../../glossary.rst:582 +#, fuzzy +msgid "free-threaded build" +msgstr "free threading(自由執行緒)" + +#: ../../glossary.rst:585 +msgid "" +"A build of :term:`CPython` that supports :term:`free threading`, configured " +"using the :option:`--disable-gil` option before compilation." +msgstr "" + +#: ../../glossary.rst:588 +msgid "See :ref:`freethreading-python-howto`." +msgstr "" + +#: ../../glossary.rst:589 msgid "free variable" msgstr "free variable(自由變數)" -#: ../../glossary.rst:584 +#: ../../glossary.rst:591 msgid "" "Formally, as defined in the :ref:`language execution model `, a " "free variable is any variable used in a namespace which is not a local " @@ -1306,11 +1321,11 @@ msgid "" "variable`." msgstr "" -#: ../../glossary.rst:589 +#: ../../glossary.rst:596 msgid "function" msgstr "function(函式)" -#: ../../glossary.rst:591 +#: ../../glossary.rst:598 msgid "" "A series of statements which returns some value to a caller. It can also be " "passed zero or more :term:`arguments ` which may be used in the " @@ -1322,15 +1337,15 @@ msgstr "" "`parameter`\\ (參數)、:term:`method`\\ (方法),以及\\ :ref:`function`\\ " "章節。" -#: ../../glossary.rst:595 +#: ../../glossary.rst:602 msgid "function annotation" msgstr "function annotation(函式註釋)" -#: ../../glossary.rst:597 +#: ../../glossary.rst:604 msgid "An :term:`annotation` of a function parameter or return value." msgstr "函式參數或回傳值的一個 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:599 +#: ../../glossary.rst:606 msgid "" "Function annotations are usually used for :term:`type hints `: " "for example, this function is expected to take two :class:`int` arguments " @@ -1339,7 +1354,7 @@ msgstr "" "函式註釋通常被使用於\\ :term:`型別提示 `:例如,這個函式預期會得到" "兩個 :class:`int` 引數,並會有一個 :class:`int` 回傳值: ::" -#: ../../glossary.rst:604 +#: ../../glossary.rst:611 msgid "" "def sum_two_numbers(a: int, b: int) -> int:\n" " return a + b" @@ -1347,11 +1362,11 @@ msgstr "" "def sum_two_numbers(a: int, b: int) -> int:\n" " return a + b" -#: ../../glossary.rst:607 +#: ../../glossary.rst:614 msgid "Function annotation syntax is explained in section :ref:`function`." msgstr "函式註釋的語法在\\ :ref:`function`\\ 章節有詳細解釋。" -#: ../../glossary.rst:609 +#: ../../glossary.rst:616 msgid "" "See :term:`variable annotation` and :pep:`484`, which describe this " "functionality. Also see :ref:`annotations-howto` for best practices on " @@ -1360,11 +1375,11 @@ msgstr "" "請參閱 :term:`variable annotation` 和 :pep:`484`,皆有此功能的描述。關於註釋" "的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:613 +#: ../../glossary.rst:620 msgid "__future__" msgstr "__future__" -#: ../../glossary.rst:615 +#: ../../glossary.rst:622 msgid "" "A :ref:`future statement `, ``from __future__ import ``, " "directs the compiler to compile the current module using syntax or semantics " @@ -1380,7 +1395,7 @@ msgstr "" "import 此模組並對其變數求值,你可以看見一個新的功能是何時首次被新增到此語言" "中,以及它何時將會(或已經)成為預設的功能: ::" -#: ../../glossary.rst:623 +#: ../../glossary.rst:630 msgid "" ">>> import __future__\n" ">>> __future__.division\n" @@ -1390,11 +1405,11 @@ msgstr "" ">>> __future__.division\n" "_Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)" -#: ../../glossary.rst:626 +#: ../../glossary.rst:633 msgid "garbage collection" msgstr "garbage collection(垃圾回收)" -#: ../../glossary.rst:628 +#: ../../glossary.rst:635 msgid "" "The process of freeing memory when it is not used anymore. Python performs " "garbage collection via reference counting and a cyclic garbage collector " @@ -1406,11 +1421,11 @@ msgstr "" "垃圾回收器 (cyclic garbage collector) 來完成。垃圾回收器可以使用 :mod:`gc` 模" "組對其進行控制。" -#: ../../glossary.rst:633 ../../glossary.rst:634 +#: ../../glossary.rst:640 ../../glossary.rst:641 msgid "generator" msgstr "generator(產生器)" -#: ../../glossary.rst:636 +#: ../../glossary.rst:643 msgid "" "A function which returns a :term:`generator iterator`. It looks like a " "normal function except that it contains :keyword:`yield` expressions for " @@ -1421,7 +1436,7 @@ msgstr "" "個正常的函式,但不同的是它包含了 :keyword:`yield` 運算式,能產生一系列的值," "這些值可用於 for 迴圈,或是以 :func:`next` 函式,每次檢索其中的一個值。" -#: ../../glossary.rst:641 +#: ../../glossary.rst:648 msgid "" "Usually refers to a generator function, but may refer to a *generator " "iterator* in some contexts. In cases where the intended meaning isn't " @@ -1430,15 +1445,15 @@ msgstr "" "這個術語通常用來表示一個產生器函式,但在某些情境中,也可能是表示\\ *產生器疊" "代器*。萬一想表達的意思不夠清楚,那就使用完整的術語,以避免歧義。" -#: ../../glossary.rst:644 +#: ../../glossary.rst:651 msgid "generator iterator" msgstr "generator iterator(產生器疊代器)" -#: ../../glossary.rst:646 +#: ../../glossary.rst:653 msgid "An object created by a :term:`generator` function." msgstr "一個由 :term:`generator`\\ (產生器)函式所建立的物件。" -#: ../../glossary.rst:648 +#: ../../glossary.rst:655 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " "execution state (including local variables and pending try-statements). " @@ -1449,11 +1464,11 @@ msgstr "" "try 陳述式)。當\\ *產生器疊代器*\\ 回復時,它會從停止的地方繼續執行(與那些" "每次呼叫時都要重新開始的函式有所不同)。" -#: ../../glossary.rst:654 ../../glossary.rst:655 +#: ../../glossary.rst:661 ../../glossary.rst:662 msgid "generator expression" msgstr "generator expression(產生器運算式)" -#: ../../glossary.rst:657 +#: ../../glossary.rst:664 msgid "" "An :term:`expression` that returns an :term:`iterator`. It looks like a " "normal expression followed by a :keyword:`!for` clause defining a loop " @@ -1465,7 +1480,7 @@ msgstr "" "變數、範圍以及一個選擇性的 :keyword:`!if` 子句。該組合運算式會為外層函式產生" "多個值: ::" -#: ../../glossary.rst:662 +#: ../../glossary.rst:669 msgid "" ">>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81\n" "285" @@ -1473,11 +1488,11 @@ msgstr "" ">>> sum(i*i for i in range(10)) # 平方之和 0, 1, 4, ... 81\n" "285" -#: ../../glossary.rst:664 +#: ../../glossary.rst:671 msgid "generic function" msgstr "generic function(泛型函式)" -#: ../../glossary.rst:666 +#: ../../glossary.rst:673 msgid "" "A function composed of multiple functions implementing the same operation " "for different types. Which implementation should be used during a call is " @@ -1486,7 +1501,7 @@ msgstr "" "一個由多個函式組成的函式,該函式會對不同的型別實作相同的運算。呼叫期間應該使" "用哪種實作,是由調度演算法 (dispatch algorithm) 來決定。" -#: ../../glossary.rst:670 +#: ../../glossary.rst:677 msgid "" "See also the :term:`single dispatch` glossary entry, the :func:`functools." "singledispatch` decorator, and :pep:`443`." @@ -1494,11 +1509,11 @@ msgstr "" "另請參閱 :term:`single dispatch`\\ (單一調度)術語表條目、:func:`functools." "singledispatch` 裝飾器和 :pep:`443`。" -#: ../../glossary.rst:672 +#: ../../glossary.rst:679 msgid "generic type" msgstr "generic type(泛型型別)" -#: ../../glossary.rst:674 +#: ../../glossary.rst:681 msgid "" "A :term:`type` that can be parameterized; typically a :ref:`container " "class` such as :class:`list` or :class:`dict`. Used for :" @@ -1508,7 +1523,7 @@ msgstr "" "`容器型別 `,像是 :class:`list` 和 :class:`dict`。它被用於" "\\ :term:`型別提示 `\\ 和\\ :term:`註釋 `。" -#: ../../glossary.rst:679 +#: ../../glossary.rst:686 msgid "" "For more details, see :ref:`generic alias types`, :pep:" "`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module." @@ -1516,19 +1531,19 @@ msgstr "" "詳情請參閱\\ :ref:`泛型別名型別 `、:pep:`483`、:pep:" "`484`、:pep:`585` 和 :mod:`typing` 模組。" -#: ../../glossary.rst:681 +#: ../../glossary.rst:688 msgid "GIL" msgstr "GIL" -#: ../../glossary.rst:683 +#: ../../glossary.rst:690 msgid "See :term:`global interpreter lock`." msgstr "請參閱 :term:`global interpreter lock`\\ (全域直譯器鎖)。" -#: ../../glossary.rst:684 +#: ../../glossary.rst:691 msgid "global interpreter lock" msgstr "global interpreter lock(全域直譯器鎖)" -#: ../../glossary.rst:686 +#: ../../glossary.rst:693 msgid "" "The mechanism used by the :term:`CPython` interpreter to assure that only " "one thread executes Python :term:`bytecode` at a time. This simplifies the " @@ -1545,7 +1560,7 @@ msgstr "" "(multi-threaded),但代價是會犧牲掉多處理器的機器能夠提供的一大部分平行性 " "(parallelism)。" -#: ../../glossary.rst:695 +#: ../../glossary.rst:702 msgid "" "However, some extension modules, either standard or third-party, are " "designed so as to release the GIL when doing computationally intensive tasks " @@ -1556,7 +1571,7 @@ msgstr "" "計算密集 (computationally intensive) 的任務時,可以解除 GIL。另外,在執行 I/" "O 時,GIL 總是會被解除。" -#: ../../glossary.rst:700 +#: ../../glossary.rst:707 msgid "" "As of Python 3.13, the GIL can be disabled using the :option:`--disable-gil` " "build configuration. After building Python with this option, code must be " @@ -1571,18 +1586,18 @@ msgstr "" "多執行緒應用程式的效能,並使多核心 CPU 的高效使用變得更加容易。有關更多詳細資" "訊,請參閱 :pep:`703`。" -#: ../../glossary.rst:707 +#: ../../glossary.rst:714 msgid "" "In prior versions of Python's C API, a function might declare that it " "requires the GIL to be held in order to use it. This refers to having an :" "term:`attached thread state`." msgstr "" -#: ../../glossary.rst:710 +#: ../../glossary.rst:717 msgid "global state" msgstr "" -#: ../../glossary.rst:712 +#: ../../glossary.rst:719 msgid "" "Data that is accessible throughout a program, such as module-level " "variables, class variables, or C static variables in :term:`extension " @@ -1591,11 +1606,11 @@ msgid "" "`race conditions ` and :term:`data races `." msgstr "" -#: ../../glossary.rst:718 +#: ../../glossary.rst:725 msgid "hash-based pyc" msgstr "hash-based pyc(雜湊架構的 pyc)" -#: ../../glossary.rst:720 +#: ../../glossary.rst:727 msgid "" "A bytecode cache file that uses the hash rather than the last-modified time " "of the corresponding source file to determine its validity. See :ref:`pyc-" @@ -1604,11 +1619,11 @@ msgstr "" "一個位元組碼 (bytecode) 暫存檔,它使用雜湊值而不是對應原始檔案的最後修改時" "間,來確定其有效性。請參閱\\ :ref:`pyc-invalidation`。" -#: ../../glossary.rst:723 +#: ../../glossary.rst:730 msgid "hashable" msgstr "hashable(可雜湊的)" -#: ../../glossary.rst:725 +#: ../../glossary.rst:732 msgid "" "An object is *hashable* if it has a hash value which never changes during " "its lifetime (it needs a :meth:`~object.__hash__` method), and can be " @@ -1620,7 +1635,7 @@ msgstr "" "`~object.__eq__` method),那麼它就是一個\\ *可雜湊*\\ 物件。比較結果為相等的" "多個可雜湊物件,它們必須擁有相同的雜湊值。" -#: ../../glossary.rst:731 +#: ../../glossary.rst:738 msgid "" "Hashability makes an object usable as a dictionary key and a set member, " "because these data structures use the hash value internally." @@ -1628,7 +1643,7 @@ msgstr "" "可雜湊性 (hashability) 使一個物件可用作 dictionary(字典)的鍵和 set(集合)" "的成員,因為這些資料結構都在其內部使用了雜湊值。" -#: ../../glossary.rst:734 +#: ../../glossary.rst:741 msgid "" "Most of Python's immutable built-in objects are hashable; mutable containers " "(such as lists or dictionaries) are not; immutable containers (such as " @@ -1643,11 +1658,11 @@ msgstr "" "則這些物件會被預設為可雜湊的。它們在互相比較時都是不相等的(除非它們與自己比" "較),而它們的雜湊值則是衍生自它們的 :func:`id`。" -#: ../../glossary.rst:741 +#: ../../glossary.rst:748 msgid "IDLE" msgstr "IDLE" -#: ../../glossary.rst:743 +#: ../../glossary.rst:750 msgid "" "An Integrated Development and Learning Environment for Python. :ref:`idle` " "is a basic editor and interpreter environment which ships with the standard " @@ -1657,17 +1672,17 @@ msgstr "" "境)。:ref:`idle` 是一個基本的編輯器和直譯器環境,它和 Python 的標準發行版本" "一起被提供。" -#: ../../glossary.rst:746 +#: ../../glossary.rst:753 msgid "immortal" msgstr "immortal(不滅)" -#: ../../glossary.rst:748 +#: ../../glossary.rst:755 msgid "" "*Immortal objects* are a CPython implementation detail introduced in :pep:" "`683`." msgstr "*不滅物件 (Immortal objects)* 是 :pep:`683` 引入的 CPython 實作細節。" -#: ../../glossary.rst:751 +#: ../../glossary.rst:758 msgid "" "If an object is immortal, its :term:`reference count` is never modified, and " "therefore it is never deallocated while the interpreter is running. For " @@ -1677,17 +1692,17 @@ msgstr "" "修改,因此在直譯器運行時它永遠不會被釋放。例如,:const:`True` 和 :const:" "`None` 在 CPython 中是不滅的。" -#: ../../glossary.rst:755 +#: ../../glossary.rst:762 msgid "" "Immortal objects can be identified via :func:`sys._is_immortal`, or via :c:" "func:`PyUnstable_IsImmortal` in the C API." msgstr "" -#: ../../glossary.rst:757 +#: ../../glossary.rst:764 msgid "immutable" msgstr "immutable(不可變物件)" -#: ../../glossary.rst:759 +#: ../../glossary.rst:766 msgid "" "An object with a fixed value. Immutable objects include numbers, strings " "and tuples. Such an object cannot be altered. A new object has to be " @@ -1698,16 +1713,16 @@ msgid "" "improperly synchronized :term:`concurrent modification`." msgstr "" "一個具有固定值的物件。不可變物件包括數字、字串和 tuple(元組)。這類物件是不" -"能被改變的。如果必須儲存一個不同的值,則需要建立一個新的物件。它們在需要恆" -"定雜湊值的地方扮演重要的角色,例如 dictionary 中的一個鍵。不可變物件本" -"質上是\\ :term:`執行緒安全的 `,因為它們的狀態在建立後無法被修改," -"從而消除了對不當同步的\\ :term:`並行修改 `\\ 的疑慮。" +"能被改變的。如果必須儲存一個不同的值,則需要建立一個新的物件。它們在需要恆定" +"雜湊值的地方扮演重要的角色,例如 dictionary 中的一個鍵。不可變物件本質上是" +"\\ :term:`執行緒安全的 `,因為它們的狀態在建立後無法被修改,從而" +"消除了對不當同步的\\ :term:`並行修改 `\\ 的疑慮。" -#: ../../glossary.rst:766 +#: ../../glossary.rst:773 msgid "import path" msgstr "import path(引入路徑)" -#: ../../glossary.rst:768 +#: ../../glossary.rst:775 msgid "" "A list of locations (or :term:`path entries `) that are searched " "by the :term:`path based finder` for modules to import. During import, this " @@ -1719,11 +1734,11 @@ msgstr "" "的位置。在 import 期間,此位置列表通常是來自 :data:`sys.path`,但對於子套件 " "(subpackage) 而言,它也可能是來自父套件的 ``__path__`` 屬性。" -#: ../../glossary.rst:773 +#: ../../glossary.rst:780 msgid "importing" msgstr "importing(引入)" -#: ../../glossary.rst:775 +#: ../../glossary.rst:782 msgid "" "The process by which Python code in one module is made available to Python " "code in another module." @@ -1731,11 +1746,11 @@ msgstr "" "一個過程。一個模組中的 Python 程式碼可以透過此過程,被另一個模組中的 Python " "程式碼使用。" -#: ../../glossary.rst:777 +#: ../../glossary.rst:784 msgid "importer" msgstr "importer(引入器)" -#: ../../glossary.rst:779 +#: ../../glossary.rst:786 msgid "" "An object that both finds and loads a module; both a :term:`finder` and :" "term:`loader` object." @@ -1743,11 +1758,11 @@ msgstr "" "一個能夠尋找及載入模組的物件;它既是 :term:`finder`\\ (尋檢器)也是 :term:" "`loader`\\ (載入器)物件。" -#: ../../glossary.rst:781 +#: ../../glossary.rst:788 msgid "interactive" msgstr "interactive(互動的)" -#: ../../glossary.rst:783 +#: ../../glossary.rst:790 msgid "" "Python has an interactive interpreter which means you can enter statements " "and expressions at the interpreter prompt, immediately execute them and see " @@ -1761,11 +1776,11 @@ msgstr "" "從你的電腦的主選單選擇它)。這是測試新想法或檢查模組和包的非常強大的方法(請" "記住help(x))。更多互動式模式相關資訊請見 :ref:`tut-interac`。" -#: ../../glossary.rst:790 +#: ../../glossary.rst:797 msgid "interpreted" msgstr "interpreted(直譯的)" -#: ../../glossary.rst:792 +#: ../../glossary.rst:799 msgid "" "Python is an interpreted language, as opposed to a compiled one, though the " "distinction can be blurry because of the presence of the bytecode compiler. " @@ -1779,11 +1794,11 @@ msgstr "" "一個執行檔,然後再執行它。直譯語言通常比編譯語言有更短的開發/除錯週期,不過" "它們的程式通常也運行得較慢。另請參閱 :term:`interactive`\\ (互動的)。" -#: ../../glossary.rst:799 +#: ../../glossary.rst:806 msgid "interpreter shutdown" msgstr "interpreter shutdown(直譯器關閉)" -#: ../../glossary.rst:801 +#: ../../glossary.rst:808 msgid "" "When asked to shut down, the Python interpreter enters a special phase where " "it gradually releases all allocated resources, such as modules and various " @@ -1801,18 +1816,18 @@ msgstr "" "段被執行的程式碼會遇到各種例外,因為它所依賴的資源可能不再有作用了(常見的例" "子是函式庫模組或是警告機制)。" -#: ../../glossary.rst:810 +#: ../../glossary.rst:817 msgid "" "The main reason for interpreter shutdown is that the ``__main__`` module or " "the script being run has finished executing." msgstr "" "直譯器關閉的主要原因,是 ``__main__`` 模組或正被運行的腳本已經執行完成。" -#: ../../glossary.rst:812 +#: ../../glossary.rst:819 msgid "iterable" msgstr "iterable(可疊代物件)" -#: ../../glossary.rst:814 +#: ../../glossary.rst:821 msgid "" "An object capable of returning its members one at a time. Examples of " "iterables include all sequence types (such as :class:`list`, :class:`str`, " @@ -1827,7 +1842,7 @@ msgstr "" "只要那些 class 有實作 :term:`sequence`\\ (序列)語意的 :meth:`~object." "__iter__` 或是 :meth:`~object.__getitem__` method,該物件就是可疊代物件。" -#: ../../glossary.rst:822 +#: ../../glossary.rst:829 msgid "" "Iterables can be used in a :keyword:`for` loop and in many other places " "where a sequence is needed (:func:`zip`, :func:`map`, ...). When an " @@ -1847,11 +1862,11 @@ msgstr "" "數,用於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、:" "term:`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" -#: ../../glossary.rst:832 +#: ../../glossary.rst:839 msgid "iterator" msgstr "iterator(疊代器)" -#: ../../glossary.rst:834 +#: ../../glossary.rst:841 msgid "" "An object representing a stream of data. Repeated calls to the iterator's :" "meth:`~iterator.__next__` method (or passing it to the built-in function :" @@ -1880,11 +1895,11 @@ msgstr "" "此事(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一個已被用盡的疊代器物" "件,使其看起來就像一個空的容器。" -#: ../../glossary.rst:849 +#: ../../glossary.rst:856 msgid "More information can be found in :ref:`typeiter`." msgstr "在\\ :ref:`typeiter`\\ 文中可以找到更多資訊。" -#: ../../glossary.rst:853 +#: ../../glossary.rst:860 msgid "" "CPython does not consistently apply the requirement that an iterator define :" "meth:`~iterator.__iter__`. And also please note that :term:`free-threaded " @@ -1893,13 +1908,14 @@ msgid "" msgstr "" "CPython 並不是始終如一地都會檢查「疊代器有定義 :meth:`~iterator." "__iter__`\\ 」這個規定。另請注意,:term:`free-threading(自由執行緒)` CPython 不保證疊代器操作的\\ :term:`執行緒安全 ` 行為。" +"threading>` CPython 不保證疊代器操作的\\ :term:`執行緒安全 ` 行" +"為。" -#: ../../glossary.rst:859 +#: ../../glossary.rst:866 msgid "key function" msgstr "key function(鍵函式)" -#: ../../glossary.rst:861 +#: ../../glossary.rst:868 msgid "" "A key function or collation function is a callable that returns a value used " "for sorting or ordering. For example, :func:`locale.strxfrm` is used to " @@ -1909,7 +1925,7 @@ msgstr "" "一個用於排序 (sorting) 或定序 (ordering) 的值。例如,:func:`locale.strxfrm` " "被用來產生一個了解區域特定排序慣例的排序鍵。" -#: ../../glossary.rst:866 +#: ../../glossary.rst:873 msgid "" "A number of tools in Python accept key functions to control how elements are " "ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`, :" @@ -1921,7 +1937,7 @@ msgstr "" "merge`、:func:`heapq.nsmallest`、:func:`heapq.nlargest` 和 :func:`itertools." "groupby`。" -#: ../../glossary.rst:872 +#: ../../glossary.rst:879 msgid "" "There are several ways to create a key function. For example. the :meth:" "`str.casefold` method can serve as a key function for case insensitive " @@ -1931,26 +1947,26 @@ msgid "" "are three key function constructors. See the :ref:`Sorting HOW TO " "` for examples of how to create and use key functions." msgstr "" -"有幾種方法可以建立一個鍵函式。例如,:meth:`str.casefold` method 可以作為不分大小" -"寫排序的鍵函式。或者,一個鍵函式也可以從 :keyword:`lambda` 運算式被建造,例" -"如 ``lambda r: (r[0], r[2])``。另外,:func:`operator.attrgetter`、:func:" +"有幾種方法可以建立一個鍵函式。例如,:meth:`str.casefold` method 可以作為不分" +"大小寫排序的鍵函式。或者,一個鍵函式也可以從 :keyword:`lambda` 運算式被建造," +"例如 ``lambda r: (r[0], r[2])``。另外,:func:`operator.attrgetter`、:func:" "`operator.itemgetter` 和 :func:`operator.methodcaller` 為三個鍵函式的建構函" "式 (constructor)。關於如何建立和使用鍵函式的範例,請參閱\\ :ref:`如何排序 " "`。" -#: ../../glossary.rst:879 +#: ../../glossary.rst:886 msgid "keyword argument" msgstr "keyword argument(關鍵字引數)" -#: ../../glossary.rst:881 ../../glossary.rst:1248 +#: ../../glossary.rst:888 ../../glossary.rst:1255 msgid "See :term:`argument`." msgstr "請參閱 :term:`argument`\\ (引數)。" -#: ../../glossary.rst:882 +#: ../../glossary.rst:889 msgid "lambda" msgstr "lambda" -#: ../../glossary.rst:884 +#: ../../glossary.rst:891 msgid "" "An anonymous inline function consisting of a single :term:`expression` which " "is evaluated when the function is called. The syntax to create a lambda " @@ -1960,11 +1976,11 @@ msgstr "" "function),於該函式被呼叫時求值。建立 lambda 函式的語法是 ``lambda " "[parameters]: expression``" -#: ../../glossary.rst:887 +#: ../../glossary.rst:894 msgid "LBYL" msgstr "LBYL" -#: ../../glossary.rst:889 +#: ../../glossary.rst:896 msgid "" "Look before you leap. This coding style explicitly tests for pre-conditions " "before making calls or lookups. This style contrasts with the :term:`EAFP` " @@ -1975,7 +1991,7 @@ msgstr "" "地測試先決條件。這種風格與 :term:`EAFP` 方式形成對比,且它的特色是會有許多 :" "keyword:`if` 陳述式的存在。" -#: ../../glossary.rst:894 +#: ../../glossary.rst:901 msgid "" "In a multi-threaded environment, the LBYL approach can risk introducing a :" "term:`race condition` between \"the looking\" and \"the leaping\". For " @@ -1984,25 +2000,25 @@ msgid "" "lookup. This issue can be solved with :term:`locks ` or by using the :" "term:`EAFP` approach. See also :term:`thread-safe`." msgstr "" -"在一個多執行緒環境中,LBYL 方式有在「三思」和「後行」之間引入\\ :term:`競爭條件 " -"` 的風險。例如以下程式碼 ``if key in mapping: return " +"在一個多執行緒環境中,LBYL 方式有在「三思」和「後行」之間引入\\ :term:`競爭條" +"件 ` 的風險。例如以下程式碼 ``if key in mapping: return " "mapping[key]``,如果另一個執行緒在測試之後但在查找之前,從 *mapping* 中移除" -"了 *key*,則該程式碼就會失效。這個問題可以用\\ :term:`鎖 `\\ 或使用 :term:" -"`EAFP` 編碼方式來解決。另請參閱\\ :term:`執行緒安全 `。" +"了 *key*,則該程式碼就會失效。這個問題可以用\\ :term:`鎖 `\\ 或使用 :" +"term:`EAFP` 編碼方式來解決。另請參閱\\ :term:`執行緒安全 `。" -#: ../../glossary.rst:900 +#: ../../glossary.rst:907 msgid "lexical analyzer" msgstr "lexical analyzer(詞法分析器)" -#: ../../glossary.rst:903 +#: ../../glossary.rst:910 msgid "Formal name for the *tokenizer*; see :term:`token`." msgstr "tokenizer 的正式名稱;請參閱 :term:`token`。" -#: ../../glossary.rst:904 +#: ../../glossary.rst:911 msgid "list" msgstr "list(串列)" -#: ../../glossary.rst:906 +#: ../../glossary.rst:913 msgid "" "A built-in Python :term:`sequence`. Despite its name it is more akin to an " "array in other languages than to a linked list since access to elements is " @@ -2012,11 +2028,11 @@ msgstr "" "似其他語言中的一個陣列 (array) 而較不像一個鏈結串列 (linked list),因為存取元" "素的時間複雜度是 *O*\\ (1)。" -#: ../../glossary.rst:909 +#: ../../glossary.rst:916 msgid "list comprehension" msgstr "list comprehension(串列綜合運算)" -#: ../../glossary.rst:911 +#: ../../glossary.rst:918 msgid "" "A compact way to process all or part of the elements in a sequence and " "return a list with the results. ``result = ['{:#04x}'.format(x) for x in " @@ -2030,11 +2046,11 @@ msgstr "" "keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所有元素都會被" "處理。" -#: ../../glossary.rst:917 +#: ../../glossary.rst:924 msgid "lock" msgstr "lock(鎖)" -#: ../../glossary.rst:919 +#: ../../glossary.rst:926 msgid "" "A :term:`synchronization primitive` that allows only one thread at a time to " "access a shared resource. A thread must acquire a lock before accessing the " @@ -2049,11 +2065,11 @@ msgid "" "`reentrant`." msgstr "" -#: ../../glossary.rst:930 +#: ../../glossary.rst:937 msgid "loader" msgstr "loader(載入器)" -#: ../../glossary.rst:932 +#: ../../glossary.rst:939 msgid "" "An object that loads a module. It must define the :meth:`!exec_module` and :" "meth:`!create_module` methods to implement the :class:`~importlib.abc." @@ -2064,23 +2080,23 @@ msgstr "" "create_module` 方法以實作 :class:`~importlib.abc.Loader` 介面。載入器通常是" "被 :term:`finder`\\ (尋檢器)回傳。更多細節請參閱:" -#: ../../glossary.rst:938 +#: ../../glossary.rst:945 msgid ":ref:`finders-and-loaders`" msgstr ":ref:`finders-and-loaders`" -#: ../../glossary.rst:939 +#: ../../glossary.rst:946 msgid ":class:`importlib.abc.Loader`" msgstr ":class:`importlib.abc.Loader`" -#: ../../glossary.rst:940 +#: ../../glossary.rst:947 msgid ":pep:`302`" msgstr ":pep:`302`" -#: ../../glossary.rst:941 +#: ../../glossary.rst:948 msgid "locale encoding" msgstr "locale encoding(區域編碼)" -#: ../../glossary.rst:943 +#: ../../glossary.rst:950 msgid "" "On Unix, it is the encoding of the LC_CTYPE locale. It can be set with :func:" "`locale.setlocale(locale.LC_CTYPE, new_locale) `." @@ -2088,36 +2104,36 @@ msgstr "" "在 Unix 上,它是 LC_CTYPE 區域設定的編碼。它可以用 :func:`locale." "setlocale(locale.LC_CTYPE, new_locale) ` 來設定。" -#: ../../glossary.rst:946 +#: ../../glossary.rst:953 msgid "On Windows, it is the ANSI code page (ex: ``\"cp1252\"``)." msgstr "在 Windows 上,它是 ANSI 碼頁(code page,例如 ``\"cp1252\"``\\ )。" -#: ../../glossary.rst:948 +#: ../../glossary.rst:955 msgid "" "On Android and VxWorks, Python uses ``\"utf-8\"`` as the locale encoding." msgstr "在 Android 和 VxWorks 上,Python 使用 ``\"utf-8\"`` 作為區域編碼。" -#: ../../glossary.rst:950 +#: ../../glossary.rst:957 msgid ":func:`locale.getencoding` can be used to get the locale encoding." msgstr ":func:`locale.getencoding` 可以用來取得區域編碼。" -#: ../../glossary.rst:952 +#: ../../glossary.rst:959 msgid "See also the :term:`filesystem encoding and error handler`." msgstr "也請參考 :term:`filesystem encoding and error handler`。" -#: ../../glossary.rst:953 +#: ../../glossary.rst:960 msgid "magic method" msgstr "magic method(魔術方法)" -#: ../../glossary.rst:957 +#: ../../glossary.rst:964 msgid "An informal synonym for :term:`special method`." msgstr ":term:`special method`\\ (特殊方法)的一個非正式同義詞。" -#: ../../glossary.rst:958 +#: ../../glossary.rst:965 msgid "mapping" msgstr "mapping(對映)" -#: ../../glossary.rst:960 +#: ../../glossary.rst:967 msgid "" "A container object that supports arbitrary key lookups and implements the " "methods specified in the :class:`collections.abc.Mapping` or :class:" @@ -2132,11 +2148,11 @@ msgstr "" "包括 :class:`dict`、:class:`collections.defaultdict`、:class:`collections." "OrderedDict` 和 :class:`collections.Counter`。" -#: ../../glossary.rst:966 +#: ../../glossary.rst:973 msgid "meta path finder" msgstr "meta path finder(元路徑尋檢器)" -#: ../../glossary.rst:968 +#: ../../glossary.rst:975 msgid "" "A :term:`finder` returned by a search of :data:`sys.meta_path`. Meta path " "finders are related to, but different from :term:`path entry finders ` " "相關但是不同。" -#: ../../glossary.rst:972 +#: ../../glossary.rst:979 msgid "" "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " "finders implement." msgstr "" "關於元路徑尋檢器實作的 method,請參閱 :class:`importlib.abc.MetaPathFinder`。" -#: ../../glossary.rst:974 +#: ../../glossary.rst:981 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../glossary.rst:976 +#: ../../glossary.rst:983 msgid "" "The class of a class. Class definitions create a class name, a class " "dictionary, and a list of base classes. The metaclass is responsible for " @@ -2177,15 +2193,15 @@ msgstr "" "性存取、增加執行緒安全性、追蹤物件建立、實作單例模式 (singleton),以及許多其" "他的任務。" -#: ../../glossary.rst:986 +#: ../../glossary.rst:993 msgid "More information can be found in :ref:`metaclasses`." msgstr "更多資訊可以在\\ :ref:`metaclasses`\\ 章節中找到。" -#: ../../glossary.rst:955 ../../glossary.rst:987 ../../glossary.rst:1430 +#: ../../glossary.rst:962 ../../glossary.rst:994 ../../glossary.rst:1437 msgid "method" msgstr "method(方法)" -#: ../../glossary.rst:989 +#: ../../glossary.rst:996 msgid "" "A function which is defined inside a class body. If called as an attribute " "of an instance of that class, the method will get the instance object as its " @@ -2197,11 +2213,11 @@ msgstr "" "通常被稱為 ``self``)。請參閱 :term:`function`\\ (函式)和 :term:`nested " "scope`\\ (巢狀作用域)。" -#: ../../glossary.rst:993 +#: ../../glossary.rst:1000 msgid "method resolution order" msgstr "method resolution order(方法解析順序)" -#: ../../glossary.rst:995 +#: ../../glossary.rst:1002 msgid "" "Method Resolution Order is the order in which base classes are searched for " "a member during lookup. See :ref:`python_2.3_mro` for details of the " @@ -2210,11 +2226,11 @@ msgstr "" "方法解析順序是在查找某個成員的過程中,base class(基底類別)被搜尋的順序。關" "於 Python 自 2.3 版直譯器所使用的演算法細節,請參閱 :ref:`python_2.3_mro`。" -#: ../../glossary.rst:998 +#: ../../glossary.rst:1005 msgid "module" msgstr "module(模組)" -#: ../../glossary.rst:1000 +#: ../../glossary.rst:1007 msgid "" "An object that serves as an organizational unit of Python code. Modules " "have a namespace containing arbitrary Python objects. Modules are loaded " @@ -2224,15 +2240,15 @@ msgstr "" "空間,它包含任意的 Python 物件。模組是藉由 :term:`importing` 的過程,被載入" "至 Python。" -#: ../../glossary.rst:1004 +#: ../../glossary.rst:1011 msgid "See also :term:`package`." msgstr "另請參閱 :term:`package`\\ (套件)。" -#: ../../glossary.rst:1005 +#: ../../glossary.rst:1012 msgid "module spec" msgstr "module spec(模組規格)" -#: ../../glossary.rst:1007 +#: ../../glossary.rst:1014 msgid "" "A namespace containing the import-related information used to load a module. " "An instance of :class:`importlib.machinery.ModuleSpec`." @@ -2240,23 +2256,23 @@ msgstr "" "一個命名空間,它包含用於載入模組的 import 相關資訊。它是 :class:`importlib." "machinery.ModuleSpec` 的一個實例。" -#: ../../glossary.rst:1010 +#: ../../glossary.rst:1017 msgid "See also :ref:`module-specs`." msgstr "另請參閱 :ref:`module-specs`。" -#: ../../glossary.rst:1011 +#: ../../glossary.rst:1018 msgid "MRO" msgstr "MRO" -#: ../../glossary.rst:1013 +#: ../../glossary.rst:1020 msgid "See :term:`method resolution order`." msgstr "請參閱 :term:`method resolution order`\\ (方法解析順序)。" -#: ../../glossary.rst:1014 +#: ../../glossary.rst:1021 msgid "mutable" msgstr "mutable(可變物件)" -#: ../../glossary.rst:1016 +#: ../../glossary.rst:1023 msgid "" "An :term:`object` with state that is allowed to change during the course of " "the program. In multi-threaded programs, mutable objects that are shared " @@ -2265,11 +2281,11 @@ msgid "" "safe`, and :term:`concurrent modification`." msgstr "" -#: ../../glossary.rst:1021 +#: ../../glossary.rst:1028 msgid "named tuple" msgstr "named tuple(附名元組)" -#: ../../glossary.rst:1023 +#: ../../glossary.rst:1030 msgid "" "The term \"named tuple\" applies to any type or class that inherits from " "tuple and whose indexable elements are also accessible using named " @@ -2279,7 +2295,7 @@ msgstr "" "索引 (indexable) 元素也可以用附名屬性來存取。這些型別或 class 也可以具有其他" "的特性。" -#: ../../glossary.rst:1027 +#: ../../glossary.rst:1034 msgid "" "Several built-in types are named tuples, including the values returned by :" "func:`time.localtime` and :func:`os.stat`. Another example is :data:`sys." @@ -2288,7 +2304,7 @@ msgstr "" "有些內建型別是 named tuple,包括由 :func:`time.localtime` 和 :func:`os.stat` " "回傳的值。另一個例子是 :data:`sys.float_info`: ::" -#: ../../glossary.rst:1031 +#: ../../glossary.rst:1038 msgid "" ">>> sys.float_info[1] # indexed access\n" "1024\n" @@ -2304,7 +2320,7 @@ msgstr "" ">>> isinstance(sys.float_info, tuple) # 屬於 tuple 型別\n" "True" -#: ../../glossary.rst:1038 +#: ../../glossary.rst:1045 msgid "" "Some named tuples are built-in types (such as the above examples). " "Alternatively, a named tuple can be created from a regular class definition " @@ -2321,11 +2337,11 @@ msgstr "" "namedtuple` 來建立。後者技術也增加了一些額外的 method,這些 method 可能是在手" "寫或內建的 named tuple 中,無法找到的。" -#: ../../glossary.rst:1046 +#: ../../glossary.rst:1053 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../glossary.rst:1048 +#: ../../glossary.rst:1055 msgid "" "The place where a variable is stored. Namespaces are implemented as " "dictionaries. There are the local, global and built-in namespaces as well " @@ -2345,11 +2361,11 @@ msgstr "" "func:`itertools.islice` 明確地表示,這些函式分別是由 :mod:`random` 和 :mod:" "`itertools` 模組在實作。" -#: ../../glossary.rst:1058 +#: ../../glossary.rst:1065 msgid "namespace package" msgstr "namespace package(命名空間套件)" -#: ../../glossary.rst:1060 +#: ../../glossary.rst:1067 msgid "" "A :term:`package` which serves only as a container for subpackages. " "Namespace packages may have no physical representation, and specifically are " @@ -2359,7 +2375,7 @@ msgstr "" "名空間套件可能沒有實體的表示法,而且具體來說它們不像是一個 :term:`regular " "package`\\ (正規套件),因為它們並沒有 ``__init__.py`` 這個檔案。" -#: ../../glossary.rst:1065 +#: ../../glossary.rst:1072 msgid "" "Namespace packages allow several individually installable packages to have a " "common parent package. Otherwise, it is recommended to use a :term:`regular " @@ -2368,20 +2384,20 @@ msgstr "" "命名空間套件允許數個可獨立安裝的套件擁有一個共同的父套件。除此之外,建議使" "用 :term:`regular package`。" -#: ../../glossary.rst:1068 +#: ../../glossary.rst:1075 msgid "" "For more information, see :pep:`420` and :ref:`reference-namespace-package`." msgstr "更多資訊,請參閱 :pep:`420` 和 :ref:`reference-namespace-package`。" -#: ../../glossary.rst:1070 +#: ../../glossary.rst:1077 msgid "See also :term:`module`." msgstr "另請參閱 :term:`module`\\ (模組)。" -#: ../../glossary.rst:1071 +#: ../../glossary.rst:1078 msgid "native code" msgstr "" -#: ../../glossary.rst:1073 +#: ../../glossary.rst:1080 msgid "" "Code that is compiled to machine instructions and runs directly on the " "processor, as opposed to code that is interpreted or runs in a virtual " @@ -2390,11 +2406,11 @@ msgid "" "can be called from Python. See also :term:`extension module`." msgstr "" -#: ../../glossary.rst:1078 +#: ../../glossary.rst:1085 msgid "nested scope" msgstr "nested scope(巢狀作用域)" -#: ../../glossary.rst:1080 +#: ../../glossary.rst:1087 msgid "" "The ability to refer to a variable in an enclosing definition. For " "instance, a function defined inside another function can refer to variables " @@ -2409,11 +2425,11 @@ msgstr "" "寫入。同樣地,全域變數是在全域命名空間中讀取及寫入。:keyword:`nonlocal` 容許" "對外層作用域進行寫入。" -#: ../../glossary.rst:1087 +#: ../../glossary.rst:1094 msgid "new-style class" msgstr "new-style class(新式類別)" -#: ../../glossary.rst:1089 +#: ../../glossary.rst:1096 msgid "" "Old name for the flavor of classes now used for all class objects. In " "earlier Python versions, only new-style classes could use Python's newer, " @@ -2425,11 +2441,11 @@ msgstr "" "__slots__`、描述器 (descriptor)、屬性 (property)、:meth:`~object." "__getattribute__`、class method(類別方法)和 static method(靜態方法)。" -#: ../../glossary.rst:1094 +#: ../../glossary.rst:1101 msgid "non-deterministic" msgstr "" -#: ../../glossary.rst:1096 +#: ../../glossary.rst:1103 msgid "" "Behavior where the outcome of a program can vary between executions with the " "same inputs. In multi-threaded programs, non-deterministic behavior often " @@ -2439,11 +2455,11 @@ msgid "" "` helps ensure deterministic behavior." msgstr "" -#: ../../glossary.rst:1103 +#: ../../glossary.rst:1110 msgid "object" msgstr "object(物件)" -#: ../../glossary.rst:1105 +#: ../../glossary.rst:1112 msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." @@ -2451,11 +2467,11 @@ msgstr "" "具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任何 :term:" "`new-style class`\\ (新式類別)的最終 base class(基底類別)。" -#: ../../glossary.rst:1108 +#: ../../glossary.rst:1115 msgid "optimized scope" msgstr "optimized scope(最佳化作用域)" -#: ../../glossary.rst:1110 +#: ../../glossary.rst:1117 msgid "" "A scope where target local variable names are reliably known to the compiler " "when the code is compiled, allowing optimization of read and write access to " @@ -2466,11 +2482,11 @@ msgid "" "to optimized scopes." msgstr "" -#: ../../glossary.rst:1117 +#: ../../glossary.rst:1124 msgid "optional module" msgstr "optional module(可選模組)" -#: ../../glossary.rst:1119 +#: ../../glossary.rst:1126 msgid "" "An :term:`extension module` that is part of the :term:`standard library`, " "but may be absent in some builds of :term:`CPython`, usually due to missing " @@ -2478,17 +2494,17 @@ msgid "" "platform." msgstr "" -#: ../../glossary.rst:1124 +#: ../../glossary.rst:1131 msgid "" "See :ref:`optional-module-requirements` for a list of optional modules that " "require third-party libraries." msgstr "" -#: ../../glossary.rst:1126 +#: ../../glossary.rst:1133 msgid "package" msgstr "package(套件)" -#: ../../glossary.rst:1128 +#: ../../glossary.rst:1135 msgid "" "A Python :term:`module` which can contain submodules or recursively, " "subpackages. Technically, a package is a Python module with a ``__path__`` " @@ -2498,17 +2514,17 @@ msgstr "" "迴的子套件 (subpackage)。技術上而言,套件就是具有 ``__path__`` 屬性的一個 " "Python 模組。" -#: ../../glossary.rst:1132 +#: ../../glossary.rst:1139 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr "" "另請參閱 :term:`regular package`\\ (正規套件)和 :term:`namespace " "package`\\ (命名空間套件)。" -#: ../../glossary.rst:1133 +#: ../../glossary.rst:1140 msgid "parallelism" msgstr "" -#: ../../glossary.rst:1135 +#: ../../glossary.rst:1142 msgid "" "Executing multiple operations at the same time (e.g. on multiple CPU " "cores). In Python builds with the :term:`global interpreter lock (GIL) " @@ -2519,11 +2535,11 @@ msgid "" "threads can run Python code simultaneously on different cores." msgstr "" -#: ../../glossary.rst:1143 +#: ../../glossary.rst:1150 msgid "parameter" msgstr "parameter(參數)" -#: ../../glossary.rst:1145 +#: ../../glossary.rst:1152 msgid "" "A named entity in a :term:`function` (or method) definition that specifies " "an :term:`argument` (or in some cases, arguments) that the function can " @@ -2533,7 +2549,7 @@ msgstr "" "它指明該函式能夠接受的一個 :term:`argument`\\ (引數),或在某些情況下指示多" "個引數。共有有五種不同的參數類型:" -#: ../../glossary.rst:1149 +#: ../../glossary.rst:1156 msgid "" ":dfn:`positional-or-keyword`: specifies an argument that can be passed " "either :term:`positionally ` or as a :term:`keyword argument " @@ -2544,11 +2560,11 @@ msgstr "" "置 `\\ 或是作為\\ :term:`關鍵字引數 `\\ 被傳遞的引數。這" "是參數的預設類型,例如以下的 *foo* 和 *bar*: ::" -#: ../../glossary.rst:1154 +#: ../../glossary.rst:1161 msgid "def func(foo, bar=None): ..." msgstr "def func(foo, bar=None): ..." -#: ../../glossary.rst:1158 +#: ../../glossary.rst:1165 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " @@ -2559,11 +2575,11 @@ msgstr "" "式定義的參數列表中包含一個 ``/`` 字元,就可以在該字元前面定義僅限位置參數,例" "如以下的 *posonly1* 和 *posonly2*: ::" -#: ../../glossary.rst:1163 +#: ../../glossary.rst:1170 msgid "def func(posonly1, posonly2, /, positional_or_keyword): ..." msgstr "def func(posonly1, posonly2, /, positional_or_keyword): ..." -#: ../../glossary.rst:1167 +#: ../../glossary.rst:1174 msgid "" ":dfn:`keyword-only`: specifies an argument that can be supplied only by " "keyword. Keyword-only parameters can be defined by including a single var-" @@ -2576,11 +2592,11 @@ msgstr "" "單純的 ``*`` 字元,就可以在其後方定義僅限關鍵字參數,例如以下的 *kw_only1* " "和 *kw_only2*: ::" -#: ../../glossary.rst:1173 +#: ../../glossary.rst:1180 msgid "def func(arg, *, kw_only1, kw_only2): ..." msgstr "def func(arg, *, kw_only1, kw_only2): ..." -#: ../../glossary.rst:1175 +#: ../../glossary.rst:1182 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " "arguments can be provided (in addition to any positional arguments already " @@ -2592,11 +2608,11 @@ msgstr "" "數(在已被其他參數接受的任何位置引數之外)。這類參數是透過在其參數名稱字首加" "上 ``*`` 來定義的,例如以下的 *args*: ::" -#: ../../glossary.rst:1181 +#: ../../glossary.rst:1188 msgid "def func(*args, **kwargs): ..." msgstr "def func(*args, **kwargs): ..." -#: ../../glossary.rst:1183 +#: ../../glossary.rst:1190 msgid "" ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " "provided (in addition to any keyword arguments already accepted by other " @@ -2607,14 +2623,14 @@ msgstr "" "已被其他參數接受的任何關鍵字引數之外)。這類參數是透過在其參數名稱字首加上 " "``**`` 來定義的,例如上面範例中的 *kwargs*。" -#: ../../glossary.rst:1189 +#: ../../glossary.rst:1196 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." msgstr "" "參數可以指明引數是選擇性的或必需的,也可以為一些選擇性的引數指定預設值。" -#: ../../glossary.rst:1192 +#: ../../glossary.rst:1199 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " @@ -2625,11 +2641,11 @@ msgstr "" "參數之間的差異 `、:class:`inspect.Parameter` " "class、:ref:`function`\\ 章節,以及 :pep:`362`。" -#: ../../glossary.rst:1196 +#: ../../glossary.rst:1203 msgid "path entry" msgstr "path entry(路徑項目)" -#: ../../glossary.rst:1198 +#: ../../glossary.rst:1205 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." @@ -2637,11 +2653,11 @@ msgstr "" "在 :term:`import path`\\ (引入路徑)中的一個位置,而 :term:`path based " "finder` (基於路徑的尋檢器)會參考該位置來尋找要 import 的模組。" -#: ../../glossary.rst:1200 +#: ../../glossary.rst:1207 msgid "path entry finder" msgstr "path entry finder(路徑項目尋檢器)" -#: ../../glossary.rst:1202 +#: ../../glossary.rst:1209 msgid "" "A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :" "term:`path entry hook`) which knows how to locate modules given a :term:" @@ -2651,7 +2667,7 @@ msgstr "" "`path entry hook`\\ )所回傳的一種 :term:`finder`,它知道如何以一個 :term:" "`path entry`\\ 定位模組。" -#: ../../glossary.rst:1206 +#: ../../glossary.rst:1213 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." @@ -2659,11 +2675,11 @@ msgstr "" "關於路徑項目尋檢器實作的 method,請參閱 :class:`importlib.abc." "PathEntryFinder`。" -#: ../../glossary.rst:1208 +#: ../../glossary.rst:1215 msgid "path entry hook" msgstr "path entry hook(路徑項目鉤)" -#: ../../glossary.rst:1210 +#: ../../glossary.rst:1217 msgid "" "A callable on the :data:`sys.path_hooks` list which returns a :term:`path " "entry finder` if it knows how to find modules on a specific :term:`path " @@ -2673,11 +2689,11 @@ msgstr "" "個特定的 :term:`path entry` 中尋找模組,則會回傳一個 :term:`path entry " "finder`\\ (路徑項目尋檢器)。" -#: ../../glossary.rst:1213 +#: ../../glossary.rst:1220 msgid "path based finder" msgstr "path based finder(基於路徑的尋檢器)" -#: ../../glossary.rst:1215 +#: ../../glossary.rst:1222 msgid "" "One of the default :term:`meta path finders ` which " "searches an :term:`import path` for modules." @@ -2685,11 +2701,11 @@ msgstr "" "預設的\\ :term:`元路徑尋檢器 (meta path finder) ` 之一,它" "會在一個 :term:`import path` 中搜尋模組。" -#: ../../glossary.rst:1217 +#: ../../glossary.rst:1224 msgid "path-like object" msgstr "path-like object(類路徑物件)" -#: ../../glossary.rst:1219 +#: ../../glossary.rst:1226 msgid "" "An object representing a file system path. A path-like object is either a :" "class:`str` or :class:`bytes` object representing a path, or an object " @@ -2707,11 +2723,11 @@ msgstr "" "`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。由 :" "pep:`519` 引入。" -#: ../../glossary.rst:1227 +#: ../../glossary.rst:1234 msgid "PEP" msgstr "PEP" -#: ../../glossary.rst:1229 +#: ../../glossary.rst:1236 msgid "" "Python Enhancement Proposal. A PEP is a design document providing " "information to the Python community, or describing a new feature for Python " @@ -2722,7 +2738,7 @@ msgstr "" "為 Python 社群提供資訊,或是描述 Python 的一個新功能或該功能的程序和環境。" "PEP 應該要提供簡潔的技術規範以及被提案功能的運作原理。" -#: ../../glossary.rst:1235 +#: ../../glossary.rst:1242 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " @@ -2734,15 +2750,15 @@ msgstr "" "已納入 Python 的設計決策的記錄,這些過程的主要機制。PEP 的作者要負責在社群內" "建立共識並記錄反對意見。" -#: ../../glossary.rst:1241 +#: ../../glossary.rst:1248 msgid "See :pep:`1`." msgstr "請參閱 :pep:`1`。" -#: ../../glossary.rst:1242 +#: ../../glossary.rst:1249 msgid "portion" msgstr "portion(部分)" -#: ../../glossary.rst:1244 +#: ../../glossary.rst:1251 msgid "" "A set of files in a single directory (possibly stored in a zip file) that " "contribute to a namespace package, as defined in :pep:`420`." @@ -2750,15 +2766,15 @@ msgstr "" "在單一目錄中的一組檔案(也可能儲存在一個 zip 檔中),這些檔案能對一個命名空間" "套件 (namespace package) 有所貢獻,如同 :pep:`420` 中的定義。" -#: ../../glossary.rst:1246 +#: ../../glossary.rst:1253 msgid "positional argument" msgstr "positional argument(位置引數)" -#: ../../glossary.rst:1249 +#: ../../glossary.rst:1256 msgid "provisional API" msgstr "provisional API(暫行 API)" -#: ../../glossary.rst:1251 +#: ../../glossary.rst:1258 msgid "" "A provisional API is one which has been deliberately excluded from the " "standard library's backwards compatibility guarantees. While major changes " @@ -2774,7 +2790,7 @@ msgstr "" "該介面)。這種變更並不會無端地產生——只有 API 被納入之前未察覺的嚴重基本缺陷被" "揭露時,它們才會發生。" -#: ../../glossary.rst:1260 +#: ../../glossary.rst:1267 msgid "" "Even for provisional APIs, backwards incompatible changes are seen as a " "\"solution of last resort\" - every attempt will still be made to find a " @@ -2783,7 +2799,7 @@ msgstr "" "即使對於暫行 API,向後不相容的變更也會被視為「最後的解決方案」——對於任何被發" "現的問題,仍然會盡可能找出一個向後相容的解決方案。" -#: ../../glossary.rst:1264 +#: ../../glossary.rst:1271 msgid "" "This process allows the standard library to continue to evolve over time, " "without locking in problematic design errors for extended periods of time. " @@ -2792,19 +2808,19 @@ msgstr "" "這個過程使得標準函式庫能隨著時間不斷進化,而避免耗費過長的時間去鎖定有問題的" "設計錯誤。請參閱 :pep:`411` 了解更多細節。" -#: ../../glossary.rst:1267 +#: ../../glossary.rst:1274 msgid "provisional package" msgstr "provisional package(暫行套件)" -#: ../../glossary.rst:1269 +#: ../../glossary.rst:1276 msgid "See :term:`provisional API`." msgstr "請參閱 :term:`provisional API`\\ (暫行 API)。" -#: ../../glossary.rst:1270 +#: ../../glossary.rst:1277 msgid "Python 3000" msgstr "Python 3000" -#: ../../glossary.rst:1272 +#: ../../glossary.rst:1279 msgid "" "Nickname for the Python 3.x release line (coined long ago when the release " "of version 3 was something in the distant future.) This is also abbreviated " @@ -2813,11 +2829,11 @@ msgstr "" "Python 3.x 系列版本的暱稱(很久以前創造的,當時第 3 版的發布是在遙遠的未" "來。)也可以縮寫為「Py3k」。" -#: ../../glossary.rst:1275 +#: ../../glossary.rst:1282 msgid "Pythonic" msgstr "Pythonic(Python 風格的)" -#: ../../glossary.rst:1277 +#: ../../glossary.rst:1284 msgid "" "An idea or piece of code which closely follows the most common idioms of the " "Python language, rather than implementing code using concepts common to " @@ -2831,7 +2847,7 @@ msgstr "" "keyword:`for` 陳述式,對一個可疊代物件的所有元素進行迴圈。許多其他語言並沒有" "這種類型的架構,所以不熟悉 Python 的人有時會使用一個數值計數器來代替: ::" -#: ../../glossary.rst:1284 +#: ../../glossary.rst:1291 msgid "" "for i in range(len(food)):\n" " print(food[i])" @@ -2839,11 +2855,11 @@ msgstr "" "for i in range(len(food)):\n" " print(food[i])" -#: ../../glossary.rst:1287 +#: ../../glossary.rst:1294 msgid "As opposed to the cleaner, Pythonic method::" msgstr "相較之下,以下方法更簡潔、更具有 Python 風格: ::" -#: ../../glossary.rst:1289 +#: ../../glossary.rst:1296 msgid "" "for piece in food:\n" " print(piece)" @@ -2851,11 +2867,11 @@ msgstr "" "for piece in food:\n" " print(piece)" -#: ../../glossary.rst:1291 +#: ../../glossary.rst:1298 msgid "qualified name" msgstr "qualified name(限定名稱)" -#: ../../glossary.rst:1293 +#: ../../glossary.rst:1300 msgid "" "A dotted name showing the \"path\" from a module's global scope to a class, " "function or method defined in that module, as defined in :pep:`3155`. For " @@ -2866,7 +2882,7 @@ msgstr "" "或 method 的「路徑」,如 :pep:`3155` 中的定義。對於頂層的函式和 class 而言," "限定名稱與其物件名稱相同: ::" -#: ../../glossary.rst:1298 +#: ../../glossary.rst:1305 msgid "" ">>> class C:\n" "... class D:\n" @@ -2892,7 +2908,7 @@ msgstr "" ">>> C.D.meth.__qualname__\n" "'C.D.meth'" -#: ../../glossary.rst:1310 +#: ../../glossary.rst:1317 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " "dotted path to the module, including any parent packages, e.g. ``email.mime." @@ -2901,7 +2917,7 @@ msgstr "" "當用於引用模組時,*完全限定名稱 (fully qualified name)* 是表示該模組的完整點" "分隔路徑,包括任何的父套件,例如 ``email.mime.text``: ::" -#: ../../glossary.rst:1314 +#: ../../glossary.rst:1321 msgid "" ">>> import email.mime.text\n" ">>> email.mime.text.__name__\n" @@ -2911,11 +2927,11 @@ msgstr "" ">>> email.mime.text.__name__\n" "'email.mime.text'" -#: ../../glossary.rst:1317 +#: ../../glossary.rst:1324 msgid "race condition" msgstr "" -#: ../../glossary.rst:1319 +#: ../../glossary.rst:1326 msgid "" "A condition of a program where the its behavior depends on the relative " "timing or ordering of events, particularly in multi-threaded programs. Race " @@ -2927,11 +2943,11 @@ msgid "" "primitives ` helps prevent race conditions." msgstr "" -#: ../../glossary.rst:1329 +#: ../../glossary.rst:1336 msgid "reference count" msgstr "reference count(參照計數)" -#: ../../glossary.rst:1331 +#: ../../glossary.rst:1338 msgid "" "The number of references to an object. When the reference count of an " "object drops to zero, it is deallocated. Some objects are :term:`immortal` " @@ -2947,7 +2963,7 @@ msgstr "" "看不到,但它卻是 :term:`CPython` 實作的一個關鍵元素。程式設計師可以呼叫 :" "func:`~sys.getrefcount` 函式來回傳一個特定物件的參照計數。" -#: ../../glossary.rst:1340 +#: ../../glossary.rst:1347 msgid "" "In :term:`CPython`, reference counts are not considered to be stable or well-" "defined values; the number of references to an object, and how that number " @@ -2956,11 +2972,11 @@ msgstr "" "在 :term:`CPython` 中,參照計數不被視為穩定或明確定義的值;對物件的參照數量," "以及該數量如何受到 Python 程式碼的影響,在不同版本之間可能會有所不同。" -#: ../../glossary.rst:1344 +#: ../../glossary.rst:1351 msgid "regular package" msgstr "regular package(正規套件)" -#: ../../glossary.rst:1346 +#: ../../glossary.rst:1353 msgid "" "A traditional :term:`package`, such as a directory containing an ``__init__." "py`` file." @@ -2968,22 +2984,22 @@ msgstr "" "一個傳統的 :term:`package`\\ (套件),例如一個包含 ``__init__.py`` 檔案的目" "錄。" -#: ../../glossary.rst:1349 +#: ../../glossary.rst:1356 msgid "See also :term:`namespace package`." msgstr "另請參閱 :term:`namespace package`\\ (命名空間套件)。" -#: ../../glossary.rst:1350 +#: ../../glossary.rst:1357 msgid "reentrant" msgstr "" -#: ../../glossary.rst:1352 +#: ../../glossary.rst:1359 msgid "" "A property of a function or :term:`lock` that allows it to be called or " "acquired multiple times by the same thread without causing errors or a :term:" "`deadlock`." msgstr "" -#: ../../glossary.rst:1356 +#: ../../glossary.rst:1363 msgid "" "For functions, reentrancy means the function can be safely called again " "before a previous invocation has completed, which is important when " @@ -2992,7 +3008,7 @@ msgid "" "a multithreaded program." msgstr "" -#: ../../glossary.rst:1362 +#: ../../glossary.rst:1369 msgid "" "For locks, Python's :class:`threading.RLock` (reentrant lock) is reentrant, " "meaning a thread that already holds the lock can acquire it again without " @@ -3000,15 +3016,15 @@ msgid "" "attempting to acquire it twice from the same thread will cause a deadlock." msgstr "" -#: ../../glossary.rst:1368 +#: ../../glossary.rst:1375 msgid "See also :term:`lock` and :term:`deadlock`." msgstr "另請參閱 :term:`lock` 和 :term:`deadlock`。" -#: ../../glossary.rst:1369 +#: ../../glossary.rst:1376 msgid "REPL" msgstr "REPL" -#: ../../glossary.rst:1371 +#: ../../glossary.rst:1378 msgid "" "An acronym for the \"read–eval–print loop\", another name for the :term:" "`interactive` interpreter shell." @@ -3016,11 +3032,11 @@ msgstr "" "「read-eval-print 迴圈 (read–eval–print loop)」的縮寫,是\\ :term:`互動式 " "`\\ 直譯器 shell 的另一個名稱。" -#: ../../glossary.rst:1373 +#: ../../glossary.rst:1380 msgid "__slots__" msgstr "__slots__" -#: ../../glossary.rst:1375 +#: ../../glossary.rst:1382 msgid "" "A declaration inside a class that saves memory by pre-declaring space for " "instance attributes and eliminating instance dictionaries. Though popular, " @@ -3033,11 +3049,11 @@ msgstr "" "最好保留給那種在一個記憶體關鍵 (memory-critical) 的應用程式中存在大量實例的罕" "見情況。" -#: ../../glossary.rst:1380 +#: ../../glossary.rst:1387 msgid "sequence" msgstr "sequence(序列)" -#: ../../glossary.rst:1382 +#: ../../glossary.rst:1389 msgid "" "An :term:`iterable` which supports efficient element access using integer " "indices via the :meth:`~object.__getitem__` special method and defines a :" @@ -3056,7 +3072,7 @@ msgstr "" "為對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`hashable` 鍵," "而不是整數。" -#: ../../glossary.rst:1391 +#: ../../glossary.rst:1398 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " "richer interface that goes beyond just :meth:`~object.__getitem__` and :meth:" @@ -3073,11 +3089,11 @@ msgstr "" "別,可以使用 :func:`~abc.ABCMeta.register` 被明確地註冊。更多關於序列方法的文" "件,請見\\ :ref:`常見序列操作 `。" -#: ../../glossary.rst:1401 +#: ../../glossary.rst:1408 msgid "set comprehension" msgstr "set comprehension(集合綜合運算)" -#: ../../glossary.rst:1403 +#: ../../glossary.rst:1410 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a set with the results. ``results = {c for c in 'abracadabra' if c " @@ -3088,11 +3104,11 @@ msgstr "" "set 回傳。``results = {c for c in 'abracadabra' if c not in 'abc'}`` 會產生一" "個字串 set:``{'r', 'd'}``。請參閱\\ :ref:`comprehensions`。" -#: ../../glossary.rst:1407 +#: ../../glossary.rst:1414 msgid "single dispatch" msgstr "single dispatch(單一調度)" -#: ../../glossary.rst:1409 +#: ../../glossary.rst:1416 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." @@ -3100,11 +3116,11 @@ msgstr "" ":term:`generic function`\\ (泛型函式)調度的一種形式,在此,實作的選擇是基於" "單一引數的型別。" -#: ../../glossary.rst:1411 +#: ../../glossary.rst:1418 msgid "slice" msgstr "slice(切片)" -#: ../../glossary.rst:1413 +#: ../../glossary.rst:1420 msgid "" "An object usually containing a portion of a :term:`sequence`. A slice is " "created using the subscript notation, ``[]`` with colons between numbers " @@ -3116,11 +3132,11 @@ msgstr "" "之間使用冒號,例如 ``variable_name[1:3:5]``。在括號(下標)符號的內部,會使" "用 :class:`slice` 物件。" -#: ../../glossary.rst:1417 +#: ../../glossary.rst:1424 msgid "soft deprecated" msgstr "soft deprecated(軟性棄用)" -#: ../../glossary.rst:1419 +#: ../../glossary.rst:1426 msgid "" "A soft deprecated API should not be used in new code, but it is safe for " "already existing code to use it. The API remains documented and tested, but " @@ -3129,13 +3145,13 @@ msgstr "" "被軟性棄用的 API 代表不應再用於新程式碼中,但在現有程式碼中繼續使用它仍會是安" "全的。API 仍會以文件記錄並會被測試,但不會被繼續改進。" -#: ../../glossary.rst:1423 +#: ../../glossary.rst:1430 msgid "" "Soft deprecation, unlike normal deprecation, does not plan on removing the " "API and will not emit warnings." msgstr "與正常棄用不同,軟性棄用沒有刪除 API 的規劃,也不會發出警告。" -#: ../../glossary.rst:1426 +#: ../../glossary.rst:1433 msgid "" "See `PEP 387: Soft Deprecation `_." @@ -3143,11 +3159,11 @@ msgstr "" "請參閱 `PEP 387:軟性棄用 `_。" -#: ../../glossary.rst:1428 +#: ../../glossary.rst:1435 msgid "special method" msgstr "special method(特殊方法)" -#: ../../glossary.rst:1432 +#: ../../glossary.rst:1439 msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " @@ -3158,11 +3174,11 @@ msgstr "" "種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在\\ :ref:" "`specialnames`\\ 中有詳細說明。" -#: ../../glossary.rst:1436 +#: ../../glossary.rst:1443 msgid "standard library" msgstr "標準函式庫" -#: ../../glossary.rst:1438 +#: ../../glossary.rst:1445 msgid "" "The collection of :term:`packages `, :term:`modules ` and :" "term:`extension modules ` distributed as a part of the " @@ -3175,7 +3191,7 @@ msgstr "" "行。該集合的成員可能會因平台、可用的系統函式庫或其他條件而有所不同。相關文件" "可以在 :ref:`library-index` 中找到。" -#: ../../glossary.rst:1444 +#: ../../glossary.rst:1451 msgid "" "See also :data:`sys.stdlib_module_names` for a list of all possible standard " "library module names." @@ -3183,11 +3199,11 @@ msgstr "" "請參閱 :data:`sys.stdlib_module_names` 以取得所有可能的標準函式庫模組名稱的列" "表。" -#: ../../glossary.rst:1446 +#: ../../glossary.rst:1453 msgid "statement" msgstr "statement(陳述式)" -#: ../../glossary.rst:1448 +#: ../../glossary.rst:1455 msgid "" "A statement is part of a suite (a \"block\" of code). A statement is either " "an :term:`expression` or one of several constructs with a keyword, such as :" @@ -3197,11 +3213,11 @@ msgstr "" "term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`、:keyword:" "`while` 或 :keyword:`for`\\ )的多種結構之一。" -#: ../../glossary.rst:1451 +#: ../../glossary.rst:1458 msgid "static type checker" msgstr "static type checker(靜態型別檢查器)" -#: ../../glossary.rst:1453 +#: ../../glossary.rst:1460 msgid "" "An external tool that reads Python code and analyzes it, looking for issues " "such as incorrect types. See also :term:`type hints ` and the :" @@ -3211,19 +3227,19 @@ msgstr "" "另請參閱\\ :term:`型別提示 (type hints) ` 以及 :mod:`typing` 模" "組。" -#: ../../glossary.rst:1456 +#: ../../glossary.rst:1463 msgid "stdlib" msgstr "stdlib(標準函式庫)" -#: ../../glossary.rst:1458 +#: ../../glossary.rst:1465 msgid "An abbreviation of :term:`standard library`." msgstr ":term:`standard library` 的縮寫。" -#: ../../glossary.rst:1459 +#: ../../glossary.rst:1466 msgid "strong reference" msgstr "strong reference(強參照)" -#: ../../glossary.rst:1461 +#: ../../glossary.rst:1468 msgid "" "In Python's C API, a strong reference is a reference to an object which is " "owned by the code holding the reference. The strong reference is taken by " @@ -3234,7 +3250,7 @@ msgstr "" "有。建立參照時透過呼叫 :c:func:`Py_INCREF` 來獲得強參照、刪除參照時透過 :c:" "func:`Py_DECREF` 釋放強參照。" -#: ../../glossary.rst:1467 +#: ../../glossary.rst:1474 msgid "" "The :c:func:`Py_NewRef` function can be used to create a strong reference to " "an object. Usually, the :c:func:`Py_DECREF` function must be called on the " @@ -3244,15 +3260,15 @@ msgstr "" ":c:func:`Py_NewRef` 函式可用於建立一個對物件的強參照。通常,在退出強參照的作" "用域之前,必須在該強參照上呼叫 :c:func:`Py_DECREF` 函式,以避免洩漏一個參照。" -#: ../../glossary.rst:1472 +#: ../../glossary.rst:1479 msgid "See also :term:`borrowed reference`." msgstr "另請參閱 :term:`borrowed reference`\\ (借用參照)。" -#: ../../glossary.rst:1473 +#: ../../glossary.rst:1480 msgid "synchronization primitive" msgstr "" -#: ../../glossary.rst:1475 +#: ../../glossary.rst:1482 msgid "" "A basic building block for coordinating (synchronizing) the execution of " "multiple threads to ensure :term:`thread-safe` access to shared resources. " @@ -3266,15 +3282,15 @@ msgid "" "term:`lock`." msgstr "" -#: ../../glossary.rst:1485 +#: ../../glossary.rst:1492 msgid "t-string" msgstr "t-string(t 字串)" -#: ../../glossary.rst:1486 +#: ../../glossary.rst:1493 msgid "t-strings" msgstr "t-strings(t 字串)" -#: ../../glossary.rst:1488 +#: ../../glossary.rst:1495 msgid "" "String literals prefixed with ``t`` or ``T`` are commonly called \"t-" "strings\" which is short for :ref:`template string literals `." @@ -3282,11 +3298,11 @@ msgstr "" "以 ``t`` 或 ``T`` 為前綴的字串文本通常被稱為「t 字串」,它是\\ :ref:`模板化的" "字串文本 `\\ 的縮寫。" -#: ../../glossary.rst:1491 +#: ../../glossary.rst:1498 msgid "text encoding" msgstr "text encoding(文字編碼)" -#: ../../glossary.rst:1493 +#: ../../glossary.rst:1500 msgid "" "A string in Python is a sequence of Unicode code points (in range " "``U+0000``--``U+10FFFF``). To store or transfer a string, it needs to be " @@ -3296,7 +3312,7 @@ msgstr "" "``U+0000`` -- ``U+10FFFF`` 之間)。若要儲存或傳送一個字串,它必須被序列化為一" "個位元組序列。" -#: ../../glossary.rst:1497 +#: ../../glossary.rst:1504 msgid "" "Serializing a string into a sequence of bytes is known as \"encoding\", and " "recreating the string from the sequence of bytes is known as \"decoding\"." @@ -3304,7 +3320,7 @@ msgstr "" "將一個字串序列化為位元組序列,稱為「編碼」,而從位元組序列重新建立該字串則稱" "為「解碼 (decoding)」。" -#: ../../glossary.rst:1500 +#: ../../glossary.rst:1507 msgid "" "There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." @@ -3312,11 +3328,11 @@ msgstr "" "有多種不同的文字序列化編解碼器 (:ref:`codecs `),它們被統" "稱為「文字編碼」。" -#: ../../glossary.rst:1503 +#: ../../glossary.rst:1510 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1505 +#: ../../glossary.rst:1512 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " "text file actually accesses a byte-oriented datastream and handles the :term:" @@ -3330,7 +3346,7 @@ msgstr "" "有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、:data:`sys.stdin`、:data:" "`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1512 +#: ../../glossary.rst:1519 msgid "" "See also :term:`binary file` for a file object able to read and write :term:" "`bytes-like objects `." @@ -3338,32 +3354,32 @@ msgstr "" "另請參閱 :term:`binary file`\\ (二進位檔案),它是一個能夠讀取和寫入\\ :" "term:`類位元組串物件 (bytes-like object) ` 的檔案物件。" -#: ../../glossary.rst:1514 +#: ../../glossary.rst:1521 msgid "thread state" msgstr "" -#: ../../glossary.rst:1517 +#: ../../glossary.rst:1524 msgid "" "The information used by the :term:`CPython` runtime to run in an OS thread. " "For example, this includes the current exception, if any, and the state of " "the bytecode interpreter." msgstr "" -#: ../../glossary.rst:1521 +#: ../../glossary.rst:1528 msgid "" "Each thread state is bound to a single OS thread, but threads may have many " "thread states available. At most, one of them may be :term:`attached " "` at once." msgstr "" -#: ../../glossary.rst:1525 +#: ../../glossary.rst:1532 msgid "" "An :term:`attached thread state` is required to call most of Python's C API, " "unless a function explicitly documents otherwise. The bytecode interpreter " "only runs under an attached thread state." msgstr "" -#: ../../glossary.rst:1529 +#: ../../glossary.rst:1536 msgid "" "Each thread state belongs to a single interpreter, but each interpreter may " "have many thread states, including multiple for the same OS thread. Thread " @@ -3372,17 +3388,17 @@ msgid "" "given moment." msgstr "" -#: ../../glossary.rst:1535 +#: ../../glossary.rst:1542 msgid "" "See :ref:`Thread State and the Global Interpreter Lock ` for more " "information." msgstr "" -#: ../../glossary.rst:1537 +#: ../../glossary.rst:1544 msgid "thread-safe" msgstr "" -#: ../../glossary.rst:1539 +#: ../../glossary.rst:1546 msgid "" "A module, function, or class that behaves correctly when used by multiple " "threads concurrently. Thread-safe code uses appropriate :term:" @@ -3396,11 +3412,11 @@ msgid "" "` when used in multi-threaded programs." msgstr "" -#: ../../glossary.rst:1550 +#: ../../glossary.rst:1557 msgid "token" msgstr "token" -#: ../../glossary.rst:1553 +#: ../../glossary.rst:1560 msgid "" "A small unit of source code, generated by the :ref:`lexical analyzer " "` (also called the *tokenizer*). Names, numbers, strings, " @@ -3409,7 +3425,7 @@ msgstr "" "原始碼的小單位,由 :ref:`詞法分析器 ` (也稱為 *tokenizer*)產生。名" "稱、數字、字串、運算子、換行符號等都以 token 表示。" -#: ../../glossary.rst:1558 +#: ../../glossary.rst:1565 msgid "" "The :mod:`tokenize` module exposes Python's lexical analyzer. The :mod:" "`token` module contains information on the various types of tokens." @@ -3417,11 +3433,11 @@ msgstr "" ":mod:`tokenize` 模組公開了 Python 的詞法分析器。:mod:`token` 模組包含各種 " "token 類型的資訊。" -#: ../../glossary.rst:1561 +#: ../../glossary.rst:1568 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1563 +#: ../../glossary.rst:1570 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -3436,11 +3452,11 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1570 +#: ../../glossary.rst:1577 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1572 +#: ../../glossary.rst:1579 msgid "" "The type of a Python object determines what kind of object it is; every " "object has a type. An object's type is accessible as its :attr:`~object." @@ -3450,22 +3466,22 @@ msgstr "" "件的型別可以用它的 :attr:`~object.__class__` 屬性來存取,或以 ``type(obj)`` " "來檢索。" -#: ../../glossary.rst:1576 +#: ../../glossary.rst:1583 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1578 +#: ../../glossary.rst:1585 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1580 +#: ../../glossary.rst:1587 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" msgstr "" "型別別名對於簡化\\ :term:`型別提示 (type hint) ` 很有用。例如: ::" -#: ../../glossary.rst:1583 +#: ../../glossary.rst:1590 msgid "" "def remove_gray_shades(\n" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" @@ -3475,11 +3491,11 @@ msgstr "" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" " pass" -#: ../../glossary.rst:1587 +#: ../../glossary.rst:1594 msgid "could be made more readable like this::" msgstr "可以寫成這樣,更具有可讀性: ::" -#: ../../glossary.rst:1589 +#: ../../glossary.rst:1596 msgid "" "Color = tuple[int, int, int]\n" "\n" @@ -3491,15 +3507,15 @@ msgstr "" "def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" " pass" -#: ../../glossary.rst:1594 ../../glossary.rst:1608 +#: ../../glossary.rst:1601 ../../glossary.rst:1615 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "請參閱 :mod:`typing` 和 :pep:`484`,有此功能的描述。" -#: ../../glossary.rst:1595 +#: ../../glossary.rst:1602 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1597 +#: ../../glossary.rst:1604 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -3507,7 +3523,7 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1600 +#: ../../glossary.rst:1607 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to :term:`static type checkers `. They can also aid " @@ -3517,7 +3533,7 @@ msgstr "" "(static type checkers) `\\ 很有用,並能協助 IDE 完成程式" "碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1604 +#: ../../glossary.rst:1611 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." @@ -3525,11 +3541,11 @@ msgstr "" "全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" "`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1609 +#: ../../glossary.rst:1616 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1611 +#: ../../glossary.rst:1618 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " @@ -3542,20 +3558,20 @@ msgstr "" "``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`,以及用於 :func:`bytes." "splitlines` 的附加用途。" -#: ../../glossary.rst:1616 +#: ../../glossary.rst:1623 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1618 +#: ../../glossary.rst:1625 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1620 +#: ../../glossary.rst:1627 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "註釋變數或 class 屬性時,賦值是選擇性的: ::" -#: ../../glossary.rst:1622 +#: ../../glossary.rst:1629 msgid "" "class C:\n" " field: 'annotation'" @@ -3563,7 +3579,7 @@ msgstr "" "class C:\n" " field: 'annotation'" -#: ../../glossary.rst:1625 +#: ../../glossary.rst:1632 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" @@ -3571,15 +3587,15 @@ msgstr "" "變數註釋通常用於\\ :term:`型別提示 (type hint) `:例如,這個變數預" "期會取得 :class:`int`\\ (整數)值: ::" -#: ../../glossary.rst:1629 +#: ../../glossary.rst:1636 msgid "count: int = 0" msgstr "count: int = 0" -#: ../../glossary.rst:1631 +#: ../../glossary.rst:1638 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1633 +#: ../../glossary.rst:1640 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " @@ -3588,11 +3604,11 @@ msgstr "" "請參閱 :term:`function annotation`\\ (函式註釋)、:pep:`484` 和 :pep:`526`," "皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:1637 +#: ../../glossary.rst:1644 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1639 +#: ../../glossary.rst:1646 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -3603,15 +3619,15 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1644 +#: ../../glossary.rst:1651 msgid "See also :mod:`venv`." msgstr "另請參閱 :mod:`venv`。" -#: ../../glossary.rst:1645 +#: ../../glossary.rst:1652 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1647 +#: ../../glossary.rst:1654 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." @@ -3619,22 +3635,22 @@ msgstr "" "一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" "`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1649 +#: ../../glossary.rst:1656 msgid "walrus operator" msgstr "walrus operator(海象運算子)" -#: ../../glossary.rst:1651 +#: ../../glossary.rst:1658 msgid "" "A light-hearted way to refer to the :ref:`assignment expression ` operator ``:=`` because it looks a bit like a walrus if you " "turn your head." msgstr "" -#: ../../glossary.rst:1654 +#: ../../glossary.rst:1661 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1656 +#: ../../glossary.rst:1663 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " @@ -3659,11 +3675,11 @@ msgstr "C-contiguous(C 連續的)" msgid "Fortran contiguous" msgstr "Fortran contiguous(Fortran 連續的)" -#: ../../glossary.rst:955 +#: ../../glossary.rst:962 msgid "magic" msgstr "magic" -#: ../../glossary.rst:1430 +#: ../../glossary.rst:1437 msgid "special" msgstr "special" diff --git a/library/ctypes.po b/library/ctypes.po index 85c879ff7b..a6cf4970b2 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-17 00:14+0000\n" +"POT-Creation-Date: 2026-02-03 00:20+0000\n" "PO-Revision-Date: 2023-04-26 02:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1803,9 +1803,9 @@ msgstr "" #: ../../library/ctypes.rst:899 msgid "" -"From Python 3.13 onward, the :term:`GIL` can be disabled on :term:`free " -"threaded ` builds. In ctypes, reads and writes to a single " -"object concurrently is safe, but not across multiple objects:" +"From Python 3.13 onward, the :term:`GIL` can be disabled on the :term:`free-" +"threaded build`. In ctypes, reads and writes to a single object concurrently " +"is safe, but not across multiple objects:" msgstr "" #: ../../library/ctypes.rst:902 diff --git a/library/site.po b/library/site.po index 4ab35b39ea..d9e0fa07b2 100644 --- a/library/site.po +++ b/library/site.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-18 00:15+0000\n" +"POT-Creation-Date: 2026-02-03 00:20+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -56,7 +56,7 @@ msgid "" "empty heads are skipped. For the tail part, it uses the empty string and " "then :file:`lib/site-packages` (on Windows) or :file:`lib/python{X.Y[t]}/" "site-packages` (on Unix and macOS). (The optional suffix \"t\" indicates " -"the :term:`free threading` build, and is appended if ``\"t\"`` is present in " +"the :term:`free-threaded build`, and is appended if ``\"t\"`` is present in " "the :data:`sys.abiflags` constant.) For each of the distinct head-tail " "combinations, it sees if it refers to an existing directory, and if so, adds " "it to ``sys.path`` and also inspects the newly added path for configuration " diff --git a/using/configure.po b/using/configure.po index a31ca6249d..5e4ebea1e8 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-01-22 16:55+0000\n" +"POT-Creation-Date: 2026-02-03 00:20+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-" @@ -769,7 +769,7 @@ msgstr "" #: ../../using/configure.rst:396 msgid "" "Enables support for running Python without the :term:`global interpreter " -"lock` (GIL): free threading build." +"lock` (GIL): :term:`free-threaded build`." msgstr "" #: ../../using/configure.rst:399 From b6c43c2e098f33eee2c32fb0c6d8f72a1f5d457f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 4 Feb 2026 00:18:32 +0000 Subject: [PATCH 07/11] sync with cpython 360214e2 --- howto/logging-cookbook.po | 426 ++++---- library/os.path.po | 230 ++--- library/stdtypes.po | 1997 +++++++++++++++++++------------------ 3 files changed, 1338 insertions(+), 1315 deletions(-) diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index e0640a56fc..286da5aa6f 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -6,7 +6,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-02-04 00:17+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -67,8 +67,8 @@ msgid "" "ch = logging.StreamHandler()\n" "ch.setLevel(logging.ERROR)\n" "# create formatter and add it to the handlers\n" -"formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %" -"(message)s')\n" +"formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - " +"%(message)s')\n" "fh.setFormatter(formatter)\n" "ch.setFormatter(formatter)\n" "# add the handlers to the logger\n" @@ -99,8 +99,8 @@ msgid "" "\n" "class Auxiliary:\n" " def __init__(self):\n" -" self.logger = " -"logging.getLogger('spam_application.auxiliary.Auxiliary')\n" +" self.logger = logging.getLogger('spam_application.auxiliary." +"Auxiliary')\n" " self.logger.info('creating an instance of Auxiliary')\n" "\n" " def do_something(self):\n" @@ -162,8 +162,8 @@ msgid "" " time.sleep(0.5)\n" "\n" "def main():\n" -" logging.basicConfig(level=logging.DEBUG, format='%(relativeCreated)6d %" -"(threadName)s %(message)s')\n" +" logging.basicConfig(level=logging.DEBUG, format='%(relativeCreated)6d " +"%(threadName)s %(message)s')\n" " info = {'stop': False}\n" " thread = threading.Thread(target=worker, args=(info,))\n" " thread.start()\n" @@ -240,8 +240,8 @@ msgid "" "ch = logging.StreamHandler()\n" "ch.setLevel(logging.ERROR)\n" "# create formatter and add it to the handlers\n" -"formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %" -"(message)s')\n" +"formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - " +"%(message)s')\n" "ch.setFormatter(formatter)\n" "fh.setFormatter(formatter)\n" "# add the handlers to logger\n" @@ -294,8 +294,8 @@ msgid "" "\n" "# set up logging to file - see previous section for more details\n" "logging.basicConfig(level=logging.DEBUG,\n" -" format='%(asctime)s %(name)-12s %(levelname)-8s %" -"(message)s',\n" +" format='%(asctime)s %(name)-12s %(levelname)-8s " +"%(message)s',\n" " datefmt='%m-%d %H:%M',\n" " filename='/tmp/myapp.log',\n" " filemode='w')\n" @@ -307,7 +307,7 @@ msgid "" "# tell the handler to use this format\n" "console.setFormatter(formatter)\n" "# add the handler to the root logger\n" -"logging.getLogger('').addHandler(console)\n" +"logging.getLogger().addHandler(console)\n" "\n" "# Now, we can log to the root logger, or any other logger. First the " "root...\n" @@ -510,9 +510,9 @@ msgid "" "a function which only returns ``True`` if the level of the passed in record " "is at or below the specified level. Note that in this example I have defined " "the ``filter_maker`` in a test script ``main.py`` that I run from the " -"command line, so its module will be ``__main__`` - hence the " -"``__main__.filter_maker`` in the filter configuration. You will need to " -"change that if you define it in a different module." +"command line, so its module will be ``__main__`` - hence the ``__main__." +"filter_maker`` in the filter configuration. You will need to change that if " +"you define it in a different module." msgstr "" #: ../../howto/logging-cookbook.rst:387 @@ -719,13 +719,13 @@ msgstr "" #: ../../howto/logging-cookbook.rst:555 msgid "" -"A common culprit which demonstrates sluggish behaviour is " -"the :class:`SMTPHandler`: sending emails can take a long time, for a number " -"of reasons outside the developer's control (for example, a poorly performing " -"mail or network infrastructure). But almost any network-based handler can " -"block: Even a :class:`SocketHandler` operation may do a DNS query under the " -"hood which is too slow (and this query can be deep in the socket library " -"code, below the Python layer, and outside your control)." +"A common culprit which demonstrates sluggish behaviour is the :class:" +"`SMTPHandler`: sending emails can take a long time, for a number of reasons " +"outside the developer's control (for example, a poorly performing mail or " +"network infrastructure). But almost any network-based handler can block: " +"Even a :class:`SocketHandler` operation may do a DNS query under the hood " +"which is too slow (and this query can be deep in the socket library code, " +"below the Python layer, and outside your control)." msgstr "" #: ../../howto/logging-cookbook.rst:563 @@ -745,12 +745,12 @@ msgstr "" #: ../../howto/logging-cookbook.rst:574 msgid "" "The second part of the solution is :class:`QueueListener`, which has been " -"designed as the counterpart to :class:`QueueHandler`. " -"A :class:`QueueListener` is very simple: it's passed a queue and some " -"handlers, and it fires up an internal thread which listens to its queue for " -"LogRecords sent from ``QueueHandlers`` (or any other source of " -"``LogRecords``, for that matter). The ``LogRecords`` are removed from the " -"queue and passed to the handlers for processing." +"designed as the counterpart to :class:`QueueHandler`. A :class:" +"`QueueListener` is very simple: it's passed a queue and some handlers, and " +"it fires up an internal thread which listens to its queue for LogRecords " +"sent from ``QueueHandlers`` (or any other source of ``LogRecords``, for that " +"matter). The ``LogRecords`` are removed from the queue and passed to the " +"handlers for processing." msgstr "" #: ../../howto/logging-cookbook.rst:582 @@ -798,10 +798,10 @@ msgid "" "Although the earlier discussion wasn't specifically talking about async " "code, but rather about slow logging handlers, it should be noted that when " "logging from async code, network and even file handlers could lead to " -"problems (blocking the event loop) because some logging is done " -"from :mod:`asyncio` internals. It might be best, if any async code is used " -"in an application, to use the above approach for logging, so that any " -"blocking code runs only in the ``QueueListener`` thread." +"problems (blocking the event loop) because some logging is done from :mod:" +"`asyncio` internals. It might be best, if any async code is used in an " +"application, to use the above approach for logging, so that any blocking " +"code runs only in the ``QueueListener`` thread." msgstr "" #: ../../howto/logging-cookbook.rst:619 @@ -818,8 +818,8 @@ msgstr "" #: ../../howto/logging-cookbook.rst:629 msgid "" -"The :class:`QueueListener` can be started (and stopped) via " -"the :keyword:`with` statement. For example:" +"The :class:`QueueListener` can be started (and stopped) via the :keyword:" +"`with` statement. For example:" msgstr "" #: ../../howto/logging-cookbook.rst:633 @@ -839,15 +839,15 @@ msgstr "" #: ../../howto/logging-cookbook.rst:647 msgid "" "Let's say you want to send logging events across a network, and handle them " -"at the receiving end. A simple way of doing this is attaching " -"a :class:`SocketHandler` instance to the root logger at the sending end::" +"at the receiving end. A simple way of doing this is attaching a :class:" +"`SocketHandler` instance to the root logger at the sending end::" msgstr "" #: ../../howto/logging-cookbook.rst:651 msgid "" "import logging, logging.handlers\n" "\n" -"rootLogger = logging.getLogger('')\n" +"rootLogger = logging.getLogger()\n" "rootLogger.setLevel(logging.DEBUG)\n" "socketHandler = logging.handlers.SocketHandler('localhost',\n" " logging.handlers.DEFAULT_TCP_LOGGING_PORT)\n" @@ -873,8 +873,8 @@ msgstr "" #: ../../howto/logging-cookbook.rst:675 msgid "" -"At the receiving end, you can set up a receiver using " -"the :mod:`socketserver` module. Here is a basic working example::" +"At the receiving end, you can set up a receiver using the :mod:" +"`socketserver` module. Here is a basic working example::" msgstr "" #: ../../howto/logging-cookbook.rst:678 @@ -958,8 +958,8 @@ msgid "" "\n" "def main():\n" " logging.basicConfig(\n" -" format='%(relativeCreated)5d %(name)-15s %(levelname)-8s %" -"(message)s')\n" +" format='%(relativeCreated)5d %(name)-15s %(levelname)-8s " +"%(message)s')\n" " tcpserver = LogRecordSocketReceiver()\n" " print('About to start TCP server...')\n" " tcpserver.serve_until_stopped()\n" @@ -1092,8 +1092,8 @@ msgstr "" #: ../../howto/logging-cookbook.rst:824 msgid "" -"Download `the Gist `__ as a ZIP archive using " -"the :guilabel:`Download ZIP` button." +"Download `the Gist `__ as a ZIP archive using the :" +"guilabel:`Download ZIP` button." msgstr "" #: ../../howto/logging-cookbook.rst:827 @@ -1177,8 +1177,8 @@ msgid "" "is not a good idea because these instances are not garbage collected. While " "this is not a problem in practice, when the number of :class:`Logger` " "instances is dependent on the level of granularity you want to use in " -"logging an application, it could be hard to manage if the number " -"of :class:`Logger` instances becomes effectively unbounded." +"logging an application, it could be hard to manage if the number of :class:" +"`Logger` instances becomes effectively unbounded." msgstr "" #: ../../howto/logging-cookbook.rst:886 @@ -1189,22 +1189,22 @@ msgstr "" msgid "" "An easy way in which you can pass contextual information to be output along " "with logging event information is to use the :class:`LoggerAdapter` class. " -"This class is designed to look like a :class:`Logger`, so that you can " -"call :meth:`debug`, :meth:`info`, :meth:`warning`, :meth:`error`, :meth:`exception`, :meth:`critical` " -"and :meth:`log`. These methods have the same signatures as their " -"counterparts in :class:`Logger`, so you can use the two types of instances " -"interchangeably." +"This class is designed to look like a :class:`Logger`, so that you can call :" +"meth:`debug`, :meth:`info`, :meth:`warning`, :meth:`error`, :meth:" +"`exception`, :meth:`critical` and :meth:`log`. These methods have the same " +"signatures as their counterparts in :class:`Logger`, so you can use the two " +"types of instances interchangeably." msgstr "" #: ../../howto/logging-cookbook.rst:896 msgid "" -"When you create an instance of :class:`LoggerAdapter`, you pass it " -"a :class:`Logger` instance and a dict-like object which contains your " -"contextual information. When you call one of the logging methods on an " -"instance of :class:`LoggerAdapter`, it delegates the call to the underlying " -"instance of :class:`Logger` passed to its constructor, and arranges to pass " -"the contextual information in the delegated call. Here's a snippet from the " -"code of :class:`LoggerAdapter`::" +"When you create an instance of :class:`LoggerAdapter`, you pass it a :class:" +"`Logger` instance and a dict-like object which contains your contextual " +"information. When you call one of the logging methods on an instance of :" +"class:`LoggerAdapter`, it delegates the call to the underlying instance of :" +"class:`Logger` passed to its constructor, and arranges to pass the " +"contextual information in the delegated call. Here's a snippet from the code " +"of :class:`LoggerAdapter`::" msgstr "" #: ../../howto/logging-cookbook.rst:904 @@ -1238,9 +1238,8 @@ msgid "" "use customized strings with your :class:`Formatter` instances which know " "about the keys of the dict-like object. If you need a different method, e.g. " "if you want to prepend or append the contextual information to the message " -"string, you just need to subclass :class:`LoggerAdapter` and " -"override :meth:`~LoggerAdapter.process` to do what you need. Here is a " -"simple example::" +"string, you just need to subclass :class:`LoggerAdapter` and override :meth:" +"`~LoggerAdapter.process` to do what you need. Here is a simple example::" msgstr "" #: ../../howto/logging-cookbook.rst:929 @@ -1289,23 +1288,23 @@ msgstr "" #: ../../howto/logging-cookbook.rst:959 msgid "" -"You can also add contextual information to log output using a user-" -"defined :class:`Filter`. ``Filter`` instances are allowed to modify the " +"You can also add contextual information to log output using a user-defined :" +"class:`Filter`. ``Filter`` instances are allowed to modify the " "``LogRecords`` passed to them, including adding additional attributes which " -"can then be output using a suitable format string, or if needed a " -"custom :class:`Formatter`." +"can then be output using a suitable format string, or if needed a custom :" +"class:`Formatter`." msgstr "" #: ../../howto/logging-cookbook.rst:964 msgid "" "For example in a web application, the request being processed (or at least, " -"the interesting parts of it) can be stored in a threadlocal " -"(:class:`threading.local`) variable, and then accessed from a ``Filter`` to " -"add, say, information from the request - say, the remote IP address and " -"remote user's username - to the ``LogRecord``, using the attribute names " -"'ip' and 'user' as in the ``LoggerAdapter`` example above. In that case, the " -"same format string can be used to get similar output to that shown above. " -"Here's an example script::" +"the interesting parts of it) can be stored in a threadlocal (:class:" +"`threading.local`) variable, and then accessed from a ``Filter`` to add, " +"say, information from the request - say, the remote IP address and remote " +"user's username - to the ``LogRecord``, using the attribute names 'ip' and " +"'user' as in the ``LoggerAdapter`` example above. In that case, the same " +"format string can be used to get similar output to that shown above. Here's " +"an example script::" msgstr "" #: ../../howto/logging-cookbook.rst:973 @@ -1462,8 +1461,8 @@ msgid "" "\n" "# A dummy set of requests which will be used in the simulation - we'll just " "pick\n" -"# from this list randomly. Note that all GET requests are from " -"192.168.2.XXX\n" +"# from this list randomly. Note that all GET requests are from 192.168.2." +"XXX\n" "# addresses, whereas POST requests are from 192.16.3.XXX addresses. Three " "users\n" "# are represented in the sample requests.\n" @@ -1481,8 +1480,8 @@ msgid "" "information\n" "# such as HTTP method, client IP and username\n" "\n" -"formatter = logging.Formatter('%(threadName)-11s %(appName)s %(name)-9s %" -"(user)-6s %(ip)s %(method)-4s %(message)s')\n" +"formatter = logging.Formatter('%(threadName)-11s %(appName)s %(name)-9s " +"%(user)-6s %(ip)s %(method)-4s %(message)s')\n" "\n" "# Create our context variables. These will be filled at the start of " "request\n" @@ -1721,19 +1720,18 @@ msgid "" "this is to have all the processes log to a :class:`~handlers.SocketHandler`, " "and have a separate process which implements a socket server which reads " "from the socket and logs to file. (If you prefer, you can dedicate one " -"thread in one of the existing processes to perform this " -"function.) :ref:`This section ` documents this approach in " -"more detail and includes a working socket receiver which can be used as a " -"starting point for you to adapt in your own applications." +"thread in one of the existing processes to perform this function.) :ref:" +"`This section ` documents this approach in more detail and " +"includes a working socket receiver which can be used as a starting point for " +"you to adapt in your own applications." msgstr "" #: ../../howto/logging-cookbook.rst:1294 msgid "" -"You could also write your own handler which uses " -"the :class:`~multiprocessing.Lock` class from the :mod:`multiprocessing` " -"module to serialize access to the file from your processes. The " -"stdlib :class:`FileHandler` and subclasses do not make use " -"of :mod:`multiprocessing`." +"You could also write your own handler which uses the :class:" +"`~multiprocessing.Lock` class from the :mod:`multiprocessing` module to " +"serialize access to the file from your processes. The stdlib :class:" +"`FileHandler` and subclasses do not make use of :mod:`multiprocessing`." msgstr "" #: ../../howto/logging-cookbook.rst:1301 @@ -1784,8 +1782,8 @@ msgid "" "def listener_configurer():\n" " root = logging.getLogger()\n" " h = logging.handlers.RotatingFileHandler('mptest.log', 'a', 300, 10)\n" -" f = logging.Formatter('%(asctime)s %(processName)-10s %(name)s %" -"(levelname)-8s %(message)s')\n" +" f = logging.Formatter('%(asctime)s %(processName)-10s %(name)s " +"%(levelname)-8s %(message)s')\n" " h.setFormatter(f)\n" " root.addHandler(h)\n" "\n" @@ -1917,8 +1915,8 @@ msgid "" " 'formatters': {\n" " 'detailed': {\n" " 'class': 'logging.Formatter',\n" -" 'format': '%(asctime)s %(name)-15s %(levelname)-8s %" -"(processName)-10s %(message)s'\n" +" 'format': '%(asctime)s %(name)-15s %(levelname)-8s " +"%(processName)-10s %(message)s'\n" " }\n" " },\n" " 'handlers': {\n" @@ -2132,9 +2130,9 @@ msgstr "" msgid "" "When logging was added to the Python standard library, the only way of " "formatting messages with variable content was to use the %-formatting " -"method. Since then, Python has gained two new formatting " -"approaches: :class:`string.Template` (added in Python 2.4) " -"and :meth:`str.format` (added in Python 2.6)." +"method. Since then, Python has gained two new formatting approaches: :class:" +"`string.Template` (added in Python 2.4) and :meth:`str.format` (added in " +"Python 2.6)." msgstr "" #: ../../howto/logging-cookbook.rst:1635 @@ -2145,9 +2143,9 @@ msgid "" "``'%'``, but other possible values are ``'{'`` and ``'$'``, which correspond " "to the other two formatting styles. Backwards compatibility is maintained by " "default (as you would expect), but by explicitly specifying a style " -"parameter, you get the ability to specify format strings which work " -"with :meth:`str.format` or :class:`string.Template`. Here's an example " -"console session to show the possibilities:" +"parameter, you get the ability to specify format strings which work with :" +"meth:`str.format` or :class:`string.Template`. Here's an example console " +"session to show the possibilities:" msgstr "" #: ../../howto/logging-cookbook.rst:1645 @@ -2221,12 +2219,12 @@ msgid "" "logging call (e.g. the ``exc_info`` keyword parameter to indicate that " "traceback information should be logged, or the ``extra`` keyword parameter " "to indicate additional contextual information to be added to the log). So " -"you cannot directly make logging calls using :meth:`str.format` " -"or :class:`string.Template` syntax, because internally the logging package " -"uses %-formatting to merge the format string and the variable arguments. " -"There would be no changing this while preserving backward compatibility, " -"since all logging calls which are out there in existing code will be using %-" -"format strings." +"you cannot directly make logging calls using :meth:`str.format` or :class:" +"`string.Template` syntax, because internally the logging package uses %-" +"formatting to merge the format string and the variable arguments. There " +"would be no changing this while preserving backward compatibility, since all " +"logging calls which are out there in existing code will be using %-format " +"strings." msgstr "" #: ../../howto/logging-cookbook.rst:1690 @@ -2394,10 +2392,10 @@ msgstr "" #: ../../howto/logging-cookbook.rst:1796 msgid "" "Every logging event is represented by a :class:`LogRecord` instance. When an " -"event is logged and not filtered out by a logger's level, " -"a :class:`LogRecord` is created, populated with information about the event " -"and then passed to the handlers for that logger (and its ancestors, up to " -"and including the logger where further propagation up the hierarchy is " +"event is logged and not filtered out by a logger's level, a :class:" +"`LogRecord` is created, populated with information about the event and then " +"passed to the handlers for that logger (and its ancestors, up to and " +"including the logger where further propagation up the hierarchy is " "disabled). Before Python 3.2, there were only two places where this creation " "was done:" msgstr "" @@ -2413,22 +2411,21 @@ msgid "" ":func:`makeLogRecord`, which is called with a dictionary containing " "attributes to be added to the LogRecord. This is typically invoked when a " "suitable dictionary has been received over the network (e.g. in pickle form " -"via a :class:`~handlers.SocketHandler`, or in JSON form via " -"an :class:`~handlers.HTTPHandler`)." +"via a :class:`~handlers.SocketHandler`, or in JSON form via an :class:" +"`~handlers.HTTPHandler`)." msgstr "" #: ../../howto/logging-cookbook.rst:1812 msgid "" -"This has usually meant that if you need to do anything special with " -"a :class:`LogRecord`, you've had to do one of the following." +"This has usually meant that if you need to do anything special with a :class:" +"`LogRecord`, you've had to do one of the following." msgstr "" #: ../../howto/logging-cookbook.rst:1815 msgid "" -"Create your own :class:`Logger` subclass, which " -"overrides :meth:`Logger.makeRecord`, and set it " -"using :func:`~logging.setLoggerClass` before any loggers that you care about " -"are instantiated." +"Create your own :class:`Logger` subclass, which overrides :meth:`Logger." +"makeRecord`, and set it using :func:`~logging.setLoggerClass` before any " +"loggers that you care about are instantiated." msgstr "" #: ../../howto/logging-cookbook.rst:1818 @@ -2473,10 +2470,10 @@ msgstr "" msgid "" "In Python 3.2 and later, :class:`~logging.LogRecord` creation is done " "through a factory, which you can specify. The factory is just a callable you " -"can set with :func:`~logging.setLogRecordFactory`, and interrogate " -"with :func:`~logging.getLogRecordFactory`. The factory is invoked with the " -"same signature as the :class:`~logging.LogRecord` constructor, " -"as :class:`LogRecord` is the default setting for the factory." +"can set with :func:`~logging.setLogRecordFactory`, and interrogate with :" +"func:`~logging.getLogRecordFactory`. The factory is invoked with the same " +"signature as the :class:`~logging.LogRecord` constructor, as :class:" +"`LogRecord` is the default setting for the factory." msgstr "" #: ../../howto/logging-cookbook.rst:1848 @@ -2596,10 +2593,10 @@ msgstr "" #: ../../howto/logging-cookbook.rst:1937 msgid "" "In a similar way to the above section, we can implement a listener and " -"handler using :pypi:`pynng`, which is a Python binding to `NNG `_, billed as a spiritual successor to ZeroMQ. The " -"following snippets illustrate -- you can test them in an environment which " -"has ``pynng`` installed. Just for variety, we present the listener first." +"handler using :pypi:`pynng`, which is a Python binding to `NNG `_, billed as a spiritual successor to ZeroMQ. The following " +"snippets illustrate -- you can test them in an environment which has " +"``pynng`` installed. Just for variety, we present the listener first." msgstr "" #: ../../howto/logging-cookbook.rst:1947 @@ -2697,8 +2694,8 @@ msgid "" "# Make sure the process ID is in the output\n" "logging.basicConfig(level=logging.DEBUG,\n" " handlers=[logging.StreamHandler(), handler],\n" -" format='%(levelname)-8s %(name)10s %(process)6s %" -"(message)s')\n" +" format='%(levelname)-8s %(name)10s %(process)6s " +"%(message)s')\n" "levels = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" " logging.CRITICAL)\n" "logger_names = ('myapp', 'myapp.lib1', 'myapp.lib2')\n" @@ -2793,8 +2790,8 @@ msgstr "" msgid "" "Below is an example of a logging configuration dictionary - it's taken from " "the `documentation on the Django project `_. This dictionary is passed " -"to :func:`~config.dictConfig` to put the configuration into effect::" +"stable/topics/logging/#configuring-logging>`_. This dictionary is passed to :" +"func:`~config.dictConfig` to put the configuration into effect::" msgstr "" #: ../../howto/logging-cookbook.rst:2127 @@ -3175,13 +3172,13 @@ msgid "" " 'formatters': {\n" " 'detailed': {\n" " 'class': 'logging.Formatter',\n" -" 'format': '%(asctime)s %(name)-15s %(levelname)-8s %" -"(processName)-10s %(message)s'\n" +" 'format': '%(asctime)s %(name)-15s %(levelname)-8s " +"%(processName)-10s %(message)s'\n" " },\n" " 'simple': {\n" " 'class': 'logging.Formatter',\n" -" 'format': '%(name)-15s %(levelname)-8s %(processName)-10s %" -"(message)s'\n" +" 'format': '%(name)-15s %(levelname)-8s %(processName)-10s " +"%(message)s'\n" " }\n" " },\n" " 'handlers': {\n" @@ -3285,9 +3282,8 @@ msgstr "" #: ../../howto/logging-cookbook.rst:2478 msgid "" -"Attach a :class:`~logging.Formatter` instance to " -"your :class:`~logging.handlers.SysLogHandler` instance, with a format string " -"such as::" +"Attach a :class:`~logging.Formatter` instance to your :class:`~logging." +"handlers.SysLogHandler` instance, with a format string such as::" msgstr "" #: ../../howto/logging-cookbook.rst:2482 @@ -3455,9 +3451,8 @@ msgstr "" #: ../../howto/logging-cookbook.rst:2601 msgid "" -"You can then specify, in a logging configuration passed " -"to :func:`dictConfig`, that a logging handler be created by calling this " -"function::" +"You can then specify, in a logging configuration passed to :func:" +"`dictConfig`, that a logging handler be created by calling this function::" msgstr "" #: ../../howto/logging-cookbook.rst:2604 @@ -3561,11 +3556,11 @@ msgstr "" #: ../../howto/logging-cookbook.rst:2691 msgid "" -"Note that this example uses Python 3.3 because that's " -"where :func:`shutil.chown` makes an appearance. This approach should work " -"with any Python version that supports :func:`dictConfig` - namely, Python " -"2.7, 3.2 or later. With pre-3.3 versions, you would need to implement the " -"actual ownership change using e.g. :func:`os.chown`." +"Note that this example uses Python 3.3 because that's where :func:`shutil." +"chown` makes an appearance. This approach should work with any Python " +"version that supports :func:`dictConfig` - namely, Python 2.7, 3.2 or later. " +"With pre-3.3 versions, you would need to implement the actual ownership " +"change using e.g. :func:`os.chown`." msgstr "" #: ../../howto/logging-cookbook.rst:2697 @@ -3631,12 +3626,11 @@ msgid "" "call (e.g. the ``exc_info`` keyword parameter to indicate that traceback " "information should be logged, or the ``extra`` keyword parameter to indicate " "additional contextual information to be added to the log). So you cannot " -"directly make logging calls using :meth:`str.format` " -"or :class:`string.Template` syntax, because internally the logging package " -"uses %-formatting to merge the format string and the variable arguments. " -"There would be no changing this while preserving backward compatibility, " -"since all logging calls which are out there in existing code will be using %-" -"format strings." +"directly make logging calls using :meth:`str.format` or :class:`string." +"Template` syntax, because internally the logging package uses %-formatting " +"to merge the format string and the variable arguments. There would be no " +"changing this while preserving backward compatibility, since all logging " +"calls which are out there in existing code will be using %-format strings." msgstr "" #: ../../howto/logging-cookbook.rst:2746 @@ -3676,8 +3670,8 @@ msgstr "" #: ../../howto/logging-cookbook.rst:2770 msgid "" -"Refer to the reference documentation on :func:`setLogRecordFactory` " -"and :class:`LogRecord` for more information." +"Refer to the reference documentation on :func:`setLogRecordFactory` and :" +"class:`LogRecord` for more information." msgstr "" #: ../../howto/logging-cookbook.rst:2775 @@ -3687,11 +3681,11 @@ msgstr "" #: ../../howto/logging-cookbook.rst:2777 msgid "" "There is another, perhaps simpler way that you can use {}- and $- formatting " -"to construct your individual log messages. You may recall " -"(from :ref:`arbitrary-object-messages`) that when logging you can use an " -"arbitrary object as a message format string, and that the logging package " -"will call :func:`str` on that object to get the actual format string. " -"Consider the following two classes::" +"to construct your individual log messages. You may recall (from :ref:" +"`arbitrary-object-messages`) that when logging you can use an arbitrary " +"object as a message format string, and that the logging package will call :" +"func:`str` on that object to get the actual format string. Consider the " +"following two classes::" msgstr "" #: ../../howto/logging-cookbook.rst:2802 @@ -3707,8 +3701,8 @@ msgstr "" #: ../../howto/logging-cookbook.rst:2810 msgid "" -"Examples of this approach are given below. Firstly, formatting " -"with :meth:`str.format`::" +"Examples of this approach are given below. Firstly, formatting with :meth:" +"`str.format`::" msgstr "" #: ../../howto/logging-cookbook.rst:2813 @@ -3775,13 +3769,13 @@ msgid "" "it might not be obvious at first glance how to do it (hence this recipe). " "Since :class:`~logging.Filter` is the only filter class included in the " "standard library, and it is unlikely to cater to many requirements (it's " -"only there as a base class), you will typically need to define your " -"own :class:`~logging.Filter` subclass with an " -"overridden :meth:`~logging.Filter.filter` method. To do this, specify the " -"``()`` key in the configuration dictionary for the filter, specifying a " -"callable which will be used to create the filter (a class is the most " -"obvious, but you can provide any callable which returns " -"a :class:`~logging.Filter` instance). Here is a complete example::" +"only there as a base class), you will typically need to define your own :" +"class:`~logging.Filter` subclass with an overridden :meth:`~logging.Filter." +"filter` method. To do this, specify the ``()`` key in the configuration " +"dictionary for the filter, specifying a callable which will be used to " +"create the filter (a class is the most obvious, but you can provide any " +"callable which returns a :class:`~logging.Filter` instance). Here is a " +"complete example::" msgstr "" #: ../../howto/logging-cookbook.rst:2858 @@ -3992,14 +3986,14 @@ msgid "" "rendered in an audible rather than a visible format. This is easy to do if " "you have text-to-speech (TTS) functionality available in your system, even " "if it doesn't have a Python binding. Most TTS systems have a command line " -"program you can run, and this can be invoked from a handler " -"using :mod:`subprocess`. It's assumed here that TTS command line programs " -"won't expect to interact with users or take a long time to complete, and " -"that the frequency of logged messages will be not so high as to swamp the " -"user with messages, and that it's acceptable to have the messages spoken one " -"at a time rather than concurrently, The example implementation below waits " -"for one message to be spoken before the next is processed, and this might " -"cause other handlers to be kept waiting. Here is a short example showing the " +"program you can run, and this can be invoked from a handler using :mod:" +"`subprocess`. It's assumed here that TTS command line programs won't expect " +"to interact with users or take a long time to complete, and that the " +"frequency of logged messages will be not so high as to swamp the user with " +"messages, and that it's acceptable to have the messages spoken one at a time " +"rather than concurrently, The example implementation below waits for one " +"message to be spoken before the next is processed, and this might cause " +"other handlers to be kept waiting. Here is a short example showing the " "approach, which assumes that the ``espeak`` TTS package is available::" msgstr "" @@ -4091,9 +4085,9 @@ msgid "" "parameter and attaches a memory handler for the duration of the call to the " "decorated function. The decorator can be additionally parameterised using a " "target handler, a level at which flushing should occur, and a capacity for " -"the buffer (number of records buffered). These default to " -"a :class:`~logging.StreamHandler` which writes to ``sys.stderr``, " -"``logging.ERROR`` and ``100`` respectively." +"the buffer (number of records buffered). These default to a :class:`~logging." +"StreamHandler` which writes to ``sys.stderr``, ``logging.ERROR`` and ``100`` " +"respectively." msgstr "" #: ../../howto/logging-cookbook.rst:3072 @@ -4224,13 +4218,12 @@ msgstr "" #: ../../howto/logging-cookbook.rst:3181 msgid "" "To illustrate how you can send log messages via email, so that a set number " -"of messages are sent per email, you can " -"subclass :class:`~logging.handlers.BufferingHandler`. In the following " -"example, which you can adapt to suit your specific needs, a simple test " -"harness is provided which allows you to run the script with command line " -"arguments specifying what you typically need to send things via SMTP. (Run " -"the downloaded script with the ``-h`` argument to see the required and " -"optional arguments.)" +"of messages are sent per email, you can subclass :class:`~logging.handlers." +"BufferingHandler`. In the following example, which you can adapt to suit " +"your specific needs, a simple test harness is provided which allows you to " +"run the script with command line arguments specifying what you typically " +"need to send things via SMTP. (Run the downloaded script with the ``-h`` " +"argument to see the required and optional arguments.)" msgstr "" #: ../../howto/logging-cookbook.rst:3189 @@ -4253,8 +4246,8 @@ msgid "" " toaddrs = [toaddrs]\n" " self.toaddrs = toaddrs\n" " self.subject = subject\n" -" self.setFormatter(logging.Formatter(\"%(asctime)s %(levelname)-5s %" -"(message)s\"))\n" +" self.setFormatter(logging.Formatter(\"%(asctime)s %(levelname)-5s " +"%(message)s\"))\n" "\n" " def flush(self):\n" " if len(self.buffer) > 0:\n" @@ -4335,10 +4328,10 @@ msgstr "" #: ../../howto/logging-cookbook.rst:3272 msgid "" -"and you can then use the ``UTCFormatter`` in your code instead " -"of :class:`~logging.Formatter`. If you want to do that via configuration, " -"you can use the :func:`~logging.config.dictConfig` API with an approach " -"illustrated by the following complete example::" +"and you can then use the ``UTCFormatter`` in your code instead of :class:" +"`~logging.Formatter`. If you want to do that via configuration, you can use " +"the :func:`~logging.config.dictConfig` API with an approach illustrated by " +"the following complete example::" msgstr "" #: ../../howto/logging-cookbook.rst:3277 @@ -4634,8 +4627,8 @@ msgid "" "Suppose we have a command-line application whose job is to stop, start or " "restart some services. This could be organised for the purposes of " "illustration as a file ``app.py`` that is the main script for the " -"application, with individual commands implemented in ``start.py``, " -"``stop.py`` and ``restart.py``. Suppose further that we want to control the " +"application, with individual commands implemented in ``start.py``, ``stop." +"py`` and ``restart.py``. Suppose further that we want to control the " "verbosity of the application via a command-line argument, defaulting to " "``logging.INFO``. Here's one way that ``app.py`` could be written::" msgstr "" @@ -4675,8 +4668,8 @@ msgid "" " mod = importlib.import_module(options.command)\n" " cmd = getattr(mod, 'command')\n" " except (ImportError, AttributeError):\n" -" print('Unable to find the code for command \\'%s\\'' % " -"options.command)\n" +" print('Unable to find the code for command \\'%s\\'' % options." +"command)\n" " return 1\n" " # Could get fancy here and load configuration from file or dictionary\n" " logging.basicConfig(level=options.log_level,\n" @@ -4895,8 +4888,8 @@ msgstr "" msgid "" "A question that comes up from time to time is about how to log to a GUI " "application. The `Qt `_ framework is a popular cross-" -"platform UI framework with Python bindings using :pypi:`PySide2` " -"or :pypi:`PyQt5` libraries." +"platform UI framework with Python bindings using :pypi:`PySide2` or :pypi:" +"`PyQt5` libraries." msgstr "" #: ../../howto/logging-cookbook.rst:3604 @@ -5107,8 +5100,8 @@ msgid "" " self.start_thread()\n" " self.work_button.clicked.connect(self.worker.start)\n" " # Once started, the button should be disabled\n" -" self.work_button.clicked.connect(lambda : " -"self.work_button.setEnabled(False))\n" +" self.work_button.clicked.connect(lambda : self.work_button." +"setEnabled(False))\n" "\n" " def start_thread(self):\n" " self.worker = Worker()\n" @@ -5185,9 +5178,8 @@ msgid "" "default to use the older :rfc:`3164`, which hails from 2001. When " "``logging`` was added to Python in 2003, it supported the earlier (and only " "existing) protocol at the time. Since RFC5424 came out, as there has not " -"been widespread deployment of it in syslog servers, " -"the :class:`~logging.handlers.SysLogHandler` functionality has not been " -"updated." +"been widespread deployment of it in syslog servers, the :class:`~logging." +"handlers.SysLogHandler` functionality has not been updated." msgstr "" #: ../../howto/logging-cookbook.rst:3861 @@ -5217,8 +5209,8 @@ msgid "" "\n" " def format(self, record):\n" " version = 1\n" -" asctime = " -"datetime.datetime.fromtimestamp(record.created).isoformat()\n" +" asctime = datetime.datetime.fromtimestamp(record.created)." +"isoformat()\n" " m = self.tz_offset.match(time.strftime('%z'))\n" " has_offset = False\n" " if m and time.timezone:\n" @@ -5358,8 +5350,8 @@ msgstr "" #: ../../howto/logging-cookbook.rst:3990 msgid "" -"You could also use ``LoggerWriter`` to redirect ``sys.stdout`` and " -"``sys.stderr`` by doing something like this:" +"You could also use ``LoggerWriter`` to redirect ``sys.stdout`` and ``sys." +"stderr`` by doing something like this:" msgstr "" #: ../../howto/logging-cookbook.rst:3993 @@ -5377,9 +5369,9 @@ msgstr "" #: ../../howto/logging-cookbook.rst:4000 msgid "" "You should do this *after* configuring logging for your needs. In the above " -"example, the :func:`~logging.basicConfig` call does this (using the " -"``sys.stderr`` value *before* it is overwritten by a ``LoggerWriter`` " -"instance). Then, you'd get this kind of result:" +"example, the :func:`~logging.basicConfig` call does this (using the ``sys." +"stderr`` value *before* it is overwritten by a ``LoggerWriter`` instance). " +"Then, you'd get this kind of result:" msgstr "" #: ../../howto/logging-cookbook.rst:4005 @@ -5398,9 +5390,9 @@ msgstr "" #: ../../howto/logging-cookbook.rst:4013 msgid "" -"Of course, the examples above show output according to the format used " -"by :func:`~logging.basicConfig`, but you can use a different formatter when " -"you configure logging." +"Of course, the examples above show output according to the format used by :" +"func:`~logging.basicConfig`, but you can use a different formatter when you " +"configure logging." msgstr "" #: ../../howto/logging-cookbook.rst:4017 @@ -5578,8 +5570,8 @@ msgid "" " pass\n" "\n" "if __name__ == '__main__':\n" -" logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %" -"(levelname)-9s %(message)s',\n" +" logging.basicConfig(level=logging.DEBUG, format='%(asctime)s " +"%(levelname)-9s %(message)s',\n" " handlers = [StreamHandler()])\n" " logger.debug('Single line')\n" " logger.debug('Multiple lines:\\nfool me once ...')\n" @@ -5597,8 +5589,8 @@ msgstr "" " pass\n" "\n" "if __name__ == '__main__':\n" -" logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %" -"(levelname)-9s %(message)s',\n" +" logging.basicConfig(level=logging.DEBUG, format='%(asctime)s " +"%(levelname)-9s %(message)s',\n" " handlers = [StreamHandler()])\n" " logger.debug('Single line')\n" " logger.debug('Multiple lines:\\nfool me once ...')\n" @@ -5630,9 +5622,9 @@ msgstr "" #: ../../howto/logging-cookbook.rst:4143 msgid "" -"If, on the other hand, you are concerned about `log injection `_, you can use a formatter " -"which escapes newlines, as per the following example:" +"If, on the other hand, you are concerned about `log injection `_, you can use a formatter which " +"escapes newlines, as per the following example:" msgstr "" #: ../../howto/logging-cookbook.rst:4147 @@ -5648,8 +5640,8 @@ msgid "" "\n" "if __name__ == '__main__':\n" " h = logging.StreamHandler()\n" -" h.setFormatter(EscapingFormatter('%(asctime)s %(levelname)-9s %" -"(message)s'))\n" +" h.setFormatter(EscapingFormatter('%(asctime)s %(levelname)-9s " +"%(message)s'))\n" " logging.basicConfig(level=logging.DEBUG, handlers = [h])\n" " logger.debug('Single line')\n" " logger.debug('Multiple lines:\\nfool me once ...')\n" @@ -5668,8 +5660,8 @@ msgstr "" "\n" "if __name__ == '__main__':\n" " h = logging.StreamHandler()\n" -" h.setFormatter(EscapingFormatter('%(asctime)s %(levelname)-9s %" -"(message)s'))\n" +" h.setFormatter(EscapingFormatter('%(asctime)s %(levelname)-9s " +"%(message)s'))\n" " logging.basicConfig(level=logging.DEBUG, handlers = [h])\n" " logger.debug('Single line')\n" " logger.debug('Multiple lines:\\nfool me once ...')\n" diff --git a/library/os.path.po b/library/os.path.po index 5ad64854fc..b2c49802ad 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-17 00:14+0000\n" +"POT-Creation-Date: 2026-02-04 00:17+0000\n" "PO-Revision-Date: 2023-07-13 14:06+0800\n" "Last-Translator: Po-Chuan Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -113,18 +113,18 @@ msgid ":func:`os.path.join` and :func:`os.path.normpath`." msgstr ":func:`os.path.join` 和 :func:`os.path.normpath`。" #: ../../library/os.path.rst:64 ../../library/os.path.rst:77 -#: ../../library/os.path.rst:118 ../../library/os.path.rst:127 -#: ../../library/os.path.rst:143 ../../library/os.path.rst:153 -#: ../../library/os.path.rst:179 ../../library/os.path.rst:199 -#: ../../library/os.path.rst:216 ../../library/os.path.rst:228 -#: ../../library/os.path.rst:237 ../../library/os.path.rst:249 -#: ../../library/os.path.rst:263 ../../library/os.path.rst:273 -#: ../../library/os.path.rst:292 ../../library/os.path.rst:312 -#: ../../library/os.path.rst:398 ../../library/os.path.rst:418 -#: ../../library/os.path.rst:458 ../../library/os.path.rst:487 -#: ../../library/os.path.rst:503 ../../library/os.path.rst:514 -#: ../../library/os.path.rst:541 ../../library/os.path.rst:566 -#: ../../library/os.path.rst:630 +#: ../../library/os.path.rst:120 ../../library/os.path.rst:129 +#: ../../library/os.path.rst:145 ../../library/os.path.rst:155 +#: ../../library/os.path.rst:181 ../../library/os.path.rst:201 +#: ../../library/os.path.rst:218 ../../library/os.path.rst:230 +#: ../../library/os.path.rst:239 ../../library/os.path.rst:251 +#: ../../library/os.path.rst:265 ../../library/os.path.rst:275 +#: ../../library/os.path.rst:294 ../../library/os.path.rst:314 +#: ../../library/os.path.rst:400 ../../library/os.path.rst:420 +#: ../../library/os.path.rst:460 ../../library/os.path.rst:489 +#: ../../library/os.path.rst:505 ../../library/os.path.rst:516 +#: ../../library/os.path.rst:543 ../../library/os.path.rst:568 +#: ../../library/os.path.rst:632 msgid "Accepts a :term:`path-like object`." msgstr "接受一個 :term:`path-like object`。" @@ -161,23 +161,27 @@ msgid "Any iterable can now be passed, rather than just sequences." msgstr "" #: ../../library/os.path.rst:100 +#, fuzzy msgid "" -"Return the longest path prefix (taken character-by-character) that is a " -"prefix of all paths in *list*. If *list* is empty, return the empty string " -"(``''``)." +"Return the longest string prefix (taken character-by-character) that is a " +"prefix of all strings in *list*. If *list* is empty, return the empty " +"string (``''``)." msgstr "" "回傳 *list* 中所有路徑的最長路徑前綴(逐字元比較)。如果 *list* 為空,則回傳" "空字串(``''``)。" #: ../../library/os.path.rst:106 +#, fuzzy msgid "" "This function may return invalid paths because it works a character at a " -"time. To obtain a valid path, see :func:`commonpath`." +"time. If you need a **common path prefix**, then the algorithm implemented " +"in this function is not secure. Use :func:`commonpath` for finding a common " +"path prefix." msgstr "" "由於此函式是逐字元比較,因此可能會回傳無效的路徑。若要獲得有效的路徑,請參" "考 :func:`commonpath` 函式。" -#: ../../library/os.path.rst:112 +#: ../../library/os.path.rst:114 msgid "" ">>> os.path.commonprefix(['/usr/lib', '/usr/local/lib'])\n" "'/usr/l'\n" @@ -191,7 +195,7 @@ msgstr "" ">>> os.path.commonpath(['/usr/lib', '/usr/local/lib'])\n" "'/usr'" -#: ../../library/os.path.rst:124 +#: ../../library/os.path.rst:126 msgid "" "Return the directory name of pathname *path*. This is the first element of " "the pair returned by passing *path* to the function :func:`split`." @@ -199,7 +203,7 @@ msgstr "" "回傳路徑名 *path* 的目錄名稱。這是將 *path* 傳遞給函式 :func:`split` 後回傳之" "成對結果中的第一個元素。" -#: ../../library/os.path.rst:133 +#: ../../library/os.path.rst:135 msgid "" "Return ``True`` if *path* refers to an existing path or an open file " "descriptor. Returns ``False`` for broken symbolic links. On some " @@ -211,7 +215,7 @@ msgstr "" "的符號連結則回傳 ``False``。在某些平台上,即使 *path* 實際存在,如果未被授予" "執行 :func:`os.stat` 的權限,此函式仍可能回傳 ``False``。" -#: ../../library/os.path.rst:139 +#: ../../library/os.path.rst:141 msgid "" "*path* can now be an integer: ``True`` is returned if it is an open file " "descriptor, ``False`` otherwise." @@ -219,7 +223,7 @@ msgstr "" "現在 *path* 可以是一個整數:如果它是一個開啟的檔案描述器,則回傳 ``True``;否" "則回傳 ``False``。" -#: ../../library/os.path.rst:149 +#: ../../library/os.path.rst:151 msgid "" "Return ``True`` if *path* refers to an existing path, including broken " "symbolic links. Equivalent to :func:`exists` on platforms lacking :func:" @@ -228,7 +232,7 @@ msgstr "" "如果 *path* 是一個存在的路徑則回傳 ``True``,對已損壞的符號連結也是。在缺乏 :" "func:`os.lstat` 的平台上,與 :func:`exists` 函式等效。" -#: ../../library/os.path.rst:161 +#: ../../library/os.path.rst:163 msgid "" "On Unix and Windows, return the argument with an initial component of ``~`` " "or ``~user`` replaced by that *user*'s home directory." @@ -236,7 +240,7 @@ msgstr "" "在 Unix 和 Windows 上,將引數中以 ``~`` 或 ``~user`` 開頭的部分替換為該 " "*user* 的家目錄。" -#: ../../library/os.path.rst:166 +#: ../../library/os.path.rst:168 msgid "" "On Unix, an initial ``~`` is replaced by the environment variable :envvar:" "`HOME` if it is set; otherwise the current user's home directory is looked " @@ -247,7 +251,7 @@ msgstr "" "數的值;否則將使用內建模組 :mod:`pwd` 在密碼目錄中查找目前使用者的家目錄。對" "於初始的 ``~user``,直接在密碼目錄中查找該使用者的家目錄。" -#: ../../library/os.path.rst:171 +#: ../../library/os.path.rst:173 msgid "" "On Windows, :envvar:`USERPROFILE` will be used if set, otherwise a " "combination of :envvar:`HOMEPATH` and :envvar:`HOMEDRIVE` will be used. An " @@ -260,18 +264,18 @@ msgstr "" "目前使用者的家目錄的最後一個目錄元件是否與 :envvar:`USERNAME` 相符,如果相符" "則替換它。" -#: ../../library/os.path.rst:176 +#: ../../library/os.path.rst:178 msgid "" "If the expansion fails or if the path does not begin with a tilde, the path " "is returned unchanged." msgstr "" "如果展開失敗或路徑不以波浪符號 (tilde) 開頭,則回傳原始路徑,不做任何變更。" -#: ../../library/os.path.rst:182 +#: ../../library/os.path.rst:184 msgid "No longer uses :envvar:`HOME` on Windows." msgstr "在 Windows 上不再使用 :envvar:`HOME` 變數。" -#: ../../library/os.path.rst:191 +#: ../../library/os.path.rst:193 msgid "" "Return the argument with environment variables expanded. Substrings of the " "form ``$name`` or ``${name}`` are replaced by the value of environment " @@ -281,7 +285,7 @@ msgstr "" "回傳已展開環境變數的引數。形如 ``$name`` 或 ``${name}`` 的子字串會被替換為環" "境變數 *name* 的值。無效的變數名稱和對不存在變數的引用保持不變。" -#: ../../library/os.path.rst:196 +#: ../../library/os.path.rst:198 msgid "" "On Windows, ``%name%`` expansions are supported in addition to ``$name`` and " "``${name}``." @@ -289,7 +293,7 @@ msgstr "" "在 Windows 上,除了支援 ``$name`` 和 ``${name}`` 形式的展開外,還支援 " "``%name%`` 形式的展開。" -#: ../../library/os.path.rst:205 +#: ../../library/os.path.rst:207 msgid "" "Return the time of last access of *path*. The return value is a floating-" "point number giving the number of seconds since the epoch (see the :mod:" @@ -299,7 +303,7 @@ msgstr "" "回傳 *path* 的最後存取時間。回傳值是一個浮點數,表示自紀元(參見 :mod:`time` " "模組)以來的秒數。如果檔案不存在或無法存取,則引發 :exc:`OSError`。" -#: ../../library/os.path.rst:212 +#: ../../library/os.path.rst:214 msgid "" "Return the time of last modification of *path*. The return value is a " "floating-point number giving the number of seconds since the epoch (see " @@ -309,7 +313,7 @@ msgstr "" "回傳 *path* 的最後修改時間。回傳值是一個浮點數,表示自紀元(參見 :mod:`time` " "模組)以來的秒數。如果檔案不存在或無法存取,則引發 :exc:`OSError`。" -#: ../../library/os.path.rst:222 +#: ../../library/os.path.rst:224 msgid "" "Return the system's ctime which, on some systems (like Unix) is the time of " "the last metadata change, and, on others (like Windows), is the creation " @@ -322,7 +326,7 @@ msgstr "" "數,表示自紀元(參見 :mod:`time` 模組)以來的秒數。如果檔案不存在或無法存" "取),則引發 :exc:`OSError`。" -#: ../../library/os.path.rst:234 +#: ../../library/os.path.rst:236 msgid "" "Return the size, in bytes, of *path*. Raise :exc:`OSError` if the file does " "not exist or is inaccessible." @@ -330,7 +334,7 @@ msgstr "" "回傳 *path* 的大小(以位元組為單位)。如果檔案不存在或無法存取,則引發 :exc:" "`OSError`。" -#: ../../library/os.path.rst:243 +#: ../../library/os.path.rst:245 msgid "" "Return ``True`` if *path* is an absolute pathname. On Unix, that means it " "begins with a slash, on Windows that it begins with two (back)slashes, or a " @@ -340,17 +344,17 @@ msgstr "" "在 Windows 上,表示這是以兩個(反)斜線開頭或者以一個驅動機字母、冒號和(反)" "斜線開頭。" -#: ../../library/os.path.rst:247 +#: ../../library/os.path.rst:249 msgid ":func:`abspath`" msgstr ":func:`abspath`" -#: ../../library/os.path.rst:252 +#: ../../library/os.path.rst:254 msgid "" "On Windows, returns ``False`` if the given path starts with exactly one " "(back)slash." msgstr "" -#: ../../library/os.path.rst:259 +#: ../../library/os.path.rst:261 msgid "" "Return ``True`` if *path* is an :func:`existing ` regular file. This " "follows symbolic links, so both :func:`islink` and :func:`isfile` can be " @@ -360,7 +364,7 @@ msgstr "" "這將跟隨符號連結,因此同一個路徑可以同時回傳 :func:`islink` 和 :func:" "`isfile` 的結果為真。" -#: ../../library/os.path.rst:269 +#: ../../library/os.path.rst:271 msgid "" "Return ``True`` if *path* is an :func:`existing ` directory. This " "follows symbolic links, so both :func:`islink` and :func:`isdir` can be true " @@ -370,7 +374,7 @@ msgstr "" "跟隨符號連結,因此同一個路徑可以同時回傳 :func:`islink` 和 :func:`isdir` 的結" "果為真。" -#: ../../library/os.path.rst:279 +#: ../../library/os.path.rst:281 msgid "" "Return ``True`` if *path* refers to an :func:`existing ` directory " "entry that is a junction. Always return ``False`` if junctions are not " @@ -379,7 +383,7 @@ msgstr "" "如果 *path* 是指向\\ :func:`已存在的 `\\ 目錄條目且為聯接點 " "(junction),則回傳 ``True``。如果目前平台不支援聯接點,則始終返回 ``False``。" -#: ../../library/os.path.rst:288 +#: ../../library/os.path.rst:290 msgid "" "Return ``True`` if *path* refers to an :func:`existing ` directory " "entry that is a symbolic link. Always ``False`` if symbolic links are not " @@ -388,7 +392,7 @@ msgstr "" "如果 *path* 是指向\\ :func:`已存在的 `\\ 目錄項目且為符號連結,則回" "傳 ``True``。如果 Python 執行時不支援符號連結,則始終回傳 ``False``。" -#: ../../library/os.path.rst:298 +#: ../../library/os.path.rst:300 msgid "" "Return ``True`` if pathname *path* is a :dfn:`mount point`: a point in a " "file system where a different file system has been mounted. On POSIX, the " @@ -411,11 +415,11 @@ msgstr "" "在 Windows 上,以驅動機字母開頭的根目錄和 UNC 共享路徑始終是掛載點,對於任何" "其他路徑,會呼叫 ``GetVolumePathName`` 函式來檢查它是否與輸入路徑不同。" -#: ../../library/os.path.rst:309 +#: ../../library/os.path.rst:311 msgid "Added support for detecting non-root mount points on Windows." msgstr "新增在 Windows 上檢測非根目錄掛載點的支援。" -#: ../../library/os.path.rst:318 +#: ../../library/os.path.rst:320 msgid "" "Return ``True`` if pathname *path* is located on a Windows Dev Drive. A Dev " "Drive is optimized for developer scenarios, and offers faster performance " @@ -424,10 +428,10 @@ msgid "" "operations." msgstr "" "如果路徑名 *path* 位於 Windows Dev 驅動機上,則回傳 ``True``。Dev 驅動機針對" -"開發人員場景進行了最佳化,提供更快的讀寫檔案性能。建議將其用於原始程式碼、臨時" -"建置目錄、封包快取和其他 I/O 密集型操作。" +"開發人員場景進行了最佳化,提供更快的讀寫檔案性能。建議將其用於原始程式碼、臨" +"時建置目錄、封包快取和其他 I/O 密集型操作。" -#: ../../library/os.path.rst:324 +#: ../../library/os.path.rst:326 msgid "" "May raise an error for an invalid path, for example, one without a " "recognizable drive, but returns ``False`` on platforms that do not support " @@ -438,17 +442,17 @@ msgstr "" "碟機的平台上回傳 ``False``。請參閱 `Windows 文件 `_\\ 以了解有關啟用和建立 Dev 驅動機的資訊。" -#: ../../library/os.path.rst:331 +#: ../../library/os.path.rst:333 msgid "" "The function is now available on all platforms, and will always return " "``False`` on those that have no support for Dev Drives" msgstr "" -#: ../../library/os.path.rst:337 +#: ../../library/os.path.rst:339 msgid "Return ``True`` if *path* is a reserved pathname on the current system." msgstr "" -#: ../../library/os.path.rst:339 +#: ../../library/os.path.rst:341 msgid "" "On Windows, reserved filenames include those that end with a space or dot; " "those that contain colons (i.e. file streams such as \"name:stream\"), " @@ -457,7 +461,7 @@ msgid "" "\", \"AUX\", \"PRN\", \"COM1\", and \"LPT1\"." msgstr "" -#: ../../library/os.path.rst:347 +#: ../../library/os.path.rst:349 msgid "" "This function approximates rules for reserved paths on most Windows systems. " "These rules change over time in various Windows releases. This function may " @@ -465,11 +469,11 @@ msgid "" "available." msgstr "" -#: ../../library/os.path.rst:352 +#: ../../library/os.path.rst:354 msgid "Availability" msgstr "可用性" -#: ../../library/os.path.rst:359 +#: ../../library/os.path.rst:361 msgid "" "Join one or more path segments intelligently. The return value is the " "concatenation of *path* and all members of *\\*paths*, with exactly one " @@ -481,14 +485,14 @@ msgstr "" "每個非空部分後面都有一個目錄分隔符號,除了最後一個部分。換句話說,如果最後一" "個部分為空或以分隔符號結尾,結果只會以分隔符號結尾。" -#: ../../library/os.path.rst:365 +#: ../../library/os.path.rst:367 msgid "" "If a segment is an absolute path (which on Windows requires both a drive and " "a root), then all previous segments are ignored and joining continues from " "the absolute path segment. On Linux, for example::" msgstr "" -#: ../../library/os.path.rst:369 +#: ../../library/os.path.rst:371 msgid "" ">>> os.path.join('/home/foo', 'bar')\n" "'/home/foo/bar'\n" @@ -496,7 +500,7 @@ msgid "" "'/home/bar'" msgstr "" -#: ../../library/os.path.rst:374 +#: ../../library/os.path.rst:376 msgid "" "On Windows, the drive is not reset when a rooted path segment (e.g., " "``r'\\foo'``) is encountered. If a segment is on a different drive or is an " @@ -507,7 +511,7 @@ msgstr "" "一個段位於不同的驅動機上,或者是絕對路徑,則將忽略所有之前的段並重置驅動機。" "例如: ::" -#: ../../library/os.path.rst:379 +#: ../../library/os.path.rst:381 msgid "" ">>> os.path.join('c:\\\\', 'foo')\n" "'c:\\\\foo'\n" @@ -515,21 +519,21 @@ msgid "" "'d:\\\\bar'" msgstr "" -#: ../../library/os.path.rst:384 +#: ../../library/os.path.rst:386 msgid "" "Note that since there is a current directory for each drive, ``os.path." "join(\"c:\", \"foo\")`` represents a path relative to the current directory " "on drive :file:`C:` (:file:`c:foo`), not :file:`c:\\\\foo`." msgstr "" "請注意,由於每個驅動機都有目前目錄,``os.path.join(\"c:\", \"foo\")`` 表示相" -"對於驅動機 :file:`C:` 的目前目錄的路徑(:file:`c:foo`),而不是 :file:`c:" -"\\\\foo`。" +"對於驅動機 :file:`C:` 的目前目錄的路徑(:file:`c:foo`),而不是 :file:`c:\\" +"\\foo`。" -#: ../../library/os.path.rst:388 +#: ../../library/os.path.rst:390 msgid "Accepts a :term:`path-like object` for *path* and *paths*." msgstr "*path* 和 *paths* 接受 :term:`path-like object` 作為參數。" -#: ../../library/os.path.rst:394 +#: ../../library/os.path.rst:396 msgid "" "Normalize the case of a pathname. On Windows, convert all characters in the " "pathname to lowercase, and also convert forward slashes to backward slashes. " @@ -538,7 +542,7 @@ msgstr "" "將路徑名的大小寫規範化。在 Windows 上,將路徑名中的所有字元轉換為小寫,並將正" "斜線轉換為反斜線。在其他作業系統上,回傳原始路徑。" -#: ../../library/os.path.rst:404 +#: ../../library/os.path.rst:406 msgid "" "Normalize a pathname by collapsing redundant separators and up-level " "references so that ``A//B``, ``A/B/``, ``A/./B`` and ``A/foo/../B`` all " @@ -551,7 +555,7 @@ msgstr "" "結的路徑的含義。在 Windows 上,它將正斜線轉換為反斜線。要標準化大小寫,請使" "用 :func:`normcase`。" -#: ../../library/os.path.rst:411 +#: ../../library/os.path.rst:413 msgid "" "On POSIX systems, in accordance with `IEEE Std 1003.1 2013 Edition; 4.13 " "Pathname Resolution >> splitdrive(\"c:/dir\")\n" "(\"c:\", \"/dir\")" @@ -750,12 +754,12 @@ msgstr "" ">>> splitdrive(\"c:/dir\")\n" "(\"c:\", \"/dir\")" -#: ../../library/os.path.rst:560 +#: ../../library/os.path.rst:562 msgid "" "If the path contains a UNC path, drive will contain the host name and share::" msgstr "如果路徑包含 UNC 路徑,則驅動機將包含主機名和共享名: ::" -#: ../../library/os.path.rst:563 +#: ../../library/os.path.rst:565 msgid "" ">>> splitdrive(\"//host/computer/dir\")\n" "(\"//host/computer\", \"/dir\")" @@ -763,7 +767,7 @@ msgstr "" ">>> splitdrive(\"//host/computer/dir\")\n" "(\"//host/computer\", \"/dir\")" -#: ../../library/os.path.rst:572 +#: ../../library/os.path.rst:574 msgid "" "Split the pathname *path* into a 3-item tuple ``(drive, root, tail)`` where " "*drive* is a device name or mount point, *root* is a string of separators " @@ -776,7 +780,7 @@ msgstr "" "這些項目中的任何一個都可能是空字串。在所有情況下,``drive + root + tail`` 將" "與 *path* 相同。" -#: ../../library/os.path.rst:578 +#: ../../library/os.path.rst:580 msgid "" "On POSIX systems, *drive* is always empty. The *root* may be empty (if " "*path* is relative), a single forward slash (if *path* is absolute), or two " @@ -790,7 +794,7 @@ msgstr "" "onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>`_ 的實作定義)。例" "如: ::" -#: ../../library/os.path.rst:584 +#: ../../library/os.path.rst:586 msgid "" ">>> splitroot('/home/sam')\n" "('', '/', 'home/sam')\n" @@ -806,7 +810,7 @@ msgstr "" ">>> splitroot('///home/sam')\n" "('', '/', '//home/sam')" -#: ../../library/os.path.rst:591 +#: ../../library/os.path.rst:593 msgid "" "On Windows, *drive* may be empty, a drive-letter name, a UNC share, or a " "device name. The *root* may be empty, a forward slash, or a backward slash. " @@ -815,7 +819,7 @@ msgstr "" "在 Windows 上,*drive* 可能為空、驅動機名稱、UNC 共享或設備名稱。*root* 可能" "為空,斜線或反斜線。例如: ::" -#: ../../library/os.path.rst:595 +#: ../../library/os.path.rst:597 msgid "" ">>> splitroot('C:/Users/Sam')\n" "('C:', '/', 'Users/Sam')\n" @@ -827,7 +831,7 @@ msgstr "" ">>> splitroot('//Server/Share/Users/Sam')\n" "('//Server/Share', '/', 'Users/Sam')" -#: ../../library/os.path.rst:605 +#: ../../library/os.path.rst:607 msgid "" "Split the pathname *path* into a pair ``(root, ext)`` such that ``root + " "ext == path``, and the extension, *ext*, is empty or begins with a period " @@ -836,11 +840,11 @@ msgstr "" "將路徑名 *path* 拆分為一對 ``(root, ext)``,使得 ``root + ext == path``,且副" "檔名 *ext* 為空或以點開頭且最多包含一個點 (period)。" -#: ../../library/os.path.rst:609 +#: ../../library/os.path.rst:611 msgid "If the path contains no extension, *ext* will be ``''``::" msgstr "如果路徑不包含副檔名,則 *ext* 將為 ``''``: ::" -#: ../../library/os.path.rst:611 +#: ../../library/os.path.rst:613 msgid "" ">>> splitext('bar')\n" "('bar', '')" @@ -848,7 +852,7 @@ msgstr "" ">>> splitext('bar')\n" "('bar', '')" -#: ../../library/os.path.rst:614 +#: ../../library/os.path.rst:616 msgid "" "If the path contains an extension, then *ext* will be set to this extension, " "including the leading period. Note that previous periods will be ignored::" @@ -856,7 +860,7 @@ msgstr "" "如果路徑包含副檔名,則 *ext* 將設置為該副檔名,包括前導的點。請注意,前面的點" "將被忽略: ::" -#: ../../library/os.path.rst:617 +#: ../../library/os.path.rst:619 msgid "" ">>> splitext('foo.bar.exe')\n" "('foo.bar', '.exe')\n" @@ -868,13 +872,13 @@ msgstr "" ">>> splitext('/foo/bar.exe')\n" "('/foo/bar', '.exe')" -#: ../../library/os.path.rst:622 +#: ../../library/os.path.rst:624 msgid "" "Leading periods of the last component of the path are considered to be part " "of the root::" msgstr "路徑的最後一個部份的前導點被認為是根的一部分: ::" -#: ../../library/os.path.rst:625 +#: ../../library/os.path.rst:627 msgid "" ">>> splitext('.cshrc')\n" "('.cshrc', '')\n" @@ -886,7 +890,7 @@ msgstr "" ">>> splitext('/foo/....jpg')\n" "('/foo/....jpg', '')" -#: ../../library/os.path.rst:636 +#: ../../library/os.path.rst:638 msgid "" "``True`` if arbitrary Unicode strings can be used as file names (within " "limitations imposed by the file system)." @@ -902,34 +906,34 @@ msgstr "path(路徑)" msgid "operations" msgstr "operations(操作)" -#: ../../library/os.path.rst:157 +#: ../../library/os.path.rst:159 msgid "~ (tilde)" msgstr "~ (波浪號)" -#: ../../library/os.path.rst:157 +#: ../../library/os.path.rst:159 msgid "home directory expansion" msgstr "home directory expansion(家目錄展開)" -#: ../../library/os.path.rst:164 +#: ../../library/os.path.rst:166 msgid "module" msgstr "module(模組)" -#: ../../library/os.path.rst:164 +#: ../../library/os.path.rst:166 msgid "pwd" msgstr "pwd" -#: ../../library/os.path.rst:185 +#: ../../library/os.path.rst:187 msgid "$ (dollar)" msgstr "$ (金錢符號)" -#: ../../library/os.path.rst:185 +#: ../../library/os.path.rst:187 msgid "environment variables expansion" msgstr "environment variables expansion(環境變數展開)" -#: ../../library/os.path.rst:185 +#: ../../library/os.path.rst:187 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/os.path.rst:185 +#: ../../library/os.path.rst:187 msgid "environment variables expansion (Windows)" msgstr "environment variables expansion (Windows)(環境變數展開 (Windows))" diff --git a/library/stdtypes.po b/library/stdtypes.po index 66e203edd7..ba43e8dc98 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-01-22 16:55+0000\n" +"POT-Creation-Date: 2026-02-04 00:17+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -139,8 +139,8 @@ msgstr "結果" #: ../../library/stdtypes.rst:88 ../../library/stdtypes.rst:284 #: ../../library/stdtypes.rst:424 ../../library/stdtypes.rst:1007 -#: ../../library/stdtypes.rst:1229 ../../library/stdtypes.rst:3135 -#: ../../library/stdtypes.rst:4395 +#: ../../library/stdtypes.rst:1229 ../../library/stdtypes.rst:3151 +#: ../../library/stdtypes.rst:4411 msgid "Notes" msgstr "註解" @@ -154,7 +154,7 @@ msgstr "假如 *x* 為真,則 *x*,否則 *y*" #: ../../library/stdtypes.rst:90 ../../library/stdtypes.rst:1009 #: ../../library/stdtypes.rst:1012 ../../library/stdtypes.rst:1244 -#: ../../library/stdtypes.rst:3141 ../../library/stdtypes.rst:4401 +#: ../../library/stdtypes.rst:3157 ../../library/stdtypes.rst:4417 msgid "\\(1)" msgstr "\\(1)" @@ -168,8 +168,8 @@ msgstr "假如 *x* 為假,則 *x*,否則 *y*" #: ../../library/stdtypes.rst:93 ../../library/stdtypes.rst:297 #: ../../library/stdtypes.rst:317 ../../library/stdtypes.rst:1255 -#: ../../library/stdtypes.rst:3145 ../../library/stdtypes.rst:3147 -#: ../../library/stdtypes.rst:4405 ../../library/stdtypes.rst:4407 +#: ../../library/stdtypes.rst:3161 ../../library/stdtypes.rst:3163 +#: ../../library/stdtypes.rst:4421 ../../library/stdtypes.rst:4423 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:3149 -#: ../../library/stdtypes.rst:3151 ../../library/stdtypes.rst:3153 -#: ../../library/stdtypes.rst:3155 ../../library/stdtypes.rst:4409 -#: ../../library/stdtypes.rst:4411 ../../library/stdtypes.rst:4413 -#: ../../library/stdtypes.rst:4415 +#: ../../library/stdtypes.rst:96 ../../library/stdtypes.rst:3165 +#: ../../library/stdtypes.rst:3167 ../../library/stdtypes.rst:3169 +#: ../../library/stdtypes.rst:3171 ../../library/stdtypes.rst:4425 +#: ../../library/stdtypes.rst:4427 ../../library/stdtypes.rst:4429 +#: ../../library/stdtypes.rst:4431 msgid "\\(3)" msgstr "\\(3)" #: ../../library/stdtypes.rst:105 ../../library/stdtypes.rst:328 #: ../../library/stdtypes.rst:442 ../../library/stdtypes.rst:1051 -#: ../../library/stdtypes.rst:1259 ../../library/stdtypes.rst:3181 -#: ../../library/stdtypes.rst:4445 +#: ../../library/stdtypes.rst:1259 ../../library/stdtypes.rst:3197 +#: ../../library/stdtypes.rst:4461 msgid "Notes:" msgstr "註解:" @@ -239,9 +239,9 @@ msgstr "" msgid "This table summarizes the comparison operations:" msgstr "這個表格統整所有比較運算:" -#: ../../library/stdtypes.rst:146 ../../library/stdtypes.rst:3112 -#: ../../library/stdtypes.rst:3135 ../../library/stdtypes.rst:4372 -#: ../../library/stdtypes.rst:4395 +#: ../../library/stdtypes.rst:146 ../../library/stdtypes.rst:3128 +#: ../../library/stdtypes.rst:3151 ../../library/stdtypes.rst:4388 +#: ../../library/stdtypes.rst:4411 msgid "Meaning" msgstr "含義" @@ -574,8 +574,8 @@ msgid "" "zero." msgstr "一個複數,其實部為 *re*,虛部為 *im*。*im* 預設為零。" -#: ../../library/stdtypes.rst:310 ../../library/stdtypes.rst:3143 -#: ../../library/stdtypes.rst:4432 +#: ../../library/stdtypes.rst:310 ../../library/stdtypes.rst:3159 +#: ../../library/stdtypes.rst:4448 msgid "\\(6)" msgstr "\\(6)" @@ -612,9 +612,9 @@ msgid "*x* to the power *y*" msgstr "*x* 的 *y* 次方" #: ../../library/stdtypes.rst:319 ../../library/stdtypes.rst:321 -#: ../../library/stdtypes.rst:3168 ../../library/stdtypes.rst:3171 -#: ../../library/stdtypes.rst:3174 ../../library/stdtypes.rst:4428 -#: ../../library/stdtypes.rst:4435 +#: ../../library/stdtypes.rst:3184 ../../library/stdtypes.rst:3187 +#: ../../library/stdtypes.rst:3190 ../../library/stdtypes.rst:4444 +#: ../../library/stdtypes.rst:4451 msgid "\\(5)" msgstr "\\(5)" @@ -772,9 +772,9 @@ msgid "bitwise :dfn:`or` of *x* and *y*" msgstr "*x* 及 *y* 的位元 :dfn:`或`" #: ../../library/stdtypes.rst:426 ../../library/stdtypes.rst:429 -#: ../../library/stdtypes.rst:432 ../../library/stdtypes.rst:3157 -#: ../../library/stdtypes.rst:3161 ../../library/stdtypes.rst:4417 -#: ../../library/stdtypes.rst:4421 +#: ../../library/stdtypes.rst:432 ../../library/stdtypes.rst:3173 +#: ../../library/stdtypes.rst:3177 ../../library/stdtypes.rst:4433 +#: ../../library/stdtypes.rst:4437 msgid "\\(4)" msgstr "\\(4)" @@ -3266,7 +3266,7 @@ msgstr "" msgid "Return the string encoded to :class:`bytes`." msgstr "" -#: ../../library/stdtypes.rst:2007 ../../library/stdtypes.rst:3571 +#: ../../library/stdtypes.rst:2007 ../../library/stdtypes.rst:3587 msgid "" "*encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for " "possible values." @@ -3302,11 +3302,11 @@ msgstr "" ">>> encoded_str_to_bytes\n" "b'Python'" -#: ../../library/stdtypes.rst:2030 ../../library/stdtypes.rst:3590 +#: ../../library/stdtypes.rst:2030 ../../library/stdtypes.rst:3606 msgid "Added support for keyword arguments." msgstr "新增關鍵字引數的支援。" -#: ../../library/stdtypes.rst:2033 ../../library/stdtypes.rst:3593 +#: ../../library/stdtypes.rst:2033 ../../library/stdtypes.rst:3609 msgid "" "The value of the *errors* argument is now checked in :ref:`devmode` and in :" "ref:`debug mode `." @@ -3475,7 +3475,10 @@ msgid "" msgstr "" #: ../../library/stdtypes.rst:2164 +#, fuzzy msgid "" +">>> 'spam, spam, spam'.index('spam')\n" +"0\n" ">>> 'spam, spam, spam'.index('eggs')\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" @@ -3490,11 +3493,11 @@ msgstr "" " ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n" "ValueError: substring not found" -#: ../../library/stdtypes.rst:2173 +#: ../../library/stdtypes.rst:2175 msgid "See also :meth:`rindex`." msgstr "另請參閱 :meth:`rindex`。" -#: ../../library/stdtypes.rst:2178 +#: ../../library/stdtypes.rst:2180 msgid "" "Return ``True`` if all characters in the string are alphanumeric and there " "is at least one character, ``False`` otherwise. A character ``c`` is " @@ -3502,7 +3505,7 @@ msgid "" "isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``." msgstr "" -#: ../../library/stdtypes.rst:2186 +#: ../../library/stdtypes.rst:2188 msgid "" "Return ``True`` if all characters in the string are alphabetic and there is " "at least one character, ``False`` otherwise. Alphabetic characters are " @@ -3514,7 +3517,7 @@ msgid "" "spec/chapter-4/#G91002>`_. For example:" msgstr "" -#: ../../library/stdtypes.rst:2195 +#: ../../library/stdtypes.rst:2197 msgid "" ">>> 'Letters and spaces'.isalpha()\n" "False\n" @@ -3531,18 +3534,18 @@ msgstr "" ">>> 'µ'.isalpha() # 非 ASCII 字元也可以被視為字母\n" "True" -#: ../../library/stdtypes.rst:2204 +#: ../../library/stdtypes.rst:2206 msgid "See :ref:`unicode-properties`." msgstr "請參閱 :ref:`unicode-properties`。" -#: ../../library/stdtypes.rst:2209 +#: ../../library/stdtypes.rst:2211 msgid "" "Return ``True`` if the string is empty or all characters in the string are " "ASCII, ``False`` otherwise. ASCII characters have code points in the range " "U+0000-U+007F. For example:" msgstr "" -#: ../../library/stdtypes.rst:2213 +#: ../../library/stdtypes.rst:2215 msgid "" ">>> 'ASCII characters'.isascii()\n" "True\n" @@ -3554,7 +3557,7 @@ msgstr "" ">>> 'µ'.isascii()\n" "False" -#: ../../library/stdtypes.rst:2225 +#: ../../library/stdtypes.rst:2227 msgid "" "Return ``True`` if all characters in the string are decimal characters and " "there is at least one character, ``False`` otherwise. Decimal characters are " @@ -3563,7 +3566,7 @@ msgid "" "Unicode General Category \"Nd\". For example:" msgstr "" -#: ../../library/stdtypes.rst:2232 +#: ../../library/stdtypes.rst:2234 msgid "" ">>> '0123456789'.isdecimal()\n" "True\n" @@ -3579,7 +3582,7 @@ msgstr "" ">>> 'alphabetic'.isdecimal()\n" "False" -#: ../../library/stdtypes.rst:2244 +#: ../../library/stdtypes.rst:2246 msgid "" "Return ``True`` if all characters in the string are digits and there is at " "least one character, ``False`` otherwise. Digits include decimal characters " @@ -3589,23 +3592,23 @@ msgid "" "property value Numeric_Type=Digit or Numeric_Type=Decimal." msgstr "" -#: ../../library/stdtypes.rst:2254 +#: ../../library/stdtypes.rst:2256 msgid "" "Return ``True`` if the string is a valid identifier according to the " "language definition, section :ref:`identifiers`." msgstr "" -#: ../../library/stdtypes.rst:2257 +#: ../../library/stdtypes.rst:2259 msgid "" ":func:`keyword.iskeyword` can be used to test whether string ``s`` is a " "reserved identifier, such as :keyword:`def` and :keyword:`class`." msgstr "" -#: ../../library/stdtypes.rst:2260 +#: ../../library/stdtypes.rst:2262 msgid "Example: ::" msgstr "範例: ::" -#: ../../library/stdtypes.rst:2263 +#: ../../library/stdtypes.rst:2265 msgid "" ">>> from keyword import iskeyword\n" "\n" @@ -3621,13 +3624,13 @@ msgstr "" ">>> 'def'.isidentifier(), iskeyword('def')\n" "(True, True)" -#: ../../library/stdtypes.rst:2273 +#: ../../library/stdtypes.rst:2275 msgid "" "Return ``True`` if all cased characters [4]_ in the string are lowercase and " "there is at least one cased character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:2279 +#: ../../library/stdtypes.rst:2281 msgid "" "Return ``True`` if all characters in the string are numeric characters, and " "there is at least one character, ``False`` otherwise. Numeric characters " @@ -3637,7 +3640,7 @@ msgid "" "Numeric_Type=Decimal or Numeric_Type=Numeric. For example:" msgstr "" -#: ../../library/stdtypes.rst:2287 +#: ../../library/stdtypes.rst:2289 msgid "" ">>> '0123456789'.isnumeric()\n" "True\n" @@ -3657,20 +3660,20 @@ msgstr "" ">>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()\n" "(False, True, True)" -#: ../../library/stdtypes.rst:2298 +#: ../../library/stdtypes.rst:2300 msgid "" "See also :meth:`isdecimal` and :meth:`isdigit`. Numeric characters are a " "superset of decimal numbers." msgstr "" "也請參閱 :meth:`isdecimal` 和 :meth:`isdigit`。數字字元是十進位數字的超集。" -#: ../../library/stdtypes.rst:2304 +#: ../../library/stdtypes.rst:2306 msgid "" "Return ``True`` if all characters in the string are printable, ``False`` if " "it contains at least one non-printable character." msgstr "" -#: ../../library/stdtypes.rst:2307 +#: ../../library/stdtypes.rst:2309 msgid "" "Here \"printable\" means the character is suitable for :func:`repr` to use " "in its output; \"non-printable\" means that :func:`repr` on built-in types " @@ -3678,7 +3681,7 @@ msgid "" "written to :data:`sys.stdout` or :data:`sys.stderr`." msgstr "" -#: ../../library/stdtypes.rst:2312 +#: ../../library/stdtypes.rst:2314 msgid "" "The printable characters are those which in the Unicode character database " "(see :mod:`unicodedata`) have a general category in group Letter, Mark, " @@ -3687,12 +3690,12 @@ msgid "" "C), except the ASCII space." msgstr "" -#: ../../library/stdtypes.rst:2318 ../../library/stdtypes.rst:2345 -#: ../../library/stdtypes.rst:2400 ../../library/stdtypes.rst:2565 +#: ../../library/stdtypes.rst:2320 ../../library/stdtypes.rst:2347 +#: ../../library/stdtypes.rst:2402 ../../library/stdtypes.rst:2581 msgid "For example:" msgstr "舉例來說:" -#: ../../library/stdtypes.rst:2320 +#: ../../library/stdtypes.rst:2322 msgid "" ">>> ''.isprintable(), ' '.isprintable()\n" "(True, True)\n" @@ -3704,20 +3707,20 @@ msgstr "" ">>> '\\t'.isprintable(), '\\n'.isprintable()\n" "(False, False)" -#: ../../library/stdtypes.rst:2330 +#: ../../library/stdtypes.rst:2332 msgid "" "Return ``True`` if there are only whitespace characters in the string and " "there is at least one character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:2333 +#: ../../library/stdtypes.rst:2335 msgid "" "A character is *whitespace* if in the Unicode character database (see :mod:" "`unicodedata`), either its general category is ``Zs`` (\"Separator, " "space\"), or its bidirectional class is one of ``WS``, ``B``, or ``S``." msgstr "" -#: ../../library/stdtypes.rst:2341 +#: ../../library/stdtypes.rst:2343 msgid "" "Return ``True`` if the string is a titlecased string and there is at least " "one character, for example uppercase characters may only follow uncased " @@ -3725,7 +3728,7 @@ msgid "" "otherwise." msgstr "" -#: ../../library/stdtypes.rst:2347 +#: ../../library/stdtypes.rst:2349 msgid "" ">>> 'Spam, Spam, Spam'.istitle()\n" "True\n" @@ -3741,17 +3744,17 @@ msgstr "" ">>> 'SPAM, SPAM, SPAM'.istitle()\n" "False" -#: ../../library/stdtypes.rst:2356 +#: ../../library/stdtypes.rst:2358 msgid "See also :meth:`title`." msgstr "另請參閱 :meth:`title`。" -#: ../../library/stdtypes.rst:2361 +#: ../../library/stdtypes.rst:2363 msgid "" "Return ``True`` if all cased characters [4]_ in the string are uppercase and " "there is at least one cased character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:2379 +#: ../../library/stdtypes.rst:2381 msgid "" "Return a string which is the concatenation of the strings in *iterable*. A :" "exc:`TypeError` will be raised if there are any non-string values in " @@ -3759,7 +3762,7 @@ msgid "" "elements is the string providing this method. For example:" msgstr "" -#: ../../library/stdtypes.rst:2384 +#: ../../library/stdtypes.rst:2386 msgid "" ">>> ', '.join(['spam', 'spam', 'spam'])\n" "'spam, spam, spam'\n" @@ -3771,18 +3774,18 @@ msgstr "" ">>> '-'.join('Python')\n" "'P-y-t-h-o-n'" -#: ../../library/stdtypes.rst:2391 +#: ../../library/stdtypes.rst:2393 msgid "See also :meth:`split`." msgstr "另請參閱 :meth:`split`。" -#: ../../library/stdtypes.rst:2396 +#: ../../library/stdtypes.rst:2398 msgid "" "Return the string left justified in a string of length *width*. Padding is " "done using the specified *fillchar* (default is an ASCII space). The " "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2402 +#: ../../library/stdtypes.rst:2404 msgid "" ">>> 'Python'.ljust(10)\n" "'Python '\n" @@ -3798,17 +3801,17 @@ msgstr "" ">>> 'Monty Python'.ljust(10, '.')\n" "'Monty Python'" -#: ../../library/stdtypes.rst:2411 +#: ../../library/stdtypes.rst:2413 msgid "See also :meth:`rjust`." msgstr "另請參閱 :meth:`rjust`。" -#: ../../library/stdtypes.rst:2416 +#: ../../library/stdtypes.rst:2418 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "lowercase. For example:" msgstr "" -#: ../../library/stdtypes.rst:2419 +#: ../../library/stdtypes.rst:2421 msgid "" ">>> 'Lower Method Example'.lower()\n" "'lower method example'" @@ -3816,14 +3819,14 @@ msgstr "" ">>> 'Lower Method Example'.lower()\n" "'lower method example'" -#: ../../library/stdtypes.rst:2424 +#: ../../library/stdtypes.rst:2426 msgid "" "The lowercasing algorithm used is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." msgstr "" -#: ../../library/stdtypes.rst:2431 +#: ../../library/stdtypes.rst:2433 msgid "" "Return a copy of the string with leading characters removed. The *chars* " "argument is a string specifying the set of characters to be removed. If " @@ -3832,7 +3835,7 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2436 +#: ../../library/stdtypes.rst:2438 msgid "" ">>> ' spacious '.lstrip()\n" "'spacious '\n" @@ -3844,13 +3847,13 @@ msgstr "" ">>> 'www.example.com'.lstrip('cmowz.')\n" "'example.com'" -#: ../../library/stdtypes.rst:2441 +#: ../../library/stdtypes.rst:2443 msgid "" "See :meth:`str.removeprefix` for a method that will remove a single prefix " "string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:2444 +#: ../../library/stdtypes.rst:2446 msgid "" ">>> 'Arthur: three!'.lstrip('Arthur: ')\n" "'ee!'\n" @@ -3862,13 +3865,13 @@ msgstr "" ">>> 'Arthur: three!'.removeprefix('Arthur: ')\n" "'three!'" -#: ../../library/stdtypes.rst:2453 +#: ../../library/stdtypes.rst:2455 msgid "" "This static method returns a translation table usable for :meth:`str." "translate`." msgstr "" -#: ../../library/stdtypes.rst:2455 +#: ../../library/stdtypes.rst:2457 msgid "" "If there is only one argument, it must be a dictionary mapping Unicode " "ordinals (integers) or characters (strings of length 1) to Unicode ordinals, " @@ -3876,7 +3879,7 @@ msgid "" "converted to ordinals." msgstr "" -#: ../../library/stdtypes.rst:2460 +#: ../../library/stdtypes.rst:2462 msgid "" "If there are two arguments, they must be strings of equal length, and in the " "resulting dictionary, each character in *from* will be mapped to the " @@ -3884,7 +3887,7 @@ msgid "" "must be a string, whose characters will be mapped to ``None`` in the result." msgstr "" -#: ../../library/stdtypes.rst:2468 +#: ../../library/stdtypes.rst:2470 msgid "" "Split the string at the first occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself, and the part " @@ -3892,13 +3895,13 @@ msgid "" "containing the string itself, followed by two empty strings." msgstr "" -#: ../../library/stdtypes.rst:2476 +#: ../../library/stdtypes.rst:2478 msgid "" "If the string starts with the *prefix* string, return " "``string[len(prefix):]``. Otherwise, return a copy of the original string:" msgstr "" -#: ../../library/stdtypes.rst:2480 +#: ../../library/stdtypes.rst:2482 msgid "" ">>> 'TestHook'.removeprefix('Test')\n" "'Hook'\n" @@ -3910,18 +3913,18 @@ msgstr "" ">>> 'BaseTestCase'.removeprefix('Test')\n" "'BaseTestCase'" -#: ../../library/stdtypes.rst:2489 +#: ../../library/stdtypes.rst:2491 msgid "See also :meth:`removesuffix` and :meth:`startswith`." msgstr "另請參閱 :meth:`removesuffix` 和 :meth:`startswith`。" -#: ../../library/stdtypes.rst:2494 +#: ../../library/stdtypes.rst:2496 msgid "" "If the string ends with the *suffix* string and that *suffix* is not empty, " "return ``string[:-len(suffix)]``. Otherwise, return a copy of the original " "string:" msgstr "" -#: ../../library/stdtypes.rst:2498 +#: ../../library/stdtypes.rst:2500 msgid "" ">>> 'MiscTests'.removesuffix('Tests')\n" "'Misc'\n" @@ -3933,11 +3936,11 @@ msgstr "" ">>> 'TmpDirMixin'.removesuffix('Tests')\n" "'TmpDirMixin'" -#: ../../library/stdtypes.rst:2507 +#: ../../library/stdtypes.rst:2509 msgid "See also :meth:`removeprefix` and :meth:`endswith`." msgstr "另請參閱 :meth:`removeprefix` 和 :meth:`endswith`。" -#: ../../library/stdtypes.rst:2512 +#: ../../library/stdtypes.rst:2514 msgid "" "Return a copy of the string with all occurrences of substring *old* replaced " "by *new*. If *count* is given, only the first *count* occurrences are " @@ -3945,7 +3948,7 @@ msgid "" "replaced. For example:" msgstr "" -#: ../../library/stdtypes.rst:2517 +#: ../../library/stdtypes.rst:2519 msgid "" ">>> 'spam, spam, spam'.replace('spam', 'eggs')\n" "'eggs, eggs, eggs'\n" @@ -3957,11 +3960,11 @@ msgstr "" ">>> 'spam, spam, spam'.replace('spam', 'eggs', 1)\n" "'eggs, spam, spam'" -#: ../../library/stdtypes.rst:2524 +#: ../../library/stdtypes.rst:2526 msgid "*count* is now supported as a keyword argument." msgstr "*count* 現在作為關鍵字引數被支援。" -#: ../../library/stdtypes.rst:2530 +#: ../../library/stdtypes.rst:2532 msgid "" "Return the highest index in the string where substring *sub* is found, such " "that *sub* is contained within ``s[start:end]``. Optional arguments *start* " @@ -3969,7 +3972,7 @@ msgid "" "For example:" msgstr "" -#: ../../library/stdtypes.rst:2535 +#: ../../library/stdtypes.rst:2537 msgid "" ">>> 'spam, spam, spam'.rfind('sp')\n" "12\n" @@ -3981,24 +3984,48 @@ msgstr "" ">>> 'spam, spam, spam'.rfind('sp', 0, 10)\n" "6" -#: ../../library/stdtypes.rst:2542 +#: ../../library/stdtypes.rst:2544 msgid "See also :meth:`find` and :meth:`rindex`." msgstr "另請參閱 :meth:`find` 和 :meth:`rindex`。" -#: ../../library/stdtypes.rst:2547 +#: ../../library/stdtypes.rst:2549 msgid "" "Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is " -"not found." +"not found. For example:" msgstr "" #: ../../library/stdtypes.rst:2553 +#, fuzzy +msgid "" +">>> 'spam, spam, spam'.rindex('spam')\n" +"12\n" +">>> 'spam, spam, spam'.rindex('eggs')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" 'spam, spam, spam'.rindex('eggs')\n" +" ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n" +"ValueError: substring not found" +msgstr "" +">>> 'spam, spam, spam'.index('eggs')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" 'spam, spam, spam'.index('eggs')\n" +" ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n" +"ValueError: substring not found" + +#: ../../library/stdtypes.rst:2564 +#, fuzzy +msgid "See also :meth:`index` and :meth:`find`." +msgstr "另請參閱 :meth:`rfind` 和 :meth:`index`。" + +#: ../../library/stdtypes.rst:2569 msgid "" "Return the string right justified in a string of length *width*. Padding is " "done using the specified *fillchar* (default is an ASCII space). The " "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2560 +#: ../../library/stdtypes.rst:2576 msgid "" "Split the string at the last occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself, and the part " @@ -4006,7 +4033,7 @@ msgid "" "containing two empty strings, followed by the string itself." msgstr "" -#: ../../library/stdtypes.rst:2567 +#: ../../library/stdtypes.rst:2583 msgid "" ">>> 'Monty Python'.rpartition(' ')\n" "('Monty', ' ', 'Python')\n" @@ -4022,11 +4049,11 @@ msgstr "" ">>> 'Monty Python'.rpartition('-')\n" "('', '', 'Monty Python')" -#: ../../library/stdtypes.rst:2576 +#: ../../library/stdtypes.rst:2592 msgid "See also :meth:`partition`." msgstr "另請參閱 :meth:`partition`。" -#: ../../library/stdtypes.rst:2581 +#: ../../library/stdtypes.rst:2597 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done, the " @@ -4035,7 +4062,7 @@ msgid "" "behaves like :meth:`split` which is described in detail below." msgstr "" -#: ../../library/stdtypes.rst:2590 +#: ../../library/stdtypes.rst:2606 msgid "" "Return a copy of the string with trailing characters removed. The *chars* " "argument is a string specifying the set of characters to be removed. If " @@ -4044,7 +4071,7 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2595 +#: ../../library/stdtypes.rst:2611 msgid "" ">>> ' spacious '.rstrip()\n" "' spacious'\n" @@ -4056,13 +4083,13 @@ msgstr "" ">>> 'mississippi'.rstrip('ipz')\n" "'mississ'" -#: ../../library/stdtypes.rst:2600 +#: ../../library/stdtypes.rst:2616 msgid "" "See :meth:`str.removesuffix` for a method that will remove a single suffix " "string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:2603 +#: ../../library/stdtypes.rst:2619 msgid "" ">>> 'Monty Python'.rstrip(' Python')\n" "'M'\n" @@ -4074,7 +4101,7 @@ msgstr "" ">>> 'Monty Python'.removesuffix(' Python')\n" "'Monty'" -#: ../../library/stdtypes.rst:2610 +#: ../../library/stdtypes.rst:2626 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, " @@ -4083,7 +4110,7 @@ msgid "" "possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:2616 +#: ../../library/stdtypes.rst:2632 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns " @@ -4093,21 +4120,21 @@ msgid "" "``['']``." msgstr "" -#: ../../library/stdtypes.rst:2623 ../../library/stdtypes.rst:2641 -#: ../../library/stdtypes.rst:2653 ../../library/stdtypes.rst:2707 -#: ../../library/stdtypes.rst:2775 ../../library/stdtypes.rst:2845 -#: ../../library/stdtypes.rst:2940 ../../library/stdtypes.rst:3906 -#: ../../library/stdtypes.rst:3924 ../../library/stdtypes.rst:4014 -#: ../../library/stdtypes.rst:4030 ../../library/stdtypes.rst:4055 -#: ../../library/stdtypes.rst:4069 ../../library/stdtypes.rst:4097 -#: ../../library/stdtypes.rst:4111 ../../library/stdtypes.rst:4129 -#: ../../library/stdtypes.rst:4156 ../../library/stdtypes.rst:4179 -#: ../../library/stdtypes.rst:4206 ../../library/stdtypes.rst:4248 -#: ../../library/stdtypes.rst:4272 +#: ../../library/stdtypes.rst:2639 ../../library/stdtypes.rst:2657 +#: ../../library/stdtypes.rst:2669 ../../library/stdtypes.rst:2723 +#: ../../library/stdtypes.rst:2791 ../../library/stdtypes.rst:2861 +#: ../../library/stdtypes.rst:2956 ../../library/stdtypes.rst:3922 +#: ../../library/stdtypes.rst:3940 ../../library/stdtypes.rst:4030 +#: ../../library/stdtypes.rst:4046 ../../library/stdtypes.rst:4071 +#: ../../library/stdtypes.rst:4085 ../../library/stdtypes.rst:4113 +#: ../../library/stdtypes.rst:4127 ../../library/stdtypes.rst:4145 +#: ../../library/stdtypes.rst:4172 ../../library/stdtypes.rst:4195 +#: ../../library/stdtypes.rst:4222 ../../library/stdtypes.rst:4264 +#: ../../library/stdtypes.rst:4288 msgid "For example::" msgstr "舉例來說: ::" -#: ../../library/stdtypes.rst:2625 +#: ../../library/stdtypes.rst:2641 msgid "" ">>> '1,2,3'.split(',')\n" "['1', '2', '3']\n" @@ -4127,7 +4154,7 @@ msgstr "" ">>> '1<>2<>3<4'.split('<>')\n" "['1', '2', '3<4']" -#: ../../library/stdtypes.rst:2634 +#: ../../library/stdtypes.rst:2650 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " "applied: runs of consecutive whitespace are regarded as a single separator, " @@ -4137,7 +4164,7 @@ msgid "" "returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:2643 +#: ../../library/stdtypes.rst:2659 msgid "" ">>> '1 2 3'.split()\n" "['1', '2', '3']\n" @@ -4153,13 +4180,13 @@ msgstr "" ">>> ' 1 2 3 '.split()\n" "['1', '2', '3']" -#: ../../library/stdtypes.rst:2650 +#: ../../library/stdtypes.rst:2666 msgid "" "If *sep* is not specified or is ``None`` and *maxsplit* is ``0``, only " "leading runs of consecutive whitespace are considered." msgstr "" -#: ../../library/stdtypes.rst:2655 +#: ../../library/stdtypes.rst:2671 msgid "" ">>> \"\".split(None, 0)\n" "[]\n" @@ -4175,124 +4202,124 @@ msgstr "" ">>> \" foo \".split(maxsplit=0)\n" "['foo ']" -#: ../../library/stdtypes.rst:2662 +#: ../../library/stdtypes.rst:2678 msgid "See also :meth:`join`." msgstr "另請參閱 :meth:`join`。" -#: ../../library/stdtypes.rst:2670 +#: ../../library/stdtypes.rst:2686 msgid "" "Return a list of the lines in the string, breaking at line boundaries. Line " "breaks are not included in the resulting list unless *keepends* is given and " "true." msgstr "" -#: ../../library/stdtypes.rst:2674 +#: ../../library/stdtypes.rst:2690 msgid "" "This method splits on the following line boundaries. In particular, the " "boundaries are a superset of :term:`universal newlines`." msgstr "" -#: ../../library/stdtypes.rst:2678 +#: ../../library/stdtypes.rst:2694 msgid "Representation" msgstr "" -#: ../../library/stdtypes.rst:2678 +#: ../../library/stdtypes.rst:2694 msgid "Description" msgstr "描述" -#: ../../library/stdtypes.rst:2680 +#: ../../library/stdtypes.rst:2696 msgid "``\\n``" msgstr "``\\n``" -#: ../../library/stdtypes.rst:2680 +#: ../../library/stdtypes.rst:2696 msgid "Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2682 +#: ../../library/stdtypes.rst:2698 msgid "``\\r``" msgstr "``\\r``" -#: ../../library/stdtypes.rst:2682 +#: ../../library/stdtypes.rst:2698 msgid "Carriage Return" msgstr "" -#: ../../library/stdtypes.rst:2684 +#: ../../library/stdtypes.rst:2700 msgid "``\\r\\n``" msgstr "``\\r\\n``" -#: ../../library/stdtypes.rst:2684 +#: ../../library/stdtypes.rst:2700 msgid "Carriage Return + Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2686 +#: ../../library/stdtypes.rst:2702 msgid "``\\v`` or ``\\x0b``" msgstr "``\\v`` 或 ``\\x0b``" -#: ../../library/stdtypes.rst:2686 +#: ../../library/stdtypes.rst:2702 msgid "Line Tabulation" msgstr "" -#: ../../library/stdtypes.rst:2688 +#: ../../library/stdtypes.rst:2704 msgid "``\\f`` or ``\\x0c``" msgstr "``\\f`` 或 ``\\x0c``" -#: ../../library/stdtypes.rst:2688 +#: ../../library/stdtypes.rst:2704 msgid "Form Feed" msgstr "" -#: ../../library/stdtypes.rst:2690 +#: ../../library/stdtypes.rst:2706 msgid "``\\x1c``" msgstr "``\\x1c``" -#: ../../library/stdtypes.rst:2690 +#: ../../library/stdtypes.rst:2706 msgid "File Separator" msgstr "" -#: ../../library/stdtypes.rst:2692 +#: ../../library/stdtypes.rst:2708 msgid "``\\x1d``" msgstr "``\\x1d``" -#: ../../library/stdtypes.rst:2692 +#: ../../library/stdtypes.rst:2708 msgid "Group Separator" msgstr "" -#: ../../library/stdtypes.rst:2694 +#: ../../library/stdtypes.rst:2710 msgid "``\\x1e``" msgstr "``\\x1e``" -#: ../../library/stdtypes.rst:2694 +#: ../../library/stdtypes.rst:2710 msgid "Record Separator" msgstr "" -#: ../../library/stdtypes.rst:2696 +#: ../../library/stdtypes.rst:2712 msgid "``\\x85``" msgstr "``\\x85``" -#: ../../library/stdtypes.rst:2696 +#: ../../library/stdtypes.rst:2712 msgid "Next Line (C1 Control Code)" msgstr "" -#: ../../library/stdtypes.rst:2698 +#: ../../library/stdtypes.rst:2714 msgid "``\\u2028``" msgstr "``\\u2028``" -#: ../../library/stdtypes.rst:2698 +#: ../../library/stdtypes.rst:2714 msgid "Line Separator" msgstr "" -#: ../../library/stdtypes.rst:2700 +#: ../../library/stdtypes.rst:2716 msgid "``\\u2029``" msgstr "``\\u2029``" -#: ../../library/stdtypes.rst:2700 +#: ../../library/stdtypes.rst:2716 msgid "Paragraph Separator" msgstr "" -#: ../../library/stdtypes.rst:2705 +#: ../../library/stdtypes.rst:2721 msgid "``\\v`` and ``\\f`` added to list of line boundaries." msgstr "" -#: ../../library/stdtypes.rst:2709 +#: ../../library/stdtypes.rst:2725 msgid "" ">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "['ab c', '', 'de fg', 'kl']\n" @@ -4304,14 +4331,14 @@ msgstr "" ">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" "['ab c\\n', '\\n', 'de fg\\r', 'kl\\r\\n']" -#: ../../library/stdtypes.rst:2714 +#: ../../library/stdtypes.rst:2730 msgid "" "Unlike :meth:`~str.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " "does not result in an extra line::" msgstr "" -#: ../../library/stdtypes.rst:2718 +#: ../../library/stdtypes.rst:2734 msgid "" ">>> \"\".splitlines()\n" "[]\n" @@ -4323,11 +4350,11 @@ msgstr "" ">>> \"One line\\n\".splitlines()\n" "['One line']" -#: ../../library/stdtypes.rst:2723 +#: ../../library/stdtypes.rst:2739 msgid "For comparison, ``split('\\n')`` gives::" msgstr "" -#: ../../library/stdtypes.rst:2725 +#: ../../library/stdtypes.rst:2741 msgid "" ">>> ''.split('\\n')\n" "['']\n" @@ -4339,7 +4366,7 @@ msgstr "" ">>> 'Two lines\\n'.split('\\n')\n" "['Two lines', '']" -#: ../../library/stdtypes.rst:2733 +#: ../../library/stdtypes.rst:2749 msgid "" "Return ``True`` if string starts with the *prefix*, otherwise return " "``False``. *prefix* can also be a tuple of prefixes to look for. With " @@ -4347,7 +4374,7 @@ msgid "" "*end*, stop comparing string at that position." msgstr "" -#: ../../library/stdtypes.rst:2741 +#: ../../library/stdtypes.rst:2757 msgid "" "Return a copy of the string with the leading and trailing characters " "removed. The *chars* argument is a string specifying the set of characters " @@ -4356,7 +4383,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2747 +#: ../../library/stdtypes.rst:2763 msgid "" ">>> ' spacious '.strip()\n" "'spacious'\n" @@ -4368,7 +4395,7 @@ msgstr "" ">>> 'www.example.com'.strip('cmowz.')\n" "'example'" -#: ../../library/stdtypes.rst:2752 +#: ../../library/stdtypes.rst:2768 msgid "" "The outermost leading and trailing *chars* argument values are stripped from " "the string. Characters are removed from the leading end until reaching a " @@ -4376,7 +4403,7 @@ msgid "" "A similar action takes place on the trailing end. For example::" msgstr "" -#: ../../library/stdtypes.rst:2758 +#: ../../library/stdtypes.rst:2774 msgid "" ">>> comment_string = '#....... Section 3.2.1 Issue #32 .......'\n" ">>> comment_string.strip('.#! ')\n" @@ -4386,20 +4413,20 @@ msgstr "" ">>> comment_string.strip('.#! ')\n" "'Section 3.2.1 Issue #32'" -#: ../../library/stdtypes.rst:2765 +#: ../../library/stdtypes.rst:2781 msgid "" "Return a copy of the string with uppercase characters converted to lowercase " "and vice versa. Note that it is not necessarily true that ``s.swapcase()." "swapcase() == s``." msgstr "" -#: ../../library/stdtypes.rst:2772 +#: ../../library/stdtypes.rst:2788 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:2777 +#: ../../library/stdtypes.rst:2793 msgid "" ">>> 'Hello world'.title()\n" "'Hello World'" @@ -4407,7 +4434,7 @@ msgstr "" ">>> 'Hello world'.title()\n" "'Hello World'" -#: ../../library/stdtypes.rst:2780 ../../library/stdtypes.rst:4216 +#: ../../library/stdtypes.rst:2796 ../../library/stdtypes.rst:4232 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 " @@ -4415,7 +4442,7 @@ msgid "" "which may not be the desired result::" msgstr "" -#: ../../library/stdtypes.rst:2785 +#: ../../library/stdtypes.rst:2801 msgid "" ">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" @@ -4423,19 +4450,19 @@ msgstr "" ">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" -#: ../../library/stdtypes.rst:2788 +#: ../../library/stdtypes.rst:2804 msgid "" "The :func:`string.capwords` function does not have this problem, as it " "splits words on spaces only." msgstr "" -#: ../../library/stdtypes.rst:2791 +#: ../../library/stdtypes.rst:2807 msgid "" "Alternatively, a workaround for apostrophes can be constructed using regular " "expressions::" msgstr "" -#: ../../library/stdtypes.rst:2794 +#: ../../library/stdtypes.rst:2810 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -4455,11 +4482,11 @@ msgstr "" ">>> titlecase(\"they're bill's friends.\")\n" "\"They're Bill's Friends.\"" -#: ../../library/stdtypes.rst:2803 +#: ../../library/stdtypes.rst:2819 msgid "See also :meth:`istitle`." msgstr "另請參閱 :meth:`istitle`。" -#: ../../library/stdtypes.rst:2808 +#: ../../library/stdtypes.rst:2824 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 " @@ -4471,19 +4498,19 @@ msgid "" "exception, to map the character to itself." msgstr "" -#: ../../library/stdtypes.rst:2817 +#: ../../library/stdtypes.rst:2833 msgid "" "You can use :meth:`str.maketrans` to create a translation map from character-" "to-character mappings in different formats." msgstr "" -#: ../../library/stdtypes.rst:2820 +#: ../../library/stdtypes.rst:2836 msgid "" "See also the :mod:`codecs` module for a more flexible approach to custom " "character mappings." msgstr "" -#: ../../library/stdtypes.rst:2826 +#: ../../library/stdtypes.rst:2842 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`` " @@ -4492,14 +4519,14 @@ msgid "" "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:2832 +#: ../../library/stdtypes.rst:2848 msgid "" "The uppercasing algorithm used is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." msgstr "" -#: ../../library/stdtypes.rst:2839 +#: ../../library/stdtypes.rst:2855 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 " @@ -4507,7 +4534,7 @@ msgid "" "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2847 +#: ../../library/stdtypes.rst:2863 msgid "" ">>> \"42\".zfill(5)\n" "'00042'\n" @@ -4519,27 +4546,27 @@ msgstr "" ">>> \"-42\".zfill(5)\n" "'-0042'" -#: ../../library/stdtypes.rst:2870 +#: ../../library/stdtypes.rst:2886 msgid "Formatted String Literals (f-strings)" msgstr "" -#: ../../library/stdtypes.rst:2873 +#: ../../library/stdtypes.rst:2889 msgid "" "The :keyword:`await` and :keyword:`async for` can be used in expressions " "within f-strings." msgstr "" -#: ../../library/stdtypes.rst:2876 +#: ../../library/stdtypes.rst:2892 msgid "Added the debug specifier (``=``)" msgstr "" -#: ../../library/stdtypes.rst:2878 +#: ../../library/stdtypes.rst:2894 msgid "" "Many restrictions on expressions within f-strings have been removed. " "Notably, nested strings, comments, and backslashes are now permitted." msgstr "" -#: ../../library/stdtypes.rst:2882 +#: ../../library/stdtypes.rst:2898 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 " @@ -4548,29 +4575,29 @@ msgid "" "replacement field must contain an expression, optionally followed by:" msgstr "" -#: ../../library/stdtypes.rst:2889 +#: ../../library/stdtypes.rst:2905 msgid "a *debug specifier* -- an equal sign (``=``);" msgstr "" -#: ../../library/stdtypes.rst:2890 +#: ../../library/stdtypes.rst:2906 msgid "a *conversion specifier* -- ``!s``, ``!r`` or ``!a``; and/or" msgstr "" -#: ../../library/stdtypes.rst:2891 +#: ../../library/stdtypes.rst:2907 msgid "a *format specifier* prefixed with a colon (``:``)." msgstr "" -#: ../../library/stdtypes.rst:2893 +#: ../../library/stdtypes.rst:2909 msgid "" "See the :ref:`Lexical Analysis section on f-strings ` for details " "on the syntax of these fields." msgstr "" -#: ../../library/stdtypes.rst:2897 +#: ../../library/stdtypes.rst:2913 msgid "Debug specifier" msgstr "" -#: ../../library/stdtypes.rst:2901 +#: ../../library/stdtypes.rst:2917 msgid "" "If a debug specifier -- an equal sign (``=``) -- appears after the " "replacement field expression, the resulting f-string will contain the " @@ -4578,7 +4605,7 @@ msgid "" "is often useful for debugging::" msgstr "" -#: ../../library/stdtypes.rst:2906 +#: ../../library/stdtypes.rst:2922 msgid "" ">>> number = 14.3\n" ">>> f'{number=}'\n" @@ -4588,13 +4615,13 @@ msgstr "" ">>> f'{number=}'\n" "'number=14.3'" -#: ../../library/stdtypes.rst:2910 +#: ../../library/stdtypes.rst:2926 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:2913 +#: ../../library/stdtypes.rst:2929 msgid "" ">>> f'{ number - 4 = }'\n" "' number - 4 = 10.3'" @@ -4602,17 +4629,17 @@ msgstr "" ">>> f'{ number - 4 = }'\n" "' number - 4 = 10.3'" -#: ../../library/stdtypes.rst:2918 +#: ../../library/stdtypes.rst:2934 msgid "Conversion specifier" msgstr "" -#: ../../library/stdtypes.rst:2920 +#: ../../library/stdtypes.rst:2936 msgid "" "By default, the value of a replacement field expression is converted to a " "string using :func:`str`::" msgstr "" -#: ../../library/stdtypes.rst:2923 +#: ../../library/stdtypes.rst:2939 msgid "" ">>> from fractions import Fraction\n" ">>> one_third = Fraction(1, 3)\n" @@ -4624,13 +4651,13 @@ msgstr "" ">>> f'{one_third}'\n" "'1/3'" -#: ../../library/stdtypes.rst:2928 +#: ../../library/stdtypes.rst:2944 msgid "" "When a debug specifier but no format specifier is used, the default " "conversion instead uses :func:`repr`::" msgstr "" -#: ../../library/stdtypes.rst:2931 +#: ../../library/stdtypes.rst:2947 msgid "" ">>> f'{one_third = }'\n" "'one_third = Fraction(1, 3)'" @@ -4638,24 +4665,24 @@ msgstr "" ">>> f'{one_third = }'\n" "'one_third = Fraction(1, 3)'" -#: ../../library/stdtypes.rst:2934 +#: ../../library/stdtypes.rst:2950 msgid "" "The conversion can be specified explicitly using one of these specifiers:" msgstr "" -#: ../../library/stdtypes.rst:2936 +#: ../../library/stdtypes.rst:2952 msgid "``!s`` for :func:`str`" msgstr "``!s`` 用於 :func:`str`" -#: ../../library/stdtypes.rst:2937 +#: ../../library/stdtypes.rst:2953 msgid "``!r`` for :func:`repr`" msgstr "``!r`` 用於 :func:`repr`" -#: ../../library/stdtypes.rst:2938 +#: ../../library/stdtypes.rst:2954 msgid "``!a`` for :func:`ascii`" msgstr "``!a`` 用於 :func:`ascii`" -#: ../../library/stdtypes.rst:2942 +#: ../../library/stdtypes.rst:2958 msgid "" ">>> str(one_third)\n" "'1/3'\n" @@ -4687,11 +4714,11 @@ msgstr "" ">>> f'{string = !a}'\n" "\"string = '\\\\xa1ko\\\\u010dka \\\\U0001f638!'\"" -#: ../../library/stdtypes.rst:2959 +#: ../../library/stdtypes.rst:2975 msgid "Format specifier" msgstr "" -#: ../../library/stdtypes.rst:2961 +#: ../../library/stdtypes.rst:2977 msgid "" "After the expression has been evaluated, and possibly converted using an " "explicit conversion specifier, it is formatted using the :func:`format` " @@ -4701,7 +4728,7 @@ msgid "" "the replacement field. For example::" msgstr "" -#: ../../library/stdtypes.rst:2968 +#: ../../library/stdtypes.rst:2984 msgid "" ">>> from fractions import Fraction\n" ">>> one_third = Fraction(1, 3)\n" @@ -4725,29 +4752,29 @@ msgstr "" ">>> f'{one_third = :~>10}~'\n" "'one_third = ~~~~~~~1/3~'" -#: ../../library/stdtypes.rst:2982 +#: ../../library/stdtypes.rst:2998 msgid "Template String Literals (t-strings)" msgstr "模板字串字面值 (t-strings)" -#: ../../library/stdtypes.rst:2984 +#: ../../library/stdtypes.rst:3000 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:2987 +#: ../../library/stdtypes.rst:3003 msgid "" "These strings follow the same syntax and evaluation rules as :ref:`formatted " "string literals `, with for the following differences:" msgstr "" -#: ../../library/stdtypes.rst:2991 +#: ../../library/stdtypes.rst:3007 msgid "" "Rather than evaluating to a ``str`` object, template string literals " "evaluate to a :class:`string.templatelib.Template` object." msgstr "" -#: ../../library/stdtypes.rst:2994 +#: ../../library/stdtypes.rst:3010 msgid "" "The :func:`format` protocol is not used. Instead, the format specifier and " "conversions (if any) are passed to a new :class:`~string.templatelib." @@ -4756,7 +4783,7 @@ msgid "" "Template` object to decide how to handle format specifiers and conversions." msgstr "" -#: ../../library/stdtypes.rst:3001 +#: ../../library/stdtypes.rst:3017 msgid "" "Format specifiers containing nested replacement fields are evaluated " "eagerly, prior to being passed to the :class:`~string.templatelib." @@ -4766,7 +4793,7 @@ msgid "" "to be ``2``, the resulting format specifier would be ``'.2f'``." msgstr "" -#: ../../library/stdtypes.rst:3009 +#: ../../library/stdtypes.rst:3025 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 " @@ -4778,18 +4805,18 @@ msgid "" "behaviour." msgstr "" -#: ../../library/stdtypes.rst:3023 +#: ../../library/stdtypes.rst:3039 msgid "``printf``-style String Formatting" msgstr "" -#: ../../library/stdtypes.rst:3036 +#: ../../library/stdtypes.rst:3052 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:3040 +#: ../../library/stdtypes.rst:3056 msgid "" "Using :ref:`formatted string literals `, the :meth:`str.format` " "interface, or :class:`string.Template` may help avoid these errors. Each of " @@ -4797,7 +4824,7 @@ msgid "" "flexibility, and/or extensibility." msgstr "" -#: ../../library/stdtypes.rst:3045 +#: ../../library/stdtypes.rst:3061 msgid "" "String objects have one unique built-in operation: the ``%`` operator " "(modulo). This is also known as the string *formatting* or *interpolation* " @@ -4807,7 +4834,7 @@ msgid "" "function in the C language. For example:" msgstr "" -#: ../../library/stdtypes.rst:3052 +#: ../../library/stdtypes.rst:3068 msgid "" ">>> print('%s has %d quote types.' % ('Python', 2))\n" "Python has 2 quote types." @@ -4815,7 +4842,7 @@ msgstr "" ">>> print('%s has %d quote types.' % ('Python', 2))\n" "Python has 2 quote types." -#: ../../library/stdtypes.rst:3057 +#: ../../library/stdtypes.rst:3073 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 " @@ -4823,36 +4850,36 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:3067 ../../library/stdtypes.rst:4327 +#: ../../library/stdtypes.rst:3083 ../../library/stdtypes.rst:4343 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: ../../library/stdtypes.rst:3070 ../../library/stdtypes.rst:4330 +#: ../../library/stdtypes.rst:3086 ../../library/stdtypes.rst:4346 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../library/stdtypes.rst:3072 ../../library/stdtypes.rst:4332 +#: ../../library/stdtypes.rst:3088 ../../library/stdtypes.rst:4348 msgid "" "Mapping key (optional), consisting of a parenthesised sequence of characters " "(for example, ``(somename)``)." msgstr "" -#: ../../library/stdtypes.rst:3075 ../../library/stdtypes.rst:4335 +#: ../../library/stdtypes.rst:3091 ../../library/stdtypes.rst:4351 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: ../../library/stdtypes.rst:3078 ../../library/stdtypes.rst:4338 +#: ../../library/stdtypes.rst:3094 ../../library/stdtypes.rst:4354 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:3082 ../../library/stdtypes.rst:4342 +#: ../../library/stdtypes.rst:3098 ../../library/stdtypes.rst:4358 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. " "If specified as ``'*'`` (an asterisk), the actual precision is read from the " @@ -4860,15 +4887,15 @@ msgid "" "the precision." msgstr "" -#: ../../library/stdtypes.rst:3087 ../../library/stdtypes.rst:4347 +#: ../../library/stdtypes.rst:3103 ../../library/stdtypes.rst:4363 msgid "Length modifier (optional)." msgstr "" -#: ../../library/stdtypes.rst:3089 ../../library/stdtypes.rst:4349 +#: ../../library/stdtypes.rst:3105 ../../library/stdtypes.rst:4365 msgid "Conversion type." msgstr "" -#: ../../library/stdtypes.rst:3091 +#: ../../library/stdtypes.rst:3107 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 " @@ -4876,279 +4903,279 @@ msgid "" "selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:3100 ../../library/stdtypes.rst:4360 +#: ../../library/stdtypes.rst:3116 ../../library/stdtypes.rst:4376 msgid "" "In this case no ``*`` specifiers may occur in a format (since they require a " "sequential parameter list)." msgstr "" -#: ../../library/stdtypes.rst:3103 ../../library/stdtypes.rst:4363 +#: ../../library/stdtypes.rst:3119 ../../library/stdtypes.rst:4379 msgid "The conversion flag characters are:" msgstr "" -#: ../../library/stdtypes.rst:3112 ../../library/stdtypes.rst:4372 +#: ../../library/stdtypes.rst:3128 ../../library/stdtypes.rst:4388 msgid "Flag" msgstr "" -#: ../../library/stdtypes.rst:3114 ../../library/stdtypes.rst:4374 +#: ../../library/stdtypes.rst:3130 ../../library/stdtypes.rst:4390 msgid "``'#'``" msgstr "``'#'``" -#: ../../library/stdtypes.rst:3114 ../../library/stdtypes.rst:4374 +#: ../../library/stdtypes.rst:3130 ../../library/stdtypes.rst:4390 msgid "" "The value conversion will use the \"alternate form\" (where defined below)." msgstr "" -#: ../../library/stdtypes.rst:3117 ../../library/stdtypes.rst:4377 +#: ../../library/stdtypes.rst:3133 ../../library/stdtypes.rst:4393 msgid "``'0'``" msgstr "``'0'``" -#: ../../library/stdtypes.rst:3117 ../../library/stdtypes.rst:4377 +#: ../../library/stdtypes.rst:3133 ../../library/stdtypes.rst:4393 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: ../../library/stdtypes.rst:3119 ../../library/stdtypes.rst:4379 +#: ../../library/stdtypes.rst:3135 ../../library/stdtypes.rst:4395 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/stdtypes.rst:3119 ../../library/stdtypes.rst:4379 +#: ../../library/stdtypes.rst:3135 ../../library/stdtypes.rst:4395 msgid "" "The converted value is left adjusted (overrides the ``'0'`` conversion if " "both are given)." msgstr "" -#: ../../library/stdtypes.rst:3122 ../../library/stdtypes.rst:4382 +#: ../../library/stdtypes.rst:3138 ../../library/stdtypes.rst:4398 msgid "``' '``" msgstr "``' '``" -#: ../../library/stdtypes.rst:3122 ../../library/stdtypes.rst:4382 +#: ../../library/stdtypes.rst:3138 ../../library/stdtypes.rst:4398 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." msgstr "" -#: ../../library/stdtypes.rst:3125 ../../library/stdtypes.rst:4385 +#: ../../library/stdtypes.rst:3141 ../../library/stdtypes.rst:4401 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/stdtypes.rst:3125 ../../library/stdtypes.rst:4385 +#: ../../library/stdtypes.rst:3141 ../../library/stdtypes.rst:4401 msgid "" "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides " "a \"space\" flag)." msgstr "" -#: ../../library/stdtypes.rst:3129 ../../library/stdtypes.rst:4389 +#: ../../library/stdtypes.rst:3145 ../../library/stdtypes.rst:4405 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:3132 ../../library/stdtypes.rst:4392 +#: ../../library/stdtypes.rst:3148 ../../library/stdtypes.rst:4408 msgid "The conversion types are:" msgstr "" -#: ../../library/stdtypes.rst:3135 ../../library/stdtypes.rst:4395 +#: ../../library/stdtypes.rst:3151 ../../library/stdtypes.rst:4411 msgid "Conversion" msgstr "" -#: ../../library/stdtypes.rst:3137 ../../library/stdtypes.rst:4397 +#: ../../library/stdtypes.rst:3153 ../../library/stdtypes.rst:4413 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/stdtypes.rst:3137 ../../library/stdtypes.rst:3139 -#: ../../library/stdtypes.rst:4397 ../../library/stdtypes.rst:4399 +#: ../../library/stdtypes.rst:3153 ../../library/stdtypes.rst:3155 +#: ../../library/stdtypes.rst:4413 ../../library/stdtypes.rst:4415 msgid "Signed integer decimal." msgstr "" -#: ../../library/stdtypes.rst:3139 ../../library/stdtypes.rst:4399 +#: ../../library/stdtypes.rst:3155 ../../library/stdtypes.rst:4415 msgid "``'i'``" msgstr "``'i'``" -#: ../../library/stdtypes.rst:3141 ../../library/stdtypes.rst:4401 +#: ../../library/stdtypes.rst:3157 ../../library/stdtypes.rst:4417 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/stdtypes.rst:3141 ../../library/stdtypes.rst:4401 +#: ../../library/stdtypes.rst:3157 ../../library/stdtypes.rst:4417 msgid "Signed octal value." msgstr "" -#: ../../library/stdtypes.rst:3143 ../../library/stdtypes.rst:4403 +#: ../../library/stdtypes.rst:3159 ../../library/stdtypes.rst:4419 msgid "``'u'``" msgstr "``'u'``" -#: ../../library/stdtypes.rst:3143 ../../library/stdtypes.rst:4403 +#: ../../library/stdtypes.rst:3159 ../../library/stdtypes.rst:4419 msgid "Obsolete type -- it is identical to ``'d'``." msgstr "" -#: ../../library/stdtypes.rst:3145 ../../library/stdtypes.rst:4405 +#: ../../library/stdtypes.rst:3161 ../../library/stdtypes.rst:4421 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/stdtypes.rst:3145 ../../library/stdtypes.rst:4405 +#: ../../library/stdtypes.rst:3161 ../../library/stdtypes.rst:4421 msgid "Signed hexadecimal (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:3147 ../../library/stdtypes.rst:4407 +#: ../../library/stdtypes.rst:3163 ../../library/stdtypes.rst:4423 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/stdtypes.rst:3147 ../../library/stdtypes.rst:4407 +#: ../../library/stdtypes.rst:3163 ../../library/stdtypes.rst:4423 msgid "Signed hexadecimal (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:3149 ../../library/stdtypes.rst:4409 +#: ../../library/stdtypes.rst:3165 ../../library/stdtypes.rst:4425 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/stdtypes.rst:3149 ../../library/stdtypes.rst:4409 +#: ../../library/stdtypes.rst:3165 ../../library/stdtypes.rst:4425 msgid "Floating-point exponential format (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:3151 ../../library/stdtypes.rst:4411 +#: ../../library/stdtypes.rst:3167 ../../library/stdtypes.rst:4427 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/stdtypes.rst:3151 ../../library/stdtypes.rst:4411 +#: ../../library/stdtypes.rst:3167 ../../library/stdtypes.rst:4427 msgid "Floating-point exponential format (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:3153 ../../library/stdtypes.rst:4413 +#: ../../library/stdtypes.rst:3169 ../../library/stdtypes.rst:4429 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/stdtypes.rst:3153 ../../library/stdtypes.rst:3155 -#: ../../library/stdtypes.rst:4413 ../../library/stdtypes.rst:4415 +#: ../../library/stdtypes.rst:3169 ../../library/stdtypes.rst:3171 +#: ../../library/stdtypes.rst:4429 ../../library/stdtypes.rst:4431 msgid "Floating-point decimal format." msgstr "" -#: ../../library/stdtypes.rst:3155 ../../library/stdtypes.rst:4415 +#: ../../library/stdtypes.rst:3171 ../../library/stdtypes.rst:4431 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/stdtypes.rst:3157 ../../library/stdtypes.rst:4417 +#: ../../library/stdtypes.rst:3173 ../../library/stdtypes.rst:4433 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/stdtypes.rst:3157 ../../library/stdtypes.rst:4417 +#: ../../library/stdtypes.rst:3173 ../../library/stdtypes.rst:4433 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:3161 ../../library/stdtypes.rst:4421 +#: ../../library/stdtypes.rst:3177 ../../library/stdtypes.rst:4437 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/stdtypes.rst:3161 ../../library/stdtypes.rst:4421 +#: ../../library/stdtypes.rst:3177 ../../library/stdtypes.rst:4437 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:3165 ../../library/stdtypes.rst:4425 +#: ../../library/stdtypes.rst:3181 ../../library/stdtypes.rst:4441 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/stdtypes.rst:3165 +#: ../../library/stdtypes.rst:3181 msgid "Single character (accepts integer or single character string)." msgstr "" -#: ../../library/stdtypes.rst:3168 ../../library/stdtypes.rst:4438 +#: ../../library/stdtypes.rst:3184 ../../library/stdtypes.rst:4454 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/stdtypes.rst:3168 +#: ../../library/stdtypes.rst:3184 msgid "String (converts any Python object using :func:`repr`)." msgstr "" -#: ../../library/stdtypes.rst:3171 ../../library/stdtypes.rst:4432 +#: ../../library/stdtypes.rst:3187 ../../library/stdtypes.rst:4448 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/stdtypes.rst:3171 +#: ../../library/stdtypes.rst:3187 msgid "String (converts any Python object using :func:`str`)." msgstr "" -#: ../../library/stdtypes.rst:3174 ../../library/stdtypes.rst:4435 +#: ../../library/stdtypes.rst:3190 ../../library/stdtypes.rst:4451 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/stdtypes.rst:3174 +#: ../../library/stdtypes.rst:3190 msgid "String (converts any Python object using :func:`ascii`)." msgstr "" -#: ../../library/stdtypes.rst:3177 ../../library/stdtypes.rst:4441 +#: ../../library/stdtypes.rst:3193 ../../library/stdtypes.rst:4457 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/stdtypes.rst:3177 ../../library/stdtypes.rst:4441 +#: ../../library/stdtypes.rst:3193 ../../library/stdtypes.rst:4457 msgid "No argument is converted, results in a ``'%'`` character in the result." msgstr "" -#: ../../library/stdtypes.rst:3184 ../../library/stdtypes.rst:4448 +#: ../../library/stdtypes.rst:3200 ../../library/stdtypes.rst:4464 msgid "" "The alternate form causes a leading octal specifier (``'0o'``) to be " "inserted before the first digit." msgstr "" -#: ../../library/stdtypes.rst:3188 ../../library/stdtypes.rst:4452 +#: ../../library/stdtypes.rst:3204 ../../library/stdtypes.rst:4468 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:3192 ../../library/stdtypes.rst:4456 +#: ../../library/stdtypes.rst:3208 ../../library/stdtypes.rst:4472 msgid "" "The alternate form causes the result to always contain a decimal point, even " "if no digits follow it." msgstr "" -#: ../../library/stdtypes.rst:3195 ../../library/stdtypes.rst:4459 +#: ../../library/stdtypes.rst:3211 ../../library/stdtypes.rst:4475 msgid "" "The precision determines the number of digits after the decimal point and " "defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:3199 ../../library/stdtypes.rst:4463 +#: ../../library/stdtypes.rst:3215 ../../library/stdtypes.rst:4479 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:3202 ../../library/stdtypes.rst:4466 +#: ../../library/stdtypes.rst:3218 ../../library/stdtypes.rst:4482 msgid "" "The precision determines the number of significant digits before and after " "the decimal point and defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:3206 ../../library/stdtypes.rst:4470 +#: ../../library/stdtypes.rst:3222 ../../library/stdtypes.rst:4486 msgid "If precision is ``N``, the output is truncated to ``N`` characters." msgstr "" -#: ../../library/stdtypes.rst:3209 ../../library/stdtypes.rst:4479 +#: ../../library/stdtypes.rst:3225 ../../library/stdtypes.rst:4495 msgid "See :pep:`237`." msgstr "參閱 :pep:`237`。" -#: ../../library/stdtypes.rst:3211 +#: ../../library/stdtypes.rst:3227 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:3216 +#: ../../library/stdtypes.rst:3232 msgid "" "``%f`` conversions for numbers whose absolute value is over 1e50 are no " "longer replaced by ``%g`` conversions." msgstr "" -#: ../../library/stdtypes.rst:3227 +#: ../../library/stdtypes.rst:3243 msgid "" "Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:" "`memoryview`" msgstr "" -#: ../../library/stdtypes.rst:3235 +#: ../../library/stdtypes.rst:3251 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 :" @@ -5156,17 +5183,17 @@ msgid "" "objects without needing to make a copy." msgstr "" -#: ../../library/stdtypes.rst:3240 +#: ../../library/stdtypes.rst:3256 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:3246 +#: ../../library/stdtypes.rst:3262 msgid "Bytes Objects" msgstr "" -#: ../../library/stdtypes.rst:3250 +#: ../../library/stdtypes.rst:3266 msgid "" "Bytes objects are immutable sequences of single bytes. Since many major " "binary protocols are based on the ASCII text encoding, bytes objects offer " @@ -5174,40 +5201,40 @@ msgid "" "and are closely related to string objects in a variety of other ways." msgstr "" -#: ../../library/stdtypes.rst:3258 +#: ../../library/stdtypes.rst:3274 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:3261 +#: ../../library/stdtypes.rst:3277 msgid "Single quotes: ``b'still allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:3262 +#: ../../library/stdtypes.rst:3278 msgid "Double quotes: ``b\"still allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:3263 +#: ../../library/stdtypes.rst:3279 msgid "" "Triple quoted: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:3265 +#: ../../library/stdtypes.rst:3281 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:3269 +#: ../../library/stdtypes.rst:3285 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:3273 +#: ../../library/stdtypes.rst:3289 msgid "" "While bytes literals and representations are based on ASCII text, bytes " "objects actually behave like immutable sequences of integers, with each " @@ -5220,29 +5247,29 @@ msgid "" "compatible will usually lead to data corruption)." msgstr "" -#: ../../library/stdtypes.rst:3283 +#: ../../library/stdtypes.rst:3299 msgid "" "In addition to the literal forms, bytes objects can be created in a number " "of other ways:" msgstr "" -#: ../../library/stdtypes.rst:3286 +#: ../../library/stdtypes.rst:3302 msgid "A zero-filled bytes object of a specified length: ``bytes(10)``" msgstr "" -#: ../../library/stdtypes.rst:3287 +#: ../../library/stdtypes.rst:3303 msgid "From an iterable of integers: ``bytes(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:3288 +#: ../../library/stdtypes.rst:3304 msgid "Copying existing binary data via the buffer protocol: ``bytes(obj)``" msgstr "" -#: ../../library/stdtypes.rst:3290 +#: ../../library/stdtypes.rst:3306 msgid "Also see the :ref:`bytes ` built-in." msgstr "另見內建的 :ref:`bytes `。" -#: ../../library/stdtypes.rst:3292 +#: ../../library/stdtypes.rst:3308 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -5250,38 +5277,38 @@ msgid "" "that format:" msgstr "" -#: ../../library/stdtypes.rst:3298 +#: ../../library/stdtypes.rst:3314 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:3305 +#: ../../library/stdtypes.rst:3321 msgid "" ":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just " "spaces." msgstr "" -#: ../../library/stdtypes.rst:3309 +#: ../../library/stdtypes.rst:3325 msgid "" ":meth:`bytes.fromhex` now accepts ASCII :class:`bytes` and :term:`bytes-like " "objects ` as input." msgstr "" -#: ../../library/stdtypes.rst:3313 +#: ../../library/stdtypes.rst:3329 msgid "" "A reverse conversion function exists to transform a bytes object into its " "hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:3319 ../../library/stdtypes.rst:3410 +#: ../../library/stdtypes.rst:3335 ../../library/stdtypes.rst:3426 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." msgstr "" -#: ../../library/stdtypes.rst:3325 +#: ../../library/stdtypes.rst:3341 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, " @@ -5290,13 +5317,13 @@ msgid "" "the separator position from the right, negative values from the left." msgstr "" -#: ../../library/stdtypes.rst:3342 +#: ../../library/stdtypes.rst:3358 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:3346 +#: ../../library/stdtypes.rst:3362 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 " @@ -5304,58 +5331,58 @@ msgid "" "and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:3351 +#: ../../library/stdtypes.rst:3367 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:3359 +#: ../../library/stdtypes.rst:3375 msgid "Bytearray Objects" msgstr "Bytearray 物件" -#: ../../library/stdtypes.rst:3363 +#: ../../library/stdtypes.rst:3379 msgid "" ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` " "objects." msgstr "" -#: ../../library/stdtypes.rst:3369 +#: ../../library/stdtypes.rst:3385 msgid "" "There is no dedicated literal syntax for bytearray objects, instead they are " "always created by calling the constructor:" msgstr "" -#: ../../library/stdtypes.rst:3372 +#: ../../library/stdtypes.rst:3388 msgid "Creating an empty instance: ``bytearray()``" msgstr "建立一個空的實例:``bytearray()``" -#: ../../library/stdtypes.rst:3373 +#: ../../library/stdtypes.rst:3389 msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" msgstr "" -#: ../../library/stdtypes.rst:3374 +#: ../../library/stdtypes.rst:3390 msgid "From an iterable of integers: ``bytearray(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:3375 +#: ../../library/stdtypes.rst:3391 msgid "" "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" -#: ../../library/stdtypes.rst:3377 +#: ../../library/stdtypes.rst:3393 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:3381 +#: ../../library/stdtypes.rst:3397 msgid "Also see the :ref:`bytearray ` built-in." msgstr "另見內建的 :ref:`bytearray `。" -#: ../../library/stdtypes.rst:3383 +#: ../../library/stdtypes.rst:3399 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -5363,64 +5390,64 @@ msgid "" "in that format:" msgstr "" -#: ../../library/stdtypes.rst:3389 +#: ../../library/stdtypes.rst:3405 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:3396 +#: ../../library/stdtypes.rst:3412 msgid "" ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not " "just spaces." msgstr "" -#: ../../library/stdtypes.rst:3400 +#: ../../library/stdtypes.rst:3416 msgid "" ":meth:`bytearray.fromhex` now accepts ASCII :class:`bytes` and :term:`bytes-" "like objects ` as input." msgstr "" -#: ../../library/stdtypes.rst:3404 +#: ../../library/stdtypes.rst:3420 msgid "" "A reverse conversion function exists to transform a bytearray object into " "its hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:3418 +#: ../../library/stdtypes.rst:3434 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:3425 +#: ../../library/stdtypes.rst:3441 msgid "" "Resize the :class:`bytearray` to contain *size* bytes. *size* must be " "greater than or equal to 0." msgstr "" -#: ../../library/stdtypes.rst:3428 +#: ../../library/stdtypes.rst:3444 msgid "" "If the :class:`bytearray` needs to shrink, bytes beyond *size* are truncated." msgstr "" -#: ../../library/stdtypes.rst:3430 +#: ../../library/stdtypes.rst:3446 msgid "" "If the :class:`bytearray` needs to grow, all new bytes, those beyond *size*, " "will be set to null bytes." msgstr "" -#: ../../library/stdtypes.rst:3434 +#: ../../library/stdtypes.rst:3450 msgid "This is equivalent to:" msgstr "等同於:" -#: ../../library/stdtypes.rst:3442 +#: ../../library/stdtypes.rst:3458 msgid "Examples:" msgstr "範例:" -#: ../../library/stdtypes.rst:3455 +#: ../../library/stdtypes.rst:3471 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 " @@ -5428,7 +5455,7 @@ msgid "" "both indexing and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:3460 +#: ../../library/stdtypes.rst:3476 msgid "" "The representation of bytearray objects uses the bytes literal format " "(``bytearray(b'...')``) since it is often more useful than e.g. " @@ -5436,11 +5463,11 @@ msgid "" "a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:3469 +#: ../../library/stdtypes.rst:3485 msgid "Bytes and Bytearray Operations" msgstr "Bytes 和 Bytearray 的操作" -#: ../../library/stdtypes.rst:3474 +#: ../../library/stdtypes.rst:3490 msgid "" "Both bytes and bytearray objects support the :ref:`common ` " "sequence operations. They interoperate not just with operands of the same " @@ -5449,14 +5476,14 @@ msgid "" "return type of the result may depend on the order of operands." msgstr "" -#: ../../library/stdtypes.rst:3482 +#: ../../library/stdtypes.rst:3498 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:3486 +#: ../../library/stdtypes.rst:3502 msgid "" "a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" @@ -5464,11 +5491,11 @@ msgstr "" "a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" -#: ../../library/stdtypes.rst:3489 +#: ../../library/stdtypes.rst:3505 msgid "and::" msgstr "和: ::" -#: ../../library/stdtypes.rst:3491 +#: ../../library/stdtypes.rst:3507 msgid "" "a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" @@ -5476,60 +5503,60 @@ msgstr "" "a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" -#: ../../library/stdtypes.rst:3494 +#: ../../library/stdtypes.rst:3510 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:3499 +#: ../../library/stdtypes.rst:3515 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:3502 +#: ../../library/stdtypes.rst:3518 msgid "" "The following methods on bytes and bytearray objects can be used with " "arbitrary binary data." msgstr "" -#: ../../library/stdtypes.rst:3508 +#: ../../library/stdtypes.rst:3524 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:3512 ../../library/stdtypes.rst:3617 -#: ../../library/stdtypes.rst:3639 ../../library/stdtypes.rst:3705 -#: ../../library/stdtypes.rst:3718 +#: ../../library/stdtypes.rst:3528 ../../library/stdtypes.rst:3633 +#: ../../library/stdtypes.rst:3655 ../../library/stdtypes.rst:3721 +#: ../../library/stdtypes.rst:3734 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:3515 +#: ../../library/stdtypes.rst:3531 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:3518 ../../library/stdtypes.rst:3629 -#: ../../library/stdtypes.rst:3642 ../../library/stdtypes.rst:3708 -#: ../../library/stdtypes.rst:3721 +#: ../../library/stdtypes.rst:3534 ../../library/stdtypes.rst:3645 +#: ../../library/stdtypes.rst:3658 ../../library/stdtypes.rst:3724 +#: ../../library/stdtypes.rst:3737 msgid "Also accept an integer in the range 0 to 255 as the subsequence." msgstr "" -#: ../../library/stdtypes.rst:3525 +#: ../../library/stdtypes.rst:3541 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:3529 +#: ../../library/stdtypes.rst:3545 msgid "" ">>> b'TestHook'.removeprefix(b'Test')\n" "b'Hook'\n" @@ -5541,32 +5568,32 @@ msgstr "" ">>> b'BaseTestCase'.removeprefix(b'Test')\n" "b'BaseTestCase'" -#: ../../library/stdtypes.rst:3534 +#: ../../library/stdtypes.rst:3550 msgid "The *prefix* may be any :term:`bytes-like object`." msgstr "*prefix* 可以是任何的 :term:`bytes-like object`。" -#: ../../library/stdtypes.rst:3538 ../../library/stdtypes.rst:3560 -#: ../../library/stdtypes.rst:3693 ../../library/stdtypes.rst:3786 -#: ../../library/stdtypes.rst:3800 ../../library/stdtypes.rst:3830 -#: ../../library/stdtypes.rst:3844 ../../library/stdtypes.rst:3885 -#: ../../library/stdtypes.rst:3955 ../../library/stdtypes.rst:3973 -#: ../../library/stdtypes.rst:4001 ../../library/stdtypes.rst:4140 -#: ../../library/stdtypes.rst:4195 ../../library/stdtypes.rst:4238 -#: ../../library/stdtypes.rst:4259 ../../library/stdtypes.rst:4281 -#: ../../library/stdtypes.rst:4483 +#: ../../library/stdtypes.rst:3554 ../../library/stdtypes.rst:3576 +#: ../../library/stdtypes.rst:3709 ../../library/stdtypes.rst:3802 +#: ../../library/stdtypes.rst:3816 ../../library/stdtypes.rst:3846 +#: ../../library/stdtypes.rst:3860 ../../library/stdtypes.rst:3901 +#: ../../library/stdtypes.rst:3971 ../../library/stdtypes.rst:3989 +#: ../../library/stdtypes.rst:4017 ../../library/stdtypes.rst:4156 +#: ../../library/stdtypes.rst:4211 ../../library/stdtypes.rst:4254 +#: ../../library/stdtypes.rst:4275 ../../library/stdtypes.rst:4297 +#: ../../library/stdtypes.rst:4499 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:3547 +#: ../../library/stdtypes.rst:3563 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:3551 +#: ../../library/stdtypes.rst:3567 msgid "" ">>> b'MiscTests'.removesuffix(b'Tests')\n" "b'Misc'\n" @@ -5578,15 +5605,15 @@ msgstr "" ">>> b'TmpDirMixin'.removesuffix(b'Tests')\n" "b'TmpDirMixin'" -#: ../../library/stdtypes.rst:3556 +#: ../../library/stdtypes.rst:3572 msgid "The *suffix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3569 +#: ../../library/stdtypes.rst:3585 msgid "Return the bytes decoded to a :class:`str`." msgstr "" -#: ../../library/stdtypes.rst:3574 +#: ../../library/stdtypes.rst:3590 msgid "" "*errors* controls how decoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -5594,21 +5621,21 @@ msgid "" "`codecs.register_error`. See :ref:`error-handlers` for details." msgstr "" -#: ../../library/stdtypes.rst:3580 +#: ../../library/stdtypes.rst:3596 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:3586 +#: ../../library/stdtypes.rst:3602 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:3601 +#: ../../library/stdtypes.rst:3617 msgid "" "Return ``True`` if the binary data ends with the specified *suffix*, " "otherwise return ``False``. *suffix* can also be a tuple of suffixes to " @@ -5616,11 +5643,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:3606 +#: ../../library/stdtypes.rst:3622 msgid "The suffix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3612 +#: ../../library/stdtypes.rst:3628 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 " @@ -5628,14 +5655,14 @@ msgid "" "``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:3622 +#: ../../library/stdtypes.rst:3638 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:3626 +#: ../../library/stdtypes.rst:3642 msgid "" ">>> b'Py' in b'Python'\n" "True" @@ -5643,13 +5670,13 @@ msgstr "" ">>> b'Py' in b'Python'\n" "True" -#: ../../library/stdtypes.rst:3636 +#: ../../library/stdtypes.rst:3652 msgid "" "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence " "is not found." msgstr "" -#: ../../library/stdtypes.rst:3649 +#: ../../library/stdtypes.rst:3665 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 " @@ -5659,7 +5686,7 @@ msgid "" "method." msgstr "" -#: ../../library/stdtypes.rst:3660 +#: ../../library/stdtypes.rst:3676 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 " @@ -5667,7 +5694,7 @@ msgid "" "objects ` and have the same length." msgstr "" -#: ../../library/stdtypes.rst:3671 +#: ../../library/stdtypes.rst:3687 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 " @@ -5676,24 +5703,24 @@ msgid "" "by two empty bytes or bytearray objects." msgstr "" -#: ../../library/stdtypes.rst:3678 ../../library/stdtypes.rst:3735 +#: ../../library/stdtypes.rst:3694 ../../library/stdtypes.rst:3751 msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3684 +#: ../../library/stdtypes.rst:3700 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:3688 +#: ../../library/stdtypes.rst:3704 msgid "" "The subsequence to search for and its replacement may be any :term:`bytes-" "like object`." msgstr "" -#: ../../library/stdtypes.rst:3700 +#: ../../library/stdtypes.rst:3716 msgid "" "Return the highest index in the sequence where the subsequence *sub* is " "found, such that *sub* is contained within ``s[start:end]``. Optional " @@ -5701,13 +5728,13 @@ msgid "" "``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:3715 +#: ../../library/stdtypes.rst:3731 msgid "" "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence " "*sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:3728 +#: ../../library/stdtypes.rst:3744 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 " @@ -5716,7 +5743,7 @@ msgid "" "followed by a copy of the original sequence." msgstr "" -#: ../../library/stdtypes.rst:3741 +#: ../../library/stdtypes.rst:3757 msgid "" "Return ``True`` if the binary data starts with the specified *prefix*, " "otherwise return ``False``. *prefix* can also be a tuple of prefixes to " @@ -5724,11 +5751,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:3746 +#: ../../library/stdtypes.rst:3762 msgid "The prefix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3752 +#: ../../library/stdtypes.rst:3768 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 " @@ -5736,18 +5763,18 @@ msgid "" "object of length 256." msgstr "" -#: ../../library/stdtypes.rst:3757 +#: ../../library/stdtypes.rst:3773 msgid "" "You can use the :func:`bytes.maketrans` method to create a translation table." msgstr "" -#: ../../library/stdtypes.rst:3760 +#: ../../library/stdtypes.rst:3776 msgid "" "Set the *table* argument to ``None`` for translations that only delete " "characters::" msgstr "" -#: ../../library/stdtypes.rst:3763 +#: ../../library/stdtypes.rst:3779 msgid "" ">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" @@ -5755,11 +5782,11 @@ msgstr "" ">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" -#: ../../library/stdtypes.rst:3766 +#: ../../library/stdtypes.rst:3782 msgid "*delete* is now supported as a keyword argument." msgstr "支援 *delete* 關鍵字引數。" -#: ../../library/stdtypes.rst:3770 +#: ../../library/stdtypes.rst:3786 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 " @@ -5768,7 +5795,7 @@ msgid "" "instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3779 +#: ../../library/stdtypes.rst:3795 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). " @@ -5776,7 +5803,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3793 +#: ../../library/stdtypes.rst:3809 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). " @@ -5784,7 +5811,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3807 +#: ../../library/stdtypes.rst:3823 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 " @@ -5793,7 +5820,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3813 +#: ../../library/stdtypes.rst:3829 msgid "" ">>> b' spacious '.lstrip()\n" "b'spacious '\n" @@ -5805,14 +5832,14 @@ msgstr "" ">>> b'www.example.com'.lstrip(b'cmowz.')\n" "b'example.com'" -#: ../../library/stdtypes.rst:3818 +#: ../../library/stdtypes.rst:3834 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:3823 +#: ../../library/stdtypes.rst:3839 msgid "" ">>> b'Arthur: three!'.lstrip(b'Arthur: ')\n" "b'ee!'\n" @@ -5824,7 +5851,7 @@ msgstr "" ">>> b'Arthur: three!'.removeprefix(b'Arthur: ')\n" "b'three!'" -#: ../../library/stdtypes.rst:3837 +#: ../../library/stdtypes.rst:3853 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). " @@ -5832,7 +5859,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3851 +#: ../../library/stdtypes.rst:3867 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 " @@ -5842,7 +5869,7 @@ msgid "" "described in detail below." msgstr "" -#: ../../library/stdtypes.rst:3862 +#: ../../library/stdtypes.rst:3878 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 " @@ -5851,7 +5878,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3868 +#: ../../library/stdtypes.rst:3884 msgid "" ">>> b' spacious '.rstrip()\n" "b' spacious'\n" @@ -5863,14 +5890,14 @@ msgstr "" ">>> b'mississippi'.rstrip(b'ipz')\n" "b'mississ'" -#: ../../library/stdtypes.rst:3873 +#: ../../library/stdtypes.rst:3889 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:3878 +#: ../../library/stdtypes.rst:3894 msgid "" ">>> b'Monty Python'.rstrip(b' Python')\n" "b'M'\n" @@ -5882,7 +5909,7 @@ msgstr "" ">>> b'Monty Python'.removesuffix(b' Python')\n" "b'Monty'" -#: ../../library/stdtypes.rst:3892 +#: ../../library/stdtypes.rst:3908 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 " @@ -5891,7 +5918,7 @@ msgid "" "limit on the number of splits (all possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:3898 +#: ../../library/stdtypes.rst:3914 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',')`` " @@ -5902,7 +5929,7 @@ msgid "" "like object`." msgstr "" -#: ../../library/stdtypes.rst:3908 +#: ../../library/stdtypes.rst:3924 msgid "" ">>> b'1,2,3'.split(b',')\n" "[b'1', b'2', b'3']\n" @@ -5922,7 +5949,7 @@ msgstr "" ">>> b'1<>2<>3<4'.split(b'<>')\n" "[b'1', b'2', b'3<4']" -#: ../../library/stdtypes.rst:3917 +#: ../../library/stdtypes.rst:3933 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 " @@ -5932,7 +5959,7 @@ msgid "" "without a specified separator returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:3927 +#: ../../library/stdtypes.rst:3943 msgid "" ">>> b'1 2 3'.split()\n" "[b'1', b'2', b'3']\n" @@ -5948,7 +5975,7 @@ msgstr "" ">>> b' 1 2 3 '.split()\n" "[b'1', b'2', b'3']" -#: ../../library/stdtypes.rst:3938 +#: ../../library/stdtypes.rst:3954 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 " @@ -5957,7 +5984,7 @@ msgid "" "or suffix; rather, all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3945 +#: ../../library/stdtypes.rst:3961 msgid "" ">>> b' spacious '.strip()\n" "b'spacious'\n" @@ -5969,13 +5996,13 @@ msgstr "" ">>> b'www.example.com'.strip(b'cmowz.')\n" "b'example'" -#: ../../library/stdtypes.rst:3950 +#: ../../library/stdtypes.rst:3966 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`." msgstr "" -#: ../../library/stdtypes.rst:3959 +#: ../../library/stdtypes.rst:3975 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 " @@ -5983,14 +6010,14 @@ msgid "" "operate in place, and instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3967 +#: ../../library/stdtypes.rst:3983 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:3980 +#: ../../library/stdtypes.rst:3996 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 " @@ -6006,7 +6033,7 @@ msgid "" "by one regardless of how the byte value is represented when printed::" msgstr "" -#: ../../library/stdtypes.rst:3994 +#: ../../library/stdtypes.rst:4010 msgid "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs()\n" "b'01 012 0123 01234'\n" @@ -6018,7 +6045,7 @@ msgstr "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs(4)\n" "b'01 012 0123 01234'" -#: ../../library/stdtypes.rst:4008 +#: ../../library/stdtypes.rst:4024 msgid "" "Return ``True`` if all bytes in the sequence are alphabetical ASCII " "characters or ASCII decimal digits and the sequence is not empty, ``False`` " @@ -6027,7 +6054,7 @@ msgid "" "digits are those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:4016 +#: ../../library/stdtypes.rst:4032 msgid "" ">>> b'ABCabc1'.isalnum()\n" "True\n" @@ -6039,7 +6066,7 @@ msgstr "" ">>> b'ABC abc1'.isalnum()\n" "False" -#: ../../library/stdtypes.rst:4025 +#: ../../library/stdtypes.rst:4041 msgid "" "Return ``True`` if all bytes in the sequence are alphabetic ASCII characters " "and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII " @@ -6047,7 +6074,7 @@ msgid "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:4032 +#: ../../library/stdtypes.rst:4048 msgid "" ">>> b'ABCabc'.isalpha()\n" "True\n" @@ -6059,20 +6086,20 @@ msgstr "" ">>> b'ABCabc1'.isalpha()\n" "False" -#: ../../library/stdtypes.rst:4041 +#: ../../library/stdtypes.rst:4057 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:4051 +#: ../../library/stdtypes.rst:4067 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:4057 +#: ../../library/stdtypes.rst:4073 msgid "" ">>> b'1234'.isdigit()\n" "True\n" @@ -6084,13 +6111,13 @@ msgstr "" ">>> b'1.23'.isdigit()\n" "False" -#: ../../library/stdtypes.rst:4066 +#: ../../library/stdtypes.rst:4082 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:4071 +#: ../../library/stdtypes.rst:4087 msgid "" ">>> b'hello world'.islower()\n" "True\n" @@ -6102,16 +6129,16 @@ msgstr "" ">>> b'Hello world'.islower()\n" "False" -#: ../../library/stdtypes.rst:4076 ../../library/stdtypes.rst:4118 -#: ../../library/stdtypes.rst:4134 ../../library/stdtypes.rst:4184 -#: ../../library/stdtypes.rst:4253 +#: ../../library/stdtypes.rst:4092 ../../library/stdtypes.rst:4134 +#: ../../library/stdtypes.rst:4150 ../../library/stdtypes.rst:4200 +#: ../../library/stdtypes.rst:4269 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:4084 +#: ../../library/stdtypes.rst:4100 msgid "" "Return ``True`` if all bytes in the sequence are ASCII whitespace and the " "sequence is not empty, ``False`` otherwise. ASCII whitespace characters are " @@ -6119,14 +6146,14 @@ msgid "" "newline, carriage return, vertical tab, form feed)." msgstr "" -#: ../../library/stdtypes.rst:4093 +#: ../../library/stdtypes.rst:4109 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:4099 +#: ../../library/stdtypes.rst:4115 msgid "" ">>> b'Hello World'.istitle()\n" "True\n" @@ -6138,14 +6165,14 @@ msgstr "" ">>> b'Hello world'.istitle()\n" "False" -#: ../../library/stdtypes.rst:4108 +#: ../../library/stdtypes.rst:4124 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:4113 +#: ../../library/stdtypes.rst:4129 msgid "" ">>> b'HELLO WORLD'.isupper()\n" "True\n" @@ -6157,13 +6184,13 @@ msgstr "" ">>> b'Hello world'.isupper()\n" "False" -#: ../../library/stdtypes.rst:4126 +#: ../../library/stdtypes.rst:4142 msgid "" "Return a copy of the sequence with all the uppercase ASCII characters " "converted to their corresponding lowercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:4131 +#: ../../library/stdtypes.rst:4147 msgid "" ">>> b'Hello World'.lower()\n" "b'hello world'" @@ -6171,7 +6198,7 @@ msgstr "" ">>> b'Hello World'.lower()\n" "b'hello world'" -#: ../../library/stdtypes.rst:4151 +#: ../../library/stdtypes.rst:4167 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 " @@ -6179,7 +6206,7 @@ msgid "" "*keepends* is given and true." msgstr "" -#: ../../library/stdtypes.rst:4158 +#: ../../library/stdtypes.rst:4174 msgid "" ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "[b'ab c', b'', b'de fg', b'kl']\n" @@ -6191,14 +6218,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:4163 +#: ../../library/stdtypes.rst:4179 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:4167 +#: ../../library/stdtypes.rst:4183 msgid "" ">>> b\"\".split(b'\\n'), b\"Two lines\\n\".split(b'\\n')\n" "([b''], [b'Two lines', b''])\n" @@ -6210,13 +6237,13 @@ msgstr "" ">>> b\"\".splitlines(), b\"One line\\n\".splitlines()\n" "([], [b'One line'])" -#: ../../library/stdtypes.rst:4176 +#: ../../library/stdtypes.rst:4192 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:4181 +#: ../../library/stdtypes.rst:4197 msgid "" ">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" @@ -6224,7 +6251,7 @@ msgstr "" ">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" -#: ../../library/stdtypes.rst:4188 +#: ../../library/stdtypes.rst:4204 msgid "" "Unlike :func:`str.swapcase`, it is always the case that ``bin.swapcase()." "swapcase() == bin`` for the binary versions. Case conversions are " @@ -6232,14 +6259,14 @@ msgid "" "Unicode code points." msgstr "" -#: ../../library/stdtypes.rst:4202 +#: ../../library/stdtypes.rst:4218 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:4208 +#: ../../library/stdtypes.rst:4224 msgid "" ">>> b'Hello world'.title()\n" "b'Hello World'" @@ -6247,7 +6274,7 @@ msgstr "" ">>> b'Hello world'.title()\n" "b'Hello World'" -#: ../../library/stdtypes.rst:4211 +#: ../../library/stdtypes.rst:4227 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -6255,7 +6282,7 @@ msgid "" "values are uncased." msgstr "" -#: ../../library/stdtypes.rst:4221 +#: ../../library/stdtypes.rst:4237 msgid "" ">>> b\"they're bill's friends from the UK\".title()\n" "b\"They'Re Bill'S Friends From The Uk\"" @@ -6263,12 +6290,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:4224 +#: ../../library/stdtypes.rst:4240 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "" -#: ../../library/stdtypes.rst:4226 +#: ../../library/stdtypes.rst:4242 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -6290,13 +6317,13 @@ msgstr "" ">>> titlecase(b\"they're bill's friends.\")\n" "b\"They're Bill's Friends.\"" -#: ../../library/stdtypes.rst:4245 +#: ../../library/stdtypes.rst:4261 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:4250 +#: ../../library/stdtypes.rst:4266 msgid "" ">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" @@ -6304,7 +6331,7 @@ msgstr "" ">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" -#: ../../library/stdtypes.rst:4266 +#: ../../library/stdtypes.rst:4282 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 " @@ -6313,7 +6340,7 @@ msgid "" "*width* is less than or equal to ``len(seq)``." msgstr "" -#: ../../library/stdtypes.rst:4274 +#: ../../library/stdtypes.rst:4290 msgid "" ">>> b\"42\".zfill(5)\n" "b'00042'\n" @@ -6325,11 +6352,11 @@ msgstr "" ">>> b\"-42\".zfill(5)\n" "b'-0042'" -#: ../../library/stdtypes.rst:4288 +#: ../../library/stdtypes.rst:4304 msgid "``printf``-style Bytes Formatting" msgstr "" -#: ../../library/stdtypes.rst:4305 +#: ../../library/stdtypes.rst:4321 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 " @@ -6337,7 +6364,7 @@ msgid "" "dictionary, wrap it in a tuple." msgstr "" -#: ../../library/stdtypes.rst:4310 +#: ../../library/stdtypes.rst:4326 msgid "" "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " @@ -6347,7 +6374,7 @@ msgid "" "func:`sprintf` in the C language." msgstr "" -#: ../../library/stdtypes.rst:4317 +#: ../../library/stdtypes.rst:4333 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 " @@ -6355,7 +6382,7 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:4351 +#: ../../library/stdtypes.rst:4367 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 " @@ -6363,77 +6390,77 @@ msgid "" "mapping key selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:4403 +#: ../../library/stdtypes.rst:4419 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/stdtypes.rst:4425 +#: ../../library/stdtypes.rst:4441 msgid "Single byte (accepts integer or single byte objects)." msgstr "" -#: ../../library/stdtypes.rst:4428 +#: ../../library/stdtypes.rst:4444 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/stdtypes.rst:4428 +#: ../../library/stdtypes.rst:4444 msgid "" "Bytes (any object that follows the :ref:`buffer protocol ` or " "has :meth:`~object.__bytes__`)." msgstr "" -#: ../../library/stdtypes.rst:4432 +#: ../../library/stdtypes.rst:4448 msgid "" "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:4435 +#: ../../library/stdtypes.rst:4451 msgid "" "Bytes (converts any Python object using ``repr(obj).encode('ascii', " "'backslashreplace')``)." msgstr "" -#: ../../library/stdtypes.rst:4438 +#: ../../library/stdtypes.rst:4454 msgid "" "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:4438 +#: ../../library/stdtypes.rst:4454 msgid "\\(7)" msgstr "\\(7)" -#: ../../library/stdtypes.rst:4473 +#: ../../library/stdtypes.rst:4489 msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." msgstr "``b'%s'`` 已被棄用,但在 3.x 系列中不會被移除。" -#: ../../library/stdtypes.rst:4476 +#: ../../library/stdtypes.rst:4492 msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." msgstr "``b'%r'`` 已被棄用,但在 3.x 系列中不會被移除。" -#: ../../library/stdtypes.rst:4488 +#: ../../library/stdtypes.rst:4504 msgid ":pep:`461` - Adding % formatting to bytes and bytearray" msgstr "" -#: ../../library/stdtypes.rst:4495 +#: ../../library/stdtypes.rst:4511 msgid "Memory Views" msgstr "" -#: ../../library/stdtypes.rst:4497 +#: ../../library/stdtypes.rst:4513 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:4503 +#: ../../library/stdtypes.rst:4519 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:4507 +#: ../../library/stdtypes.rst:4523 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 " @@ -6441,32 +6468,32 @@ msgid "" "other types such as :class:`array.array` may have bigger elements." msgstr "" -#: ../../library/stdtypes.rst:4512 +#: ../../library/stdtypes.rst:4528 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:4516 +#: ../../library/stdtypes.rst:4532 msgid "" "If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of " "returning 1." msgstr "" -#: ../../library/stdtypes.rst:4519 +#: ../../library/stdtypes.rst:4535 msgid "" "The :class:`~memoryview.itemsize` attribute will give you the number of " "bytes in a single element." msgstr "" -#: ../../library/stdtypes.rst:4522 +#: ../../library/stdtypes.rst:4538 msgid "" "A :class:`memoryview` supports slicing and indexing to expose its data. One-" "dimensional slicing will result in a subview::" msgstr "" -#: ../../library/stdtypes.rst:4525 +#: ../../library/stdtypes.rst:4541 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> v[1]\n" @@ -6488,7 +6515,7 @@ msgstr "" ">>> bytes(v[1:4])\n" "b'bce'" -#: ../../library/stdtypes.rst:4535 +#: ../../library/stdtypes.rst:4551 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 " @@ -6499,11 +6526,11 @@ msgid "" "memoryviews can be indexed with the empty tuple." msgstr "" -#: ../../library/stdtypes.rst:4544 +#: ../../library/stdtypes.rst:4560 msgid "Here is an example with a non-byte format::" msgstr "" -#: ../../library/stdtypes.rst:4546 +#: ../../library/stdtypes.rst:4562 msgid "" ">>> import array\n" ">>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444])\n" @@ -6525,13 +6552,13 @@ msgstr "" ">>> m[::2].tolist()\n" "[-11111111, -33333333]" -#: ../../library/stdtypes.rst:4556 +#: ../../library/stdtypes.rst:4572 msgid "" "If the underlying object is writable, the memoryview supports one-" "dimensional slice assignment. Resizing is not allowed::" msgstr "" -#: ../../library/stdtypes.rst:4559 +#: ../../library/stdtypes.rst:4575 msgid "" ">>> data = bytearray(b'abcefg')\n" ">>> v = memoryview(data)\n" @@ -6571,14 +6598,14 @@ msgstr "" ">>> data\n" "bytearray(b'z1spam')" -#: ../../library/stdtypes.rst:4577 +#: ../../library/stdtypes.rst:4593 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:4581 +#: ../../library/stdtypes.rst:4597 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> hash(v) == hash(b'abcefg')\n" @@ -6596,44 +6623,44 @@ msgstr "" ">>> hash(v[::-2]) == hash(b'abcefg'[::-2])\n" "True" -#: ../../library/stdtypes.rst:4589 +#: ../../library/stdtypes.rst:4605 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:4593 +#: ../../library/stdtypes.rst:4609 msgid "" "memoryview is now registered automatically with :class:`collections.abc." "Sequence`" msgstr "" -#: ../../library/stdtypes.rst:4597 +#: ../../library/stdtypes.rst:4613 msgid "memoryviews can now be indexed with tuple of integers." msgstr "" -#: ../../library/stdtypes.rst:4600 +#: ../../library/stdtypes.rst:4616 msgid "memoryview is now a :term:`generic type`." msgstr "" -#: ../../library/stdtypes.rst:4603 +#: ../../library/stdtypes.rst:4619 msgid ":class:`memoryview` has several methods:" msgstr ":class:`memoryview` 有幾個方法:" -#: ../../library/stdtypes.rst:4607 +#: ../../library/stdtypes.rst:4623 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:4611 +#: ../../library/stdtypes.rst:4627 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:4614 +#: ../../library/stdtypes.rst:4630 msgid "" ">>> import array\n" ">>> a = array.array('I', [1, 2, 3, 4, 5])\n" @@ -6667,14 +6694,14 @@ msgstr "" ">>> z.tolist() == c.tolist()\n" "True" -#: ../../library/stdtypes.rst:4630 +#: ../../library/stdtypes.rst:4646 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:4634 +#: ../../library/stdtypes.rst:4650 msgid "" ">>> from ctypes import BigEndianStructure, c_long\n" ">>> class BEPoint(BigEndianStructure):\n" @@ -6700,25 +6727,25 @@ msgstr "" ">>> a == b\n" "False" -#: ../../library/stdtypes.rst:4646 +#: ../../library/stdtypes.rst:4662 msgid "" "Note that, as with floating-point numbers, ``v is w`` does *not* imply ``v " "== w`` for memoryview objects." msgstr "" -#: ../../library/stdtypes.rst:4649 +#: ../../library/stdtypes.rst:4665 msgid "" "Previous versions compared the raw memory disregarding the item format and " "the logical array structure." msgstr "" -#: ../../library/stdtypes.rst:4655 +#: ../../library/stdtypes.rst:4671 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:4658 +#: ../../library/stdtypes.rst:4674 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.tobytes()\n" @@ -6732,7 +6759,7 @@ msgstr "" ">>> bytes(m)\n" "b'abc'" -#: ../../library/stdtypes.rst:4664 +#: ../../library/stdtypes.rst:4680 msgid "" "For non-contiguous arrays the result is equal to the flattened list " "representation with all elements converted to bytes. :meth:`tobytes` " @@ -6740,7 +6767,7 @@ msgid "" "module syntax." msgstr "" -#: ../../library/stdtypes.rst:4669 +#: ../../library/stdtypes.rst:4685 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' " @@ -6749,13 +6776,13 @@ msgid "" "to C first. *order=None* is the same as *order='C'*." msgstr "" -#: ../../library/stdtypes.rst:4679 +#: ../../library/stdtypes.rst:4695 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the buffer. ::" msgstr "" -#: ../../library/stdtypes.rst:4682 +#: ../../library/stdtypes.rst:4698 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.hex()\n" @@ -6765,18 +6792,18 @@ msgstr "" ">>> m.hex()\n" "'616263'" -#: ../../library/stdtypes.rst:4688 +#: ../../library/stdtypes.rst:4704 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:4695 +#: ../../library/stdtypes.rst:4711 msgid "Return the data in the buffer as a list of elements. ::" msgstr "" -#: ../../library/stdtypes.rst:4697 +#: ../../library/stdtypes.rst:4713 msgid "" ">>> memoryview(b'abc').tolist()\n" "[97, 98, 99]\n" @@ -6794,19 +6821,19 @@ msgstr "" ">>> m.tolist()\n" "[1.1, 2.2, 3.3]" -#: ../../library/stdtypes.rst:4705 +#: ../../library/stdtypes.rst:4721 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:4712 +#: ../../library/stdtypes.rst:4728 msgid "" "Return a readonly version of the memoryview object. The original memoryview " "object is unchanged. ::" msgstr "" -#: ../../library/stdtypes.rst:4715 +#: ../../library/stdtypes.rst:4731 msgid "" ">>> m = memoryview(bytearray(b'abc'))\n" ">>> mm = m.toreadonly()\n" @@ -6832,7 +6859,7 @@ msgstr "" ">>> mm.tolist()\n" "[43, 98, 99]" -#: ../../library/stdtypes.rst:4731 +#: ../../library/stdtypes.rst:4747 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 :" @@ -6841,14 +6868,14 @@ msgid "" "resources) as soon as possible." msgstr "" -#: ../../library/stdtypes.rst:4737 +#: ../../library/stdtypes.rst:4753 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:4741 +#: ../../library/stdtypes.rst:4757 msgid "" ">>> m = memoryview(b'abc')\n" ">>> m.release()\n" @@ -6864,13 +6891,13 @@ msgstr "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" -#: ../../library/stdtypes.rst:4748 +#: ../../library/stdtypes.rst:4764 msgid "" "The context management protocol can be used for a similar effect, using the " "``with`` statement::" msgstr "" -#: ../../library/stdtypes.rst:4751 +#: ../../library/stdtypes.rst:4767 msgid "" ">>> with memoryview(b'abc') as m:\n" "... m[0]\n" @@ -6890,7 +6917,7 @@ msgstr "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" -#: ../../library/stdtypes.rst:4765 +#: ../../library/stdtypes.rst:4781 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 " @@ -6899,7 +6926,7 @@ msgid "" "contiguous -> 1D." msgstr "" -#: ../../library/stdtypes.rst:4771 +#: ../../library/stdtypes.rst:4787 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 " @@ -6907,11 +6934,11 @@ msgid "" "Note that all byte lengths may depend on the operating system." msgstr "" -#: ../../library/stdtypes.rst:4777 +#: ../../library/stdtypes.rst:4793 msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "" -#: ../../library/stdtypes.rst:4779 +#: ../../library/stdtypes.rst:4795 msgid "" ">>> import array\n" ">>> a = array.array('l', [1,2,3])\n" @@ -6955,11 +6982,11 @@ msgstr "" ">>> y.nbytes\n" "24" -#: ../../library/stdtypes.rst:4800 +#: ../../library/stdtypes.rst:4816 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "" -#: ../../library/stdtypes.rst:4802 +#: ../../library/stdtypes.rst:4818 msgid "" ">>> b = bytearray(b'zyz')\n" ">>> x = memoryview(b)\n" @@ -6983,11 +7010,11 @@ msgstr "" ">>> b\n" "bytearray(b'ayz')" -#: ../../library/stdtypes.rst:4813 +#: ../../library/stdtypes.rst:4829 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "" -#: ../../library/stdtypes.rst:4815 +#: ../../library/stdtypes.rst:4831 msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"i\"*12, *list(range(12)))\n" @@ -7037,11 +7064,11 @@ msgstr "" ">>> z.nbytes\n" "48" -#: ../../library/stdtypes.rst:4839 +#: ../../library/stdtypes.rst:4855 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "" -#: ../../library/stdtypes.rst:4841 +#: ../../library/stdtypes.rst:4857 msgid "" ">>> buf = struct.pack(\"L\"*6, *list(range(6)))\n" ">>> x = memoryview(buf)\n" @@ -7063,33 +7090,33 @@ msgstr "" ">>> y.tolist()\n" "[[0, 1, 2], [3, 4, 5]]" -#: ../../library/stdtypes.rst:4853 +#: ../../library/stdtypes.rst:4869 msgid "The source format is no longer restricted when casting to a byte view." msgstr "" -#: ../../library/stdtypes.rst:4858 +#: ../../library/stdtypes.rst:4874 msgid "Count the number of occurrences of *value*." msgstr "計算 *value* 的出現次數" -#: ../../library/stdtypes.rst:4864 +#: ../../library/stdtypes.rst:4880 msgid "" "Return the index of the first occurrence of *value* (at or after index " "*start* and before index *stop*)." msgstr "" -#: ../../library/stdtypes.rst:4867 +#: ../../library/stdtypes.rst:4883 msgid "Raises a :exc:`ValueError` if *value* cannot be found." msgstr "在找不到 *value* 時引發 :exc:`ValueError`。" -#: ../../library/stdtypes.rst:4871 +#: ../../library/stdtypes.rst:4887 msgid "There are also several readonly attributes available:" msgstr "" -#: ../../library/stdtypes.rst:4875 +#: ../../library/stdtypes.rst:4891 msgid "The underlying object of the memoryview::" msgstr "memoryview 的底層物件: ::" -#: ../../library/stdtypes.rst:4877 +#: ../../library/stdtypes.rst:4893 msgid "" ">>> b = bytearray(b'xyz')\n" ">>> m = memoryview(b)\n" @@ -7101,14 +7128,14 @@ msgstr "" ">>> m.obj is b\n" "True" -#: ../../library/stdtypes.rst:4886 +#: ../../library/stdtypes.rst:4902 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:4890 +#: ../../library/stdtypes.rst:4906 msgid "" ">>> import array\n" ">>> a = array.array('i', [1,2,3,4,5])\n" @@ -7140,11 +7167,11 @@ msgstr "" ">>> len(y.tobytes())\n" "12" -#: ../../library/stdtypes.rst:4905 +#: ../../library/stdtypes.rst:4921 msgid "Multi-dimensional arrays::" msgstr "" -#: ../../library/stdtypes.rst:4907 +#: ../../library/stdtypes.rst:4923 msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"d\"*12, *[1.5*x for x in range(12)])\n" @@ -7168,11 +7195,11 @@ msgstr "" ">>> y.nbytes\n" "96" -#: ../../library/stdtypes.rst:4922 +#: ../../library/stdtypes.rst:4938 msgid "A bool indicating whether the memory is read only." msgstr "" -#: ../../library/stdtypes.rst:4926 +#: ../../library/stdtypes.rst:4942 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 " @@ -7180,17 +7207,17 @@ msgid "" "restricted to native single element formats." msgstr "" -#: ../../library/stdtypes.rst:4931 +#: ../../library/stdtypes.rst:4947 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:4937 +#: ../../library/stdtypes.rst:4953 msgid "The size in bytes of each element of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4939 +#: ../../library/stdtypes.rst:4955 msgid "" ">>> import array, struct\n" ">>> m = memoryview(array.array('H', [32000, 32001, 32002]))\n" @@ -7210,49 +7237,49 @@ msgstr "" ">>> struct.calcsize('H') == m.itemsize\n" "True" -#: ../../library/stdtypes.rst:4950 +#: ../../library/stdtypes.rst:4966 msgid "" "An integer indicating how many dimensions of a multi-dimensional array the " "memory represents." msgstr "" -#: ../../library/stdtypes.rst:4955 +#: ../../library/stdtypes.rst:4971 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:4958 ../../library/stdtypes.rst:4966 +#: ../../library/stdtypes.rst:4974 ../../library/stdtypes.rst:4982 msgid "An empty tuple instead of ``None`` when ndim = 0." msgstr "" -#: ../../library/stdtypes.rst:4963 +#: ../../library/stdtypes.rst:4979 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:4971 +#: ../../library/stdtypes.rst:4987 msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" -#: ../../library/stdtypes.rst:4975 +#: ../../library/stdtypes.rst:4991 msgid "A bool indicating whether the memory is C-:term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4981 +#: ../../library/stdtypes.rst:4997 msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4987 +#: ../../library/stdtypes.rst:5003 msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4995 +#: ../../library/stdtypes.rst:5011 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "" -#: ../../library/stdtypes.rst:4999 +#: ../../library/stdtypes.rst:5015 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -7262,7 +7289,7 @@ msgid "" "`collections` module.)" msgstr "" -#: ../../library/stdtypes.rst:5006 +#: ../../library/stdtypes.rst:5022 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 " @@ -7270,7 +7297,7 @@ msgid "" "slicing, or other sequence-like behavior." msgstr "" -#: ../../library/stdtypes.rst:5011 +#: ../../library/stdtypes.rst:5027 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -7282,18 +7309,18 @@ msgid "" "of another set." msgstr "" -#: ../../library/stdtypes.rst:5020 +#: ../../library/stdtypes.rst:5036 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:5024 +#: ../../library/stdtypes.rst:5040 msgid "The constructors for both classes work the same:" msgstr "" -#: ../../library/stdtypes.rst:5029 +#: ../../library/stdtypes.rst:5045 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 " @@ -7301,92 +7328,92 @@ msgid "" "*iterable* is not specified, a new empty set is returned." msgstr "" -#: ../../library/stdtypes.rst:5035 +#: ../../library/stdtypes.rst:5051 msgid "Sets can be created by several means:" msgstr "集合可以以多種方式建立:" -#: ../../library/stdtypes.rst:5037 +#: ../../library/stdtypes.rst:5053 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:5038 +#: ../../library/stdtypes.rst:5054 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" -#: ../../library/stdtypes.rst:5039 +#: ../../library/stdtypes.rst:5055 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" msgstr "" -#: ../../library/stdtypes.rst:5041 +#: ../../library/stdtypes.rst:5057 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" msgstr "" -#: ../../library/stdtypes.rst:5046 +#: ../../library/stdtypes.rst:5062 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" -#: ../../library/stdtypes.rst:5050 +#: ../../library/stdtypes.rst:5066 msgid "Test *x* for membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:5054 +#: ../../library/stdtypes.rst:5070 msgid "Test *x* for non-membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:5059 +#: ../../library/stdtypes.rst:5075 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:5066 +#: ../../library/stdtypes.rst:5082 msgid "Test whether every element in the set is in *other*." msgstr "" -#: ../../library/stdtypes.rst:5070 +#: ../../library/stdtypes.rst:5086 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." msgstr "" -#: ../../library/stdtypes.rst:5077 +#: ../../library/stdtypes.rst:5093 msgid "Test whether every element in *other* is in the set." msgstr "" -#: ../../library/stdtypes.rst:5081 +#: ../../library/stdtypes.rst:5097 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." msgstr "" -#: ../../library/stdtypes.rst:5088 +#: ../../library/stdtypes.rst:5104 msgid "Return a new set with elements from the set and all others." msgstr "" -#: ../../library/stdtypes.rst:5094 +#: ../../library/stdtypes.rst:5110 msgid "Return a new set with elements common to the set and all others." msgstr "" -#: ../../library/stdtypes.rst:5100 +#: ../../library/stdtypes.rst:5116 msgid "Return a new set with elements in the set that are not in the others." msgstr "" -#: ../../library/stdtypes.rst:5106 +#: ../../library/stdtypes.rst:5122 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" -#: ../../library/stdtypes.rst:5111 +#: ../../library/stdtypes.rst:5127 msgid "Return a shallow copy of the set." msgstr "" -#: ../../library/stdtypes.rst:5114 +#: ../../library/stdtypes.rst:5130 msgid "" "Note, the non-operator versions of :meth:`~frozenset.union`, :meth:" "`~frozenset.intersection`, :meth:`~frozenset.difference`, :meth:`~frozenset." @@ -7397,7 +7424,7 @@ msgid "" "the more readable ``set('abc').intersection('cbs')``." msgstr "" -#: ../../library/stdtypes.rst:5121 +#: ../../library/stdtypes.rst:5137 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 " @@ -7407,14 +7434,14 @@ msgid "" "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -#: ../../library/stdtypes.rst:5128 +#: ../../library/stdtypes.rst:5144 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:5132 +#: ../../library/stdtypes.rst:5148 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 " @@ -7422,78 +7449,78 @@ msgid "" "``ab``." msgstr "" -#: ../../library/stdtypes.rst:5137 +#: ../../library/stdtypes.rst:5153 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:5140 +#: ../../library/stdtypes.rst:5156 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:5142 +#: ../../library/stdtypes.rst:5158 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:5146 +#: ../../library/stdtypes.rst:5162 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" msgstr "" -#: ../../library/stdtypes.rst:5152 +#: ../../library/stdtypes.rst:5168 msgid "Update the set, adding elements from all others." msgstr "" -#: ../../library/stdtypes.rst:5157 +#: ../../library/stdtypes.rst:5173 msgid "Update the set, keeping only elements found in it and all others." msgstr "" -#: ../../library/stdtypes.rst:5162 +#: ../../library/stdtypes.rst:5178 msgid "Update the set, removing elements found in others." msgstr "" -#: ../../library/stdtypes.rst:5167 +#: ../../library/stdtypes.rst:5183 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" -#: ../../library/stdtypes.rst:5171 +#: ../../library/stdtypes.rst:5187 msgid "Add element *elem* to the set." msgstr "將元素 *elem* 加入集合。" -#: ../../library/stdtypes.rst:5175 +#: ../../library/stdtypes.rst:5191 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." msgstr "" -#: ../../library/stdtypes.rst:5180 +#: ../../library/stdtypes.rst:5196 msgid "Remove element *elem* from the set if it is present." msgstr "如果 *elem* 存在於集合中則將其移除。" -#: ../../library/stdtypes.rst:5184 +#: ../../library/stdtypes.rst:5200 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." msgstr "" -#: ../../library/stdtypes.rst:5189 +#: ../../library/stdtypes.rst:5205 msgid "Remove all elements from the set." msgstr "從集合中移除所有元素。" -#: ../../library/stdtypes.rst:5192 +#: ../../library/stdtypes.rst:5208 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:5197 +#: ../../library/stdtypes.rst:5213 msgid "" "Note, the *elem* argument to the :meth:`~object.__contains__`, :meth:`~set." "remove`, and :meth:`~set.discard` methods may be a set. To support " @@ -7501,11 +7528,11 @@ msgid "" "*elem*." msgstr "" -#: ../../library/stdtypes.rst:5206 +#: ../../library/stdtypes.rst:5222 msgid "Mapping Types --- :class:`dict`" msgstr "" -#: ../../library/stdtypes.rst:5216 +#: ../../library/stdtypes.rst:5232 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -7514,7 +7541,7 @@ msgid "" "module.)" msgstr "" -#: ../../library/stdtypes.rst:5222 +#: ../../library/stdtypes.rst:5238 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -7523,33 +7550,33 @@ msgid "" "and ``True``) can be used interchangeably to index the same dictionary entry." msgstr "" -#: ../../library/stdtypes.rst:5233 +#: ../../library/stdtypes.rst:5249 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:5236 +#: ../../library/stdtypes.rst:5252 msgid "Dictionaries can be created by several means:" msgstr "字典可以用數種方式建立:" -#: ../../library/stdtypes.rst:5238 +#: ../../library/stdtypes.rst:5254 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:5240 +#: ../../library/stdtypes.rst:5256 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" -#: ../../library/stdtypes.rst:5241 +#: ../../library/stdtypes.rst:5257 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" msgstr "" -#: ../../library/stdtypes.rst:5244 +#: ../../library/stdtypes.rst:5260 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 " @@ -7562,7 +7589,7 @@ msgid "" "that key becomes the corresponding value in the new dictionary." msgstr "" -#: ../../library/stdtypes.rst:5254 +#: ../../library/stdtypes.rst:5270 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 " @@ -7570,7 +7597,7 @@ msgid "" "the value from the positional argument." msgstr "" -#: ../../library/stdtypes.rst:5259 +#: ../../library/stdtypes.rst:5275 msgid "" "Dictionaries compare equal if and only if they have the same ``(key, " "value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', " @@ -7579,7 +7606,7 @@ msgid "" "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -#: ../../library/stdtypes.rst:5265 +#: ../../library/stdtypes.rst:5281 msgid "" ">>> a = dict(one=1, two=2, three=3)\n" ">>> b = {'one': 1, 'two': 2, 'three': 3}\n" @@ -7599,19 +7626,19 @@ msgstr "" ">>> a == b == c == d == e == f\n" "True" -#: ../../library/stdtypes.rst:5274 +#: ../../library/stdtypes.rst:5290 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:5277 +#: ../../library/stdtypes.rst:5293 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:5280 +#: ../../library/stdtypes.rst:5296 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -7643,33 +7670,33 @@ msgstr "" ">>> d\n" "{'one': 42, 'three': 3, 'four': 4, 'two': None}" -#: ../../library/stdtypes.rst:5295 +#: ../../library/stdtypes.rst:5311 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:5299 +#: ../../library/stdtypes.rst:5315 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -#: ../../library/stdtypes.rst:5304 +#: ../../library/stdtypes.rst:5320 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:5308 +#: ../../library/stdtypes.rst:5324 msgid "Return the number of items in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:5312 +#: ../../library/stdtypes.rst:5328 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." msgstr "" -#: ../../library/stdtypes.rst:5317 +#: ../../library/stdtypes.rst:5333 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 " @@ -7680,7 +7707,7 @@ msgid "" "__missing__` must be a method; it cannot be an instance variable::" msgstr "" -#: ../../library/stdtypes.rst:5325 +#: ../../library/stdtypes.rst:5341 msgid "" ">>> class Counter(dict):\n" "... def __missing__(self, key):\n" @@ -7704,51 +7731,51 @@ msgstr "" ">>> c['red']\n" "1" -#: ../../library/stdtypes.rst:5336 +#: ../../library/stdtypes.rst:5352 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:5343 +#: ../../library/stdtypes.rst:5359 msgid "Set ``d[key]`` to *value*." msgstr "將 ``d[key]`` 設為 *value*。" -#: ../../library/stdtypes.rst:5347 +#: ../../library/stdtypes.rst:5363 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:5352 +#: ../../library/stdtypes.rst:5368 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "若 *d* 有鍵 *key* 則回傳 ``True``,否則回傳 ``False``。" -#: ../../library/stdtypes.rst:5356 +#: ../../library/stdtypes.rst:5372 msgid "Equivalent to ``not key in d``." msgstr "等價於 ``not key in d``。" -#: ../../library/stdtypes.rst:5360 +#: ../../library/stdtypes.rst:5376 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:5365 +#: ../../library/stdtypes.rst:5381 msgid "Remove all items from the dictionary." msgstr "從字典中移除所有項目。" -#: ../../library/stdtypes.rst:5369 +#: ../../library/stdtypes.rst:5385 msgid "Return a shallow copy of the dictionary." msgstr "" -#: ../../library/stdtypes.rst:5373 +#: ../../library/stdtypes.rst:5389 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" -#: ../../library/stdtypes.rst:5375 +#: ../../library/stdtypes.rst:5391 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 " @@ -7757,70 +7784,70 @@ msgid "" "` instead." msgstr "" -#: ../../library/stdtypes.rst:5383 +#: ../../library/stdtypes.rst:5399 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:5389 +#: ../../library/stdtypes.rst:5405 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." msgstr "" -#: ../../library/stdtypes.rst:5394 +#: ../../library/stdtypes.rst:5410 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." msgstr "" -#: ../../library/stdtypes.rst:5400 +#: ../../library/stdtypes.rst:5416 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:5406 +#: ../../library/stdtypes.rst:5422 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:5409 +#: ../../library/stdtypes.rst:5425 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:5413 +#: ../../library/stdtypes.rst:5429 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." msgstr "" -#: ../../library/stdtypes.rst:5419 +#: ../../library/stdtypes.rst:5435 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:5426 +#: ../../library/stdtypes.rst:5442 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:5434 +#: ../../library/stdtypes.rst:5450 msgid "" "Update the dictionary with the key/value pairs from *mapping* or *iterable* " "and *kwargs*, overwriting existing keys. Return ``None``." msgstr "" -#: ../../library/stdtypes.rst:5437 +#: ../../library/stdtypes.rst:5453 msgid "" ":meth:`update` accepts either another object with a ``keys()`` method (in " "which case :meth:`~object.__getitem__` is called with every key returned " @@ -7829,20 +7856,20 @@ msgid "" "is then updated with those key/value pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:5445 +#: ../../library/stdtypes.rst:5461 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:5448 +#: ../../library/stdtypes.rst:5464 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:5452 +#: ../../library/stdtypes.rst:5468 msgid "" ">>> d = {'a': 1}\n" ">>> d.values() == d.values()\n" @@ -7852,25 +7879,25 @@ msgstr "" ">>> d.values() == d.values()\n" "False" -#: ../../library/stdtypes.rst:5458 +#: ../../library/stdtypes.rst:5474 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:5466 +#: ../../library/stdtypes.rst:5482 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:5472 +#: ../../library/stdtypes.rst:5488 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:5474 +#: ../../library/stdtypes.rst:5490 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -7892,21 +7919,21 @@ msgstr "" ">>> list(reversed(d.items()))\n" "[('four', 4), ('three', 3), ('two', 2), ('one', 1)]" -#: ../../library/stdtypes.rst:5484 +#: ../../library/stdtypes.rst:5500 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:5489 +#: ../../library/stdtypes.rst:5505 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:5496 +#: ../../library/stdtypes.rst:5512 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:5498 +#: ../../library/stdtypes.rst:5514 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 " @@ -7914,23 +7941,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:5503 +#: ../../library/stdtypes.rst:5519 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:5508 +#: ../../library/stdtypes.rst:5524 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:5512 +#: ../../library/stdtypes.rst:5528 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:5515 +#: ../../library/stdtypes.rst:5531 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -7938,39 +7965,39 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:5520 +#: ../../library/stdtypes.rst:5536 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:5523 +#: ../../library/stdtypes.rst:5539 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:5528 +#: ../../library/stdtypes.rst:5544 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:5533 +#: ../../library/stdtypes.rst:5549 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:5536 +#: ../../library/stdtypes.rst:5552 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:5541 +#: ../../library/stdtypes.rst:5557 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:5546 +#: ../../library/stdtypes.rst:5562 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 " @@ -7984,11 +8011,11 @@ msgid "" "input." msgstr "" -#: ../../library/stdtypes.rst:5558 +#: ../../library/stdtypes.rst:5574 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:5560 +#: ../../library/stdtypes.rst:5576 msgid "" ">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" ">>> keys = dishes.keys()\n" @@ -8029,11 +8056,11 @@ msgid "" "500" msgstr "" -#: ../../library/stdtypes.rst:5602 +#: ../../library/stdtypes.rst:5618 msgid "Context Manager Types" msgstr "情境管理器型別" -#: ../../library/stdtypes.rst:5609 +#: ../../library/stdtypes.rst:5625 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 " @@ -8044,7 +8071,7 @@ msgstr "" "要使用兩個方法來實作,該方法讓使用者定義類別能夠去定義 runtime 情境,且該情境" "在執行陳述式主體 (statement body) 之前進入、在陳述式結束時退出:" -#: ../../library/stdtypes.rst:5617 +#: ../../library/stdtypes.rst:5633 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 " @@ -8055,7 +8082,7 @@ msgstr "" "的值有被綁定到使用此情境管理器的 :keyword:`with` 陳述式的 :keyword:`!as` 子句" "中的識別字。" -#: ../../library/stdtypes.rst:5622 +#: ../../library/stdtypes.rst:5638 msgid "" "An example of a context manager that returns itself is a :term:`file " "object`. File objects return themselves from __enter__() to allow :func:" @@ -8064,7 +8091,7 @@ msgstr "" "一個會回傳自己的情境管理器範例是 :term:`file object`。檔案物件從 __enter__() " "回傳自己,以允許將 :func:`open` 用作 :keyword:`with` 陳述式中的情境運算式。" -#: ../../library/stdtypes.rst:5626 +#: ../../library/stdtypes.rst:5642 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 " @@ -8078,7 +8105,7 @@ msgstr "" "本。這允許對 :keyword:`with` 陳述式主體中的目前十進位情境進行更改,而不會影" "響 :keyword:`!with` 陳述式外部的程式碼。" -#: ../../library/stdtypes.rst:5636 +#: ../../library/stdtypes.rst:5652 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -8090,7 +8117,7 @@ msgstr "" "keyword:`with` 陳述式主體時發生例外,則引數包含例外型別、值和回溯 " "(traceback) 資訊。否則,所有三個引數都是 ``None``。" -#: ../../library/stdtypes.rst:5641 +#: ../../library/stdtypes.rst:5657 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -8101,14 +8128,14 @@ msgstr "" "keyword:`!with` 陳述式之後的陳述式。否則,該例外將在該方法執行完畢後繼續傳播 " "(propagate)。" -#: ../../library/stdtypes.rst:5646 +#: ../../library/stdtypes.rst:5662 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:5650 +#: ../../library/stdtypes.rst:5666 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -8120,7 +8147,7 @@ msgstr "" "已成功完成且不希望抑制引發的例外。這讓情境管理程式碼能輕鬆檢測 :meth:" "`~object.__exit__` 方法是否曾實際失敗過。" -#: ../../library/stdtypes.rst:5656 +#: ../../library/stdtypes.rst:5672 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -8132,7 +8159,7 @@ msgstr "" "及對有效十進位算術情境的更簡單操作。除了情境管理協定的實作之外,不會對特定型" "別進行特殊處理。更多範例請參閱 :mod:`contextlib` 模組。" -#: ../../library/stdtypes.rst:5662 +#: ../../library/stdtypes.rst:5678 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -8147,7 +8174,7 @@ msgstr "" "`~contextmanager.__enter__` 和 :meth:`~contextmanager.__exit__` 方法的情境管" "理器,而不是由未裝飾產生器函式產生的疊代器。" -#: ../../library/stdtypes.rst:5669 +#: ../../library/stdtypes.rst:5685 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 " @@ -8159,7 +8186,7 @@ msgstr "" "定義這些方法的擴充型別必須將它們作為普通的 Python 可存取方法提供。與設定 " "runtime 情境的開銷相比,單一類別字典查找的開銷可以忽略不計。" -#: ../../library/stdtypes.rst:5677 +#: ../../library/stdtypes.rst:5693 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" @@ -8167,7 +8194,7 @@ msgstr "" "型別註釋的型別 --- :ref:`泛型別名 (Generic Alias) `、:" "ref:`聯合 (Union) `" -#: ../../library/stdtypes.rst:5682 +#: ../../library/stdtypes.rst:5698 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." @@ -8175,11 +8202,11 @@ msgstr "" ":term:`型別註釋 ` 的核心內建型別是\\ :ref:`泛型別名 `\\ 和\\ :ref:`聯合 `。" -#: ../../library/stdtypes.rst:5689 +#: ../../library/stdtypes.rst:5705 msgid "Generic Alias Type" msgstr "泛型別名型別" -#: ../../library/stdtypes.rst:5695 +#: ../../library/stdtypes.rst:5711 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -8195,7 +8222,7 @@ msgstr "" "立的。``GenericAlias`` 物件主要會與\\ :term:`型別註釋 ` 一起使" "用。" -#: ../../library/stdtypes.rst:5705 +#: ../../library/stdtypes.rst:5721 msgid "" "It is generally only possible to subscript a class if the class implements " "the special method :meth:`~object.__class_getitem__`." @@ -8203,7 +8230,7 @@ msgstr "" "通常只有當類別有實作特殊方法 :meth:`~object.__class_getitem__` 時才可以去下標" "該類別。" -#: ../../library/stdtypes.rst:5708 +#: ../../library/stdtypes.rst:5724 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." @@ -8211,7 +8238,7 @@ msgstr "" "將一個 ``GenericAlias`` 物件用作 :term:`generic type` 的代理,實作\\ *參數化" "泛型 (parameterized generics)*。" -#: ../../library/stdtypes.rst:5711 +#: ../../library/stdtypes.rst:5727 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 " @@ -8223,7 +8250,7 @@ msgstr "" "物件所包含元素的型別。例如 ``set[bytes]`` 可以用於型別註釋來表示一個 :class:" "`set`,其中所有元素的型別都是 :class:`bytes`。" -#: ../../library/stdtypes.rst:5717 +#: ../../library/stdtypes.rst:5733 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 " @@ -8235,7 +8262,7 @@ msgstr "" "標引數通常會指示物件上有定義的一個或多個方法的回傳型別。例如\\ :mod:`正規表示" "式 `\\ 可以用於 :class:`str` 和 :class:`bytes` 資料型別:" -#: ../../library/stdtypes.rst:5723 +#: ../../library/stdtypes.rst:5739 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 " @@ -8247,7 +8274,7 @@ msgstr "" "別。我們就可以用 ``GenericAlias`` ``re.Match[str]`` 在型別註釋中表示這種物" "件。" -#: ../../library/stdtypes.rst:5729 +#: ../../library/stdtypes.rst:5745 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." @@ -8260,7 +8287,7 @@ msgstr "" "別都是 :class:`bytes`。在型別註釋中,我們將用 ``re.Match[bytes]`` 來表示各" "種 :ref:`re.Match ` 物件。" -#: ../../library/stdtypes.rst:5735 +#: ../../library/stdtypes.rst:5751 msgid "" "``GenericAlias`` objects are instances of the class :class:`types." "GenericAlias`, which can also be used to create ``GenericAlias`` objects " @@ -8269,7 +8296,7 @@ msgstr "" "``GenericAlias`` 物件是 :class:`types.GenericAlias` 類別的實例,也可以用來直" "接建立 ``GenericAlias`` 物件。" -#: ../../library/stdtypes.rst:5741 +#: ../../library/stdtypes.rst:5757 msgid "" "Creates a ``GenericAlias`` representing a type ``T`` parameterized by types " "*X*, *Y*, and more depending on the ``T`` used. For example, a function " @@ -8279,7 +8306,7 @@ msgstr "" "所使用的 ``T``)來參數化。例如,一個函式需要一個包含 :class:`float` 元素的 :" "class:`list`: ::" -#: ../../library/stdtypes.rst:5746 +#: ../../library/stdtypes.rst:5762 msgid "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" @@ -8287,7 +8314,7 @@ msgstr "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" -#: ../../library/stdtypes.rst:5749 +#: ../../library/stdtypes.rst:5765 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 " @@ -8298,7 +8325,7 @@ msgstr "" "別,需要兩個型別參數,分別表示鍵型別和值型別。在此範例中,函式需要一個 " "``dict``,其帶有 :class:`str` 型別的鍵和 :class:`int` 型別的值: ::" -#: ../../library/stdtypes.rst:5754 +#: ../../library/stdtypes.rst:5770 msgid "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." @@ -8306,7 +8333,7 @@ msgstr "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." -#: ../../library/stdtypes.rst:5757 +#: ../../library/stdtypes.rst:5773 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" @@ -8314,7 +8341,7 @@ msgstr "" "內建函式 :func:`isinstance` 和 :func:`issubclass` 不接受 ``GenericAlias`` 型" "別作為第二個引數: ::" -#: ../../library/stdtypes.rst:5760 +#: ../../library/stdtypes.rst:5776 msgid "" ">>> isinstance([1, 2], list[str])\n" "Traceback (most recent call last):\n" @@ -8326,7 +8353,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: isinstance() argument 2 cannot be a parameterized generic" -#: ../../library/stdtypes.rst:5765 +#: ../../library/stdtypes.rst:5781 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -8338,7 +8365,7 @@ msgstr "" "及其型別參數。當從 ``GenericAlias`` 建立容器物件時,不會檢查容器中元素的型" "別。例如,不鼓勵使用以下程式碼,但 runtime 不會出現錯誤: ::" -#: ../../library/stdtypes.rst:5771 +#: ../../library/stdtypes.rst:5787 msgid "" ">>> t = list[str]\n" ">>> t([1, 2, 3])\n" @@ -8348,13 +8375,13 @@ msgstr "" ">>> t([1, 2, 3])\n" "[1, 2, 3]" -#: ../../library/stdtypes.rst:5775 +#: ../../library/stdtypes.rst:5791 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "此外,參數化泛型在物件建立期間會擦除 (erase) 型別參數: ::" -#: ../../library/stdtypes.rst:5778 +#: ../../library/stdtypes.rst:5794 msgid "" ">>> t = list[str]\n" ">>> type(t)\n" @@ -8372,13 +8399,13 @@ msgstr "" ">>> type(l)\n" "" -#: ../../library/stdtypes.rst:5786 +#: ../../library/stdtypes.rst:5802 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "在泛型上呼叫 :func:`repr` 或 :func:`str` 會顯示參數化型別: ::" -#: ../../library/stdtypes.rst:5788 +#: ../../library/stdtypes.rst:5804 msgid "" ">>> repr(list[int])\n" "'list[int]'\n" @@ -8392,7 +8419,7 @@ msgstr "" ">>> str(list[int])\n" "'list[int]'" -#: ../../library/stdtypes.rst:5794 +#: ../../library/stdtypes.rst:5810 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" @@ -8400,7 +8427,7 @@ msgstr "" "為防止像是 ``dict[str][str]`` 的錯誤出現,泛型容器的 :meth:`~object." "__getitem__` 方法會在這種情況下引發例外: ::" -#: ../../library/stdtypes.rst:5797 +#: ../../library/stdtypes.rst:5813 msgid "" ">>> dict[str][str]\n" "Traceback (most recent call last):\n" @@ -8412,7 +8439,7 @@ msgstr "" " ...\n" "TypeError: dict[str] is not a generic class" -#: ../../library/stdtypes.rst:5802 +#: ../../library/stdtypes.rst:5818 msgid "" "However, such expressions are valid when :ref:`type variables ` " "are used. The index must have as many elements as there are type variable " @@ -8422,7 +8449,7 @@ msgstr "" "的。索引的元素數量必須與 ``GenericAlias`` 物件的 :attr:`~genericalias." "__args__` 中的型別變數項目一樣多: ::" -#: ../../library/stdtypes.rst:5806 +#: ../../library/stdtypes.rst:5822 msgid "" ">>> from typing import TypeVar\n" ">>> Y = TypeVar('Y')\n" @@ -8434,253 +8461,253 @@ msgstr "" ">>> dict[str, Y][int]\n" "dict[str, int]" -#: ../../library/stdtypes.rst:5813 +#: ../../library/stdtypes.rst:5829 msgid "Standard Generic Classes" msgstr "標準泛型類別" -#: ../../library/stdtypes.rst:5815 +#: ../../library/stdtypes.rst:5831 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "以下標準函式庫類別有支援參數化泛型。此列表並非詳盡無遺。" -#: ../../library/stdtypes.rst:5818 +#: ../../library/stdtypes.rst:5834 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:5819 +#: ../../library/stdtypes.rst:5835 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:5820 +#: ../../library/stdtypes.rst:5836 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:5821 +#: ../../library/stdtypes.rst:5837 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:5822 +#: ../../library/stdtypes.rst:5838 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:5823 +#: ../../library/stdtypes.rst:5839 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:5824 +#: ../../library/stdtypes.rst:5840 msgid ":class:`asyncio.Future`" msgstr ":class:`asyncio.Future`" -#: ../../library/stdtypes.rst:5825 +#: ../../library/stdtypes.rst:5841 msgid ":class:`asyncio.Task`" msgstr ":class:`asyncio.Task`" -#: ../../library/stdtypes.rst:5826 +#: ../../library/stdtypes.rst:5842 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:5827 +#: ../../library/stdtypes.rst:5843 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:5828 +#: ../../library/stdtypes.rst:5844 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:5829 +#: ../../library/stdtypes.rst:5845 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:5830 +#: ../../library/stdtypes.rst:5846 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:5831 +#: ../../library/stdtypes.rst:5847 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:5832 +#: ../../library/stdtypes.rst:5848 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:5833 +#: ../../library/stdtypes.rst:5849 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:5834 +#: ../../library/stdtypes.rst:5850 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:5835 +#: ../../library/stdtypes.rst:5851 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:5836 +#: ../../library/stdtypes.rst:5852 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:5837 +#: ../../library/stdtypes.rst:5853 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:5838 +#: ../../library/stdtypes.rst:5854 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:5839 +#: ../../library/stdtypes.rst:5855 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:5840 +#: ../../library/stdtypes.rst:5856 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:5841 +#: ../../library/stdtypes.rst:5857 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:5842 +#: ../../library/stdtypes.rst:5858 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:5843 +#: ../../library/stdtypes.rst:5859 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:5844 +#: ../../library/stdtypes.rst:5860 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:5845 +#: ../../library/stdtypes.rst:5861 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:5846 +#: ../../library/stdtypes.rst:5862 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:5847 +#: ../../library/stdtypes.rst:5863 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:5848 +#: ../../library/stdtypes.rst:5864 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:5849 +#: ../../library/stdtypes.rst:5865 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:5850 +#: ../../library/stdtypes.rst:5866 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:5851 +#: ../../library/stdtypes.rst:5867 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:5852 +#: ../../library/stdtypes.rst:5868 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:5853 +#: ../../library/stdtypes.rst:5869 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:5854 +#: ../../library/stdtypes.rst:5870 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:5855 +#: ../../library/stdtypes.rst:5871 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:5856 +#: ../../library/stdtypes.rst:5872 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:5857 +#: ../../library/stdtypes.rst:5873 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:5858 +#: ../../library/stdtypes.rst:5874 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:5859 +#: ../../library/stdtypes.rst:5875 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:5860 +#: ../../library/stdtypes.rst:5876 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:5861 +#: ../../library/stdtypes.rst:5877 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:5862 +#: ../../library/stdtypes.rst:5878 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:5863 +#: ../../library/stdtypes.rst:5879 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:5864 +#: ../../library/stdtypes.rst:5880 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:5865 +#: ../../library/stdtypes.rst:5881 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:5866 +#: ../../library/stdtypes.rst:5882 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:5867 +#: ../../library/stdtypes.rst:5883 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5868 +#: ../../library/stdtypes.rst:5884 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5869 +#: ../../library/stdtypes.rst:5885 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5870 +#: ../../library/stdtypes.rst:5886 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5871 +#: ../../library/stdtypes.rst:5887 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5872 +#: ../../library/stdtypes.rst:5888 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5873 +#: ../../library/stdtypes.rst:5889 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5878 +#: ../../library/stdtypes.rst:5894 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "``GenericAlias`` 物件的特殊屬性" -#: ../../library/stdtypes.rst:5880 +#: ../../library/stdtypes.rst:5896 msgid "All parameterized generics implement special read-only attributes." msgstr "所有參數化泛型都有實作特殊的唯讀屬性。" -#: ../../library/stdtypes.rst:5884 +#: ../../library/stdtypes.rst:5900 msgid "This attribute points at the non-parameterized generic class::" msgstr "此屬性指向非參數化泛型類別: ::" -#: ../../library/stdtypes.rst:5886 +#: ../../library/stdtypes.rst:5902 msgid "" ">>> list[int].__origin__\n" "" @@ -8688,7 +8715,7 @@ msgstr "" ">>> list[int].__origin__\n" "" -#: ../../library/stdtypes.rst:5892 +#: ../../library/stdtypes.rst:5908 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 " @@ -8697,7 +8724,7 @@ msgstr "" "此屬性是傳遞給泛型類別之原始 :meth:`~object.__class_getitem__` 的泛型型別 :" "class:`tuple`\\ (長度可以為 1): ::" -#: ../../library/stdtypes.rst:5896 +#: ../../library/stdtypes.rst:5912 msgid "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" @@ -8705,7 +8732,7 @@ msgstr "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" -#: ../../library/stdtypes.rst:5902 +#: ../../library/stdtypes.rst:5918 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" @@ -8713,7 +8740,7 @@ msgstr "" "此屬性是個會被延遲計算 (lazily computed) 的元組(可能為空),包含了在 " "``__args__`` 中找得到的不重複型別變數: ::" -#: ../../library/stdtypes.rst:5905 +#: ../../library/stdtypes.rst:5921 msgid "" ">>> from typing import TypeVar\n" "\n" @@ -8727,7 +8754,7 @@ msgstr "" ">>> list[T].__parameters__\n" "(~T,)" -#: ../../library/stdtypes.rst:5913 +#: ../../library/stdtypes.rst:5929 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " "have correct ``__parameters__`` after substitution because :class:`typing." @@ -8737,7 +8764,7 @@ msgstr "" "有正確的 ``__parameters__``,因為 :class:`typing.ParamSpec` 主要用於靜態型別" "檢查。" -#: ../../library/stdtypes.rst:5920 +#: ../../library/stdtypes.rst:5936 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." @@ -8745,19 +8772,19 @@ msgstr "" "如果別名已使用 ``*`` 運算子解包 (unpack) 則為 true 的布林值(請參閱 :data:" "`~typing.TypeVarTuple`\\ )。" -#: ../../library/stdtypes.rst:5928 +#: ../../library/stdtypes.rst:5944 msgid ":pep:`484` - Type Hints" msgstr ":pep:`484` - 型別提示" -#: ../../library/stdtypes.rst:5929 +#: ../../library/stdtypes.rst:5945 msgid "Introducing Python's framework for type annotations." msgstr "引入 Python 的型別註釋框架。" -#: ../../library/stdtypes.rst:5931 +#: ../../library/stdtypes.rst:5947 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr ":pep:`585` - 標準集合 (Standard Collections) 中的型別提示泛型" -#: ../../library/stdtypes.rst:5932 +#: ../../library/stdtypes.rst:5948 msgid "" "Introducing the ability to natively parameterize standard-library classes, " "provided they implement the special class method :meth:`~object." @@ -8766,7 +8793,7 @@ msgstr "" "引入原生參數化標準函式庫類別的能力,前提是它們有實作特殊的類別方法 :meth:" "`~object.__class_getitem__`。" -#: ../../library/stdtypes.rst:5936 +#: ../../library/stdtypes.rst:5952 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" @@ -8774,18 +8801,18 @@ msgstr "" ":ref:`Generics`、:ref:`使用者定義泛型 `\\ 和 :class:" "`typing.Generic`" -#: ../../library/stdtypes.rst:5937 +#: ../../library/stdtypes.rst:5953 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:5946 +#: ../../library/stdtypes.rst:5962 msgid "Union Type" msgstr "聯合型別 (Union Type)" -#: ../../library/stdtypes.rst:5952 +#: ../../library/stdtypes.rst:5968 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -8798,7 +8825,7 @@ msgstr "" "釋 (type annotation) `。與下標 :data:`typing.Union` 相比,聯合型" "別運算式可以讓型別提示語法更清晰簡潔。" -#: ../../library/stdtypes.rst:5959 +#: ../../library/stdtypes.rst:5975 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 " @@ -8809,7 +8836,7 @@ msgstr "" "``typing.Union[X, Y]``。舉例來說,下列函式需要一個型別為 :class:`int` 或 :" "class:`float` 的引數: ::" -#: ../../library/stdtypes.rst:5964 +#: ../../library/stdtypes.rst:5980 msgid "" "def square(number: int | float) -> int | float:\n" " return number ** 2" @@ -8817,7 +8844,7 @@ msgstr "" "def square(number: int | float) -> int | float:\n" " return number ** 2" -#: ../../library/stdtypes.rst:5969 +#: ../../library/stdtypes.rst:5985 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 " @@ -8830,40 +8857,40 @@ msgstr "" "義類別的參照,將在 runtime 失敗。對於包含向前參照的聯合,請將整個運算式以字串" "呈現,例如 ``\"int | Foo\"``。" -#: ../../library/stdtypes.rst:5977 +#: ../../library/stdtypes.rst:5993 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "聯合物件可以與其他聯合物件一起進行相等性測試。細節如下:" -#: ../../library/stdtypes.rst:5979 +#: ../../library/stdtypes.rst:5995 msgid "Unions of unions are flattened::" msgstr "聯合的聯合會被扁平化: ::" -#: ../../library/stdtypes.rst:5981 +#: ../../library/stdtypes.rst:5997 msgid "(int | str) | float == int | str | float" msgstr "(int | str) | float == int | str | float" -#: ../../library/stdtypes.rst:5983 +#: ../../library/stdtypes.rst:5999 msgid "Redundant types are removed::" msgstr "冗餘型別會被刪除: ::" -#: ../../library/stdtypes.rst:5985 +#: ../../library/stdtypes.rst:6001 msgid "int | str | int == int | str" msgstr "int | str | int == int | str" -#: ../../library/stdtypes.rst:5987 +#: ../../library/stdtypes.rst:6003 msgid "When comparing unions, the order is ignored::" msgstr "比較聯合時,順序會被忽略: ::" -#: ../../library/stdtypes.rst:5989 +#: ../../library/stdtypes.rst:6005 msgid "int | str == str | int" msgstr "int | str == str | int" -#: ../../library/stdtypes.rst:5991 +#: ../../library/stdtypes.rst:6007 msgid "It creates instances of :class:`typing.Union`::" msgstr "它會建立 :class:`typing.Union` 的實例: ::" -#: ../../library/stdtypes.rst:5993 +#: ../../library/stdtypes.rst:6009 msgid "" "int | str == typing.Union[int, str]\n" "type(int | str) is typing.Union" @@ -8871,21 +8898,21 @@ msgstr "" "int | str == typing.Union[int, str]\n" "type(int | str) is typing.Union" -#: ../../library/stdtypes.rst:5996 +#: ../../library/stdtypes.rst:6012 msgid "Optional types can be spelled as a union with ``None``::" msgstr "可選型別可以表示為與 ``None`` 的聯合: ::" -#: ../../library/stdtypes.rst:5998 +#: ../../library/stdtypes.rst:6014 msgid "str | None == typing.Optional[str]" msgstr "str | None == typing.Optional[str]" -#: ../../library/stdtypes.rst:6003 +#: ../../library/stdtypes.rst:6019 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "聯合物件也支援 :func:`isinstance` 和 :func:`issubclass` 的呼叫: ::" -#: ../../library/stdtypes.rst:6006 +#: ../../library/stdtypes.rst:6022 msgid "" ">>> isinstance(\"\", int | str)\n" "True" @@ -8893,14 +8920,14 @@ msgstr "" ">>> isinstance(\"\", int | str)\n" "True" -#: ../../library/stdtypes.rst:6009 +#: ../../library/stdtypes.rst:6025 msgid "" "However, :ref:`parameterized generics ` in union objects " "cannot be checked::" msgstr "" "然而聯合物件中的\\ :ref:`參數化泛型 `\\ 則無法被檢查: ::" -#: ../../library/stdtypes.rst:6012 +#: ../../library/stdtypes.rst:6028 msgid "" ">>> isinstance(1, int | list[int]) # short-circuit evaluation\n" "True\n" @@ -8910,7 +8937,7 @@ msgid "" "TypeError: isinstance() argument 2 cannot be a parameterized generic" msgstr "" -#: ../../library/stdtypes.rst:6019 +#: ../../library/stdtypes.rst:6035 msgid "" "The user-exposed type for the union object can be accessed from :class:" "`typing.Union` and used for :func:`isinstance` checks::" @@ -8918,7 +8945,7 @@ msgstr "" "構成聯合物件的對使用者公開型別 (user-exposed type) 可以透過 :data:`typing." "Union` 存取並用於 :func:`isinstance` 檢查: ::" -#: ../../library/stdtypes.rst:6022 +#: ../../library/stdtypes.rst:6038 msgid "" ">>> import typing\n" ">>> isinstance(int | str, typing.Union)\n" @@ -8936,7 +8963,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: cannot create 'typing.Union' instances" -#: ../../library/stdtypes.rst:6031 +#: ../../library/stdtypes.rst:6047 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 " @@ -8945,7 +8972,7 @@ msgstr "" "新增了型別物件的 :meth:`!__or__` 方法來支援 ``X | Y`` 語法。如果元類別有實" "作 :meth:`!__or__`,則 Union 可以覆寫 (override) 它: ::" -#: ../../library/stdtypes.rst:6035 +#: ../../library/stdtypes.rst:6051 msgid "" ">>> class M(type):\n" "... def __or__(self, other):\n" @@ -8971,32 +8998,32 @@ msgstr "" ">>> int | C\n" "int | C" -#: ../../library/stdtypes.rst:6051 +#: ../../library/stdtypes.rst:6067 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr ":pep:`604` -- PEP 提出 ``X | Y`` 語法和聯合型別。" -#: ../../library/stdtypes.rst:6057 +#: ../../library/stdtypes.rst:6073 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:6064 +#: ../../library/stdtypes.rst:6080 msgid "Other Built-in Types" msgstr "其他內建型別" -#: ../../library/stdtypes.rst:6066 +#: ../../library/stdtypes.rst:6082 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:6073 +#: ../../library/stdtypes.rst:6089 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:6075 +#: ../../library/stdtypes.rst:6091 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 " @@ -9007,7 +9034,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:6082 +#: ../../library/stdtypes.rst:6098 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -9018,32 +9045,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:6090 +#: ../../library/stdtypes.rst:6106 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:6098 +#: ../../library/stdtypes.rst:6114 msgid "Classes and Class Instances" msgstr "類別與類別實例" -#: ../../library/stdtypes.rst:6100 +#: ../../library/stdtypes.rst:6116 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "請見 :ref:`objects` 和 :ref:`class`。" -#: ../../library/stdtypes.rst:6106 +#: ../../library/stdtypes.rst:6122 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:6108 +#: ../../library/stdtypes.rst:6124 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:6111 +#: ../../library/stdtypes.rst:6127 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -9051,15 +9078,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:6115 +#: ../../library/stdtypes.rst:6131 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`。" -#: ../../library/stdtypes.rst:6121 +#: ../../library/stdtypes.rst:6137 msgid "Methods" msgstr "方法" -#: ../../library/stdtypes.rst:6125 +#: ../../library/stdtypes.rst:6141 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: :ref:`built-in methods ` (such as :meth:" @@ -9067,7 +9094,7 @@ msgid "" "methods>`. Built-in methods are described with the types that support them." msgstr "" -#: ../../library/stdtypes.rst:6131 +#: ../../library/stdtypes.rst:6147 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:" @@ -9080,7 +9107,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:6142 +#: ../../library/stdtypes.rst:6158 msgid "" "Like :ref:`function objects `, bound method objects " "support getting arbitrary attributes. However, since method attributes are " @@ -9091,7 +9118,7 @@ msgid "" "underlying function object:" msgstr "" -#: ../../library/stdtypes.rst:6150 +#: ../../library/stdtypes.rst:6166 msgid "" ">>> class C:\n" "... def method(self):\n" @@ -9119,15 +9146,15 @@ msgstr "" ">>> c.method.whoami\n" "'my name is method'" -#: ../../library/stdtypes.rst:6165 +#: ../../library/stdtypes.rst:6181 msgid "See :ref:`instance-methods` for more information." msgstr "更多資訊請見 :ref:`instance-methods`。" -#: ../../library/stdtypes.rst:6173 +#: ../../library/stdtypes.rst:6189 msgid "Code Objects" msgstr "程式碼物件" -#: ../../library/stdtypes.rst:6179 +#: ../../library/stdtypes.rst:6195 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -9137,7 +9164,7 @@ msgid "" "`~function.__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:6186 +#: ../../library/stdtypes.rst:6202 msgid "" "Accessing :attr:`~function.__code__` raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and " @@ -9146,21 +9173,21 @@ msgstr "" "存取 :attr:`~function.__code__` 會引發一個附帶引數 ``obj`` 與 " "``\"__code__\"`` 的\\ :ref:`稽核事件 ` ``object.__getattr__``。" -#: ../../library/stdtypes.rst:6193 +#: ../../library/stdtypes.rst:6209 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:6196 +#: ../../library/stdtypes.rst:6212 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`。" -#: ../../library/stdtypes.rst:6202 +#: ../../library/stdtypes.rst:6218 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:6208 +#: ../../library/stdtypes.rst:6224 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 " @@ -9168,30 +9195,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:6213 +#: ../../library/stdtypes.rst:6229 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:6219 +#: ../../library/stdtypes.rst:6235 msgid "The Null Object" msgstr "Null 物件" -#: ../../library/stdtypes.rst:6221 +#: ../../library/stdtypes.rst:6237 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:6225 +#: ../../library/stdtypes.rst:6241 msgid "It is written as ``None``." msgstr "它被寫為 ``None``。" -#: ../../library/stdtypes.rst:6232 +#: ../../library/stdtypes.rst:6248 msgid "The Ellipsis Object" msgstr "Ellipsis 物件" -#: ../../library/stdtypes.rst:6234 +#: ../../library/stdtypes.rst:6250 msgid "" "This object is commonly used to indicate that something is omitted. It " "supports no special operations. There is exactly one ellipsis object, " @@ -9199,63 +9226,63 @@ msgid "" "the :const:`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:6239 +#: ../../library/stdtypes.rst:6255 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "它被寫為 ``Ellipsis`` 或 ``...``。" -#: ../../library/stdtypes.rst:6241 +#: ../../library/stdtypes.rst:6257 msgid "" "In typical use, ``...`` as the ``Ellipsis`` object appears in a few " "different places, for instance:" msgstr "" -#: ../../library/stdtypes.rst:6244 +#: ../../library/stdtypes.rst:6260 msgid "" "In type annotations, such as :ref:`callable arguments ` or :ref:`tuple elements `." msgstr "" -#: ../../library/stdtypes.rst:6247 +#: ../../library/stdtypes.rst:6263 msgid "" "As the body of a function instead of a :ref:`pass statement `." msgstr "" -#: ../../library/stdtypes.rst:6249 +#: ../../library/stdtypes.rst:6265 msgid "" "In third-party libraries, such as `Numpy's slicing and striding `_." msgstr "" -#: ../../library/stdtypes.rst:6252 +#: ../../library/stdtypes.rst:6268 msgid "" "Python also uses three dots in ways that are not ``Ellipsis`` objects, for " "instance:" msgstr "" -#: ../../library/stdtypes.rst:6254 +#: ../../library/stdtypes.rst:6270 msgid "" "Doctest's :const:`ELLIPSIS `, as a pattern for missing " "content." msgstr "" -#: ../../library/stdtypes.rst:6256 +#: ../../library/stdtypes.rst:6272 msgid "" "The default Python prompt of the :term:`interactive` shell when partial " "input is incomplete." msgstr "" -#: ../../library/stdtypes.rst:6258 +#: ../../library/stdtypes.rst:6274 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:6266 +#: ../../library/stdtypes.rst:6282 msgid "The NotImplemented Object" msgstr "NotImplemented 物件" -#: ../../library/stdtypes.rst:6268 +#: ../../library/stdtypes.rst:6284 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 " @@ -9263,64 +9290,64 @@ msgid "" "`type(NotImplemented)()` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:6273 +#: ../../library/stdtypes.rst:6289 msgid "It is written as :code:`NotImplemented`." msgstr "它被寫為 :code:`NotImplemented`。" -#: ../../library/stdtypes.rst:6279 +#: ../../library/stdtypes.rst:6295 msgid "Internal Objects" msgstr "內部物件" -#: ../../library/stdtypes.rst:6281 +#: ../../library/stdtypes.rst:6297 msgid "" "See :ref:`types` for this information. It describes :ref:`stack frame " "objects `, :ref:`traceback objects `, and " "slice objects." msgstr "" -#: ../../library/stdtypes.rst:6289 +#: ../../library/stdtypes.rst:6305 msgid "Special Attributes" msgstr "特殊屬性" -#: ../../library/stdtypes.rst:6291 +#: ../../library/stdtypes.rst:6307 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:6298 +#: ../../library/stdtypes.rst:6314 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:6304 +#: ../../library/stdtypes.rst:6320 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:6312 +#: ../../library/stdtypes.rst:6328 msgid "The name of the module in which a class or function was defined." msgstr "" -#: ../../library/stdtypes.rst:6317 +#: ../../library/stdtypes.rst:6333 msgid "" "The documentation string of a class or function, or ``None`` if undefined." msgstr "" -#: ../../library/stdtypes.rst:6322 +#: ../../library/stdtypes.rst:6338 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:6332 +#: ../../library/stdtypes.rst:6348 msgid "Integer string conversion length limitation" msgstr "" -#: ../../library/stdtypes.rst:6334 +#: ../../library/stdtypes.rst:6350 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 " @@ -9328,7 +9355,7 @@ msgid "" "binary conversions are unlimited. The limit can be configured." msgstr "" -#: ../../library/stdtypes.rst:6339 +#: ../../library/stdtypes.rst:6355 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 " @@ -9338,24 +9365,24 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:6346 +#: ../../library/stdtypes.rst:6362 msgid "" "Limiting conversion size offers a practical way to avoid :cve:`2020-10735`." msgstr "" -#: ../../library/stdtypes.rst:6348 +#: ../../library/stdtypes.rst:6364 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:6352 +#: ../../library/stdtypes.rst:6368 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:6354 +#: ../../library/stdtypes.rst:6370 msgid "" ">>> import sys\n" ">>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default.\n" @@ -9379,7 +9406,7 @@ msgid "" ">>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited." msgstr "" -#: ../../library/stdtypes.rst:6374 +#: ../../library/stdtypes.rst:6390 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -9387,11 +9414,11 @@ msgid "" "str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:6379 +#: ../../library/stdtypes.rst:6395 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:6381 +#: ../../library/stdtypes.rst:6397 msgid "" ">>> import sys\n" ">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" @@ -9409,11 +9436,11 @@ msgstr "" "... '571186405732').to_bytes(53, 'big')\n" "..." -#: ../../library/stdtypes.rst:6394 +#: ../../library/stdtypes.rst:6410 msgid "Affected APIs" msgstr "受影響的 API" -#: ../../library/stdtypes.rst:6396 +#: ../../library/stdtypes.rst:6412 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" @@ -9421,74 +9448,74 @@ msgstr "" "此限制僅適用於 :class:`int` 與 :class:`str` 或 :class:`bytes` 之間可能較慢的" "轉換:" -#: ../../library/stdtypes.rst:6399 +#: ../../library/stdtypes.rst:6415 msgid "``int(string)`` with default base 10." msgstr "``int(string)`` 以預設的 10 為底。" -#: ../../library/stdtypes.rst:6400 +#: ../../library/stdtypes.rst:6416 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "``int(string, base)`` 用於所有非 2 冪次方的底。" -#: ../../library/stdtypes.rst:6401 +#: ../../library/stdtypes.rst:6417 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:6402 +#: ../../library/stdtypes.rst:6418 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:6403 +#: ../../library/stdtypes.rst:6419 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:6406 +#: ../../library/stdtypes.rst:6422 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:6408 +#: ../../library/stdtypes.rst:6424 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "``int(string, base)`` 以 2、4、8、16 或 32 為底。" -#: ../../library/stdtypes.rst:6409 +#: ../../library/stdtypes.rst:6425 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr ":func:`int.from_bytes` 和 :func:`int.to_bytes`。" -#: ../../library/stdtypes.rst:6410 +#: ../../library/stdtypes.rst:6426 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr ":func:`hex`、:func:`oct`、:func:`bin`。" -#: ../../library/stdtypes.rst:6411 +#: ../../library/stdtypes.rst:6427 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr ":ref:`formatspec` 用於十六進位、八進位和二進位數字。" -#: ../../library/stdtypes.rst:6412 +#: ../../library/stdtypes.rst:6428 msgid ":class:`str` to :class:`float`." msgstr ":class:`str` 轉換為 :class:`float`。" -#: ../../library/stdtypes.rst:6413 +#: ../../library/stdtypes.rst:6429 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr ":class:`str` 轉換為 :class:`decimal.Decimal`。" -#: ../../library/stdtypes.rst:6416 +#: ../../library/stdtypes.rst:6432 msgid "Configuring the limit" msgstr "設定限制" -#: ../../library/stdtypes.rst:6418 +#: ../../library/stdtypes.rst:6434 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:6421 +#: ../../library/stdtypes.rst:6437 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:6424 +#: ../../library/stdtypes.rst:6440 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" @@ -9496,7 +9523,7 @@ msgstr "" ":option:`-X int_max_str_digits <-X>`,例如 ``python3 -X " "int_max_str_digits=640``" -#: ../../library/stdtypes.rst:6426 +#: ../../library/stdtypes.rst:6442 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 " @@ -9505,38 +9532,38 @@ msgid "" "int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:6432 +#: ../../library/stdtypes.rst:6448 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:6435 +#: ../../library/stdtypes.rst:6451 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:6439 +#: ../../library/stdtypes.rst:6455 msgid "" "Information about the default and minimum can be found in :data:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:6441 +#: ../../library/stdtypes.rst:6457 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:6443 +#: ../../library/stdtypes.rst:6459 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:6450 +#: ../../library/stdtypes.rst:6466 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 " @@ -9548,7 +9575,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:6459 +#: ../../library/stdtypes.rst:6475 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 " @@ -9556,11 +9583,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:6465 +#: ../../library/stdtypes.rst:6481 msgid "Recommended configuration" msgstr "建議的配置" -#: ../../library/stdtypes.rst:6467 +#: ../../library/stdtypes.rst:6483 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 " @@ -9568,11 +9595,11 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.12." msgstr "" -#: ../../library/stdtypes.rst:6472 +#: ../../library/stdtypes.rst:6488 msgid "Example::" msgstr "範例: ::" -#: ../../library/stdtypes.rst:6474 +#: ../../library/stdtypes.rst:6490 msgid "" ">>> import sys\n" ">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" @@ -9594,38 +9621,38 @@ msgstr "" "... elif current_limit < lower_bound:\n" "... sys.set_int_max_str_digits(lower_bound)" -#: ../../library/stdtypes.rst:6484 +#: ../../library/stdtypes.rst:6500 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:6488 +#: ../../library/stdtypes.rst:6504 msgid "Footnotes" msgstr "註腳" -#: ../../library/stdtypes.rst:6489 +#: ../../library/stdtypes.rst:6505 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:6492 +#: ../../library/stdtypes.rst:6508 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:6495 +#: ../../library/stdtypes.rst:6511 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:6497 +#: ../../library/stdtypes.rst:6513 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:6500 +#: ../../library/stdtypes.rst:6516 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." @@ -9638,13 +9665,13 @@ msgstr "built-in(內建)" #: ../../library/stdtypes.rst:13 ../../library/stdtypes.rst:324 #: ../../library/stdtypes.rst:401 ../../library/stdtypes.rst:994 #: ../../library/stdtypes.rst:1184 ../../library/stdtypes.rst:1206 -#: ../../library/stdtypes.rst:1221 ../../library/stdtypes.rst:5208 -#: ../../library/stdtypes.rst:6204 +#: ../../library/stdtypes.rst:1221 ../../library/stdtypes.rst:5224 +#: ../../library/stdtypes.rst:6220 msgid "types" msgstr "type(型別)" #: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:1221 -#: ../../library/stdtypes.rst:5208 +#: ../../library/stdtypes.rst:5224 msgid "statement" msgstr "statement(陳述式)" @@ -9766,11 +9793,11 @@ msgstr "is not" #: ../../library/stdtypes.rst:1206 ../../library/stdtypes.rst:1371 #: ../../library/stdtypes.rst:1553 ../../library/stdtypes.rst:1597 #: ../../library/stdtypes.rst:1718 ../../library/stdtypes.rst:1848 -#: ../../library/stdtypes.rst:3229 ../../library/stdtypes.rst:3248 -#: ../../library/stdtypes.rst:3361 ../../library/stdtypes.rst:4997 -#: ../../library/stdtypes.rst:5208 ../../library/stdtypes.rst:5691 -#: ../../library/stdtypes.rst:5948 ../../library/stdtypes.rst:6123 -#: ../../library/stdtypes.rst:6168 +#: ../../library/stdtypes.rst:3245 ../../library/stdtypes.rst:3264 +#: ../../library/stdtypes.rst:3377 ../../library/stdtypes.rst:5013 +#: ../../library/stdtypes.rst:5224 ../../library/stdtypes.rst:5707 +#: ../../library/stdtypes.rst:5964 ../../library/stdtypes.rst:6139 +#: ../../library/stdtypes.rst:6184 msgid "object" msgstr "object(物件)" @@ -9862,9 +9889,9 @@ msgid "arithmetic" msgstr "arithmetic(算術)" #: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:994 -#: ../../library/stdtypes.rst:1184 ../../library/stdtypes.rst:5208 -#: ../../library/stdtypes.rst:6175 ../../library/stdtypes.rst:6189 -#: ../../library/stdtypes.rst:6204 +#: ../../library/stdtypes.rst:1184 ../../library/stdtypes.rst:5224 +#: ../../library/stdtypes.rst:6191 ../../library/stdtypes.rst:6205 +#: ../../library/stdtypes.rst:6220 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -9880,8 +9907,8 @@ msgstr "float" msgid "complex" msgstr "complex(複數)" -#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3105 -#: ../../library/stdtypes.rst:4365 +#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3121 +#: ../../library/stdtypes.rst:4381 msgid "+ (plus)" msgstr "+ (加號)" @@ -9893,13 +9920,13 @@ msgstr "unary operator(一元運算子)" msgid "binary operator" msgstr "binary operator(二元運算子)" -#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3105 -#: ../../library/stdtypes.rst:4365 +#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3121 +#: ../../library/stdtypes.rst:4381 msgid "- (minus)" msgstr "- (減號)" -#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3062 -#: ../../library/stdtypes.rst:4322 +#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3078 +#: ../../library/stdtypes.rst:4338 msgid "* (asterisk)" msgstr "* (星號)" @@ -9911,8 +9938,8 @@ msgstr "/ (斜線)" msgid "//" msgstr "//" -#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3025 -#: ../../library/stdtypes.rst:4290 +#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3041 +#: ../../library/stdtypes.rst:4306 msgid "% (percent)" msgstr "% (百分號)" @@ -9922,7 +9949,7 @@ msgstr "**" #: ../../library/stdtypes.rst:324 ../../library/stdtypes.rst:401 #: ../../library/stdtypes.rst:994 ../../library/stdtypes.rst:1221 -#: ../../library/stdtypes.rst:5208 +#: ../../library/stdtypes.rst:5224 msgid "operations on" msgstr "operations on(操作於)" @@ -9931,7 +9958,7 @@ msgid "conjugate() (complex number method)" msgstr "conjugate()(複數方法)" #: ../../library/stdtypes.rst:343 ../../library/stdtypes.rst:1916 -#: ../../library/stdtypes.rst:3229 ../../library/stdtypes.rst:6204 +#: ../../library/stdtypes.rst:3245 ../../library/stdtypes.rst:6220 msgid "module" msgstr "模組" @@ -9999,7 +10026,7 @@ msgstr "values" msgid "iterator protocol" msgstr "iterator protocol(疊代器協定)" -#: ../../library/stdtypes.rst:891 ../../library/stdtypes.rst:5604 +#: ../../library/stdtypes.rst:891 ../../library/stdtypes.rst:5620 msgid "protocol" msgstr "protocol(協定)" @@ -10025,7 +10052,7 @@ msgstr "container(容器)" msgid "iteration over" msgstr "iteration over(疊代於)" -#: ../../library/stdtypes.rst:994 ../../library/stdtypes.rst:5208 +#: ../../library/stdtypes.rst:994 ../../library/stdtypes.rst:5224 msgid "len" msgstr "len" @@ -10094,14 +10121,14 @@ msgstr "mutable(可變)" msgid "list" msgstr "list(串列)" -#: ../../library/stdtypes.rst:1206 ../../library/stdtypes.rst:3229 -#: ../../library/stdtypes.rst:3361 ../../library/stdtypes.rst:3471 -#: ../../library/stdtypes.rst:4290 +#: ../../library/stdtypes.rst:1206 ../../library/stdtypes.rst:3245 +#: ../../library/stdtypes.rst:3377 ../../library/stdtypes.rst:3487 +#: ../../library/stdtypes.rst:4306 msgid "bytearray" msgstr "bytearray(位元組陣列)" -#: ../../library/stdtypes.rst:1221 ../../library/stdtypes.rst:5208 -#: ../../library/stdtypes.rst:5948 ../../library/stdtypes.rst:6204 +#: ../../library/stdtypes.rst:1221 ../../library/stdtypes.rst:5224 +#: ../../library/stdtypes.rst:5964 ../../library/stdtypes.rst:6220 msgid "type" msgstr "type(型別)" @@ -10109,7 +10136,7 @@ msgstr "type(型別)" msgid "assignment" msgstr "assignment(賦值)" -#: ../../library/stdtypes.rst:1221 ../../library/stdtypes.rst:5208 +#: ../../library/stdtypes.rst:1221 ../../library/stdtypes.rst:5224 msgid "del" msgstr "del" @@ -10118,8 +10145,8 @@ msgid "range" msgstr "range" #: ../../library/stdtypes.rst:1718 ../../library/stdtypes.rst:1861 -#: ../../library/stdtypes.rst:1908 ../../library/stdtypes.rst:2853 -#: ../../library/stdtypes.rst:3025 +#: ../../library/stdtypes.rst:1908 ../../library/stdtypes.rst:2869 +#: ../../library/stdtypes.rst:3041 msgid "string" msgstr "string(字串)" @@ -10140,17 +10167,17 @@ msgstr "(亦請見 string)" msgid "io.StringIO" msgstr "io.StringIO" -#: ../../library/stdtypes.rst:1881 ../../library/stdtypes.rst:3221 +#: ../../library/stdtypes.rst:1881 ../../library/stdtypes.rst:3237 msgid "buffer protocol" msgstr "buffer protocol(緩衝區協定)" -#: ../../library/stdtypes.rst:1881 ../../library/stdtypes.rst:3229 -#: ../../library/stdtypes.rst:3248 ../../library/stdtypes.rst:3471 -#: ../../library/stdtypes.rst:4290 +#: ../../library/stdtypes.rst:1881 ../../library/stdtypes.rst:3245 +#: ../../library/stdtypes.rst:3264 ../../library/stdtypes.rst:3487 +#: ../../library/stdtypes.rst:4306 msgid "bytes" msgstr "bytes(位元組)" -#: ../../library/stdtypes.rst:1908 ../../library/stdtypes.rst:3471 +#: ../../library/stdtypes.rst:1908 ../../library/stdtypes.rst:3487 msgid "methods" msgstr "methods(方法)" @@ -10158,239 +10185,239 @@ msgstr "methods(方法)" msgid "re" msgstr "re" -#: ../../library/stdtypes.rst:2665 ../../library/stdtypes.rst:4144 +#: ../../library/stdtypes.rst:2681 ../../library/stdtypes.rst:4160 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/stdtypes.rst:2665 +#: ../../library/stdtypes.rst:2681 msgid "str.splitlines method" msgstr "str.splitlines 方法" -#: ../../library/stdtypes.rst:2853 +#: ../../library/stdtypes.rst:2869 msgid "! formatted string literal" msgstr "! formatted string literals(! 格式化字串常數)" -#: ../../library/stdtypes.rst:2853 +#: ../../library/stdtypes.rst:2869 msgid "formatted string literals" msgstr "formatted string literals(格式化字串常數)" -#: ../../library/stdtypes.rst:2853 +#: ../../library/stdtypes.rst:2869 msgid "! f-string" msgstr "! f-string(! f 字串)" -#: ../../library/stdtypes.rst:2853 +#: ../../library/stdtypes.rst:2869 msgid "f-strings" msgstr "f-string(f 字串)" -#: ../../library/stdtypes.rst:2853 +#: ../../library/stdtypes.rst:2869 msgid "fstring" msgstr "fstring(f 字串)" -#: ../../library/stdtypes.rst:2853 +#: ../../library/stdtypes.rst:2869 msgid "interpolated string literal" msgstr "interpolated string literal(插值字串常數)" -#: ../../library/stdtypes.rst:2853 +#: ../../library/stdtypes.rst:2869 msgid "formatted literal" msgstr "formatted literal(格式化常數)" -#: ../../library/stdtypes.rst:2853 +#: ../../library/stdtypes.rst:2869 msgid "interpolated literal" msgstr "interpolated literal(插值常數)" -#: ../../library/stdtypes.rst:2853 +#: ../../library/stdtypes.rst:2869 msgid "{} (curly brackets)" msgstr "{} (花括號)" -#: ../../library/stdtypes.rst:2853 +#: ../../library/stdtypes.rst:2869 msgid "in formatted string literal" msgstr "於格式化字串常數中" -#: ../../library/stdtypes.rst:2853 +#: ../../library/stdtypes.rst:2869 msgid "! (exclamation mark)" msgstr "! (驚嘆號)" -#: ../../library/stdtypes.rst:2853 +#: ../../library/stdtypes.rst:2869 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/stdtypes.rst:2853 +#: ../../library/stdtypes.rst:2869 msgid "= (equals)" msgstr "= (等號)" -#: ../../library/stdtypes.rst:2853 +#: ../../library/stdtypes.rst:2869 msgid "for help in debugging using string literals" msgstr "" -#: ../../library/stdtypes.rst:3025 +#: ../../library/stdtypes.rst:3041 msgid "formatting, string (%)" msgstr "formatting(格式化)、字串 (%)" -#: ../../library/stdtypes.rst:3025 +#: ../../library/stdtypes.rst:3041 msgid "interpolation, string (%)" msgstr "interpolation(插值)、字串 (%)" -#: ../../library/stdtypes.rst:3025 +#: ../../library/stdtypes.rst:3041 msgid "formatting, printf" msgstr "formatting(格式化)、printf" -#: ../../library/stdtypes.rst:3025 +#: ../../library/stdtypes.rst:3041 msgid "interpolation, printf" msgstr "interpolation(插值)、printf" -#: ../../library/stdtypes.rst:3025 ../../library/stdtypes.rst:4290 +#: ../../library/stdtypes.rst:3041 ../../library/stdtypes.rst:4306 msgid "printf-style formatting" msgstr "printf 風格格式化" -#: ../../library/stdtypes.rst:3025 ../../library/stdtypes.rst:4290 +#: ../../library/stdtypes.rst:3041 ../../library/stdtypes.rst:4306 msgid "sprintf-style formatting" msgstr "sprintf 風格格式化" -#: ../../library/stdtypes.rst:3062 ../../library/stdtypes.rst:4322 +#: ../../library/stdtypes.rst:3078 ../../library/stdtypes.rst:4338 msgid "() (parentheses)" msgstr "() (圓括號)" -#: ../../library/stdtypes.rst:3062 ../../library/stdtypes.rst:3105 -#: ../../library/stdtypes.rst:4322 ../../library/stdtypes.rst:4365 +#: ../../library/stdtypes.rst:3078 ../../library/stdtypes.rst:3121 +#: ../../library/stdtypes.rst:4338 ../../library/stdtypes.rst:4381 msgid "in printf-style formatting" msgstr "於 printf 風格格式化" -#: ../../library/stdtypes.rst:3062 ../../library/stdtypes.rst:4322 +#: ../../library/stdtypes.rst:3078 ../../library/stdtypes.rst:4338 msgid ". (dot)" msgstr ". (點)" -#: ../../library/stdtypes.rst:3105 ../../library/stdtypes.rst:4365 +#: ../../library/stdtypes.rst:3121 ../../library/stdtypes.rst:4381 msgid "# (hash)" msgstr "# (井字號)" -#: ../../library/stdtypes.rst:3105 ../../library/stdtypes.rst:4365 +#: ../../library/stdtypes.rst:3121 ../../library/stdtypes.rst:4381 msgid "space" msgstr "space(空白)" -#: ../../library/stdtypes.rst:3221 +#: ../../library/stdtypes.rst:3237 msgid "binary sequence types" msgstr "binary sequence types(二進位序列型別)" -#: ../../library/stdtypes.rst:3229 +#: ../../library/stdtypes.rst:3245 msgid "memoryview" msgstr "memoryview(記憶體視圖)" -#: ../../library/stdtypes.rst:3229 +#: ../../library/stdtypes.rst:3245 msgid "array" msgstr "array(陣列)" -#: ../../library/stdtypes.rst:4144 +#: ../../library/stdtypes.rst:4160 msgid "bytes.splitlines method" msgstr "bytes.splitlines 方法" -#: ../../library/stdtypes.rst:4144 +#: ../../library/stdtypes.rst:4160 msgid "bytearray.splitlines method" msgstr "bytearray.splitlines 方法" -#: ../../library/stdtypes.rst:4290 +#: ../../library/stdtypes.rst:4306 msgid "formatting" msgstr "formatting(格式化)" -#: ../../library/stdtypes.rst:4290 +#: ../../library/stdtypes.rst:4306 msgid "bytes (%)" msgstr "bytes (%)" -#: ../../library/stdtypes.rst:4290 +#: ../../library/stdtypes.rst:4306 msgid "bytearray (%)" msgstr "bytearray (%)" -#: ../../library/stdtypes.rst:4290 +#: ../../library/stdtypes.rst:4306 msgid "interpolation" msgstr "interpolation(插值)" -#: ../../library/stdtypes.rst:4997 +#: ../../library/stdtypes.rst:5013 msgid "set" msgstr "set(集合)" -#: ../../library/stdtypes.rst:5208 +#: ../../library/stdtypes.rst:5224 msgid "mapping" msgstr "mapping(對映)" -#: ../../library/stdtypes.rst:5208 +#: ../../library/stdtypes.rst:5224 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../library/stdtypes.rst:5315 +#: ../../library/stdtypes.rst:5331 msgid "__missing__()" msgstr "__missing__()" -#: ../../library/stdtypes.rst:5604 +#: ../../library/stdtypes.rst:5620 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../library/stdtypes.rst:5604 +#: ../../library/stdtypes.rst:5620 msgid "context management protocol" msgstr "context management protocol(情境管理協定)" -#: ../../library/stdtypes.rst:5604 +#: ../../library/stdtypes.rst:5620 msgid "context management" msgstr "context management(情境管理)" -#: ../../library/stdtypes.rst:5679 +#: ../../library/stdtypes.rst:5695 msgid "annotation" msgstr "annotation(註記)" -#: ../../library/stdtypes.rst:5679 +#: ../../library/stdtypes.rst:5695 msgid "type annotation; type hint" msgstr "type annotation(型別註記);type hint(型別提示)" -#: ../../library/stdtypes.rst:5691 +#: ../../library/stdtypes.rst:5707 msgid "GenericAlias" msgstr "GenericAlias(泛型別名)" -#: ../../library/stdtypes.rst:5691 +#: ../../library/stdtypes.rst:5707 msgid "Generic" msgstr "Generic(泛型)" -#: ../../library/stdtypes.rst:5691 +#: ../../library/stdtypes.rst:5707 msgid "Alias" msgstr "Alias(別名)" -#: ../../library/stdtypes.rst:5948 +#: ../../library/stdtypes.rst:5964 msgid "Union" msgstr "Union(聯合)" -#: ../../library/stdtypes.rst:5948 +#: ../../library/stdtypes.rst:5964 msgid "union" msgstr "union(聯集)" -#: ../../library/stdtypes.rst:6123 +#: ../../library/stdtypes.rst:6139 msgid "method" msgstr "method(方法)" -#: ../../library/stdtypes.rst:6168 +#: ../../library/stdtypes.rst:6184 msgid "code" msgstr "code(程式碼)" -#: ../../library/stdtypes.rst:6168 +#: ../../library/stdtypes.rst:6184 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../library/stdtypes.rst:6175 +#: ../../library/stdtypes.rst:6191 msgid "compile" msgstr "compile(編譯)" -#: ../../library/stdtypes.rst:6175 +#: ../../library/stdtypes.rst:6191 msgid "__code__ (function object attribute)" msgstr "__code__(函式物件屬性)" -#: ../../library/stdtypes.rst:6189 +#: ../../library/stdtypes.rst:6205 msgid "exec" msgstr "exec" -#: ../../library/stdtypes.rst:6189 +#: ../../library/stdtypes.rst:6205 msgid "eval" msgstr "eval" -#: ../../library/stdtypes.rst:6228 +#: ../../library/stdtypes.rst:6244 msgid "..." msgstr "..." -#: ../../library/stdtypes.rst:6228 +#: ../../library/stdtypes.rst:6244 msgid "ellipsis literal" msgstr "ellipsis literal(刪節號字面值)" From 41f7af43b525f202de20b952792529afc049238c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Feb 2026 00:21:32 +0000 Subject: [PATCH 08/11] sync with cpython 48015091 --- c-api/intro.po | 450 ++++++--- library/itertools.po | 22 +- library/stdtypes.po | 1769 +++++++++++++++++---------------- library/urllib.robotparser.po | 18 +- 4 files changed, 1217 insertions(+), 1042 deletions(-) diff --git a/c-api/intro.po b/c-api/intro.po index 456e744317..d53f508f9c 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-16 00:15+0000\n" +"POT-Creation-Date: 2026-02-05 00:20+0000\n" "PO-Revision-Date: 2023-04-25 18:01+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -232,6 +232,47 @@ msgid "" msgstr "" #: ../../c-api/intro.rst:132 +msgid "Specify alignment to *num* bytes on compilers that support it." +msgstr "" + +#: ../../c-api/intro.rst:134 +msgid "Consider using the C11 standard ``_Alignas`` specifier over this macro." +msgstr "" + +#: ../../c-api/intro.rst:138 +msgid "" +"Similar to ``integer >> positions``, but forces sign extension, as the C " +"standard does not define whether a right-shift of a signed integer will " +"perform sign extension or a zero-fill." +msgstr "" + +#: ../../c-api/intro.rst:142 +msgid "" +"*integer* should be any signed integer type. *positions* is the number of " +"positions to shift to the right." +msgstr "" + +#: ../../c-api/intro.rst:145 +msgid "" +"Both *integer* and *positions* can be evaluated more than once; " +"consequently, avoid directly passing a function call or some other operation " +"with side-effects to this macro. Instead, store the result as a variable and " +"then pass it." +msgstr "" + +#: ../../c-api/intro.rst:150 +msgid "" +"*type* is unused and only kept for backwards compatibility. Historically, " +"*type* was used to cast *integer*." +msgstr "" + +#: ../../c-api/intro.rst:155 +msgid "" +"This macro is now valid for all signed integer types, not just those for " +"which ``unsigned type`` is legal. As a result, *type* is no longer used." +msgstr "" + +#: ../../c-api/intro.rst:161 msgid "" "Ask the compiler to always inline a static inline function. The compiler can " "ignore it and decide to not inline the function." @@ -239,7 +280,7 @@ msgstr "" "要求編譯器總是嵌入靜態行內函式 (static inline function),編譯器可以忽略它並決" "定不嵌入該函式。" -#: ../../c-api/intro.rst:135 +#: ../../c-api/intro.rst:164 msgid "" "It can be used to inline performance critical static inline functions when " "building Python in debug mode with function inlining disabled. For example, " @@ -248,7 +289,7 @@ msgstr "" "在禁用函式嵌入的除錯模式下建置 Python 時,它可用於嵌入有性能要求的靜態行內函" "式。例如,MSC 在除錯模式下建置時禁用函式嵌入。" -#: ../../c-api/intro.rst:139 +#: ../../c-api/intro.rst:168 msgid "" "Marking blindly a static inline function with Py_ALWAYS_INLINE can result in " "worse performances (due to increased code size for example). The compiler is " @@ -257,7 +298,7 @@ msgstr "" "盲目地使用 Py_ALWAYS_INLINE 標記靜態行內函式可能會導致更差的性能(例如程式碼" "大小增加)。在成本/收益分析方面,編譯器通常比開發人員更聰明。" -#: ../../c-api/intro.rst:143 +#: ../../c-api/intro.rst:172 msgid "" "If Python is :ref:`built in debug mode ` (if the :c:macro:" "`Py_DEBUG` macro is defined), the :c:macro:`Py_ALWAYS_INLINE` macro does " @@ -266,15 +307,26 @@ msgstr "" "如果 Python 是\\ :ref:`在除錯模式下建置 `\\ (如果 :c:macro:" "`Py_DEBUG` 巨集有被定義),:c:macro:`Py_ALWAYS_INLINE` 巨集就什麼都不會做。" -#: ../../c-api/intro.rst:146 +#: ../../c-api/intro.rst:175 msgid "It must be specified before the function return type. Usage::" msgstr "它必須在函式回傳型別之前被指定。用法: ::" -#: ../../c-api/intro.rst:148 +#: ../../c-api/intro.rst:177 msgid "static inline Py_ALWAYS_INLINE int random(void) { return 4; }" msgstr "static inline Py_ALWAYS_INLINE int random(void) { return 4; }" -#: ../../c-api/intro.rst:154 +#: ../../c-api/intro.rst:183 +msgid "" +"If this macro is defined, then the current system is able to start threads." +msgstr "" + +#: ../../c-api/intro.rst:185 +msgid "" +"Currently, all systems supported by CPython (per :pep:`11`), with the " +"exception of some WebAssembly platforms, support starting threads." +msgstr "" + +#: ../../c-api/intro.rst:192 msgid "" "Argument must be a character or an integer in the range [-128, 127] or [0, " "255]. This macro returns ``c`` cast to an ``unsigned char``." @@ -282,26 +334,44 @@ msgstr "" "引數必須是 [-128, 127] 或 [0, 255] 範圍內的字元或整數。這個巨集會將 ``c`` 轉" "換為 ``unsigned char`` 並回傳。" -#: ../../c-api/intro.rst:159 +#: ../../c-api/intro.rst:197 msgid "" "Use this for deprecated declarations. The macro must be placed before the " "symbol name." msgstr "將其用於已棄用的聲明。巨集必須放在符號名稱之前。" -#: ../../c-api/intro.rst:162 ../../c-api/intro.rst:298 -#: ../../c-api/intro.rst:316 +#: ../../c-api/intro.rst:200 ../../c-api/intro.rst:384 +#: ../../c-api/intro.rst:402 msgid "Example::" msgstr "範例: ::" -#: ../../c-api/intro.rst:164 +#: ../../c-api/intro.rst:202 msgid "Py_DEPRECATED(3.8) PyAPI_FUNC(int) Py_OldFunction(void);" msgstr "Py_DEPRECATED(3.8) PyAPI_FUNC(int) Py_OldFunction(void);" -#: ../../c-api/intro.rst:166 +#: ../../c-api/intro.rst:204 msgid "MSVC support was added." msgstr "新增了 MSVC 支援。" -#: ../../c-api/intro.rst:171 +#: ../../c-api/intro.rst:209 +msgid "" +"This is equivalent to ``X``, which is useful for token-pasting in macros, as " +"macro expansions in *X* are forcefully evaluated by the preprocessor." +msgstr "" + +#: ../../c-api/intro.rst:215 +msgid "" +"Use a GCC attribute *name*, hiding it from compilers that don't support GCC " +"attributes (such as MSVC)." +msgstr "" + +#: ../../c-api/intro.rst:218 +msgid "" +"This expands to ``__attribute__((name))`` on a GCC compiler, and expands to " +"nothing on compilers that don't support GCC attributes." +msgstr "" + +#: ../../c-api/intro.rst:223 msgid "" "Like ``getenv(s)``, but returns ``NULL`` if :option:`-E` was passed on the " "command line (see :c:member:`PyConfig.use_environment`)." @@ -309,40 +379,56 @@ msgstr "" "類似於 ``getenv(s)``,但如果在命令列上傳遞了 :option:`-E` 則回傳 ``NULL`` " "(請見 :c:member:`PyConfig.use_environment`)。" -#: ../../c-api/intro.rst:176 +#: ../../c-api/intro.rst:228 +msgid "Use *number* as a ``long long`` integer literal." +msgstr "" + +#: ../../c-api/intro.rst:230 +msgid "" +"This usally expands to *number* followed by ``LL``, but will expand to some " +"compiler-specific suffixes (such as ``I64``) on older compilers." +msgstr "" + +#: ../../c-api/intro.rst:233 +msgid "" +"In modern versions of Python, this macro is not very useful, as C99 and " +"later require the ``LL`` suffix to be valid for an integer." +msgstr "" + +#: ../../c-api/intro.rst:238 msgid "" "Declare a function returning the specified *type* using a fast-calling " "qualifier for functions that are local to the current file. Semantically, " "this is equivalent to ``static type``." msgstr "" -#: ../../c-api/intro.rst:182 +#: ../../c-api/intro.rst:244 msgid "" "Equivalent to :c:macro:`Py_LOCAL` but additionally requests the function be " "inlined." msgstr "" -#: ../../c-api/intro.rst:187 +#: ../../c-api/intro.rst:249 msgid "" "Macro used to declare a symbol as local to the shared library (hidden). On " "supported platforms, it ensures the symbol is not exported." msgstr "" -#: ../../c-api/intro.rst:190 +#: ../../c-api/intro.rst:252 msgid "" "On compatible versions of GCC/Clang, it expands to " "``__attribute__((visibility(\"hidden\")))``." msgstr "" -#: ../../c-api/intro.rst:195 +#: ../../c-api/intro.rst:257 msgid "Return the maximum value between ``x`` and ``y``." msgstr "回傳 ``x`` 和 ``y`` 之間的最大值。" -#: ../../c-api/intro.rst:201 +#: ../../c-api/intro.rst:263 msgid "Return the size of a structure (``type``) ``member`` in bytes." msgstr "以位元組為單位回傳結構 (``type``) ``member`` 的大小。" -#: ../../c-api/intro.rst:207 +#: ../../c-api/intro.rst:269 msgid "" "This is a :term:`soft deprecated` alias to :c:func:`!memcpy`. Use :c:func:`!" "memcpy` directly instead." @@ -350,15 +436,15 @@ msgstr "" "這是 :c:func:`!memcpy` 的已\\ :term:`軟性棄用 `\\ 別名。請直" "接使用 :c:func:`!memcpy`。" -#: ../../c-api/intro.rst:210 +#: ../../c-api/intro.rst:272 msgid "The macro is :term:`soft deprecated`." msgstr "這個巨集已被\\ :term:`軟性棄用 `。" -#: ../../c-api/intro.rst:215 +#: ../../c-api/intro.rst:277 msgid "Return the minimum value between ``x`` and ``y``." msgstr "回傳 ``x`` 和 ``y`` 之間的最小值。" -#: ../../c-api/intro.rst:221 +#: ../../c-api/intro.rst:283 msgid "" "Disable inlining on a function. For example, it reduces the C stack " "consumption: useful on LTO+PGO builds which heavily inline code (see :issue:" @@ -367,21 +453,58 @@ msgstr "" "禁用函式的嵌入。例如,它減少了 C 堆疊的消耗:對大量嵌入程式碼的 LTO+PGO 建置" "很有用(請參閱 :issue:`33720`)。" -#: ../../c-api/intro.rst:225 +#: ../../c-api/intro.rst:287 msgid "Usage::" msgstr "用法: ::" -#: ../../c-api/intro.rst:227 +#: ../../c-api/intro.rst:289 msgid "Py_NO_INLINE static int random(void) { return 4; }" msgstr "Py_NO_INLINE static int random(void) { return 4; }" -#: ../../c-api/intro.rst:233 +#: ../../c-api/intro.rst:295 +msgid "" +"Cast *value* to type *smaller* from type *larger*, validating that no " +"information was lost." +msgstr "" + +#: ../../c-api/intro.rst:298 +msgid "" +"On release builds of Python, this is roughly equivalent to ``(smaller) " +"value`` (in C++, ``static_cast(value)`` will be used instead)." +msgstr "" + +#: ../../c-api/intro.rst:302 +msgid "" +"On debug builds (implying that :c:macro:`Py_DEBUG` is defined), this asserts " +"that no information was lost with the cast from *larger* to *smaller*." +msgstr "" + +#: ../../c-api/intro.rst:305 +msgid "" +"*value*, *larger*, and *smaller* may all be evaluated more than once in the " +"expression; consequently, do not pass an expression with side-effects " +"directly to this macro." +msgstr "" + +#: ../../c-api/intro.rst:311 msgid "" "Convert ``x`` to a C string. E.g. ``Py_STRINGIFY(123)`` returns ``\"123\"``." msgstr "" "將 ``x`` 轉換為 C 字串。例如 ``Py_STRINGIFY(123)`` 會回傳 ``\"123\"``。" -#: ../../c-api/intro.rst:240 +#: ../../c-api/intro.rst:318 +msgid "" +"Similar to :c:macro:`Py_LL`, but *number* will be an ``unsigned long long`` " +"literal instead. This is done by appending ``U`` to the result of ``Py_LL``." +msgstr "" + +#: ../../c-api/intro.rst:321 +msgid "" +"In modern versions of Python, this macro is not very useful, as C99 and " +"later require the ``ULL``/``LLU`` suffixes to be valid for an integer." +msgstr "" + +#: ../../c-api/intro.rst:326 msgid "" "Use this when you have a code path that cannot be reached by design. For " "example, in the ``default:`` clause in a ``switch`` statement for which all " @@ -392,7 +515,7 @@ msgstr "" "蓋了所有可能值的 ``switch`` 陳述式中的 ``default:`` 子句。在你可能想要呼叫 " "``assert(0)`` 或 ``abort()`` 的地方使用它。" -#: ../../c-api/intro.rst:245 +#: ../../c-api/intro.rst:331 msgid "" "In release mode, the macro helps the compiler to optimize the code, and " "avoids a warning about unreachable code. For example, the macro is " @@ -402,7 +525,7 @@ msgstr "" "程式碼的警告。例如該巨集是在發布模式下於 GCC 使用 " "``__builtin_unreachable()`` 來實作。" -#: ../../c-api/intro.rst:249 +#: ../../c-api/intro.rst:335 msgid "" "A use for ``Py_UNREACHABLE()`` is following a call a function that never " "returns but that is not declared :c:macro:`_Py_NO_RETURN`." @@ -410,7 +533,7 @@ msgstr "" "``Py_UNREACHABLE()`` 的一個用途是,在對一個永不回傳但並未聲明為 :c:macro:" "`_Py_NO_RETURN` 的函式之呼叫後使用。" -#: ../../c-api/intro.rst:252 +#: ../../c-api/intro.rst:338 msgid "" "If a code path is very unlikely code but can be reached under exceptional " "case, this macro must not be used. For example, under low memory condition " @@ -422,7 +545,7 @@ msgstr "" "憶體條件下或系統呼叫回傳了超出預期範圍的值。在這種情況下,最好將錯誤回報給呼" "叫者。如果無法回報錯誤則可以使用 :c:func:`Py_FatalError`。" -#: ../../c-api/intro.rst:262 +#: ../../c-api/intro.rst:348 msgid "" "Use this for unused arguments in a function definition to silence compiler " "warnings. Example: ``int func(int a, int Py_UNUSED(b)) { return a; }``." @@ -430,29 +553,29 @@ msgstr "" "將此用於函式定義中未使用的參數以消除編譯器警告。例如:``int func(int a, int " "Py_UNUSED(b)) { return a; }``。" -#: ../../c-api/intro.rst:269 +#: ../../c-api/intro.rst:355 msgid "" "Asserts a compile-time condition *cond*, as a statement. The build will fail " "if the condition is false or cannot be evaluated at compile time." msgstr "" -#: ../../c-api/intro.rst:272 ../../c-api/intro.rst:283 -#: ../../c-api/intro.rst:328 +#: ../../c-api/intro.rst:358 ../../c-api/intro.rst:369 +#: ../../c-api/intro.rst:414 msgid "For example::" msgstr "範例: ::" -#: ../../c-api/intro.rst:274 +#: ../../c-api/intro.rst:360 msgid "Py_BUILD_ASSERT(sizeof(PyTime_t) == sizeof(int64_t));" msgstr "Py_BUILD_ASSERT(sizeof(PyTime_t) == sizeof(int64_t));" -#: ../../c-api/intro.rst:280 +#: ../../c-api/intro.rst:366 msgid "" "Asserts a compile-time condition *cond*, as an expression that evaluates to " "``0``. The build will fail if the condition is false or cannot be evaluated " "at compile time." msgstr "" -#: ../../c-api/intro.rst:285 +#: ../../c-api/intro.rst:371 msgid "" "#define foo_to_char(foo) \\\n" " ((char *)(foo) + Py_BUILD_ASSERT_EXPR(offsetof(struct foo, string) == 0))" @@ -460,7 +583,7 @@ msgstr "" "#define foo_to_char(foo) \\\n" " ((char *)(foo) + Py_BUILD_ASSERT_EXPR(offsetof(struct foo, string) == 0))" -#: ../../c-api/intro.rst:292 +#: ../../c-api/intro.rst:378 msgid "" "Creates a variable with name *name* that can be used in docstrings. If " "Python is built without docstrings, the value will be empty." @@ -468,7 +591,7 @@ msgstr "" "建立一個名為 *name* 的變數,可以在文件字串中使用。如果 Python 是在沒有文件字" "串的情況下建置,則該值將為空。" -#: ../../c-api/intro.rst:295 +#: ../../c-api/intro.rst:381 msgid "" "Use :c:macro:`PyDoc_STRVAR` for docstrings to support building Python " "without docstrings, as specified in :pep:`7`." @@ -476,7 +599,7 @@ msgstr "" "如 :pep:`7` 中所指明,使用 :c:macro:`PyDoc_STRVAR` 作為文件字串可以支援在沒有" "文件字串的情況下建置 Python。" -#: ../../c-api/intro.rst:300 +#: ../../c-api/intro.rst:386 msgid "" "PyDoc_STRVAR(pop_doc, \"Remove and return the rightmost element.\");\n" "\n" @@ -494,13 +617,13 @@ msgstr "" " // ...\n" "}" -#: ../../c-api/intro.rst:310 +#: ../../c-api/intro.rst:396 msgid "" "Creates a docstring for the given input string or an empty string if " "docstrings are disabled." msgstr "為給定的輸入字串建立一個文件字串,如果文件字串被禁用則建立空字串。" -#: ../../c-api/intro.rst:313 +#: ../../c-api/intro.rst:399 msgid "" "Use :c:macro:`PyDoc_STR` in specifying docstrings to support building Python " "without docstrings, as specified in :pep:`7`." @@ -508,7 +631,7 @@ msgstr "" "如 :pep:`7` 中所指明,使用 :c:macro:`PyDoc_STR` 指定文件字串以支援在沒有文件" "字串下建置 Python。" -#: ../../c-api/intro.rst:318 +#: ../../c-api/intro.rst:404 msgid "" "static PyMethodDef pysqlite_row_methods[] = {\n" " {\"keys\", (PyCFunction)pysqlite_row_keys, METH_NOARGS,\n" @@ -522,11 +645,11 @@ msgstr "" " {NULL, NULL}\n" "};" -#: ../../c-api/intro.rst:326 +#: ../../c-api/intro.rst:412 msgid "Declares a static character array variable with the given name *name*." msgstr "" -#: ../../c-api/intro.rst:330 +#: ../../c-api/intro.rst:416 msgid "" "PyDoc_VAR(python_doc) = PyDoc_STR(\"A genus of constricting snakes in the " "Pythonidae family native \"\n" @@ -538,11 +661,11 @@ msgstr "" " \"to the tropics and subtropics of the " "Eastern Hemisphere.\");" -#: ../../c-api/intro.rst:335 +#: ../../c-api/intro.rst:421 msgid "Compute the length of a statically allocated C array at compile time." msgstr "" -#: ../../c-api/intro.rst:337 +#: ../../c-api/intro.rst:423 msgid "" "The *array* argument must be a C array with a size known at compile time. " "Passing an array with an unknown size, such as a heap-allocated array, will " @@ -550,15 +673,15 @@ msgid "" "incorrect results." msgstr "" -#: ../../c-api/intro.rst:342 +#: ../../c-api/intro.rst:428 msgid "This is roughly equivalent to::" msgstr "這大致上相當於: ::" -#: ../../c-api/intro.rst:344 +#: ../../c-api/intro.rst:430 msgid "sizeof(array) / sizeof((array)[0])" msgstr "sizeof(array) / sizeof((array)[0])" -#: ../../c-api/intro.rst:349 +#: ../../c-api/intro.rst:435 msgid "" "Macro used to declare a symbol (function or data) as exported. On Windows, " "this expands to ``__declspec(dllexport)``. On compatible versions of GCC/" @@ -566,14 +689,14 @@ msgid "" "macro is for defining the C API itself; extension modules should not use it." msgstr "" -#: ../../c-api/intro.rst:358 +#: ../../c-api/intro.rst:444 msgid "" "Macro used to declare a symbol as imported. On Windows, this expands to " "``__declspec(dllimport)``. This macro is for defining the C API itself; " "extension modules should not use it." msgstr "" -#: ../../c-api/intro.rst:365 +#: ../../c-api/intro.rst:451 msgid "" "Macro used by CPython to declare a function as part of the C API. Its " "expansion depends on the platform and build configuration. This macro is " @@ -581,7 +704,7 @@ msgid "" "use it for their own symbols." msgstr "" -#: ../../c-api/intro.rst:373 +#: ../../c-api/intro.rst:459 msgid "" "Macro used by CPython to declare a public global variable as part of the C " "API. Its expansion depends on the platform and build configuration. This " @@ -589,11 +712,30 @@ msgid "" "should not use it for their own symbols." msgstr "" -#: ../../c-api/intro.rst:382 +#: ../../c-api/intro.rst:466 +#, fuzzy +msgid "" +"This is a :term:`soft deprecated` alias to the C99-standard ``va_copy`` " +"function." +msgstr "" +"這是 :c:func:`!memcpy` 的已\\ :term:`軟性棄用 `\\ 別名。請直" +"接使用 :c:func:`!memcpy`。" + +#: ../../c-api/intro.rst:469 +msgid "" +"Historically, this would use a compiler-specific method to copy a " +"``va_list``." +msgstr "" + +#: ../../c-api/intro.rst:471 +msgid "This is now an alias to ``va_copy``." +msgstr "" + +#: ../../c-api/intro.rst:478 msgid "Objects, Types and Reference Counts" msgstr "物件、型別和參照計數" -#: ../../c-api/intro.rst:386 +#: ../../c-api/intro.rst:482 msgid "" "Most Python/C API functions have one or more arguments as well as a return " "value of type :c:expr:`PyObject*`. This type is a pointer to an opaque data " @@ -616,7 +758,7 @@ msgstr "" "別物件;由於它們絕不能被釋放,因此它們通常是靜態 :c:type:`PyTypeObject` 物" "件。" -#: ../../c-api/intro.rst:397 +#: ../../c-api/intro.rst:493 msgid "" "All Python objects (even Python integers) have a :dfn:`type` and a :dfn:" "`reference count`. An object's type determines what kind of object it is (e." @@ -632,11 +774,11 @@ msgstr "" "`types`\\ )。對於每個眾所周知的型別,都有一個巨集來檢查物件是否屬於該型別;" "例如,若(且唯若)*a* 指向的物件是 Python list 時,``PyList_Check(a)`` 為真。" -#: ../../c-api/intro.rst:408 +#: ../../c-api/intro.rst:504 msgid "Reference Counts" msgstr "參照計數" -#: ../../c-api/intro.rst:410 +#: ../../c-api/intro.rst:506 msgid "" "The reference count is important because today's computers have a finite " "(and often severely limited) memory size; it counts how many different " @@ -659,7 +801,7 @@ msgstr "" "則可以依次為那些其他物件解除配置,依此類推。(此處相互參照物件的存在是個明顯" "的問題;目前,解決方案是「就不要那樣做」。)" -#: ../../c-api/intro.rst:427 +#: ../../c-api/intro.rst:523 msgid "" "Reference counts are always manipulated explicitly. The normal way is to " "use the macro :c:func:`Py_INCREF` to take a new reference to an object (i.e. " @@ -687,7 +829,7 @@ msgstr "" "元會被使用(假設 ``sizeof(Py_ssize_t) >= sizeof(void*)``)。因此參照計數增加" "是一個簡單的操作。" -#: ../../c-api/intro.rst:443 +#: ../../c-api/intro.rst:539 msgid "" "It is not necessary to hold a :term:`strong reference` (i.e. increment the " "reference count) for every local variable that contains a pointer to an " @@ -713,7 +855,7 @@ msgstr "" "種情況的一個重要情況是在從 Python 呼叫的擴充模組中作為引數傳遞給 C 函式的物" "件;呼叫機制保證在呼叫期間保持對每個參數的參照。" -#: ../../c-api/intro.rst:459 +#: ../../c-api/intro.rst:555 msgid "" "However, a common pitfall is to extract an object from a list and hold on to " "it for a while without taking a new reference. Some other operation might " @@ -729,7 +871,7 @@ msgstr "" "程式碼路徑允許控制權從 :c:func:`Py_DECREF` 回歸使用者,因此幾乎任何操作都有潛" "在危險。" -#: ../../c-api/intro.rst:467 +#: ../../c-api/intro.rst:563 msgid "" "A safe approach is to always use the generic operations (functions whose " "name begins with ``PyObject_``, ``PyNumber_``, ``PySequence_`` or " @@ -744,11 +886,11 @@ msgstr "" "計數)。這讓呼叫者有責任在處理完結果後呼叫 :c:func:`Py_DECREF`;這就成為第二" "本質。" -#: ../../c-api/intro.rst:478 +#: ../../c-api/intro.rst:574 msgid "Reference Count Details" msgstr "參照計數詳細資訊" -#: ../../c-api/intro.rst:480 +#: ../../c-api/intro.rst:576 msgid "" "The reference count behavior of functions in the Python/C API is best " "explained in terms of *ownership of references*. Ownership pertains to " @@ -773,7 +915,7 @@ msgstr "" "照。當沒有所有權轉移時,呼叫者被稱為\\ *借用*\\ 參照。如果是\\ :term:`借用參" "照 `\\ 就不需要做任何事情。" -#: ../../c-api/intro.rst:493 +#: ../../c-api/intro.rst:589 msgid "" "Conversely, when a calling function passes in a reference to an object, " "there are two possibilities: the function *steals* a reference to the " @@ -785,7 +927,7 @@ msgstr "" "物件的參照,或者沒有。 *竊取參照*\\ 意味著當你將參照傳遞給函式時,該函式假定" "它現在擁有該參照,並且你不再對它負責。" -#: ../../c-api/intro.rst:503 +#: ../../c-api/intro.rst:599 msgid "" "Few functions steal references; the two notable exceptions are :c:func:" "`PyList_SetItem` and :c:func:`PyTuple_SetItem`, which steal a reference to " @@ -802,7 +944,7 @@ msgstr "" "慣,這些函式旨在竊取參照;例如,建立 tuple ``(1, 2, \"three\")`` 的程式碼可以" "如下所示(先暫時忘記錯誤處理;更好的編寫方式如下所示):" -#: ../../c-api/intro.rst:511 +#: ../../c-api/intro.rst:607 msgid "" "PyObject *t;\n" "\n" @@ -818,7 +960,7 @@ msgstr "" "PyTuple_SetItem(t, 1, PyLong_FromLong(2L));\n" "PyTuple_SetItem(t, 2, PyUnicode_FromString(\"three\"));" -#: ../../c-api/intro.rst:518 +#: ../../c-api/intro.rst:614 msgid "" "Here, :c:func:`PyLong_FromLong` returns a new reference which is immediately " "stolen by :c:func:`PyTuple_SetItem`. When you want to keep using an object " @@ -829,7 +971,7 @@ msgstr "" "`PyTuple_SetItem` 竊取。如果你想繼續使用一個物件,儘管對它的參照將被竊取,請" "在呼叫參照竊取函式之前使用 :c:func:`Py_INCREF` 來取得另一個參照。" -#: ../../c-api/intro.rst:523 +#: ../../c-api/intro.rst:619 msgid "" "Incidentally, :c:func:`PyTuple_SetItem` is the *only* way to set tuple " "items; :c:func:`PySequence_SetItem` and :c:func:`PyObject_SetItem` refuse to " @@ -841,7 +983,7 @@ msgstr "" "tuple 是一種不可變 (immutable) 的資料型別。你應該只對你自己建立的 tuple 使" "用 :c:func:`PyTuple_SetItem`。" -#: ../../c-api/intro.rst:528 +#: ../../c-api/intro.rst:624 msgid "" "Equivalent code for populating a list can be written using :c:func:" "`PyList_New` and :c:func:`PyList_SetItem`." @@ -849,7 +991,7 @@ msgstr "" "可以使用 :c:func:`PyList_New` 和 :c:func:`PyList_SetItem` 編寫用於填充列表的" "等效程式碼。" -#: ../../c-api/intro.rst:531 +#: ../../c-api/intro.rst:627 msgid "" "However, in practice, you will rarely use these ways of creating and " "populating a tuple or list. There's a generic function, :c:func:" @@ -862,7 +1004,7 @@ msgstr "" "string` 引導。例如上面的兩個程式碼可以用以下程式碼替換(它還負責了錯誤檢" "查): ::" -#: ../../c-api/intro.rst:537 +#: ../../c-api/intro.rst:633 msgid "" "PyObject *tuple, *list;\n" "\n" @@ -874,7 +1016,7 @@ msgstr "" "tuple = Py_BuildValue(\"(iis)\", 1, 2, \"three\");\n" "list = Py_BuildValue(\"[iis]\", 1, 2, \"three\");" -#: ../../c-api/intro.rst:542 +#: ../../c-api/intro.rst:638 msgid "" "It is much more common to use :c:func:`PyObject_SetItem` and friends with " "items whose references you are only borrowing, like arguments that were " @@ -889,7 +1031,7 @@ msgstr "" "穩健,因為你不取得新的一個參照就可以放棄參照(「讓它被竊取」)。例如,此函式" "將 list(實際上是任何可變序列)的所有項目設定於給定項目:" -#: ../../c-api/intro.rst:549 +#: ../../c-api/intro.rst:645 msgid "" "int\n" "set_all(PyObject *target, PyObject *item)\n" @@ -933,7 +1075,7 @@ msgstr "" " return 0;\n" "}" -#: ../../c-api/intro.rst:572 +#: ../../c-api/intro.rst:668 msgid "" "The situation is slightly different for function return values. While " "passing a reference to most functions does not change your ownership " @@ -951,7 +1093,7 @@ msgstr "" "照的通用函式,如 :c:func:`PyObject_GetItem` 和 :c:func:`PySequence_GetItem`," "總是回傳一個新的參照(呼叫者成為參照的所有者)。" -#: ../../c-api/intro.rst:581 +#: ../../c-api/intro.rst:677 msgid "" "It is important to realize that whether you own a reference returned by a " "function depends on which function you call only --- *the plumage* (the type " @@ -967,7 +1109,7 @@ msgstr "" "但如果你使用 :c:func:`PySequence_GetItem` 從同一 list 中取得相同的項目(且恰" "好使用完全相同的引數),你確實會擁有對回傳物件的參照。" -#: ../../c-api/intro.rst:593 +#: ../../c-api/intro.rst:689 msgid "" "Here is an example of how you could write a function that computes the sum " "of the items in a list of integers; once using :c:func:`PyList_GetItem`, " @@ -976,7 +1118,7 @@ msgstr "" "以下是一個範例,說明如何編寫函式來計算一個整數 list 中項目的總和;一次使用 :" "c:func:`PyList_GetItem`,一次使用 :c:func:`PySequence_GetItem`: ::" -#: ../../c-api/intro.rst:597 +#: ../../c-api/intro.rst:693 msgid "" "long\n" "sum_list(PyObject *list)\n" @@ -1022,7 +1164,7 @@ msgstr "" " return total;\n" "}" -#: ../../c-api/intro.rst:623 +#: ../../c-api/intro.rst:719 msgid "" "long\n" "sum_sequence(PyObject *sequence)\n" @@ -1080,11 +1222,11 @@ msgstr "" " return total;\n" "}" -#: ../../c-api/intro.rst:657 +#: ../../c-api/intro.rst:753 msgid "Types" msgstr "型別" -#: ../../c-api/intro.rst:659 +#: ../../c-api/intro.rst:755 msgid "" "There are few other data types that play a significant role in the Python/C " "API; most are simple C types such as :c:expr:`int`, :c:expr:`long`, :c:expr:" @@ -1099,7 +1241,7 @@ msgstr "" "一些結構型別被用於描述用於列出模組所匯出的函式或新物件型別的資料屬性的靜態" "表,其他則用於描述複數的值。這些將與使用它們的函式一起討論。" -#: ../../c-api/intro.rst:669 +#: ../../c-api/intro.rst:765 msgid "" "A signed integral type such that ``sizeof(Py_ssize_t) == sizeof(size_t)``. " "C99 doesn't define such a thing directly (size_t is an unsigned integral " @@ -1110,11 +1252,11 @@ msgstr "" "有直接定義這樣的東西(size_t 是無符號整數型別)。有關詳細資訊,請參閱 :pep:" "`353`。 ``PY_SSIZE_T_MAX`` 是 :c:type:`Py_ssize_t` 型別的最大正值。" -#: ../../c-api/intro.rst:678 +#: ../../c-api/intro.rst:774 msgid "Exceptions" msgstr "例外" -#: ../../c-api/intro.rst:680 +#: ../../c-api/intro.rst:776 msgid "" "The Python programmer only needs to deal with exceptions if specific error " "handling is required; unhandled exceptions are automatically propagated to " @@ -1126,7 +1268,7 @@ msgstr "" "給呼叫者,然後傳遞給呼叫者的呼叫者,依此類推,直到它們到達頂層直譯器,在那裡" "它們透過堆疊回溯 (stack trace) 回報給使用者。" -#: ../../c-api/intro.rst:688 +#: ../../c-api/intro.rst:784 msgid "" "For C programmers, however, error checking always has to be explicit. All " "functions in the Python/C API can raise exceptions, unless an explicit claim " @@ -1148,7 +1290,7 @@ msgstr "" "確的錯誤指示器或者有不明確的回傳值,而需要使用 :c:func:`PyErr_Occurred` 明確" "測試錯誤。這些例外都會被明確地記錄於文件。" -#: ../../c-api/intro.rst:703 +#: ../../c-api/intro.rst:799 msgid "" "Exception state is maintained in per-thread storage (this is equivalent to " "using global storage in an unthreaded application). A thread can be in one " @@ -1167,7 +1309,7 @@ msgstr "" "func:`PyErr_SetString` 是最常見的(儘管不是最通用的)設定例外狀態的函式,而 :" "c:func:`PyErr_Clear` 是用來清除例外狀態。" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:809 msgid "" "The full exception state consists of three objects (all of which can be " "``NULL``): the exception type, the corresponding exception value, and the " @@ -1186,7 +1328,7 @@ msgstr "" "達 Python 位元組碼直譯器的主迴圈,該迴圈負責將它傳遞給 ``sys.exc_info()`` 和" "其系列函式。" -#: ../../c-api/intro.rst:725 +#: ../../c-api/intro.rst:821 msgid "" "Note that starting with Python 1.5, the preferred, thread-safe way to access " "the exception state from Python code is to call the function :func:`sys." @@ -1206,7 +1348,7 @@ msgstr "" "式碼中的常見錯誤,這些錯誤是由看似無辜的函式覆蓋了正在處理的例外而引起的;它" "還替回溯中被堆疊框 (stack frame) 參照的物件減少了通常不需要的生命週期延長。" -#: ../../c-api/intro.rst:736 +#: ../../c-api/intro.rst:832 msgid "" "As a general principle, a function that calls another function to perform " "some task should check whether the called function raised an exception, and " @@ -1221,7 +1363,7 @@ msgstr "" "並回傳一個錯誤指示符,但它\\ *不應該*\\ 設定另一個例外 --- 這將覆蓋剛剛引發的" "例外,並丟失關於錯誤確切原因的重要資訊。" -#: ../../c-api/intro.rst:745 +#: ../../c-api/intro.rst:841 msgid "" "A simple example of detecting exceptions and passing them on is shown in " "the :c:func:`!sum_sequence` example above. It so happens that this example " @@ -1233,7 +1375,7 @@ msgstr "" "巧這個例子在檢測到錯誤時不需要清理任何擁有的參照。以下範例函式展示了一些錯誤" "清理。首先,為了提醒你為什麼喜歡 Python,我們展示了等效的 Python 程式碼: ::" -#: ../../c-api/intro.rst:751 +#: ../../c-api/intro.rst:847 msgid "" "def incr_item(dict, key):\n" " try:\n" @@ -1249,11 +1391,11 @@ msgstr "" " item = 0\n" " dict[key] = item + 1" -#: ../../c-api/intro.rst:760 +#: ../../c-api/intro.rst:856 msgid "Here is the corresponding C code, in all its glory::" msgstr "這是相應的 C 程式碼:" -#: ../../c-api/intro.rst:762 +#: ../../c-api/intro.rst:858 msgid "" "int\n" "incr_item(PyObject *dict, PyObject *key)\n" @@ -1299,7 +1441,7 @@ msgid "" "}" msgstr "" -#: ../../c-api/intro.rst:812 +#: ../../c-api/intro.rst:908 msgid "" "This example represents an endorsed use of the ``goto`` statement in C! It " "illustrates the use of :c:func:`PyErr_ExceptionMatches` and :c:func:" @@ -1318,11 +1460,11 @@ msgstr "" "於保存擁有的參照的變數被初始化為 ``NULL`` 以使其能夠順利作用;同樣地,回傳值" "被初始化為 ``-1``\\ (失敗),並且僅在最後一次呼叫成功後才設定為成功。" -#: ../../c-api/intro.rst:826 +#: ../../c-api/intro.rst:922 msgid "Embedding Python" msgstr "嵌入式Python" -#: ../../c-api/intro.rst:828 +#: ../../c-api/intro.rst:924 msgid "" "The one important task that only embedders (as opposed to extension writers) " "of the Python interpreter have to worry about is the initialization, and " @@ -1332,7 +1474,7 @@ msgstr "" "只有 Python 直譯器的嵌入者(而不是擴充編寫者)需要擔心的一項重要任務是 " "Python 直譯器的初始化與完成階段。直譯器的大部分功能只能在直譯器初始化後使用。" -#: ../../c-api/intro.rst:841 +#: ../../c-api/intro.rst:937 msgid "" "The basic initialization function is :c:func:`Py_Initialize`. This " "initializes the table of loaded modules, and creates the fundamental " @@ -1343,7 +1485,7 @@ msgstr "" "立基礎模組 :mod:`builtins`、:mod:`__main__` 和 :mod:`sys`。它還會初始化模組搜" "索路徑 (``sys.path``)。" -#: ../../c-api/intro.rst:846 +#: ../../c-api/intro.rst:942 msgid "" ":c:func:`Py_Initialize` does not set the \"script argument list\" (``sys." "argv``). If this variable is needed by Python code that will be executed " @@ -1355,7 +1497,7 @@ msgstr "" "`PyConfig.argv` 和 :c:member:`PyConfig.parse_argv`,請見 :ref:`Python 初始化" "配置 `。" -#: ../../c-api/intro.rst:851 +#: ../../c-api/intro.rst:947 msgid "" "On most systems (in particular, on Unix and Windows, although the details " "are slightly different), :c:func:`Py_Initialize` calculates the module " @@ -1373,7 +1515,7 @@ msgstr "" "file:`python` 的可執行檔案,並在其父目錄中查找一個名為 :file:`lib/python{X.Y}" "` 的目錄的相對位置。" -#: ../../c-api/intro.rst:860 +#: ../../c-api/intro.rst:956 msgid "" "For instance, if the Python executable is found in :file:`/usr/local/bin/" "python`, it will assume that the libraries are in :file:`/usr/local/lib/" @@ -1390,7 +1532,7 @@ msgstr "" "`PYTHONHOME`,或者透過設定 :envvar:`PYTHONPATH` 在標準路徑前面插入額外的目" "錄。" -#: ../../c-api/intro.rst:874 +#: ../../c-api/intro.rst:970 msgid "" "The embedding application can steer the search by setting :c:member:" "`PyConfig.program_name` *before* calling :c:func:`Py_InitializeFromConfig`. " @@ -1407,7 +1549,7 @@ msgstr "" "func:`Py_GetExecPrefix` 和 :c:func:`Py_GetProgramFullPath`\\(全部定義在 :" "file:`Modules/getpath.c`)。" -#: ../../c-api/intro.rst:885 +#: ../../c-api/intro.rst:981 msgid "" "Sometimes, it is desirable to \"uninitialize\" Python. For instance, the " "application may want to start over (make another call to :c:func:" @@ -1428,11 +1570,11 @@ msgstr "" "`Py_FinalizeEx` *不會*\\ 釋放由 Python 直譯器分配的所有記憶體,例如目前無法釋" "放被擴充模組所分配的記憶體。" -#: ../../c-api/intro.rst:899 +#: ../../c-api/intro.rst:995 msgid "Debugging Builds" msgstr "除錯建置" -#: ../../c-api/intro.rst:901 +#: ../../c-api/intro.rst:997 msgid "" "Python can be built with several macros to enable extra checks of the " "interpreter and extension modules. These checks tend to add a large amount " @@ -1441,7 +1583,7 @@ msgstr "" "Python 可以在建置時使用多個巨集來啟用對直譯器和擴充模組的額外檢查,這些檢查往" "往會在執行環境 (runtime) 增加大量開銷 (overhead),因此預設情況下不啟用它們。" -#: ../../c-api/intro.rst:905 +#: ../../c-api/intro.rst:1001 msgid "" "A full list of the various types of debugging builds is in the file :file:" "`Misc/SpecialBuilds.txt` in the Python source distribution. Builds are " @@ -1454,7 +1596,7 @@ msgstr "" "錯構置的完整列表,為支援追蹤參照計數、為記憶體分配器除錯或對主直譯器迴圈進行" "低階分析的建置。本節的其餘部分將僅描述最常用的建置。" -#: ../../c-api/intro.rst:913 +#: ../../c-api/intro.rst:1009 msgid "" "Compiling the interpreter with the :c:macro:`!Py_DEBUG` macro defined " "produces what is generally meant by :ref:`a debug build of Python `." @@ -1478,7 +1620,7 @@ msgstr "" "除了下面描述的參照計數除錯之外,還會執行額外的檢查,請參閱 :ref:`Python 除錯" "建置 `。" -#: ../../c-api/intro.rst:924 +#: ../../c-api/intro.rst:1020 msgid "" "Defining :c:macro:`Py_TRACE_REFS` enables reference tracing (see the :option:" "`configure --with-trace-refs option <--with-trace-refs>`). When defined, a " @@ -1493,7 +1635,7 @@ msgstr "" "linked list)。全體分配也有被追蹤。退出時將印出所有現行參照。(在交互模式下," "這發生在直譯器運行的每個陳述句之後。)" -#: ../../c-api/intro.rst:931 +#: ../../c-api/intro.rst:1027 msgid "" "Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution for more detailed information." @@ -1501,11 +1643,11 @@ msgstr "" "有關更多詳細資訊,請參閱 Python 原始碼發布版中的 :file:`Misc/SpecialBuilds." "txt`。" -#: ../../c-api/intro.rst:938 +#: ../../c-api/intro.rst:1034 msgid "Recommended third party tools" msgstr "建議的第三方工具" -#: ../../c-api/intro.rst:940 +#: ../../c-api/intro.rst:1036 msgid "" "The following third party tools offer both simpler and more sophisticated " "approaches to creating C, C++ and Rust extensions for Python:" @@ -1513,39 +1655,39 @@ msgstr "" "以下第三方工具提供了更簡單且更細緻的方法來為 Python 建立 C、C++ 和 Rust 擴充" "模組:" -#: ../../c-api/intro.rst:943 +#: ../../c-api/intro.rst:1039 msgid "`Cython `_" msgstr "`Cython `_" -#: ../../c-api/intro.rst:944 +#: ../../c-api/intro.rst:1040 msgid "`cffi `_" msgstr "`cffi `_" -#: ../../c-api/intro.rst:945 +#: ../../c-api/intro.rst:1041 msgid "`HPy `_" msgstr "`HPy `_" -#: ../../c-api/intro.rst:946 +#: ../../c-api/intro.rst:1042 msgid "`nanobind `_ (C++)" msgstr "`nanobind `_ (C++)" -#: ../../c-api/intro.rst:947 +#: ../../c-api/intro.rst:1043 msgid "`Numba `_" msgstr "`Numba `_" -#: ../../c-api/intro.rst:948 +#: ../../c-api/intro.rst:1044 msgid "`pybind11 `_ (C++)" msgstr "`pybind11 `_ (C++)" -#: ../../c-api/intro.rst:949 +#: ../../c-api/intro.rst:1045 msgid "`PyO3 `_ (Rust)" msgstr "`PyO3 `_ (Rust)" -#: ../../c-api/intro.rst:950 +#: ../../c-api/intro.rst:1046 msgid "`SWIG `_" msgstr "`SWIG `_" -#: ../../c-api/intro.rst:952 +#: ../../c-api/intro.rst:1048 msgid "" "Using tools such as these can help avoid writing code that is tightly bound " "to a particular version of CPython, avoid reference counting errors, and " @@ -1556,7 +1698,7 @@ msgid "" "sources." msgstr "" -#: ../../c-api/intro.rst:959 +#: ../../c-api/intro.rst:1055 msgid "" "These projects are not supported by the same people who maintain Python, and " "issues need to be raised with the projects directly. Remember to check that " @@ -1564,139 +1706,139 @@ msgid "" "outdated." msgstr "" -#: ../../c-api/intro.rst:966 +#: ../../c-api/intro.rst:1062 msgid "" "`Python Packaging User Guide: Binary Extensions `_" msgstr "" -#: ../../c-api/intro.rst:967 +#: ../../c-api/intro.rst:1063 msgid "" "The Python Packaging User Guide not only covers several available tools that " "simplify the creation of binary extensions, but also discusses the various " "reasons why creating an extension module may be desirable in the first place." msgstr "" -#: ../../c-api/intro.rst:384 +#: ../../c-api/intro.rst:480 msgid "object" msgstr "object(物件)" -#: ../../c-api/intro.rst:384 +#: ../../c-api/intro.rst:480 msgid "type" msgstr "type(型別)" -#: ../../c-api/intro.rst:423 +#: ../../c-api/intro.rst:519 msgid "Py_INCREF (C function)" msgstr "Py_INCREF(C 函式)" -#: ../../c-api/intro.rst:423 +#: ../../c-api/intro.rst:519 msgid "Py_DECREF (C function)" msgstr "Py_DECREF(C 函式)" -#: ../../c-api/intro.rst:499 +#: ../../c-api/intro.rst:595 msgid "PyList_SetItem (C function)" msgstr "PyList_SetItem(C 函式)" -#: ../../c-api/intro.rst:499 +#: ../../c-api/intro.rst:595 msgid "PyTuple_SetItem (C function)" msgstr "PyTuple_SetItem(C 函式)" -#: ../../c-api/intro.rst:570 +#: ../../c-api/intro.rst:666 msgid "set_all()" msgstr "set_all()" -#: ../../c-api/intro.rst:589 +#: ../../c-api/intro.rst:685 msgid "PyList_GetItem (C function)" msgstr "PyList_GetItem(C 函式)" -#: ../../c-api/intro.rst:589 +#: ../../c-api/intro.rst:685 msgid "PySequence_GetItem (C function)" msgstr "PySequence_GetItem(C 函式)" -#: ../../c-api/intro.rst:619 +#: ../../c-api/intro.rst:715 msgid "sum_list()" msgstr "sum_list()" -#: ../../c-api/intro.rst:651 ../../c-api/intro.rst:743 +#: ../../c-api/intro.rst:747 ../../c-api/intro.rst:839 msgid "sum_sequence()" msgstr "sum_sequence()" -#: ../../c-api/intro.rst:686 +#: ../../c-api/intro.rst:782 msgid "PyErr_Occurred (C function)" msgstr "PyErr_Occurred(C 函式)" -#: ../../c-api/intro.rst:699 +#: ../../c-api/intro.rst:795 msgid "PyErr_SetString (C function)" msgstr "PyErr_SetString(C 函式)" -#: ../../c-api/intro.rst:699 ../../c-api/intro.rst:807 +#: ../../c-api/intro.rst:795 ../../c-api/intro.rst:903 msgid "PyErr_Clear (C function)" msgstr "PyErr_Clear(C 函式)" -#: ../../c-api/intro.rst:723 +#: ../../c-api/intro.rst:819 msgid "exc_info (in module sys)" msgstr "exc_info (sys 模組中)" -#: ../../c-api/intro.rst:758 ../../c-api/intro.rst:805 +#: ../../c-api/intro.rst:854 ../../c-api/intro.rst:901 msgid "incr_item()" msgstr "incr_item()" -#: ../../c-api/intro.rst:807 +#: ../../c-api/intro.rst:903 msgid "PyErr_ExceptionMatches (C function)" msgstr "PyErr_ExceptionMatches(C 函式)" -#: ../../c-api/intro.rst:807 +#: ../../c-api/intro.rst:903 msgid "Py_XDECREF (C function)" msgstr "Py_XDECREF(C 函式)" -#: ../../c-api/intro.rst:833 +#: ../../c-api/intro.rst:929 msgid "Py_Initialize (C function)" msgstr "Py_Initialize(C 函式)" -#: ../../c-api/intro.rst:833 +#: ../../c-api/intro.rst:929 msgid "module" msgstr "module(模組)" -#: ../../c-api/intro.rst:833 +#: ../../c-api/intro.rst:929 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/intro.rst:833 +#: ../../c-api/intro.rst:929 msgid "__main__" msgstr "__main__" -#: ../../c-api/intro.rst:833 +#: ../../c-api/intro.rst:929 msgid "sys" msgstr "sys" -#: ../../c-api/intro.rst:833 +#: ../../c-api/intro.rst:929 msgid "search" msgstr "search(搜尋)" -#: ../../c-api/intro.rst:833 +#: ../../c-api/intro.rst:929 msgid "path" msgstr "path(路徑)" -#: ../../c-api/intro.rst:833 +#: ../../c-api/intro.rst:929 msgid "path (in module sys)" msgstr "path(sys 模組中)" -#: ../../c-api/intro.rst:868 +#: ../../c-api/intro.rst:964 msgid "Py_GetPath (C function)" msgstr "Py_GetPath(C 函式)" -#: ../../c-api/intro.rst:868 +#: ../../c-api/intro.rst:964 msgid "Py_GetPrefix (C function)" msgstr "Py_GetPrefix(C 函式)" -#: ../../c-api/intro.rst:868 +#: ../../c-api/intro.rst:964 msgid "Py_GetExecPrefix (C function)" msgstr "Py_GetExecPrefix(C 函式)" -#: ../../c-api/intro.rst:868 +#: ../../c-api/intro.rst:964 msgid "Py_GetProgramFullPath (C function)" msgstr "Py_GetProgramFullPath(C 函式)" -#: ../../c-api/intro.rst:883 +#: ../../c-api/intro.rst:979 msgid "Py_IsInitialized (C function)" msgstr "Py_IsInitialized(C 函式)" diff --git a/library/itertools.po b/library/itertools.po index 61ec398f06..c031abe499 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-01-13 00:13+0000\n" +"POT-Creation-Date: 2026-02-05 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-" @@ -1780,8 +1780,8 @@ msgid "" msgstr "" "應用技巧的次要目的是作為 itertools 的孵化器。``accumulate()``, " "``compress()`` 和 ``pairwise()`` itertools 最初都是作為應用技巧出現的。目前," -"``sliding_window()``、``derangements()`` 和 ``sieve()`` 的應用技巧正在被測試," -"以確定它們是否有價值被收錄到內建的 itertools 中。" +"``sliding_window()``、``derangements()`` 和 ``sieve()`` 的應用技巧正在被測" +"試,以確定它們是否有價值被收錄到內建的 itertools 中。" #: ../../library/itertools.rst:825 msgid "" @@ -1814,6 +1814,7 @@ msgstr "" "term:`產生器 `,則能保持高速度。" #: ../../library/itertools.rst:839 +#, fuzzy msgid "" "from itertools import (accumulate, batched, chain, combinations, compress,\n" " count, cycle, filterfalse, groupby, islice, permutations, product,\n" @@ -1822,7 +1823,8 @@ msgid "" "from contextlib import suppress\n" "from functools import reduce\n" "from math import comb, isqrt, prod, sumprod\n" -"from operator import getitem, is_not, itemgetter, mul, neg\n" +"from operator import getitem, is_not, itemgetter, mul, neg, truediv\n" +"\n" "\n" "# ==== Basic one liners ====\n" "\n" @@ -1835,9 +1837,10 @@ msgid "" " # prepend(1, [2, 3, 4]) → 1 2 3 4\n" " return chain([value], iterable)\n" "\n" -"def tabulate(function, start=0):\n" -" \"Return function(0), function(1), ...\"\n" -" return map(function, count(start))\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" +" return map(truediv, accumulate(iterable), count(1))\n" "\n" "def repeatfunc(function, times=None, *args):\n" " \"Repeat calls to a function with specified arguments.\"\n" @@ -1892,6 +1895,7 @@ msgid "" " # all_equal('4٤௪౪໔', key=int) → True\n" " return len(take(2, groupby(iterable, key))) <= 1\n" "\n" +"\n" "# ==== Data pipelines ====\n" "\n" "def unique_justseen(iterable, key=None):\n" @@ -2003,6 +2007,7 @@ msgid "" " while True:\n" " yield function()\n" "\n" +"\n" "# ==== Mathematical operations ====\n" "\n" "def multinomial(*counts):\n" @@ -2022,6 +2027,7 @@ msgid "" " # sum_of_squares([10, 20, 30]) → 1400\n" " return sumprod(*tee(iterable))\n" "\n" +"\n" "# ==== Matrix operations ====\n" "\n" "def reshape(matrix, columns):\n" @@ -2040,6 +2046,7 @@ msgid "" " n = len(m2[0])\n" " return batched(starmap(sumprod, product(m1, transpose(m2))), n)\n" "\n" +"\n" "# ==== Polynomial arithmetic ====\n" "\n" "def convolve(signal, kernel):\n" @@ -2096,6 +2103,7 @@ msgid "" " powers = reversed(range(1, n))\n" " return list(map(mul, coefficients, powers))\n" "\n" +"\n" "# ==== Number theory ====\n" "\n" "def sieve(n):\n" diff --git a/library/stdtypes.po b/library/stdtypes.po index ba43e8dc98..1fafd07b11 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-02-04 00:17+0000\n" +"POT-Creation-Date: 2026-02-05 00:20+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -139,8 +139,8 @@ msgstr "結果" #: ../../library/stdtypes.rst:88 ../../library/stdtypes.rst:284 #: ../../library/stdtypes.rst:424 ../../library/stdtypes.rst:1007 -#: ../../library/stdtypes.rst:1229 ../../library/stdtypes.rst:3151 -#: ../../library/stdtypes.rst:4411 +#: ../../library/stdtypes.rst:1229 ../../library/stdtypes.rst:3164 +#: ../../library/stdtypes.rst:4424 msgid "Notes" msgstr "註解" @@ -154,7 +154,7 @@ msgstr "假如 *x* 為真,則 *x*,否則 *y*" #: ../../library/stdtypes.rst:90 ../../library/stdtypes.rst:1009 #: ../../library/stdtypes.rst:1012 ../../library/stdtypes.rst:1244 -#: ../../library/stdtypes.rst:3157 ../../library/stdtypes.rst:4417 +#: ../../library/stdtypes.rst:3170 ../../library/stdtypes.rst:4430 msgid "\\(1)" msgstr "\\(1)" @@ -168,8 +168,8 @@ msgstr "假如 *x* 為假,則 *x*,否則 *y*" #: ../../library/stdtypes.rst:93 ../../library/stdtypes.rst:297 #: ../../library/stdtypes.rst:317 ../../library/stdtypes.rst:1255 -#: ../../library/stdtypes.rst:3161 ../../library/stdtypes.rst:3163 -#: ../../library/stdtypes.rst:4421 ../../library/stdtypes.rst:4423 +#: ../../library/stdtypes.rst:3174 ../../library/stdtypes.rst:3176 +#: ../../library/stdtypes.rst:4434 ../../library/stdtypes.rst:4436 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:3165 -#: ../../library/stdtypes.rst:3167 ../../library/stdtypes.rst:3169 -#: ../../library/stdtypes.rst:3171 ../../library/stdtypes.rst:4425 -#: ../../library/stdtypes.rst:4427 ../../library/stdtypes.rst:4429 -#: ../../library/stdtypes.rst:4431 +#: ../../library/stdtypes.rst:96 ../../library/stdtypes.rst:3178 +#: ../../library/stdtypes.rst:3180 ../../library/stdtypes.rst:3182 +#: ../../library/stdtypes.rst:3184 ../../library/stdtypes.rst:4438 +#: ../../library/stdtypes.rst:4440 ../../library/stdtypes.rst:4442 +#: ../../library/stdtypes.rst:4444 msgid "\\(3)" msgstr "\\(3)" #: ../../library/stdtypes.rst:105 ../../library/stdtypes.rst:328 #: ../../library/stdtypes.rst:442 ../../library/stdtypes.rst:1051 -#: ../../library/stdtypes.rst:1259 ../../library/stdtypes.rst:3197 -#: ../../library/stdtypes.rst:4461 +#: ../../library/stdtypes.rst:1259 ../../library/stdtypes.rst:3210 +#: ../../library/stdtypes.rst:4474 msgid "Notes:" msgstr "註解:" @@ -239,9 +239,9 @@ msgstr "" msgid "This table summarizes the comparison operations:" msgstr "這個表格統整所有比較運算:" -#: ../../library/stdtypes.rst:146 ../../library/stdtypes.rst:3128 -#: ../../library/stdtypes.rst:3151 ../../library/stdtypes.rst:4388 -#: ../../library/stdtypes.rst:4411 +#: ../../library/stdtypes.rst:146 ../../library/stdtypes.rst:3141 +#: ../../library/stdtypes.rst:3164 ../../library/stdtypes.rst:4401 +#: ../../library/stdtypes.rst:4424 msgid "Meaning" msgstr "含義" @@ -574,8 +574,8 @@ msgid "" "zero." msgstr "一個複數,其實部為 *re*,虛部為 *im*。*im* 預設為零。" -#: ../../library/stdtypes.rst:310 ../../library/stdtypes.rst:3159 -#: ../../library/stdtypes.rst:4448 +#: ../../library/stdtypes.rst:310 ../../library/stdtypes.rst:3172 +#: ../../library/stdtypes.rst:4461 msgid "\\(6)" msgstr "\\(6)" @@ -612,9 +612,9 @@ msgid "*x* to the power *y*" msgstr "*x* 的 *y* 次方" #: ../../library/stdtypes.rst:319 ../../library/stdtypes.rst:321 -#: ../../library/stdtypes.rst:3184 ../../library/stdtypes.rst:3187 -#: ../../library/stdtypes.rst:3190 ../../library/stdtypes.rst:4444 -#: ../../library/stdtypes.rst:4451 +#: ../../library/stdtypes.rst:3197 ../../library/stdtypes.rst:3200 +#: ../../library/stdtypes.rst:3203 ../../library/stdtypes.rst:4457 +#: ../../library/stdtypes.rst:4464 msgid "\\(5)" msgstr "\\(5)" @@ -772,9 +772,9 @@ msgid "bitwise :dfn:`or` of *x* and *y*" msgstr "*x* 及 *y* 的位元 :dfn:`或`" #: ../../library/stdtypes.rst:426 ../../library/stdtypes.rst:429 -#: ../../library/stdtypes.rst:432 ../../library/stdtypes.rst:3173 -#: ../../library/stdtypes.rst:3177 ../../library/stdtypes.rst:4433 -#: ../../library/stdtypes.rst:4437 +#: ../../library/stdtypes.rst:432 ../../library/stdtypes.rst:3186 +#: ../../library/stdtypes.rst:3190 ../../library/stdtypes.rst:4446 +#: ../../library/stdtypes.rst:4450 msgid "\\(4)" msgstr "\\(4)" @@ -3266,7 +3266,7 @@ msgstr "" msgid "Return the string encoded to :class:`bytes`." msgstr "" -#: ../../library/stdtypes.rst:2007 ../../library/stdtypes.rst:3587 +#: ../../library/stdtypes.rst:2007 ../../library/stdtypes.rst:3600 msgid "" "*encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for " "possible values." @@ -3302,11 +3302,11 @@ msgstr "" ">>> encoded_str_to_bytes\n" "b'Python'" -#: ../../library/stdtypes.rst:2030 ../../library/stdtypes.rst:3606 +#: ../../library/stdtypes.rst:2030 ../../library/stdtypes.rst:3619 msgid "Added support for keyword arguments." msgstr "新增關鍵字引數的支援。" -#: ../../library/stdtypes.rst:2033 ../../library/stdtypes.rst:3609 +#: ../../library/stdtypes.rst:2033 ../../library/stdtypes.rst:3622 msgid "" "The value of the *errors* argument is now checked in :ref:`devmode` and in :" "ref:`debug mode `." @@ -3692,6 +3692,7 @@ msgstr "" #: ../../library/stdtypes.rst:2320 ../../library/stdtypes.rst:2347 #: ../../library/stdtypes.rst:2402 ../../library/stdtypes.rst:2581 +#: ../../library/stdtypes.rst:2754 msgid "For example:" msgstr "舉例來說:" @@ -4122,15 +4123,15 @@ msgstr "" #: ../../library/stdtypes.rst:2639 ../../library/stdtypes.rst:2657 #: ../../library/stdtypes.rst:2669 ../../library/stdtypes.rst:2723 -#: ../../library/stdtypes.rst:2791 ../../library/stdtypes.rst:2861 -#: ../../library/stdtypes.rst:2956 ../../library/stdtypes.rst:3922 -#: ../../library/stdtypes.rst:3940 ../../library/stdtypes.rst:4030 -#: ../../library/stdtypes.rst:4046 ../../library/stdtypes.rst:4071 -#: ../../library/stdtypes.rst:4085 ../../library/stdtypes.rst:4113 -#: ../../library/stdtypes.rst:4127 ../../library/stdtypes.rst:4145 -#: ../../library/stdtypes.rst:4172 ../../library/stdtypes.rst:4195 -#: ../../library/stdtypes.rst:4222 ../../library/stdtypes.rst:4264 -#: ../../library/stdtypes.rst:4288 +#: ../../library/stdtypes.rst:2804 ../../library/stdtypes.rst:2874 +#: ../../library/stdtypes.rst:2969 ../../library/stdtypes.rst:3935 +#: ../../library/stdtypes.rst:3953 ../../library/stdtypes.rst:4043 +#: ../../library/stdtypes.rst:4059 ../../library/stdtypes.rst:4084 +#: ../../library/stdtypes.rst:4098 ../../library/stdtypes.rst:4126 +#: ../../library/stdtypes.rst:4140 ../../library/stdtypes.rst:4158 +#: ../../library/stdtypes.rst:4185 ../../library/stdtypes.rst:4208 +#: ../../library/stdtypes.rst:4235 ../../library/stdtypes.rst:4277 +#: ../../library/stdtypes.rst:4301 msgid "For example::" msgstr "舉例來說: ::" @@ -4374,7 +4375,31 @@ msgid "" "*end*, stop comparing string at that position." msgstr "" -#: ../../library/stdtypes.rst:2757 +#: ../../library/stdtypes.rst:2756 +#, fuzzy +msgid "" +">>> 'Python'.startswith('Py')\n" +"True\n" +">>> 'a tuple of prefixes'.startswith(('at', 'a'))\n" +"True\n" +">>> 'Python is amazing'.startswith('is', 7)\n" +"True" +msgstr "" +">>> 'Python'.endswith('on')\n" +"True\n" +">>> 'a tuple of suffixes'.endswith(('at', 'in'))\n" +"False\n" +">>> 'a tuple of suffixes'.endswith(('at', 'es'))\n" +"True\n" +">>> 'Python is amazing'.endswith('is', 0, 9)\n" +"True" + +#: ../../library/stdtypes.rst:2765 +#, fuzzy +msgid "See also :meth:`endswith` and :meth:`removeprefix`." +msgstr "另請參閱 :meth:`startswith` 和 :meth:`removesuffix`。" + +#: ../../library/stdtypes.rst:2770 msgid "" "Return a copy of the string with the leading and trailing characters " "removed. The *chars* argument is a string specifying the set of characters " @@ -4383,7 +4408,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2763 +#: ../../library/stdtypes.rst:2776 msgid "" ">>> ' spacious '.strip()\n" "'spacious'\n" @@ -4395,7 +4420,7 @@ msgstr "" ">>> 'www.example.com'.strip('cmowz.')\n" "'example'" -#: ../../library/stdtypes.rst:2768 +#: ../../library/stdtypes.rst:2781 msgid "" "The outermost leading and trailing *chars* argument values are stripped from " "the string. Characters are removed from the leading end until reaching a " @@ -4403,7 +4428,7 @@ msgid "" "A similar action takes place on the trailing end. For example::" msgstr "" -#: ../../library/stdtypes.rst:2774 +#: ../../library/stdtypes.rst:2787 msgid "" ">>> comment_string = '#....... Section 3.2.1 Issue #32 .......'\n" ">>> comment_string.strip('.#! ')\n" @@ -4413,20 +4438,20 @@ msgstr "" ">>> comment_string.strip('.#! ')\n" "'Section 3.2.1 Issue #32'" -#: ../../library/stdtypes.rst:2781 +#: ../../library/stdtypes.rst:2794 msgid "" "Return a copy of the string with uppercase characters converted to lowercase " "and vice versa. Note that it is not necessarily true that ``s.swapcase()." "swapcase() == s``." msgstr "" -#: ../../library/stdtypes.rst:2788 +#: ../../library/stdtypes.rst:2801 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:2793 +#: ../../library/stdtypes.rst:2806 msgid "" ">>> 'Hello world'.title()\n" "'Hello World'" @@ -4434,7 +4459,7 @@ msgstr "" ">>> 'Hello world'.title()\n" "'Hello World'" -#: ../../library/stdtypes.rst:2796 ../../library/stdtypes.rst:4232 +#: ../../library/stdtypes.rst:2809 ../../library/stdtypes.rst:4245 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 " @@ -4442,7 +4467,7 @@ msgid "" "which may not be the desired result::" msgstr "" -#: ../../library/stdtypes.rst:2801 +#: ../../library/stdtypes.rst:2814 msgid "" ">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" @@ -4450,19 +4475,19 @@ msgstr "" ">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" -#: ../../library/stdtypes.rst:2804 +#: ../../library/stdtypes.rst:2817 msgid "" "The :func:`string.capwords` function does not have this problem, as it " "splits words on spaces only." msgstr "" -#: ../../library/stdtypes.rst:2807 +#: ../../library/stdtypes.rst:2820 msgid "" "Alternatively, a workaround for apostrophes can be constructed using regular " "expressions::" msgstr "" -#: ../../library/stdtypes.rst:2810 +#: ../../library/stdtypes.rst:2823 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -4482,11 +4507,11 @@ msgstr "" ">>> titlecase(\"they're bill's friends.\")\n" "\"They're Bill's Friends.\"" -#: ../../library/stdtypes.rst:2819 +#: ../../library/stdtypes.rst:2832 msgid "See also :meth:`istitle`." msgstr "另請參閱 :meth:`istitle`。" -#: ../../library/stdtypes.rst:2824 +#: ../../library/stdtypes.rst:2837 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 " @@ -4498,19 +4523,19 @@ msgid "" "exception, to map the character to itself." msgstr "" -#: ../../library/stdtypes.rst:2833 +#: ../../library/stdtypes.rst:2846 msgid "" "You can use :meth:`str.maketrans` to create a translation map from character-" "to-character mappings in different formats." msgstr "" -#: ../../library/stdtypes.rst:2836 +#: ../../library/stdtypes.rst:2849 msgid "" "See also the :mod:`codecs` module for a more flexible approach to custom " "character mappings." msgstr "" -#: ../../library/stdtypes.rst:2842 +#: ../../library/stdtypes.rst:2855 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`` " @@ -4519,14 +4544,14 @@ msgid "" "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:2848 +#: ../../library/stdtypes.rst:2861 msgid "" "The uppercasing algorithm used is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." msgstr "" -#: ../../library/stdtypes.rst:2855 +#: ../../library/stdtypes.rst:2868 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 " @@ -4534,7 +4559,7 @@ msgid "" "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2863 +#: ../../library/stdtypes.rst:2876 msgid "" ">>> \"42\".zfill(5)\n" "'00042'\n" @@ -4546,27 +4571,27 @@ msgstr "" ">>> \"-42\".zfill(5)\n" "'-0042'" -#: ../../library/stdtypes.rst:2886 +#: ../../library/stdtypes.rst:2899 msgid "Formatted String Literals (f-strings)" msgstr "" -#: ../../library/stdtypes.rst:2889 +#: ../../library/stdtypes.rst:2902 msgid "" "The :keyword:`await` and :keyword:`async for` can be used in expressions " "within f-strings." msgstr "" -#: ../../library/stdtypes.rst:2892 +#: ../../library/stdtypes.rst:2905 msgid "Added the debug specifier (``=``)" msgstr "" -#: ../../library/stdtypes.rst:2894 +#: ../../library/stdtypes.rst:2907 msgid "" "Many restrictions on expressions within f-strings have been removed. " "Notably, nested strings, comments, and backslashes are now permitted." msgstr "" -#: ../../library/stdtypes.rst:2898 +#: ../../library/stdtypes.rst:2911 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 " @@ -4575,29 +4600,29 @@ msgid "" "replacement field must contain an expression, optionally followed by:" msgstr "" -#: ../../library/stdtypes.rst:2905 +#: ../../library/stdtypes.rst:2918 msgid "a *debug specifier* -- an equal sign (``=``);" msgstr "" -#: ../../library/stdtypes.rst:2906 +#: ../../library/stdtypes.rst:2919 msgid "a *conversion specifier* -- ``!s``, ``!r`` or ``!a``; and/or" msgstr "" -#: ../../library/stdtypes.rst:2907 +#: ../../library/stdtypes.rst:2920 msgid "a *format specifier* prefixed with a colon (``:``)." msgstr "" -#: ../../library/stdtypes.rst:2909 +#: ../../library/stdtypes.rst:2922 msgid "" "See the :ref:`Lexical Analysis section on f-strings ` for details " "on the syntax of these fields." msgstr "" -#: ../../library/stdtypes.rst:2913 +#: ../../library/stdtypes.rst:2926 msgid "Debug specifier" msgstr "" -#: ../../library/stdtypes.rst:2917 +#: ../../library/stdtypes.rst:2930 msgid "" "If a debug specifier -- an equal sign (``=``) -- appears after the " "replacement field expression, the resulting f-string will contain the " @@ -4605,7 +4630,7 @@ msgid "" "is often useful for debugging::" msgstr "" -#: ../../library/stdtypes.rst:2922 +#: ../../library/stdtypes.rst:2935 msgid "" ">>> number = 14.3\n" ">>> f'{number=}'\n" @@ -4615,13 +4640,13 @@ msgstr "" ">>> f'{number=}'\n" "'number=14.3'" -#: ../../library/stdtypes.rst:2926 +#: ../../library/stdtypes.rst:2939 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:2929 +#: ../../library/stdtypes.rst:2942 msgid "" ">>> f'{ number - 4 = }'\n" "' number - 4 = 10.3'" @@ -4629,17 +4654,17 @@ msgstr "" ">>> f'{ number - 4 = }'\n" "' number - 4 = 10.3'" -#: ../../library/stdtypes.rst:2934 +#: ../../library/stdtypes.rst:2947 msgid "Conversion specifier" msgstr "" -#: ../../library/stdtypes.rst:2936 +#: ../../library/stdtypes.rst:2949 msgid "" "By default, the value of a replacement field expression is converted to a " "string using :func:`str`::" msgstr "" -#: ../../library/stdtypes.rst:2939 +#: ../../library/stdtypes.rst:2952 msgid "" ">>> from fractions import Fraction\n" ">>> one_third = Fraction(1, 3)\n" @@ -4651,13 +4676,13 @@ msgstr "" ">>> f'{one_third}'\n" "'1/3'" -#: ../../library/stdtypes.rst:2944 +#: ../../library/stdtypes.rst:2957 msgid "" "When a debug specifier but no format specifier is used, the default " "conversion instead uses :func:`repr`::" msgstr "" -#: ../../library/stdtypes.rst:2947 +#: ../../library/stdtypes.rst:2960 msgid "" ">>> f'{one_third = }'\n" "'one_third = Fraction(1, 3)'" @@ -4665,24 +4690,24 @@ msgstr "" ">>> f'{one_third = }'\n" "'one_third = Fraction(1, 3)'" -#: ../../library/stdtypes.rst:2950 +#: ../../library/stdtypes.rst:2963 msgid "" "The conversion can be specified explicitly using one of these specifiers:" msgstr "" -#: ../../library/stdtypes.rst:2952 +#: ../../library/stdtypes.rst:2965 msgid "``!s`` for :func:`str`" msgstr "``!s`` 用於 :func:`str`" -#: ../../library/stdtypes.rst:2953 +#: ../../library/stdtypes.rst:2966 msgid "``!r`` for :func:`repr`" msgstr "``!r`` 用於 :func:`repr`" -#: ../../library/stdtypes.rst:2954 +#: ../../library/stdtypes.rst:2967 msgid "``!a`` for :func:`ascii`" msgstr "``!a`` 用於 :func:`ascii`" -#: ../../library/stdtypes.rst:2958 +#: ../../library/stdtypes.rst:2971 msgid "" ">>> str(one_third)\n" "'1/3'\n" @@ -4714,11 +4739,11 @@ msgstr "" ">>> f'{string = !a}'\n" "\"string = '\\\\xa1ko\\\\u010dka \\\\U0001f638!'\"" -#: ../../library/stdtypes.rst:2975 +#: ../../library/stdtypes.rst:2988 msgid "Format specifier" msgstr "" -#: ../../library/stdtypes.rst:2977 +#: ../../library/stdtypes.rst:2990 msgid "" "After the expression has been evaluated, and possibly converted using an " "explicit conversion specifier, it is formatted using the :func:`format` " @@ -4728,7 +4753,7 @@ msgid "" "the replacement field. For example::" msgstr "" -#: ../../library/stdtypes.rst:2984 +#: ../../library/stdtypes.rst:2997 msgid "" ">>> from fractions import Fraction\n" ">>> one_third = Fraction(1, 3)\n" @@ -4752,29 +4777,29 @@ msgstr "" ">>> f'{one_third = :~>10}~'\n" "'one_third = ~~~~~~~1/3~'" -#: ../../library/stdtypes.rst:2998 +#: ../../library/stdtypes.rst:3011 msgid "Template String Literals (t-strings)" msgstr "模板字串字面值 (t-strings)" -#: ../../library/stdtypes.rst:3000 +#: ../../library/stdtypes.rst:3013 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:3003 +#: ../../library/stdtypes.rst:3016 msgid "" "These strings follow the same syntax and evaluation rules as :ref:`formatted " "string literals `, with for the following differences:" msgstr "" -#: ../../library/stdtypes.rst:3007 +#: ../../library/stdtypes.rst:3020 msgid "" "Rather than evaluating to a ``str`` object, template string literals " "evaluate to a :class:`string.templatelib.Template` object." msgstr "" -#: ../../library/stdtypes.rst:3010 +#: ../../library/stdtypes.rst:3023 msgid "" "The :func:`format` protocol is not used. Instead, the format specifier and " "conversions (if any) are passed to a new :class:`~string.templatelib." @@ -4783,7 +4808,7 @@ msgid "" "Template` object to decide how to handle format specifiers and conversions." msgstr "" -#: ../../library/stdtypes.rst:3017 +#: ../../library/stdtypes.rst:3030 msgid "" "Format specifiers containing nested replacement fields are evaluated " "eagerly, prior to being passed to the :class:`~string.templatelib." @@ -4793,7 +4818,7 @@ msgid "" "to be ``2``, the resulting format specifier would be ``'.2f'``." msgstr "" -#: ../../library/stdtypes.rst:3025 +#: ../../library/stdtypes.rst:3038 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 " @@ -4805,18 +4830,18 @@ msgid "" "behaviour." msgstr "" -#: ../../library/stdtypes.rst:3039 +#: ../../library/stdtypes.rst:3052 msgid "``printf``-style String Formatting" msgstr "" -#: ../../library/stdtypes.rst:3052 +#: ../../library/stdtypes.rst:3065 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:3056 +#: ../../library/stdtypes.rst:3069 msgid "" "Using :ref:`formatted string literals `, the :meth:`str.format` " "interface, or :class:`string.Template` may help avoid these errors. Each of " @@ -4824,7 +4849,7 @@ msgid "" "flexibility, and/or extensibility." msgstr "" -#: ../../library/stdtypes.rst:3061 +#: ../../library/stdtypes.rst:3074 msgid "" "String objects have one unique built-in operation: the ``%`` operator " "(modulo). This is also known as the string *formatting* or *interpolation* " @@ -4834,7 +4859,7 @@ msgid "" "function in the C language. For example:" msgstr "" -#: ../../library/stdtypes.rst:3068 +#: ../../library/stdtypes.rst:3081 msgid "" ">>> print('%s has %d quote types.' % ('Python', 2))\n" "Python has 2 quote types." @@ -4842,7 +4867,7 @@ msgstr "" ">>> print('%s has %d quote types.' % ('Python', 2))\n" "Python has 2 quote types." -#: ../../library/stdtypes.rst:3073 +#: ../../library/stdtypes.rst:3086 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 " @@ -4850,36 +4875,36 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:3083 ../../library/stdtypes.rst:4343 +#: ../../library/stdtypes.rst:3096 ../../library/stdtypes.rst:4356 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: ../../library/stdtypes.rst:3086 ../../library/stdtypes.rst:4346 +#: ../../library/stdtypes.rst:3099 ../../library/stdtypes.rst:4359 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../library/stdtypes.rst:3088 ../../library/stdtypes.rst:4348 +#: ../../library/stdtypes.rst:3101 ../../library/stdtypes.rst:4361 msgid "" "Mapping key (optional), consisting of a parenthesised sequence of characters " "(for example, ``(somename)``)." msgstr "" -#: ../../library/stdtypes.rst:3091 ../../library/stdtypes.rst:4351 +#: ../../library/stdtypes.rst:3104 ../../library/stdtypes.rst:4364 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: ../../library/stdtypes.rst:3094 ../../library/stdtypes.rst:4354 +#: ../../library/stdtypes.rst:3107 ../../library/stdtypes.rst:4367 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:3098 ../../library/stdtypes.rst:4358 +#: ../../library/stdtypes.rst:3111 ../../library/stdtypes.rst:4371 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. " "If specified as ``'*'`` (an asterisk), the actual precision is read from the " @@ -4887,15 +4912,15 @@ msgid "" "the precision." msgstr "" -#: ../../library/stdtypes.rst:3103 ../../library/stdtypes.rst:4363 +#: ../../library/stdtypes.rst:3116 ../../library/stdtypes.rst:4376 msgid "Length modifier (optional)." msgstr "" -#: ../../library/stdtypes.rst:3105 ../../library/stdtypes.rst:4365 +#: ../../library/stdtypes.rst:3118 ../../library/stdtypes.rst:4378 msgid "Conversion type." msgstr "" -#: ../../library/stdtypes.rst:3107 +#: ../../library/stdtypes.rst:3120 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 " @@ -4903,279 +4928,279 @@ msgid "" "selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:3116 ../../library/stdtypes.rst:4376 +#: ../../library/stdtypes.rst:3129 ../../library/stdtypes.rst:4389 msgid "" "In this case no ``*`` specifiers may occur in a format (since they require a " "sequential parameter list)." msgstr "" -#: ../../library/stdtypes.rst:3119 ../../library/stdtypes.rst:4379 +#: ../../library/stdtypes.rst:3132 ../../library/stdtypes.rst:4392 msgid "The conversion flag characters are:" msgstr "" -#: ../../library/stdtypes.rst:3128 ../../library/stdtypes.rst:4388 +#: ../../library/stdtypes.rst:3141 ../../library/stdtypes.rst:4401 msgid "Flag" msgstr "" -#: ../../library/stdtypes.rst:3130 ../../library/stdtypes.rst:4390 +#: ../../library/stdtypes.rst:3143 ../../library/stdtypes.rst:4403 msgid "``'#'``" msgstr "``'#'``" -#: ../../library/stdtypes.rst:3130 ../../library/stdtypes.rst:4390 +#: ../../library/stdtypes.rst:3143 ../../library/stdtypes.rst:4403 msgid "" "The value conversion will use the \"alternate form\" (where defined below)." msgstr "" -#: ../../library/stdtypes.rst:3133 ../../library/stdtypes.rst:4393 +#: ../../library/stdtypes.rst:3146 ../../library/stdtypes.rst:4406 msgid "``'0'``" msgstr "``'0'``" -#: ../../library/stdtypes.rst:3133 ../../library/stdtypes.rst:4393 +#: ../../library/stdtypes.rst:3146 ../../library/stdtypes.rst:4406 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: ../../library/stdtypes.rst:3135 ../../library/stdtypes.rst:4395 +#: ../../library/stdtypes.rst:3148 ../../library/stdtypes.rst:4408 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/stdtypes.rst:3135 ../../library/stdtypes.rst:4395 +#: ../../library/stdtypes.rst:3148 ../../library/stdtypes.rst:4408 msgid "" "The converted value is left adjusted (overrides the ``'0'`` conversion if " "both are given)." msgstr "" -#: ../../library/stdtypes.rst:3138 ../../library/stdtypes.rst:4398 +#: ../../library/stdtypes.rst:3151 ../../library/stdtypes.rst:4411 msgid "``' '``" msgstr "``' '``" -#: ../../library/stdtypes.rst:3138 ../../library/stdtypes.rst:4398 +#: ../../library/stdtypes.rst:3151 ../../library/stdtypes.rst:4411 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." msgstr "" -#: ../../library/stdtypes.rst:3141 ../../library/stdtypes.rst:4401 +#: ../../library/stdtypes.rst:3154 ../../library/stdtypes.rst:4414 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/stdtypes.rst:3141 ../../library/stdtypes.rst:4401 +#: ../../library/stdtypes.rst:3154 ../../library/stdtypes.rst:4414 msgid "" "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides " "a \"space\" flag)." msgstr "" -#: ../../library/stdtypes.rst:3145 ../../library/stdtypes.rst:4405 +#: ../../library/stdtypes.rst:3158 ../../library/stdtypes.rst:4418 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:3148 ../../library/stdtypes.rst:4408 +#: ../../library/stdtypes.rst:3161 ../../library/stdtypes.rst:4421 msgid "The conversion types are:" msgstr "" -#: ../../library/stdtypes.rst:3151 ../../library/stdtypes.rst:4411 +#: ../../library/stdtypes.rst:3164 ../../library/stdtypes.rst:4424 msgid "Conversion" msgstr "" -#: ../../library/stdtypes.rst:3153 ../../library/stdtypes.rst:4413 +#: ../../library/stdtypes.rst:3166 ../../library/stdtypes.rst:4426 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/stdtypes.rst:3153 ../../library/stdtypes.rst:3155 -#: ../../library/stdtypes.rst:4413 ../../library/stdtypes.rst:4415 +#: ../../library/stdtypes.rst:3166 ../../library/stdtypes.rst:3168 +#: ../../library/stdtypes.rst:4426 ../../library/stdtypes.rst:4428 msgid "Signed integer decimal." msgstr "" -#: ../../library/stdtypes.rst:3155 ../../library/stdtypes.rst:4415 +#: ../../library/stdtypes.rst:3168 ../../library/stdtypes.rst:4428 msgid "``'i'``" msgstr "``'i'``" -#: ../../library/stdtypes.rst:3157 ../../library/stdtypes.rst:4417 +#: ../../library/stdtypes.rst:3170 ../../library/stdtypes.rst:4430 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/stdtypes.rst:3157 ../../library/stdtypes.rst:4417 +#: ../../library/stdtypes.rst:3170 ../../library/stdtypes.rst:4430 msgid "Signed octal value." msgstr "" -#: ../../library/stdtypes.rst:3159 ../../library/stdtypes.rst:4419 +#: ../../library/stdtypes.rst:3172 ../../library/stdtypes.rst:4432 msgid "``'u'``" msgstr "``'u'``" -#: ../../library/stdtypes.rst:3159 ../../library/stdtypes.rst:4419 +#: ../../library/stdtypes.rst:3172 ../../library/stdtypes.rst:4432 msgid "Obsolete type -- it is identical to ``'d'``." msgstr "" -#: ../../library/stdtypes.rst:3161 ../../library/stdtypes.rst:4421 +#: ../../library/stdtypes.rst:3174 ../../library/stdtypes.rst:4434 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/stdtypes.rst:3161 ../../library/stdtypes.rst:4421 +#: ../../library/stdtypes.rst:3174 ../../library/stdtypes.rst:4434 msgid "Signed hexadecimal (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:3163 ../../library/stdtypes.rst:4423 +#: ../../library/stdtypes.rst:3176 ../../library/stdtypes.rst:4436 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/stdtypes.rst:3163 ../../library/stdtypes.rst:4423 +#: ../../library/stdtypes.rst:3176 ../../library/stdtypes.rst:4436 msgid "Signed hexadecimal (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:3165 ../../library/stdtypes.rst:4425 +#: ../../library/stdtypes.rst:3178 ../../library/stdtypes.rst:4438 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/stdtypes.rst:3165 ../../library/stdtypes.rst:4425 +#: ../../library/stdtypes.rst:3178 ../../library/stdtypes.rst:4438 msgid "Floating-point exponential format (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:3167 ../../library/stdtypes.rst:4427 +#: ../../library/stdtypes.rst:3180 ../../library/stdtypes.rst:4440 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/stdtypes.rst:3167 ../../library/stdtypes.rst:4427 +#: ../../library/stdtypes.rst:3180 ../../library/stdtypes.rst:4440 msgid "Floating-point exponential format (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:3169 ../../library/stdtypes.rst:4429 +#: ../../library/stdtypes.rst:3182 ../../library/stdtypes.rst:4442 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/stdtypes.rst:3169 ../../library/stdtypes.rst:3171 -#: ../../library/stdtypes.rst:4429 ../../library/stdtypes.rst:4431 +#: ../../library/stdtypes.rst:3182 ../../library/stdtypes.rst:3184 +#: ../../library/stdtypes.rst:4442 ../../library/stdtypes.rst:4444 msgid "Floating-point decimal format." msgstr "" -#: ../../library/stdtypes.rst:3171 ../../library/stdtypes.rst:4431 +#: ../../library/stdtypes.rst:3184 ../../library/stdtypes.rst:4444 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/stdtypes.rst:3173 ../../library/stdtypes.rst:4433 +#: ../../library/stdtypes.rst:3186 ../../library/stdtypes.rst:4446 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/stdtypes.rst:3173 ../../library/stdtypes.rst:4433 +#: ../../library/stdtypes.rst:3186 ../../library/stdtypes.rst:4446 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:3177 ../../library/stdtypes.rst:4437 +#: ../../library/stdtypes.rst:3190 ../../library/stdtypes.rst:4450 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/stdtypes.rst:3177 ../../library/stdtypes.rst:4437 +#: ../../library/stdtypes.rst:3190 ../../library/stdtypes.rst:4450 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:3181 ../../library/stdtypes.rst:4441 +#: ../../library/stdtypes.rst:3194 ../../library/stdtypes.rst:4454 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/stdtypes.rst:3181 +#: ../../library/stdtypes.rst:3194 msgid "Single character (accepts integer or single character string)." msgstr "" -#: ../../library/stdtypes.rst:3184 ../../library/stdtypes.rst:4454 +#: ../../library/stdtypes.rst:3197 ../../library/stdtypes.rst:4467 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/stdtypes.rst:3184 +#: ../../library/stdtypes.rst:3197 msgid "String (converts any Python object using :func:`repr`)." msgstr "" -#: ../../library/stdtypes.rst:3187 ../../library/stdtypes.rst:4448 +#: ../../library/stdtypes.rst:3200 ../../library/stdtypes.rst:4461 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/stdtypes.rst:3187 +#: ../../library/stdtypes.rst:3200 msgid "String (converts any Python object using :func:`str`)." msgstr "" -#: ../../library/stdtypes.rst:3190 ../../library/stdtypes.rst:4451 +#: ../../library/stdtypes.rst:3203 ../../library/stdtypes.rst:4464 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/stdtypes.rst:3190 +#: ../../library/stdtypes.rst:3203 msgid "String (converts any Python object using :func:`ascii`)." msgstr "" -#: ../../library/stdtypes.rst:3193 ../../library/stdtypes.rst:4457 +#: ../../library/stdtypes.rst:3206 ../../library/stdtypes.rst:4470 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/stdtypes.rst:3193 ../../library/stdtypes.rst:4457 +#: ../../library/stdtypes.rst:3206 ../../library/stdtypes.rst:4470 msgid "No argument is converted, results in a ``'%'`` character in the result." msgstr "" -#: ../../library/stdtypes.rst:3200 ../../library/stdtypes.rst:4464 +#: ../../library/stdtypes.rst:3213 ../../library/stdtypes.rst:4477 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:4468 +#: ../../library/stdtypes.rst:3217 ../../library/stdtypes.rst:4481 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:4472 +#: ../../library/stdtypes.rst:3221 ../../library/stdtypes.rst:4485 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:4475 +#: ../../library/stdtypes.rst:3224 ../../library/stdtypes.rst:4488 msgid "" "The precision determines the number of digits after the decimal point and " "defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:3215 ../../library/stdtypes.rst:4479 +#: ../../library/stdtypes.rst:3228 ../../library/stdtypes.rst:4492 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:4482 +#: ../../library/stdtypes.rst:3231 ../../library/stdtypes.rst:4495 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:4486 +#: ../../library/stdtypes.rst:3235 ../../library/stdtypes.rst:4499 msgid "If precision is ``N``, the output is truncated to ``N`` characters." msgstr "" -#: ../../library/stdtypes.rst:3225 ../../library/stdtypes.rst:4495 +#: ../../library/stdtypes.rst:3238 ../../library/stdtypes.rst:4508 msgid "See :pep:`237`." msgstr "參閱 :pep:`237`。" -#: ../../library/stdtypes.rst:3227 +#: ../../library/stdtypes.rst:3240 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:3245 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:3256 msgid "" "Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:" "`memoryview`" msgstr "" -#: ../../library/stdtypes.rst:3251 +#: ../../library/stdtypes.rst:3264 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 :" @@ -5183,17 +5208,17 @@ msgid "" "objects without needing to make a copy." msgstr "" -#: ../../library/stdtypes.rst:3256 +#: ../../library/stdtypes.rst:3269 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:3275 msgid "Bytes Objects" msgstr "" -#: ../../library/stdtypes.rst:3266 +#: ../../library/stdtypes.rst:3279 msgid "" "Bytes objects are immutable sequences of single bytes. Since many major " "binary protocols are based on the ASCII text encoding, bytes objects offer " @@ -5201,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:3287 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:3290 msgid "Single quotes: ``b'still allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:3278 +#: ../../library/stdtypes.rst:3291 msgid "Double quotes: ``b\"still allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:3279 +#: ../../library/stdtypes.rst:3292 msgid "" "Triple quoted: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:3281 +#: ../../library/stdtypes.rst:3294 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:3298 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:3302 msgid "" "While bytes literals and representations are based on ASCII text, bytes " "objects actually behave like immutable sequences of integers, with each " @@ -5247,29 +5272,29 @@ msgid "" "compatible will usually lead to data corruption)." msgstr "" -#: ../../library/stdtypes.rst:3299 +#: ../../library/stdtypes.rst:3312 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:3315 msgid "A zero-filled bytes object of a specified length: ``bytes(10)``" msgstr "" -#: ../../library/stdtypes.rst:3303 +#: ../../library/stdtypes.rst:3316 msgid "From an iterable of integers: ``bytes(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:3304 +#: ../../library/stdtypes.rst:3317 msgid "Copying existing binary data via the buffer protocol: ``bytes(obj)``" msgstr "" -#: ../../library/stdtypes.rst:3306 +#: ../../library/stdtypes.rst:3319 msgid "Also see the :ref:`bytes ` built-in." msgstr "另見內建的 :ref:`bytes `。" -#: ../../library/stdtypes.rst:3308 +#: ../../library/stdtypes.rst:3321 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -5277,38 +5302,38 @@ msgid "" "that format:" msgstr "" -#: ../../library/stdtypes.rst:3314 +#: ../../library/stdtypes.rst:3327 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:3334 msgid "" ":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just " "spaces." msgstr "" -#: ../../library/stdtypes.rst:3325 +#: ../../library/stdtypes.rst:3338 msgid "" ":meth:`bytes.fromhex` now accepts ASCII :class:`bytes` and :term:`bytes-like " "objects ` as input." msgstr "" -#: ../../library/stdtypes.rst:3329 +#: ../../library/stdtypes.rst:3342 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:3348 ../../library/stdtypes.rst:3439 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." msgstr "" -#: ../../library/stdtypes.rst:3341 +#: ../../library/stdtypes.rst:3354 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, " @@ -5317,13 +5342,13 @@ msgid "" "the separator position from the right, negative values from the left." msgstr "" -#: ../../library/stdtypes.rst:3358 +#: ../../library/stdtypes.rst:3371 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:3375 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 " @@ -5331,58 +5356,58 @@ msgid "" "and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:3367 +#: ../../library/stdtypes.rst:3380 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:3388 msgid "Bytearray Objects" msgstr "Bytearray 物件" -#: ../../library/stdtypes.rst:3379 +#: ../../library/stdtypes.rst:3392 msgid "" ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` " "objects." msgstr "" -#: ../../library/stdtypes.rst:3385 +#: ../../library/stdtypes.rst:3398 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:3401 msgid "Creating an empty instance: ``bytearray()``" msgstr "建立一個空的實例:``bytearray()``" -#: ../../library/stdtypes.rst:3389 +#: ../../library/stdtypes.rst:3402 msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" msgstr "" -#: ../../library/stdtypes.rst:3390 +#: ../../library/stdtypes.rst:3403 msgid "From an iterable of integers: ``bytearray(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:3391 +#: ../../library/stdtypes.rst:3404 msgid "" "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" -#: ../../library/stdtypes.rst:3393 +#: ../../library/stdtypes.rst:3406 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:3410 msgid "Also see the :ref:`bytearray ` built-in." msgstr "另見內建的 :ref:`bytearray `。" -#: ../../library/stdtypes.rst:3399 +#: ../../library/stdtypes.rst:3412 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -5390,64 +5415,64 @@ msgid "" "in that format:" msgstr "" -#: ../../library/stdtypes.rst:3405 +#: ../../library/stdtypes.rst:3418 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:3425 msgid "" ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not " "just spaces." msgstr "" -#: ../../library/stdtypes.rst:3416 +#: ../../library/stdtypes.rst:3429 msgid "" ":meth:`bytearray.fromhex` now accepts ASCII :class:`bytes` and :term:`bytes-" "like objects ` as input." msgstr "" -#: ../../library/stdtypes.rst:3420 +#: ../../library/stdtypes.rst:3433 msgid "" "A reverse conversion function exists to transform a bytearray object into " "its hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:3434 +#: ../../library/stdtypes.rst:3447 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:3454 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:3457 msgid "" "If the :class:`bytearray` needs to shrink, bytes beyond *size* are truncated." msgstr "" -#: ../../library/stdtypes.rst:3446 +#: ../../library/stdtypes.rst:3459 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:3463 msgid "This is equivalent to:" msgstr "等同於:" -#: ../../library/stdtypes.rst:3458 +#: ../../library/stdtypes.rst:3471 msgid "Examples:" msgstr "範例:" -#: ../../library/stdtypes.rst:3471 +#: ../../library/stdtypes.rst:3484 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 " @@ -5455,7 +5480,7 @@ msgid "" "both indexing and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:3476 +#: ../../library/stdtypes.rst:3489 msgid "" "The representation of bytearray objects uses the bytes literal format " "(``bytearray(b'...')``) since it is often more useful than e.g. " @@ -5463,11 +5488,11 @@ msgid "" "a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:3485 +#: ../../library/stdtypes.rst:3498 msgid "Bytes and Bytearray Operations" msgstr "Bytes 和 Bytearray 的操作" -#: ../../library/stdtypes.rst:3490 +#: ../../library/stdtypes.rst:3503 msgid "" "Both bytes and bytearray objects support the :ref:`common ` " "sequence operations. They interoperate not just with operands of the same " @@ -5476,14 +5501,14 @@ msgid "" "return type of the result may depend on the order of operands." msgstr "" -#: ../../library/stdtypes.rst:3498 +#: ../../library/stdtypes.rst:3511 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:3502 +#: ../../library/stdtypes.rst:3515 msgid "" "a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" @@ -5491,11 +5516,11 @@ msgstr "" "a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" -#: ../../library/stdtypes.rst:3505 +#: ../../library/stdtypes.rst:3518 msgid "and::" msgstr "和: ::" -#: ../../library/stdtypes.rst:3507 +#: ../../library/stdtypes.rst:3520 msgid "" "a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" @@ -5503,60 +5528,60 @@ msgstr "" "a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" -#: ../../library/stdtypes.rst:3510 +#: ../../library/stdtypes.rst:3523 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:3515 +#: ../../library/stdtypes.rst:3528 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:3518 +#: ../../library/stdtypes.rst:3531 msgid "" "The following methods on bytes and bytearray objects can be used with " "arbitrary binary data." msgstr "" -#: ../../library/stdtypes.rst:3524 +#: ../../library/stdtypes.rst:3537 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:3528 ../../library/stdtypes.rst:3633 -#: ../../library/stdtypes.rst:3655 ../../library/stdtypes.rst:3721 -#: ../../library/stdtypes.rst:3734 +#: ../../library/stdtypes.rst:3541 ../../library/stdtypes.rst:3646 +#: ../../library/stdtypes.rst:3668 ../../library/stdtypes.rst:3734 +#: ../../library/stdtypes.rst:3747 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:3531 +#: ../../library/stdtypes.rst:3544 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:3534 ../../library/stdtypes.rst:3645 -#: ../../library/stdtypes.rst:3658 ../../library/stdtypes.rst:3724 -#: ../../library/stdtypes.rst:3737 +#: ../../library/stdtypes.rst:3547 ../../library/stdtypes.rst:3658 +#: ../../library/stdtypes.rst:3671 ../../library/stdtypes.rst:3737 +#: ../../library/stdtypes.rst:3750 msgid "Also accept an integer in the range 0 to 255 as the subsequence." msgstr "" -#: ../../library/stdtypes.rst:3541 +#: ../../library/stdtypes.rst:3554 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:3545 +#: ../../library/stdtypes.rst:3558 msgid "" ">>> b'TestHook'.removeprefix(b'Test')\n" "b'Hook'\n" @@ -5568,32 +5593,32 @@ msgstr "" ">>> b'BaseTestCase'.removeprefix(b'Test')\n" "b'BaseTestCase'" -#: ../../library/stdtypes.rst:3550 +#: ../../library/stdtypes.rst:3563 msgid "The *prefix* may be any :term:`bytes-like object`." msgstr "*prefix* 可以是任何的 :term:`bytes-like object`。" -#: ../../library/stdtypes.rst:3554 ../../library/stdtypes.rst:3576 -#: ../../library/stdtypes.rst:3709 ../../library/stdtypes.rst:3802 -#: ../../library/stdtypes.rst:3816 ../../library/stdtypes.rst:3846 -#: ../../library/stdtypes.rst:3860 ../../library/stdtypes.rst:3901 -#: ../../library/stdtypes.rst:3971 ../../library/stdtypes.rst:3989 -#: ../../library/stdtypes.rst:4017 ../../library/stdtypes.rst:4156 -#: ../../library/stdtypes.rst:4211 ../../library/stdtypes.rst:4254 -#: ../../library/stdtypes.rst:4275 ../../library/stdtypes.rst:4297 -#: ../../library/stdtypes.rst:4499 +#: ../../library/stdtypes.rst:3567 ../../library/stdtypes.rst:3589 +#: ../../library/stdtypes.rst:3722 ../../library/stdtypes.rst:3815 +#: ../../library/stdtypes.rst:3829 ../../library/stdtypes.rst:3859 +#: ../../library/stdtypes.rst:3873 ../../library/stdtypes.rst:3914 +#: ../../library/stdtypes.rst:3984 ../../library/stdtypes.rst:4002 +#: ../../library/stdtypes.rst:4030 ../../library/stdtypes.rst:4169 +#: ../../library/stdtypes.rst:4224 ../../library/stdtypes.rst:4267 +#: ../../library/stdtypes.rst:4288 ../../library/stdtypes.rst:4310 +#: ../../library/stdtypes.rst:4512 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:3563 +#: ../../library/stdtypes.rst:3576 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:3567 +#: ../../library/stdtypes.rst:3580 msgid "" ">>> b'MiscTests'.removesuffix(b'Tests')\n" "b'Misc'\n" @@ -5605,15 +5630,15 @@ msgstr "" ">>> b'TmpDirMixin'.removesuffix(b'Tests')\n" "b'TmpDirMixin'" -#: ../../library/stdtypes.rst:3572 +#: ../../library/stdtypes.rst:3585 msgid "The *suffix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3585 +#: ../../library/stdtypes.rst:3598 msgid "Return the bytes decoded to a :class:`str`." msgstr "" -#: ../../library/stdtypes.rst:3590 +#: ../../library/stdtypes.rst:3603 msgid "" "*errors* controls how decoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -5621,21 +5646,21 @@ msgid "" "`codecs.register_error`. See :ref:`error-handlers` for details." msgstr "" -#: ../../library/stdtypes.rst:3596 +#: ../../library/stdtypes.rst:3609 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:3602 +#: ../../library/stdtypes.rst:3615 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:3617 +#: ../../library/stdtypes.rst:3630 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 +5668,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:3622 +#: ../../library/stdtypes.rst:3635 msgid "The suffix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3628 +#: ../../library/stdtypes.rst:3641 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 +5680,14 @@ msgid "" "``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:3638 +#: ../../library/stdtypes.rst:3651 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:3642 +#: ../../library/stdtypes.rst:3655 msgid "" ">>> b'Py' in b'Python'\n" "True" @@ -5670,13 +5695,13 @@ msgstr "" ">>> b'Py' in b'Python'\n" "True" -#: ../../library/stdtypes.rst:3652 +#: ../../library/stdtypes.rst:3665 msgid "" "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence " "is not found." msgstr "" -#: ../../library/stdtypes.rst:3665 +#: ../../library/stdtypes.rst:3678 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 +5711,7 @@ msgid "" "method." msgstr "" -#: ../../library/stdtypes.rst:3676 +#: ../../library/stdtypes.rst:3689 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 +5719,7 @@ msgid "" "objects ` and have the same length." msgstr "" -#: ../../library/stdtypes.rst:3687 +#: ../../library/stdtypes.rst:3700 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 +5728,24 @@ msgid "" "by two empty bytes or bytearray objects." msgstr "" -#: ../../library/stdtypes.rst:3694 ../../library/stdtypes.rst:3751 +#: ../../library/stdtypes.rst:3707 ../../library/stdtypes.rst:3764 msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3700 +#: ../../library/stdtypes.rst:3713 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:3704 +#: ../../library/stdtypes.rst:3717 msgid "" "The subsequence to search for and its replacement may be any :term:`bytes-" "like object`." msgstr "" -#: ../../library/stdtypes.rst:3716 +#: ../../library/stdtypes.rst:3729 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 +5753,13 @@ msgid "" "``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:3731 +#: ../../library/stdtypes.rst:3744 msgid "" "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence " "*sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:3744 +#: ../../library/stdtypes.rst:3757 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 +5768,7 @@ msgid "" "followed by a copy of the original sequence." msgstr "" -#: ../../library/stdtypes.rst:3757 +#: ../../library/stdtypes.rst:3770 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 +5776,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:3762 +#: ../../library/stdtypes.rst:3775 msgid "The prefix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3768 +#: ../../library/stdtypes.rst:3781 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 +5788,18 @@ msgid "" "object of length 256." msgstr "" -#: ../../library/stdtypes.rst:3773 +#: ../../library/stdtypes.rst:3786 msgid "" "You can use the :func:`bytes.maketrans` method to create a translation table." msgstr "" -#: ../../library/stdtypes.rst:3776 +#: ../../library/stdtypes.rst:3789 msgid "" "Set the *table* argument to ``None`` for translations that only delete " "characters::" msgstr "" -#: ../../library/stdtypes.rst:3779 +#: ../../library/stdtypes.rst:3792 msgid "" ">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" @@ -5782,11 +5807,11 @@ msgstr "" ">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" -#: ../../library/stdtypes.rst:3782 +#: ../../library/stdtypes.rst:3795 msgid "*delete* is now supported as a keyword argument." msgstr "支援 *delete* 關鍵字引數。" -#: ../../library/stdtypes.rst:3786 +#: ../../library/stdtypes.rst:3799 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 +5820,7 @@ msgid "" "instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3795 +#: ../../library/stdtypes.rst:3808 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 +5828,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3809 +#: ../../library/stdtypes.rst:3822 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 +5836,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3823 +#: ../../library/stdtypes.rst:3836 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 +5845,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3829 +#: ../../library/stdtypes.rst:3842 msgid "" ">>> b' spacious '.lstrip()\n" "b'spacious '\n" @@ -5832,14 +5857,14 @@ msgstr "" ">>> b'www.example.com'.lstrip(b'cmowz.')\n" "b'example.com'" -#: ../../library/stdtypes.rst:3834 +#: ../../library/stdtypes.rst:3847 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:3839 +#: ../../library/stdtypes.rst:3852 msgid "" ">>> b'Arthur: three!'.lstrip(b'Arthur: ')\n" "b'ee!'\n" @@ -5851,7 +5876,7 @@ msgstr "" ">>> b'Arthur: three!'.removeprefix(b'Arthur: ')\n" "b'three!'" -#: ../../library/stdtypes.rst:3853 +#: ../../library/stdtypes.rst:3866 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 +5884,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3867 +#: ../../library/stdtypes.rst:3880 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 +5894,7 @@ msgid "" "described in detail below." msgstr "" -#: ../../library/stdtypes.rst:3878 +#: ../../library/stdtypes.rst:3891 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 +5903,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3884 +#: ../../library/stdtypes.rst:3897 msgid "" ">>> b' spacious '.rstrip()\n" "b' spacious'\n" @@ -5890,14 +5915,14 @@ msgstr "" ">>> b'mississippi'.rstrip(b'ipz')\n" "b'mississ'" -#: ../../library/stdtypes.rst:3889 +#: ../../library/stdtypes.rst:3902 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:3894 +#: ../../library/stdtypes.rst:3907 msgid "" ">>> b'Monty Python'.rstrip(b' Python')\n" "b'M'\n" @@ -5909,7 +5934,7 @@ msgstr "" ">>> b'Monty Python'.removesuffix(b' Python')\n" "b'Monty'" -#: ../../library/stdtypes.rst:3908 +#: ../../library/stdtypes.rst:3921 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 +5943,7 @@ msgid "" "limit on the number of splits (all possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:3914 +#: ../../library/stdtypes.rst:3927 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 +5954,7 @@ msgid "" "like object`." msgstr "" -#: ../../library/stdtypes.rst:3924 +#: ../../library/stdtypes.rst:3937 msgid "" ">>> b'1,2,3'.split(b',')\n" "[b'1', b'2', b'3']\n" @@ -5949,7 +5974,7 @@ msgstr "" ">>> b'1<>2<>3<4'.split(b'<>')\n" "[b'1', b'2', b'3<4']" -#: ../../library/stdtypes.rst:3933 +#: ../../library/stdtypes.rst:3946 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 +5984,7 @@ msgid "" "without a specified separator returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:3943 +#: ../../library/stdtypes.rst:3956 msgid "" ">>> b'1 2 3'.split()\n" "[b'1', b'2', b'3']\n" @@ -5975,7 +6000,7 @@ msgstr "" ">>> b' 1 2 3 '.split()\n" "[b'1', b'2', b'3']" -#: ../../library/stdtypes.rst:3954 +#: ../../library/stdtypes.rst:3967 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 +6009,7 @@ msgid "" "or suffix; rather, all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3961 +#: ../../library/stdtypes.rst:3974 msgid "" ">>> b' spacious '.strip()\n" "b'spacious'\n" @@ -5996,13 +6021,13 @@ msgstr "" ">>> b'www.example.com'.strip(b'cmowz.')\n" "b'example'" -#: ../../library/stdtypes.rst:3966 +#: ../../library/stdtypes.rst:3979 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`." msgstr "" -#: ../../library/stdtypes.rst:3975 +#: ../../library/stdtypes.rst:3988 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 +6035,14 @@ msgid "" "operate in place, and instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3983 +#: ../../library/stdtypes.rst:3996 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:3996 +#: ../../library/stdtypes.rst:4009 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 +6058,7 @@ msgid "" "by one regardless of how the byte value is represented when printed::" msgstr "" -#: ../../library/stdtypes.rst:4010 +#: ../../library/stdtypes.rst:4023 msgid "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs()\n" "b'01 012 0123 01234'\n" @@ -6045,7 +6070,7 @@ msgstr "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs(4)\n" "b'01 012 0123 01234'" -#: ../../library/stdtypes.rst:4024 +#: ../../library/stdtypes.rst:4037 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 +6079,7 @@ msgid "" "digits are those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:4032 +#: ../../library/stdtypes.rst:4045 msgid "" ">>> b'ABCabc1'.isalnum()\n" "True\n" @@ -6066,7 +6091,7 @@ msgstr "" ">>> b'ABC abc1'.isalnum()\n" "False" -#: ../../library/stdtypes.rst:4041 +#: ../../library/stdtypes.rst:4054 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 +6099,7 @@ msgid "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:4048 +#: ../../library/stdtypes.rst:4061 msgid "" ">>> b'ABCabc'.isalpha()\n" "True\n" @@ -6086,20 +6111,20 @@ msgstr "" ">>> b'ABCabc1'.isalpha()\n" "False" -#: ../../library/stdtypes.rst:4057 +#: ../../library/stdtypes.rst:4070 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:4067 +#: ../../library/stdtypes.rst:4080 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:4073 +#: ../../library/stdtypes.rst:4086 msgid "" ">>> b'1234'.isdigit()\n" "True\n" @@ -6111,13 +6136,13 @@ msgstr "" ">>> b'1.23'.isdigit()\n" "False" -#: ../../library/stdtypes.rst:4082 +#: ../../library/stdtypes.rst:4095 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:4087 +#: ../../library/stdtypes.rst:4100 msgid "" ">>> b'hello world'.islower()\n" "True\n" @@ -6129,16 +6154,16 @@ msgstr "" ">>> b'Hello world'.islower()\n" "False" -#: ../../library/stdtypes.rst:4092 ../../library/stdtypes.rst:4134 -#: ../../library/stdtypes.rst:4150 ../../library/stdtypes.rst:4200 -#: ../../library/stdtypes.rst:4269 +#: ../../library/stdtypes.rst:4105 ../../library/stdtypes.rst:4147 +#: ../../library/stdtypes.rst:4163 ../../library/stdtypes.rst:4213 +#: ../../library/stdtypes.rst:4282 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:4100 +#: ../../library/stdtypes.rst:4113 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 +6171,14 @@ msgid "" "newline, carriage return, vertical tab, form feed)." msgstr "" -#: ../../library/stdtypes.rst:4109 +#: ../../library/stdtypes.rst:4122 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:4115 +#: ../../library/stdtypes.rst:4128 msgid "" ">>> b'Hello World'.istitle()\n" "True\n" @@ -6165,14 +6190,14 @@ msgstr "" ">>> b'Hello world'.istitle()\n" "False" -#: ../../library/stdtypes.rst:4124 +#: ../../library/stdtypes.rst:4137 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:4129 +#: ../../library/stdtypes.rst:4142 msgid "" ">>> b'HELLO WORLD'.isupper()\n" "True\n" @@ -6184,13 +6209,13 @@ msgstr "" ">>> b'Hello world'.isupper()\n" "False" -#: ../../library/stdtypes.rst:4142 +#: ../../library/stdtypes.rst:4155 msgid "" "Return a copy of the sequence with all the uppercase ASCII characters " "converted to their corresponding lowercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:4147 +#: ../../library/stdtypes.rst:4160 msgid "" ">>> b'Hello World'.lower()\n" "b'hello world'" @@ -6198,7 +6223,7 @@ msgstr "" ">>> b'Hello World'.lower()\n" "b'hello world'" -#: ../../library/stdtypes.rst:4167 +#: ../../library/stdtypes.rst:4180 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 +6231,7 @@ msgid "" "*keepends* is given and true." msgstr "" -#: ../../library/stdtypes.rst:4174 +#: ../../library/stdtypes.rst:4187 msgid "" ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "[b'ab c', b'', b'de fg', b'kl']\n" @@ -6218,14 +6243,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:4179 +#: ../../library/stdtypes.rst:4192 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:4183 +#: ../../library/stdtypes.rst:4196 msgid "" ">>> b\"\".split(b'\\n'), b\"Two lines\\n\".split(b'\\n')\n" "([b''], [b'Two lines', b''])\n" @@ -6237,13 +6262,13 @@ msgstr "" ">>> b\"\".splitlines(), b\"One line\\n\".splitlines()\n" "([], [b'One line'])" -#: ../../library/stdtypes.rst:4192 +#: ../../library/stdtypes.rst:4205 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:4197 +#: ../../library/stdtypes.rst:4210 msgid "" ">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" @@ -6251,7 +6276,7 @@ msgstr "" ">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" -#: ../../library/stdtypes.rst:4204 +#: ../../library/stdtypes.rst:4217 msgid "" "Unlike :func:`str.swapcase`, it is always the case that ``bin.swapcase()." "swapcase() == bin`` for the binary versions. Case conversions are " @@ -6259,14 +6284,14 @@ msgid "" "Unicode code points." msgstr "" -#: ../../library/stdtypes.rst:4218 +#: ../../library/stdtypes.rst:4231 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:4224 +#: ../../library/stdtypes.rst:4237 msgid "" ">>> b'Hello world'.title()\n" "b'Hello World'" @@ -6274,7 +6299,7 @@ msgstr "" ">>> b'Hello world'.title()\n" "b'Hello World'" -#: ../../library/stdtypes.rst:4227 +#: ../../library/stdtypes.rst:4240 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -6282,7 +6307,7 @@ msgid "" "values are uncased." msgstr "" -#: ../../library/stdtypes.rst:4237 +#: ../../library/stdtypes.rst:4250 msgid "" ">>> b\"they're bill's friends from the UK\".title()\n" "b\"They'Re Bill'S Friends From The Uk\"" @@ -6290,12 +6315,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:4240 +#: ../../library/stdtypes.rst:4253 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "" -#: ../../library/stdtypes.rst:4242 +#: ../../library/stdtypes.rst:4255 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -6317,13 +6342,13 @@ msgstr "" ">>> titlecase(b\"they're bill's friends.\")\n" "b\"They're Bill's Friends.\"" -#: ../../library/stdtypes.rst:4261 +#: ../../library/stdtypes.rst:4274 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:4266 +#: ../../library/stdtypes.rst:4279 msgid "" ">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" @@ -6331,7 +6356,7 @@ msgstr "" ">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" -#: ../../library/stdtypes.rst:4282 +#: ../../library/stdtypes.rst:4295 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 +6365,7 @@ msgid "" "*width* is less than or equal to ``len(seq)``." msgstr "" -#: ../../library/stdtypes.rst:4290 +#: ../../library/stdtypes.rst:4303 msgid "" ">>> b\"42\".zfill(5)\n" "b'00042'\n" @@ -6352,11 +6377,11 @@ msgstr "" ">>> b\"-42\".zfill(5)\n" "b'-0042'" -#: ../../library/stdtypes.rst:4304 +#: ../../library/stdtypes.rst:4317 msgid "``printf``-style Bytes Formatting" msgstr "" -#: ../../library/stdtypes.rst:4321 +#: ../../library/stdtypes.rst:4334 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 +6389,7 @@ msgid "" "dictionary, wrap it in a tuple." msgstr "" -#: ../../library/stdtypes.rst:4326 +#: ../../library/stdtypes.rst:4339 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 +6399,7 @@ msgid "" "func:`sprintf` in the C language." msgstr "" -#: ../../library/stdtypes.rst:4333 +#: ../../library/stdtypes.rst:4346 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 +6407,7 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:4367 +#: ../../library/stdtypes.rst:4380 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 +6415,77 @@ msgid "" "mapping key selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:4419 +#: ../../library/stdtypes.rst:4432 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/stdtypes.rst:4441 +#: ../../library/stdtypes.rst:4454 msgid "Single byte (accepts integer or single byte objects)." msgstr "" -#: ../../library/stdtypes.rst:4444 +#: ../../library/stdtypes.rst:4457 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/stdtypes.rst:4444 +#: ../../library/stdtypes.rst:4457 msgid "" "Bytes (any object that follows the :ref:`buffer protocol ` or " "has :meth:`~object.__bytes__`)." msgstr "" -#: ../../library/stdtypes.rst:4448 +#: ../../library/stdtypes.rst:4461 msgid "" "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:4451 +#: ../../library/stdtypes.rst:4464 msgid "" "Bytes (converts any Python object using ``repr(obj).encode('ascii', " "'backslashreplace')``)." msgstr "" -#: ../../library/stdtypes.rst:4454 +#: ../../library/stdtypes.rst:4467 msgid "" "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:4454 +#: ../../library/stdtypes.rst:4467 msgid "\\(7)" msgstr "\\(7)" -#: ../../library/stdtypes.rst:4489 +#: ../../library/stdtypes.rst:4502 msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." msgstr "``b'%s'`` 已被棄用,但在 3.x 系列中不會被移除。" -#: ../../library/stdtypes.rst:4492 +#: ../../library/stdtypes.rst:4505 msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." msgstr "``b'%r'`` 已被棄用,但在 3.x 系列中不會被移除。" -#: ../../library/stdtypes.rst:4504 +#: ../../library/stdtypes.rst:4517 msgid ":pep:`461` - Adding % formatting to bytes and bytearray" msgstr "" -#: ../../library/stdtypes.rst:4511 +#: ../../library/stdtypes.rst:4524 msgid "Memory Views" msgstr "" -#: ../../library/stdtypes.rst:4513 +#: ../../library/stdtypes.rst:4526 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:4519 +#: ../../library/stdtypes.rst:4532 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:4523 +#: ../../library/stdtypes.rst:4536 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 +6493,32 @@ msgid "" "other types such as :class:`array.array` may have bigger elements." msgstr "" -#: ../../library/stdtypes.rst:4528 +#: ../../library/stdtypes.rst:4541 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:4532 +#: ../../library/stdtypes.rst:4545 msgid "" "If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of " "returning 1." msgstr "" -#: ../../library/stdtypes.rst:4535 +#: ../../library/stdtypes.rst:4548 msgid "" "The :class:`~memoryview.itemsize` attribute will give you the number of " "bytes in a single element." msgstr "" -#: ../../library/stdtypes.rst:4538 +#: ../../library/stdtypes.rst:4551 msgid "" "A :class:`memoryview` supports slicing and indexing to expose its data. One-" "dimensional slicing will result in a subview::" msgstr "" -#: ../../library/stdtypes.rst:4541 +#: ../../library/stdtypes.rst:4554 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> v[1]\n" @@ -6515,7 +6540,7 @@ msgstr "" ">>> bytes(v[1:4])\n" "b'bce'" -#: ../../library/stdtypes.rst:4551 +#: ../../library/stdtypes.rst:4564 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 +6551,11 @@ msgid "" "memoryviews can be indexed with the empty tuple." msgstr "" -#: ../../library/stdtypes.rst:4560 +#: ../../library/stdtypes.rst:4573 msgid "Here is an example with a non-byte format::" msgstr "" -#: ../../library/stdtypes.rst:4562 +#: ../../library/stdtypes.rst:4575 msgid "" ">>> import array\n" ">>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444])\n" @@ -6552,13 +6577,13 @@ msgstr "" ">>> m[::2].tolist()\n" "[-11111111, -33333333]" -#: ../../library/stdtypes.rst:4572 +#: ../../library/stdtypes.rst:4585 msgid "" "If the underlying object is writable, the memoryview supports one-" "dimensional slice assignment. Resizing is not allowed::" msgstr "" -#: ../../library/stdtypes.rst:4575 +#: ../../library/stdtypes.rst:4588 msgid "" ">>> data = bytearray(b'abcefg')\n" ">>> v = memoryview(data)\n" @@ -6598,14 +6623,14 @@ msgstr "" ">>> data\n" "bytearray(b'z1spam')" -#: ../../library/stdtypes.rst:4593 +#: ../../library/stdtypes.rst:4606 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:4597 +#: ../../library/stdtypes.rst:4610 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> hash(v) == hash(b'abcefg')\n" @@ -6623,44 +6648,44 @@ msgstr "" ">>> hash(v[::-2]) == hash(b'abcefg'[::-2])\n" "True" -#: ../../library/stdtypes.rst:4605 +#: ../../library/stdtypes.rst:4618 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:4609 +#: ../../library/stdtypes.rst:4622 msgid "" "memoryview is now registered automatically with :class:`collections.abc." "Sequence`" msgstr "" -#: ../../library/stdtypes.rst:4613 +#: ../../library/stdtypes.rst:4626 msgid "memoryviews can now be indexed with tuple of integers." msgstr "" -#: ../../library/stdtypes.rst:4616 +#: ../../library/stdtypes.rst:4629 msgid "memoryview is now a :term:`generic type`." msgstr "" -#: ../../library/stdtypes.rst:4619 +#: ../../library/stdtypes.rst:4632 msgid ":class:`memoryview` has several methods:" msgstr ":class:`memoryview` 有幾個方法:" -#: ../../library/stdtypes.rst:4623 +#: ../../library/stdtypes.rst:4636 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:4627 +#: ../../library/stdtypes.rst:4640 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:4630 +#: ../../library/stdtypes.rst:4643 msgid "" ">>> import array\n" ">>> a = array.array('I', [1, 2, 3, 4, 5])\n" @@ -6694,14 +6719,14 @@ msgstr "" ">>> z.tolist() == c.tolist()\n" "True" -#: ../../library/stdtypes.rst:4646 +#: ../../library/stdtypes.rst:4659 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:4650 +#: ../../library/stdtypes.rst:4663 msgid "" ">>> from ctypes import BigEndianStructure, c_long\n" ">>> class BEPoint(BigEndianStructure):\n" @@ -6727,25 +6752,25 @@ msgstr "" ">>> a == b\n" "False" -#: ../../library/stdtypes.rst:4662 +#: ../../library/stdtypes.rst:4675 msgid "" "Note that, as with floating-point numbers, ``v is w`` does *not* imply ``v " "== w`` for memoryview objects." msgstr "" -#: ../../library/stdtypes.rst:4665 +#: ../../library/stdtypes.rst:4678 msgid "" "Previous versions compared the raw memory disregarding the item format and " "the logical array structure." msgstr "" -#: ../../library/stdtypes.rst:4671 +#: ../../library/stdtypes.rst:4684 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:4674 +#: ../../library/stdtypes.rst:4687 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.tobytes()\n" @@ -6759,7 +6784,7 @@ msgstr "" ">>> bytes(m)\n" "b'abc'" -#: ../../library/stdtypes.rst:4680 +#: ../../library/stdtypes.rst:4693 msgid "" "For non-contiguous arrays the result is equal to the flattened list " "representation with all elements converted to bytes. :meth:`tobytes` " @@ -6767,7 +6792,7 @@ msgid "" "module syntax." msgstr "" -#: ../../library/stdtypes.rst:4685 +#: ../../library/stdtypes.rst:4698 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 +6801,13 @@ msgid "" "to C first. *order=None* is the same as *order='C'*." msgstr "" -#: ../../library/stdtypes.rst:4695 +#: ../../library/stdtypes.rst:4708 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the buffer. ::" msgstr "" -#: ../../library/stdtypes.rst:4698 +#: ../../library/stdtypes.rst:4711 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.hex()\n" @@ -6792,18 +6817,18 @@ msgstr "" ">>> m.hex()\n" "'616263'" -#: ../../library/stdtypes.rst:4704 +#: ../../library/stdtypes.rst:4717 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:4711 +#: ../../library/stdtypes.rst:4724 msgid "Return the data in the buffer as a list of elements. ::" msgstr "" -#: ../../library/stdtypes.rst:4713 +#: ../../library/stdtypes.rst:4726 msgid "" ">>> memoryview(b'abc').tolist()\n" "[97, 98, 99]\n" @@ -6821,19 +6846,19 @@ msgstr "" ">>> m.tolist()\n" "[1.1, 2.2, 3.3]" -#: ../../library/stdtypes.rst:4721 +#: ../../library/stdtypes.rst:4734 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:4728 +#: ../../library/stdtypes.rst:4741 msgid "" "Return a readonly version of the memoryview object. The original memoryview " "object is unchanged. ::" msgstr "" -#: ../../library/stdtypes.rst:4731 +#: ../../library/stdtypes.rst:4744 msgid "" ">>> m = memoryview(bytearray(b'abc'))\n" ">>> mm = m.toreadonly()\n" @@ -6859,7 +6884,7 @@ msgstr "" ">>> mm.tolist()\n" "[43, 98, 99]" -#: ../../library/stdtypes.rst:4747 +#: ../../library/stdtypes.rst:4760 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 +6893,14 @@ msgid "" "resources) as soon as possible." msgstr "" -#: ../../library/stdtypes.rst:4753 +#: ../../library/stdtypes.rst:4766 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:4757 +#: ../../library/stdtypes.rst:4770 msgid "" ">>> m = memoryview(b'abc')\n" ">>> m.release()\n" @@ -6891,13 +6916,13 @@ msgstr "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" -#: ../../library/stdtypes.rst:4764 +#: ../../library/stdtypes.rst:4777 msgid "" "The context management protocol can be used for a similar effect, using the " "``with`` statement::" msgstr "" -#: ../../library/stdtypes.rst:4767 +#: ../../library/stdtypes.rst:4780 msgid "" ">>> with memoryview(b'abc') as m:\n" "... m[0]\n" @@ -6917,7 +6942,7 @@ msgstr "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" -#: ../../library/stdtypes.rst:4781 +#: ../../library/stdtypes.rst:4794 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 +6951,7 @@ msgid "" "contiguous -> 1D." msgstr "" -#: ../../library/stdtypes.rst:4787 +#: ../../library/stdtypes.rst:4800 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 +6959,11 @@ msgid "" "Note that all byte lengths may depend on the operating system." msgstr "" -#: ../../library/stdtypes.rst:4793 +#: ../../library/stdtypes.rst:4806 msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "" -#: ../../library/stdtypes.rst:4795 +#: ../../library/stdtypes.rst:4808 msgid "" ">>> import array\n" ">>> a = array.array('l', [1,2,3])\n" @@ -6982,11 +7007,11 @@ msgstr "" ">>> y.nbytes\n" "24" -#: ../../library/stdtypes.rst:4816 +#: ../../library/stdtypes.rst:4829 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "" -#: ../../library/stdtypes.rst:4818 +#: ../../library/stdtypes.rst:4831 msgid "" ">>> b = bytearray(b'zyz')\n" ">>> x = memoryview(b)\n" @@ -7010,11 +7035,11 @@ msgstr "" ">>> b\n" "bytearray(b'ayz')" -#: ../../library/stdtypes.rst:4829 +#: ../../library/stdtypes.rst:4842 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "" -#: ../../library/stdtypes.rst:4831 +#: ../../library/stdtypes.rst:4844 msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"i\"*12, *list(range(12)))\n" @@ -7064,11 +7089,11 @@ msgstr "" ">>> z.nbytes\n" "48" -#: ../../library/stdtypes.rst:4855 +#: ../../library/stdtypes.rst:4868 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "" -#: ../../library/stdtypes.rst:4857 +#: ../../library/stdtypes.rst:4870 msgid "" ">>> buf = struct.pack(\"L\"*6, *list(range(6)))\n" ">>> x = memoryview(buf)\n" @@ -7090,33 +7115,33 @@ msgstr "" ">>> y.tolist()\n" "[[0, 1, 2], [3, 4, 5]]" -#: ../../library/stdtypes.rst:4869 +#: ../../library/stdtypes.rst:4882 msgid "The source format is no longer restricted when casting to a byte view." msgstr "" -#: ../../library/stdtypes.rst:4874 +#: ../../library/stdtypes.rst:4887 msgid "Count the number of occurrences of *value*." msgstr "計算 *value* 的出現次數" -#: ../../library/stdtypes.rst:4880 +#: ../../library/stdtypes.rst:4893 msgid "" "Return the index of the first occurrence of *value* (at or after index " "*start* and before index *stop*)." msgstr "" -#: ../../library/stdtypes.rst:4883 +#: ../../library/stdtypes.rst:4896 msgid "Raises a :exc:`ValueError` if *value* cannot be found." msgstr "在找不到 *value* 時引發 :exc:`ValueError`。" -#: ../../library/stdtypes.rst:4887 +#: ../../library/stdtypes.rst:4900 msgid "There are also several readonly attributes available:" msgstr "" -#: ../../library/stdtypes.rst:4891 +#: ../../library/stdtypes.rst:4904 msgid "The underlying object of the memoryview::" msgstr "memoryview 的底層物件: ::" -#: ../../library/stdtypes.rst:4893 +#: ../../library/stdtypes.rst:4906 msgid "" ">>> b = bytearray(b'xyz')\n" ">>> m = memoryview(b)\n" @@ -7128,14 +7153,14 @@ msgstr "" ">>> m.obj is b\n" "True" -#: ../../library/stdtypes.rst:4902 +#: ../../library/stdtypes.rst:4915 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:4906 +#: ../../library/stdtypes.rst:4919 msgid "" ">>> import array\n" ">>> a = array.array('i', [1,2,3,4,5])\n" @@ -7167,11 +7192,11 @@ msgstr "" ">>> len(y.tobytes())\n" "12" -#: ../../library/stdtypes.rst:4921 +#: ../../library/stdtypes.rst:4934 msgid "Multi-dimensional arrays::" msgstr "" -#: ../../library/stdtypes.rst:4923 +#: ../../library/stdtypes.rst:4936 msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"d\"*12, *[1.5*x for x in range(12)])\n" @@ -7195,11 +7220,11 @@ msgstr "" ">>> y.nbytes\n" "96" -#: ../../library/stdtypes.rst:4938 +#: ../../library/stdtypes.rst:4951 msgid "A bool indicating whether the memory is read only." msgstr "" -#: ../../library/stdtypes.rst:4942 +#: ../../library/stdtypes.rst:4955 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 +7232,17 @@ msgid "" "restricted to native single element formats." msgstr "" -#: ../../library/stdtypes.rst:4947 +#: ../../library/stdtypes.rst:4960 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:4953 +#: ../../library/stdtypes.rst:4966 msgid "The size in bytes of each element of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4955 +#: ../../library/stdtypes.rst:4968 msgid "" ">>> import array, struct\n" ">>> m = memoryview(array.array('H', [32000, 32001, 32002]))\n" @@ -7237,49 +7262,49 @@ msgstr "" ">>> struct.calcsize('H') == m.itemsize\n" "True" -#: ../../library/stdtypes.rst:4966 +#: ../../library/stdtypes.rst:4979 msgid "" "An integer indicating how many dimensions of a multi-dimensional array the " "memory represents." msgstr "" -#: ../../library/stdtypes.rst:4971 +#: ../../library/stdtypes.rst:4984 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:4974 ../../library/stdtypes.rst:4982 +#: ../../library/stdtypes.rst:4987 ../../library/stdtypes.rst:4995 msgid "An empty tuple instead of ``None`` when ndim = 0." msgstr "" -#: ../../library/stdtypes.rst:4979 +#: ../../library/stdtypes.rst:4992 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:4987 +#: ../../library/stdtypes.rst:5000 msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" -#: ../../library/stdtypes.rst:4991 +#: ../../library/stdtypes.rst:5004 msgid "A bool indicating whether the memory is C-:term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4997 +#: ../../library/stdtypes.rst:5010 msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:5003 +#: ../../library/stdtypes.rst:5016 msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:5011 +#: ../../library/stdtypes.rst:5024 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "" -#: ../../library/stdtypes.rst:5015 +#: ../../library/stdtypes.rst:5028 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -7289,7 +7314,7 @@ msgid "" "`collections` module.)" msgstr "" -#: ../../library/stdtypes.rst:5022 +#: ../../library/stdtypes.rst:5035 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 " @@ -7297,7 +7322,7 @@ msgid "" "slicing, or other sequence-like behavior." msgstr "" -#: ../../library/stdtypes.rst:5027 +#: ../../library/stdtypes.rst:5040 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -7309,18 +7334,18 @@ msgid "" "of another set." msgstr "" -#: ../../library/stdtypes.rst:5036 +#: ../../library/stdtypes.rst:5049 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:5040 +#: ../../library/stdtypes.rst:5053 msgid "The constructors for both classes work the same:" msgstr "" -#: ../../library/stdtypes.rst:5045 +#: ../../library/stdtypes.rst:5058 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 " @@ -7328,92 +7353,92 @@ msgid "" "*iterable* is not specified, a new empty set is returned." msgstr "" -#: ../../library/stdtypes.rst:5051 +#: ../../library/stdtypes.rst:5064 msgid "Sets can be created by several means:" msgstr "集合可以以多種方式建立:" -#: ../../library/stdtypes.rst:5053 +#: ../../library/stdtypes.rst:5066 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:5054 +#: ../../library/stdtypes.rst:5067 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" -#: ../../library/stdtypes.rst:5055 +#: ../../library/stdtypes.rst:5068 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" msgstr "" -#: ../../library/stdtypes.rst:5057 +#: ../../library/stdtypes.rst:5070 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" msgstr "" -#: ../../library/stdtypes.rst:5062 +#: ../../library/stdtypes.rst:5075 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" -#: ../../library/stdtypes.rst:5066 +#: ../../library/stdtypes.rst:5079 msgid "Test *x* for membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:5070 +#: ../../library/stdtypes.rst:5083 msgid "Test *x* for non-membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:5075 +#: ../../library/stdtypes.rst:5088 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:5082 +#: ../../library/stdtypes.rst:5095 msgid "Test whether every element in the set is in *other*." msgstr "" -#: ../../library/stdtypes.rst:5086 +#: ../../library/stdtypes.rst:5099 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." msgstr "" -#: ../../library/stdtypes.rst:5093 +#: ../../library/stdtypes.rst:5106 msgid "Test whether every element in *other* is in the set." msgstr "" -#: ../../library/stdtypes.rst:5097 +#: ../../library/stdtypes.rst:5110 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." msgstr "" -#: ../../library/stdtypes.rst:5104 +#: ../../library/stdtypes.rst:5117 msgid "Return a new set with elements from the set and all others." msgstr "" -#: ../../library/stdtypes.rst:5110 +#: ../../library/stdtypes.rst:5123 msgid "Return a new set with elements common to the set and all others." msgstr "" -#: ../../library/stdtypes.rst:5116 +#: ../../library/stdtypes.rst:5129 msgid "Return a new set with elements in the set that are not in the others." msgstr "" -#: ../../library/stdtypes.rst:5122 +#: ../../library/stdtypes.rst:5135 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" -#: ../../library/stdtypes.rst:5127 +#: ../../library/stdtypes.rst:5140 msgid "Return a shallow copy of the set." msgstr "" -#: ../../library/stdtypes.rst:5130 +#: ../../library/stdtypes.rst:5143 msgid "" "Note, the non-operator versions of :meth:`~frozenset.union`, :meth:" "`~frozenset.intersection`, :meth:`~frozenset.difference`, :meth:`~frozenset." @@ -7424,7 +7449,7 @@ msgid "" "the more readable ``set('abc').intersection('cbs')``." msgstr "" -#: ../../library/stdtypes.rst:5137 +#: ../../library/stdtypes.rst:5150 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 " @@ -7434,14 +7459,14 @@ msgid "" "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -#: ../../library/stdtypes.rst:5144 +#: ../../library/stdtypes.rst:5157 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:5148 +#: ../../library/stdtypes.rst:5161 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 " @@ -7449,78 +7474,78 @@ msgid "" "``ab``." msgstr "" -#: ../../library/stdtypes.rst:5153 +#: ../../library/stdtypes.rst:5166 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:5156 +#: ../../library/stdtypes.rst:5169 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:5158 +#: ../../library/stdtypes.rst:5171 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:5162 +#: ../../library/stdtypes.rst:5175 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" msgstr "" -#: ../../library/stdtypes.rst:5168 +#: ../../library/stdtypes.rst:5181 msgid "Update the set, adding elements from all others." msgstr "" -#: ../../library/stdtypes.rst:5173 +#: ../../library/stdtypes.rst:5186 msgid "Update the set, keeping only elements found in it and all others." msgstr "" -#: ../../library/stdtypes.rst:5178 +#: ../../library/stdtypes.rst:5191 msgid "Update the set, removing elements found in others." msgstr "" -#: ../../library/stdtypes.rst:5183 +#: ../../library/stdtypes.rst:5196 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" -#: ../../library/stdtypes.rst:5187 +#: ../../library/stdtypes.rst:5200 msgid "Add element *elem* to the set." msgstr "將元素 *elem* 加入集合。" -#: ../../library/stdtypes.rst:5191 +#: ../../library/stdtypes.rst:5204 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." msgstr "" -#: ../../library/stdtypes.rst:5196 +#: ../../library/stdtypes.rst:5209 msgid "Remove element *elem* from the set if it is present." msgstr "如果 *elem* 存在於集合中則將其移除。" -#: ../../library/stdtypes.rst:5200 +#: ../../library/stdtypes.rst:5213 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." msgstr "" -#: ../../library/stdtypes.rst:5205 +#: ../../library/stdtypes.rst:5218 msgid "Remove all elements from the set." msgstr "從集合中移除所有元素。" -#: ../../library/stdtypes.rst:5208 +#: ../../library/stdtypes.rst:5221 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:5213 +#: ../../library/stdtypes.rst:5226 msgid "" "Note, the *elem* argument to the :meth:`~object.__contains__`, :meth:`~set." "remove`, and :meth:`~set.discard` methods may be a set. To support " @@ -7528,11 +7553,11 @@ msgid "" "*elem*." msgstr "" -#: ../../library/stdtypes.rst:5222 +#: ../../library/stdtypes.rst:5235 msgid "Mapping Types --- :class:`dict`" msgstr "" -#: ../../library/stdtypes.rst:5232 +#: ../../library/stdtypes.rst:5245 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -7541,7 +7566,7 @@ msgid "" "module.)" msgstr "" -#: ../../library/stdtypes.rst:5238 +#: ../../library/stdtypes.rst:5251 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -7550,33 +7575,33 @@ msgid "" "and ``True``) can be used interchangeably to index the same dictionary entry." msgstr "" -#: ../../library/stdtypes.rst:5249 +#: ../../library/stdtypes.rst:5262 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:5252 +#: ../../library/stdtypes.rst:5265 msgid "Dictionaries can be created by several means:" msgstr "字典可以用數種方式建立:" -#: ../../library/stdtypes.rst:5254 +#: ../../library/stdtypes.rst:5267 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:5256 +#: ../../library/stdtypes.rst:5269 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" -#: ../../library/stdtypes.rst:5257 +#: ../../library/stdtypes.rst:5270 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" msgstr "" -#: ../../library/stdtypes.rst:5260 +#: ../../library/stdtypes.rst:5273 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 " @@ -7589,7 +7614,7 @@ msgid "" "that key becomes the corresponding value in the new dictionary." msgstr "" -#: ../../library/stdtypes.rst:5270 +#: ../../library/stdtypes.rst:5283 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 " @@ -7597,7 +7622,7 @@ msgid "" "the value from the positional argument." msgstr "" -#: ../../library/stdtypes.rst:5275 +#: ../../library/stdtypes.rst:5288 msgid "" "Dictionaries compare equal if and only if they have the same ``(key, " "value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', " @@ -7606,7 +7631,7 @@ msgid "" "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -#: ../../library/stdtypes.rst:5281 +#: ../../library/stdtypes.rst:5294 msgid "" ">>> a = dict(one=1, two=2, three=3)\n" ">>> b = {'one': 1, 'two': 2, 'three': 3}\n" @@ -7626,19 +7651,19 @@ msgstr "" ">>> a == b == c == d == e == f\n" "True" -#: ../../library/stdtypes.rst:5290 +#: ../../library/stdtypes.rst:5303 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:5293 +#: ../../library/stdtypes.rst:5306 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:5296 +#: ../../library/stdtypes.rst:5309 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -7670,33 +7695,33 @@ msgstr "" ">>> d\n" "{'one': 42, 'three': 3, 'four': 4, 'two': None}" -#: ../../library/stdtypes.rst:5311 +#: ../../library/stdtypes.rst:5324 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:5315 +#: ../../library/stdtypes.rst:5328 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -#: ../../library/stdtypes.rst:5320 +#: ../../library/stdtypes.rst:5333 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:5324 +#: ../../library/stdtypes.rst:5337 msgid "Return the number of items in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:5328 +#: ../../library/stdtypes.rst:5341 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." msgstr "" -#: ../../library/stdtypes.rst:5333 +#: ../../library/stdtypes.rst:5346 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 " @@ -7707,7 +7732,7 @@ msgid "" "__missing__` must be a method; it cannot be an instance variable::" msgstr "" -#: ../../library/stdtypes.rst:5341 +#: ../../library/stdtypes.rst:5354 msgid "" ">>> class Counter(dict):\n" "... def __missing__(self, key):\n" @@ -7731,51 +7756,51 @@ msgstr "" ">>> c['red']\n" "1" -#: ../../library/stdtypes.rst:5352 +#: ../../library/stdtypes.rst:5365 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:5359 +#: ../../library/stdtypes.rst:5372 msgid "Set ``d[key]`` to *value*." msgstr "將 ``d[key]`` 設為 *value*。" -#: ../../library/stdtypes.rst:5363 +#: ../../library/stdtypes.rst:5376 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:5368 +#: ../../library/stdtypes.rst:5381 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "若 *d* 有鍵 *key* 則回傳 ``True``,否則回傳 ``False``。" -#: ../../library/stdtypes.rst:5372 +#: ../../library/stdtypes.rst:5385 msgid "Equivalent to ``not key in d``." msgstr "等價於 ``not key in d``。" -#: ../../library/stdtypes.rst:5376 +#: ../../library/stdtypes.rst:5389 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:5381 +#: ../../library/stdtypes.rst:5394 msgid "Remove all items from the dictionary." msgstr "從字典中移除所有項目。" -#: ../../library/stdtypes.rst:5385 +#: ../../library/stdtypes.rst:5398 msgid "Return a shallow copy of the dictionary." msgstr "" -#: ../../library/stdtypes.rst:5389 +#: ../../library/stdtypes.rst:5402 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" -#: ../../library/stdtypes.rst:5391 +#: ../../library/stdtypes.rst:5404 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 " @@ -7784,70 +7809,70 @@ msgid "" "` instead." msgstr "" -#: ../../library/stdtypes.rst:5399 +#: ../../library/stdtypes.rst:5412 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:5405 +#: ../../library/stdtypes.rst:5418 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." msgstr "" -#: ../../library/stdtypes.rst:5410 +#: ../../library/stdtypes.rst:5423 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." msgstr "" -#: ../../library/stdtypes.rst:5416 +#: ../../library/stdtypes.rst:5429 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:5422 +#: ../../library/stdtypes.rst:5435 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:5425 +#: ../../library/stdtypes.rst:5438 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:5429 +#: ../../library/stdtypes.rst:5442 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." msgstr "" -#: ../../library/stdtypes.rst:5435 +#: ../../library/stdtypes.rst:5448 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:5442 +#: ../../library/stdtypes.rst:5455 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:5450 +#: ../../library/stdtypes.rst:5463 msgid "" "Update the dictionary with the key/value pairs from *mapping* or *iterable* " "and *kwargs*, overwriting existing keys. Return ``None``." msgstr "" -#: ../../library/stdtypes.rst:5453 +#: ../../library/stdtypes.rst:5466 msgid "" ":meth:`update` accepts either another object with a ``keys()`` method (in " "which case :meth:`~object.__getitem__` is called with every key returned " @@ -7856,20 +7881,20 @@ msgid "" "is then updated with those key/value pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:5461 +#: ../../library/stdtypes.rst:5474 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:5464 +#: ../../library/stdtypes.rst:5477 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:5468 +#: ../../library/stdtypes.rst:5481 msgid "" ">>> d = {'a': 1}\n" ">>> d.values() == d.values()\n" @@ -7879,25 +7904,25 @@ msgstr "" ">>> d.values() == d.values()\n" "False" -#: ../../library/stdtypes.rst:5474 +#: ../../library/stdtypes.rst:5487 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:5482 +#: ../../library/stdtypes.rst:5495 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:5488 +#: ../../library/stdtypes.rst:5501 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:5490 +#: ../../library/stdtypes.rst:5503 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -7919,21 +7944,21 @@ msgstr "" ">>> list(reversed(d.items()))\n" "[('four', 4), ('three', 3), ('two', 2), ('one', 1)]" -#: ../../library/stdtypes.rst:5500 +#: ../../library/stdtypes.rst:5513 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:5505 +#: ../../library/stdtypes.rst:5518 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:5512 +#: ../../library/stdtypes.rst:5525 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:5514 +#: ../../library/stdtypes.rst:5527 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 " @@ -7941,23 +7966,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:5519 +#: ../../library/stdtypes.rst:5532 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:5524 +#: ../../library/stdtypes.rst:5537 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:5528 +#: ../../library/stdtypes.rst:5541 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:5531 +#: ../../library/stdtypes.rst:5544 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -7965,39 +7990,39 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:5536 +#: ../../library/stdtypes.rst:5549 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:5539 +#: ../../library/stdtypes.rst:5552 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:5544 +#: ../../library/stdtypes.rst:5557 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:5549 +#: ../../library/stdtypes.rst:5562 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:5552 +#: ../../library/stdtypes.rst:5565 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:5557 +#: ../../library/stdtypes.rst:5570 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:5562 +#: ../../library/stdtypes.rst:5575 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 " @@ -8011,11 +8036,11 @@ msgid "" "input." msgstr "" -#: ../../library/stdtypes.rst:5574 +#: ../../library/stdtypes.rst:5587 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:5576 +#: ../../library/stdtypes.rst:5589 msgid "" ">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" ">>> keys = dishes.keys()\n" @@ -8056,11 +8081,11 @@ msgid "" "500" msgstr "" -#: ../../library/stdtypes.rst:5618 +#: ../../library/stdtypes.rst:5631 msgid "Context Manager Types" msgstr "情境管理器型別" -#: ../../library/stdtypes.rst:5625 +#: ../../library/stdtypes.rst:5638 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 " @@ -8071,7 +8096,7 @@ msgstr "" "要使用兩個方法來實作,該方法讓使用者定義類別能夠去定義 runtime 情境,且該情境" "在執行陳述式主體 (statement body) 之前進入、在陳述式結束時退出:" -#: ../../library/stdtypes.rst:5633 +#: ../../library/stdtypes.rst:5646 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 " @@ -8082,7 +8107,7 @@ msgstr "" "的值有被綁定到使用此情境管理器的 :keyword:`with` 陳述式的 :keyword:`!as` 子句" "中的識別字。" -#: ../../library/stdtypes.rst:5638 +#: ../../library/stdtypes.rst:5651 msgid "" "An example of a context manager that returns itself is a :term:`file " "object`. File objects return themselves from __enter__() to allow :func:" @@ -8091,7 +8116,7 @@ msgstr "" "一個會回傳自己的情境管理器範例是 :term:`file object`。檔案物件從 __enter__() " "回傳自己,以允許將 :func:`open` 用作 :keyword:`with` 陳述式中的情境運算式。" -#: ../../library/stdtypes.rst:5642 +#: ../../library/stdtypes.rst:5655 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 " @@ -8105,7 +8130,7 @@ msgstr "" "本。這允許對 :keyword:`with` 陳述式主體中的目前十進位情境進行更改,而不會影" "響 :keyword:`!with` 陳述式外部的程式碼。" -#: ../../library/stdtypes.rst:5652 +#: ../../library/stdtypes.rst:5665 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -8117,7 +8142,7 @@ msgstr "" "keyword:`with` 陳述式主體時發生例外,則引數包含例外型別、值和回溯 " "(traceback) 資訊。否則,所有三個引數都是 ``None``。" -#: ../../library/stdtypes.rst:5657 +#: ../../library/stdtypes.rst:5670 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -8128,14 +8153,14 @@ msgstr "" "keyword:`!with` 陳述式之後的陳述式。否則,該例外將在該方法執行完畢後繼續傳播 " "(propagate)。" -#: ../../library/stdtypes.rst:5662 +#: ../../library/stdtypes.rst:5675 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:5666 +#: ../../library/stdtypes.rst:5679 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -8147,7 +8172,7 @@ msgstr "" "已成功完成且不希望抑制引發的例外。這讓情境管理程式碼能輕鬆檢測 :meth:" "`~object.__exit__` 方法是否曾實際失敗過。" -#: ../../library/stdtypes.rst:5672 +#: ../../library/stdtypes.rst:5685 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -8159,7 +8184,7 @@ msgstr "" "及對有效十進位算術情境的更簡單操作。除了情境管理協定的實作之外,不會對特定型" "別進行特殊處理。更多範例請參閱 :mod:`contextlib` 模組。" -#: ../../library/stdtypes.rst:5678 +#: ../../library/stdtypes.rst:5691 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -8174,7 +8199,7 @@ msgstr "" "`~contextmanager.__enter__` 和 :meth:`~contextmanager.__exit__` 方法的情境管" "理器,而不是由未裝飾產生器函式產生的疊代器。" -#: ../../library/stdtypes.rst:5685 +#: ../../library/stdtypes.rst:5698 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 " @@ -8186,7 +8211,7 @@ msgstr "" "定義這些方法的擴充型別必須將它們作為普通的 Python 可存取方法提供。與設定 " "runtime 情境的開銷相比,單一類別字典查找的開銷可以忽略不計。" -#: ../../library/stdtypes.rst:5693 +#: ../../library/stdtypes.rst:5706 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" @@ -8194,7 +8219,7 @@ msgstr "" "型別註釋的型別 --- :ref:`泛型別名 (Generic Alias) `、:" "ref:`聯合 (Union) `" -#: ../../library/stdtypes.rst:5698 +#: ../../library/stdtypes.rst:5711 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." @@ -8202,11 +8227,11 @@ msgstr "" ":term:`型別註釋 ` 的核心內建型別是\\ :ref:`泛型別名 `\\ 和\\ :ref:`聯合 `。" -#: ../../library/stdtypes.rst:5705 +#: ../../library/stdtypes.rst:5718 msgid "Generic Alias Type" msgstr "泛型別名型別" -#: ../../library/stdtypes.rst:5711 +#: ../../library/stdtypes.rst:5724 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -8222,7 +8247,7 @@ msgstr "" "立的。``GenericAlias`` 物件主要會與\\ :term:`型別註釋 ` 一起使" "用。" -#: ../../library/stdtypes.rst:5721 +#: ../../library/stdtypes.rst:5734 msgid "" "It is generally only possible to subscript a class if the class implements " "the special method :meth:`~object.__class_getitem__`." @@ -8230,7 +8255,7 @@ msgstr "" "通常只有當類別有實作特殊方法 :meth:`~object.__class_getitem__` 時才可以去下標" "該類別。" -#: ../../library/stdtypes.rst:5724 +#: ../../library/stdtypes.rst:5737 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." @@ -8238,7 +8263,7 @@ msgstr "" "將一個 ``GenericAlias`` 物件用作 :term:`generic type` 的代理,實作\\ *參數化" "泛型 (parameterized generics)*。" -#: ../../library/stdtypes.rst:5727 +#: ../../library/stdtypes.rst:5740 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 " @@ -8250,7 +8275,7 @@ msgstr "" "物件所包含元素的型別。例如 ``set[bytes]`` 可以用於型別註釋來表示一個 :class:" "`set`,其中所有元素的型別都是 :class:`bytes`。" -#: ../../library/stdtypes.rst:5733 +#: ../../library/stdtypes.rst:5746 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 " @@ -8262,7 +8287,7 @@ msgstr "" "標引數通常會指示物件上有定義的一個或多個方法的回傳型別。例如\\ :mod:`正規表示" "式 `\\ 可以用於 :class:`str` 和 :class:`bytes` 資料型別:" -#: ../../library/stdtypes.rst:5739 +#: ../../library/stdtypes.rst:5752 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 " @@ -8274,7 +8299,7 @@ msgstr "" "別。我們就可以用 ``GenericAlias`` ``re.Match[str]`` 在型別註釋中表示這種物" "件。" -#: ../../library/stdtypes.rst:5745 +#: ../../library/stdtypes.rst:5758 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." @@ -8287,7 +8312,7 @@ msgstr "" "別都是 :class:`bytes`。在型別註釋中,我們將用 ``re.Match[bytes]`` 來表示各" "種 :ref:`re.Match ` 物件。" -#: ../../library/stdtypes.rst:5751 +#: ../../library/stdtypes.rst:5764 msgid "" "``GenericAlias`` objects are instances of the class :class:`types." "GenericAlias`, which can also be used to create ``GenericAlias`` objects " @@ -8296,7 +8321,7 @@ msgstr "" "``GenericAlias`` 物件是 :class:`types.GenericAlias` 類別的實例,也可以用來直" "接建立 ``GenericAlias`` 物件。" -#: ../../library/stdtypes.rst:5757 +#: ../../library/stdtypes.rst:5770 msgid "" "Creates a ``GenericAlias`` representing a type ``T`` parameterized by types " "*X*, *Y*, and more depending on the ``T`` used. For example, a function " @@ -8306,7 +8331,7 @@ msgstr "" "所使用的 ``T``)來參數化。例如,一個函式需要一個包含 :class:`float` 元素的 :" "class:`list`: ::" -#: ../../library/stdtypes.rst:5762 +#: ../../library/stdtypes.rst:5775 msgid "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" @@ -8314,7 +8339,7 @@ msgstr "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" -#: ../../library/stdtypes.rst:5765 +#: ../../library/stdtypes.rst:5778 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 " @@ -8325,7 +8350,7 @@ msgstr "" "別,需要兩個型別參數,分別表示鍵型別和值型別。在此範例中,函式需要一個 " "``dict``,其帶有 :class:`str` 型別的鍵和 :class:`int` 型別的值: ::" -#: ../../library/stdtypes.rst:5770 +#: ../../library/stdtypes.rst:5783 msgid "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." @@ -8333,7 +8358,7 @@ msgstr "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." -#: ../../library/stdtypes.rst:5773 +#: ../../library/stdtypes.rst:5786 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" @@ -8341,7 +8366,7 @@ msgstr "" "內建函式 :func:`isinstance` 和 :func:`issubclass` 不接受 ``GenericAlias`` 型" "別作為第二個引數: ::" -#: ../../library/stdtypes.rst:5776 +#: ../../library/stdtypes.rst:5789 msgid "" ">>> isinstance([1, 2], list[str])\n" "Traceback (most recent call last):\n" @@ -8353,7 +8378,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: isinstance() argument 2 cannot be a parameterized generic" -#: ../../library/stdtypes.rst:5781 +#: ../../library/stdtypes.rst:5794 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -8365,7 +8390,7 @@ msgstr "" "及其型別參數。當從 ``GenericAlias`` 建立容器物件時,不會檢查容器中元素的型" "別。例如,不鼓勵使用以下程式碼,但 runtime 不會出現錯誤: ::" -#: ../../library/stdtypes.rst:5787 +#: ../../library/stdtypes.rst:5800 msgid "" ">>> t = list[str]\n" ">>> t([1, 2, 3])\n" @@ -8375,13 +8400,13 @@ msgstr "" ">>> t([1, 2, 3])\n" "[1, 2, 3]" -#: ../../library/stdtypes.rst:5791 +#: ../../library/stdtypes.rst:5804 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "此外,參數化泛型在物件建立期間會擦除 (erase) 型別參數: ::" -#: ../../library/stdtypes.rst:5794 +#: ../../library/stdtypes.rst:5807 msgid "" ">>> t = list[str]\n" ">>> type(t)\n" @@ -8399,13 +8424,13 @@ msgstr "" ">>> type(l)\n" "" -#: ../../library/stdtypes.rst:5802 +#: ../../library/stdtypes.rst:5815 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "在泛型上呼叫 :func:`repr` 或 :func:`str` 會顯示參數化型別: ::" -#: ../../library/stdtypes.rst:5804 +#: ../../library/stdtypes.rst:5817 msgid "" ">>> repr(list[int])\n" "'list[int]'\n" @@ -8419,7 +8444,7 @@ msgstr "" ">>> str(list[int])\n" "'list[int]'" -#: ../../library/stdtypes.rst:5810 +#: ../../library/stdtypes.rst:5823 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" @@ -8427,7 +8452,7 @@ msgstr "" "為防止像是 ``dict[str][str]`` 的錯誤出現,泛型容器的 :meth:`~object." "__getitem__` 方法會在這種情況下引發例外: ::" -#: ../../library/stdtypes.rst:5813 +#: ../../library/stdtypes.rst:5826 msgid "" ">>> dict[str][str]\n" "Traceback (most recent call last):\n" @@ -8439,7 +8464,7 @@ msgstr "" " ...\n" "TypeError: dict[str] is not a generic class" -#: ../../library/stdtypes.rst:5818 +#: ../../library/stdtypes.rst:5831 msgid "" "However, such expressions are valid when :ref:`type variables ` " "are used. The index must have as many elements as there are type variable " @@ -8449,7 +8474,7 @@ msgstr "" "的。索引的元素數量必須與 ``GenericAlias`` 物件的 :attr:`~genericalias." "__args__` 中的型別變數項目一樣多: ::" -#: ../../library/stdtypes.rst:5822 +#: ../../library/stdtypes.rst:5835 msgid "" ">>> from typing import TypeVar\n" ">>> Y = TypeVar('Y')\n" @@ -8461,253 +8486,253 @@ msgstr "" ">>> dict[str, Y][int]\n" "dict[str, int]" -#: ../../library/stdtypes.rst:5829 +#: ../../library/stdtypes.rst:5842 msgid "Standard Generic Classes" msgstr "標準泛型類別" -#: ../../library/stdtypes.rst:5831 +#: ../../library/stdtypes.rst:5844 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "以下標準函式庫類別有支援參數化泛型。此列表並非詳盡無遺。" -#: ../../library/stdtypes.rst:5834 +#: ../../library/stdtypes.rst:5847 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:5835 +#: ../../library/stdtypes.rst:5848 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:5836 +#: ../../library/stdtypes.rst:5849 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:5837 +#: ../../library/stdtypes.rst:5850 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:5838 +#: ../../library/stdtypes.rst:5851 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:5839 +#: ../../library/stdtypes.rst:5852 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:5840 +#: ../../library/stdtypes.rst:5853 msgid ":class:`asyncio.Future`" msgstr ":class:`asyncio.Future`" -#: ../../library/stdtypes.rst:5841 +#: ../../library/stdtypes.rst:5854 msgid ":class:`asyncio.Task`" msgstr ":class:`asyncio.Task`" -#: ../../library/stdtypes.rst:5842 +#: ../../library/stdtypes.rst:5855 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:5843 +#: ../../library/stdtypes.rst:5856 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:5844 +#: ../../library/stdtypes.rst:5857 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:5845 +#: ../../library/stdtypes.rst:5858 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:5846 +#: ../../library/stdtypes.rst:5859 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:5847 +#: ../../library/stdtypes.rst:5860 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:5848 +#: ../../library/stdtypes.rst:5861 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:5849 +#: ../../library/stdtypes.rst:5862 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:5850 +#: ../../library/stdtypes.rst:5863 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:5851 +#: ../../library/stdtypes.rst:5864 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:5852 +#: ../../library/stdtypes.rst:5865 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:5853 +#: ../../library/stdtypes.rst:5866 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:5854 +#: ../../library/stdtypes.rst:5867 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:5855 +#: ../../library/stdtypes.rst:5868 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:5856 +#: ../../library/stdtypes.rst:5869 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:5857 +#: ../../library/stdtypes.rst:5870 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:5858 +#: ../../library/stdtypes.rst:5871 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:5859 +#: ../../library/stdtypes.rst:5872 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:5860 +#: ../../library/stdtypes.rst:5873 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:5861 +#: ../../library/stdtypes.rst:5874 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:5862 +#: ../../library/stdtypes.rst:5875 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:5863 +#: ../../library/stdtypes.rst:5876 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:5864 +#: ../../library/stdtypes.rst:5877 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:5865 +#: ../../library/stdtypes.rst:5878 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:5866 +#: ../../library/stdtypes.rst:5879 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:5867 +#: ../../library/stdtypes.rst:5880 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:5868 +#: ../../library/stdtypes.rst:5881 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:5869 +#: ../../library/stdtypes.rst:5882 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:5870 +#: ../../library/stdtypes.rst:5883 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:5871 +#: ../../library/stdtypes.rst:5884 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:5872 +#: ../../library/stdtypes.rst:5885 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:5873 +#: ../../library/stdtypes.rst:5886 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:5874 +#: ../../library/stdtypes.rst:5887 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:5875 +#: ../../library/stdtypes.rst:5888 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:5876 +#: ../../library/stdtypes.rst:5889 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:5877 +#: ../../library/stdtypes.rst:5890 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:5878 +#: ../../library/stdtypes.rst:5891 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:5879 +#: ../../library/stdtypes.rst:5892 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:5880 +#: ../../library/stdtypes.rst:5893 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:5881 +#: ../../library/stdtypes.rst:5894 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:5882 +#: ../../library/stdtypes.rst:5895 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:5883 +#: ../../library/stdtypes.rst:5896 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5884 +#: ../../library/stdtypes.rst:5897 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5885 +#: ../../library/stdtypes.rst:5898 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5886 +#: ../../library/stdtypes.rst:5899 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5887 +#: ../../library/stdtypes.rst:5900 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5888 +#: ../../library/stdtypes.rst:5901 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5889 +#: ../../library/stdtypes.rst:5902 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5894 +#: ../../library/stdtypes.rst:5907 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "``GenericAlias`` 物件的特殊屬性" -#: ../../library/stdtypes.rst:5896 +#: ../../library/stdtypes.rst:5909 msgid "All parameterized generics implement special read-only attributes." msgstr "所有參數化泛型都有實作特殊的唯讀屬性。" -#: ../../library/stdtypes.rst:5900 +#: ../../library/stdtypes.rst:5913 msgid "This attribute points at the non-parameterized generic class::" msgstr "此屬性指向非參數化泛型類別: ::" -#: ../../library/stdtypes.rst:5902 +#: ../../library/stdtypes.rst:5915 msgid "" ">>> list[int].__origin__\n" "" @@ -8715,7 +8740,7 @@ msgstr "" ">>> list[int].__origin__\n" "" -#: ../../library/stdtypes.rst:5908 +#: ../../library/stdtypes.rst:5921 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 " @@ -8724,7 +8749,7 @@ msgstr "" "此屬性是傳遞給泛型類別之原始 :meth:`~object.__class_getitem__` 的泛型型別 :" "class:`tuple`\\ (長度可以為 1): ::" -#: ../../library/stdtypes.rst:5912 +#: ../../library/stdtypes.rst:5925 msgid "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" @@ -8732,7 +8757,7 @@ msgstr "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" -#: ../../library/stdtypes.rst:5918 +#: ../../library/stdtypes.rst:5931 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" @@ -8740,7 +8765,7 @@ msgstr "" "此屬性是個會被延遲計算 (lazily computed) 的元組(可能為空),包含了在 " "``__args__`` 中找得到的不重複型別變數: ::" -#: ../../library/stdtypes.rst:5921 +#: ../../library/stdtypes.rst:5934 msgid "" ">>> from typing import TypeVar\n" "\n" @@ -8754,7 +8779,7 @@ msgstr "" ">>> list[T].__parameters__\n" "(~T,)" -#: ../../library/stdtypes.rst:5929 +#: ../../library/stdtypes.rst:5942 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " "have correct ``__parameters__`` after substitution because :class:`typing." @@ -8764,7 +8789,7 @@ msgstr "" "有正確的 ``__parameters__``,因為 :class:`typing.ParamSpec` 主要用於靜態型別" "檢查。" -#: ../../library/stdtypes.rst:5936 +#: ../../library/stdtypes.rst:5949 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." @@ -8772,19 +8797,19 @@ msgstr "" "如果別名已使用 ``*`` 運算子解包 (unpack) 則為 true 的布林值(請參閱 :data:" "`~typing.TypeVarTuple`\\ )。" -#: ../../library/stdtypes.rst:5944 +#: ../../library/stdtypes.rst:5957 msgid ":pep:`484` - Type Hints" msgstr ":pep:`484` - 型別提示" -#: ../../library/stdtypes.rst:5945 +#: ../../library/stdtypes.rst:5958 msgid "Introducing Python's framework for type annotations." msgstr "引入 Python 的型別註釋框架。" -#: ../../library/stdtypes.rst:5947 +#: ../../library/stdtypes.rst:5960 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr ":pep:`585` - 標準集合 (Standard Collections) 中的型別提示泛型" -#: ../../library/stdtypes.rst:5948 +#: ../../library/stdtypes.rst:5961 msgid "" "Introducing the ability to natively parameterize standard-library classes, " "provided they implement the special class method :meth:`~object." @@ -8793,7 +8818,7 @@ msgstr "" "引入原生參數化標準函式庫類別的能力,前提是它們有實作特殊的類別方法 :meth:" "`~object.__class_getitem__`。" -#: ../../library/stdtypes.rst:5952 +#: ../../library/stdtypes.rst:5965 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" @@ -8801,18 +8826,18 @@ msgstr "" ":ref:`Generics`、:ref:`使用者定義泛型 `\\ 和 :class:" "`typing.Generic`" -#: ../../library/stdtypes.rst:5953 +#: ../../library/stdtypes.rst:5966 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:5962 +#: ../../library/stdtypes.rst:5975 msgid "Union Type" msgstr "聯合型別 (Union Type)" -#: ../../library/stdtypes.rst:5968 +#: ../../library/stdtypes.rst:5981 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -8825,7 +8850,7 @@ msgstr "" "釋 (type annotation) `。與下標 :data:`typing.Union` 相比,聯合型" "別運算式可以讓型別提示語法更清晰簡潔。" -#: ../../library/stdtypes.rst:5975 +#: ../../library/stdtypes.rst:5988 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 " @@ -8836,7 +8861,7 @@ msgstr "" "``typing.Union[X, Y]``。舉例來說,下列函式需要一個型別為 :class:`int` 或 :" "class:`float` 的引數: ::" -#: ../../library/stdtypes.rst:5980 +#: ../../library/stdtypes.rst:5993 msgid "" "def square(number: int | float) -> int | float:\n" " return number ** 2" @@ -8844,7 +8869,7 @@ msgstr "" "def square(number: int | float) -> int | float:\n" " return number ** 2" -#: ../../library/stdtypes.rst:5985 +#: ../../library/stdtypes.rst:5998 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 " @@ -8857,40 +8882,40 @@ msgstr "" "義類別的參照,將在 runtime 失敗。對於包含向前參照的聯合,請將整個運算式以字串" "呈現,例如 ``\"int | Foo\"``。" -#: ../../library/stdtypes.rst:5993 +#: ../../library/stdtypes.rst:6006 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "聯合物件可以與其他聯合物件一起進行相等性測試。細節如下:" -#: ../../library/stdtypes.rst:5995 +#: ../../library/stdtypes.rst:6008 msgid "Unions of unions are flattened::" msgstr "聯合的聯合會被扁平化: ::" -#: ../../library/stdtypes.rst:5997 +#: ../../library/stdtypes.rst:6010 msgid "(int | str) | float == int | str | float" msgstr "(int | str) | float == int | str | float" -#: ../../library/stdtypes.rst:5999 +#: ../../library/stdtypes.rst:6012 msgid "Redundant types are removed::" msgstr "冗餘型別會被刪除: ::" -#: ../../library/stdtypes.rst:6001 +#: ../../library/stdtypes.rst:6014 msgid "int | str | int == int | str" msgstr "int | str | int == int | str" -#: ../../library/stdtypes.rst:6003 +#: ../../library/stdtypes.rst:6016 msgid "When comparing unions, the order is ignored::" msgstr "比較聯合時,順序會被忽略: ::" -#: ../../library/stdtypes.rst:6005 +#: ../../library/stdtypes.rst:6018 msgid "int | str == str | int" msgstr "int | str == str | int" -#: ../../library/stdtypes.rst:6007 +#: ../../library/stdtypes.rst:6020 msgid "It creates instances of :class:`typing.Union`::" msgstr "它會建立 :class:`typing.Union` 的實例: ::" -#: ../../library/stdtypes.rst:6009 +#: ../../library/stdtypes.rst:6022 msgid "" "int | str == typing.Union[int, str]\n" "type(int | str) is typing.Union" @@ -8898,21 +8923,21 @@ msgstr "" "int | str == typing.Union[int, str]\n" "type(int | str) is typing.Union" -#: ../../library/stdtypes.rst:6012 +#: ../../library/stdtypes.rst:6025 msgid "Optional types can be spelled as a union with ``None``::" msgstr "可選型別可以表示為與 ``None`` 的聯合: ::" -#: ../../library/stdtypes.rst:6014 +#: ../../library/stdtypes.rst:6027 msgid "str | None == typing.Optional[str]" msgstr "str | None == typing.Optional[str]" -#: ../../library/stdtypes.rst:6019 +#: ../../library/stdtypes.rst:6032 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "聯合物件也支援 :func:`isinstance` 和 :func:`issubclass` 的呼叫: ::" -#: ../../library/stdtypes.rst:6022 +#: ../../library/stdtypes.rst:6035 msgid "" ">>> isinstance(\"\", int | str)\n" "True" @@ -8920,14 +8945,14 @@ msgstr "" ">>> isinstance(\"\", int | str)\n" "True" -#: ../../library/stdtypes.rst:6025 +#: ../../library/stdtypes.rst:6038 msgid "" "However, :ref:`parameterized generics ` in union objects " "cannot be checked::" msgstr "" "然而聯合物件中的\\ :ref:`參數化泛型 `\\ 則無法被檢查: ::" -#: ../../library/stdtypes.rst:6028 +#: ../../library/stdtypes.rst:6041 msgid "" ">>> isinstance(1, int | list[int]) # short-circuit evaluation\n" "True\n" @@ -8937,7 +8962,7 @@ msgid "" "TypeError: isinstance() argument 2 cannot be a parameterized generic" msgstr "" -#: ../../library/stdtypes.rst:6035 +#: ../../library/stdtypes.rst:6048 msgid "" "The user-exposed type for the union object can be accessed from :class:" "`typing.Union` and used for :func:`isinstance` checks::" @@ -8945,7 +8970,7 @@ msgstr "" "構成聯合物件的對使用者公開型別 (user-exposed type) 可以透過 :data:`typing." "Union` 存取並用於 :func:`isinstance` 檢查: ::" -#: ../../library/stdtypes.rst:6038 +#: ../../library/stdtypes.rst:6051 msgid "" ">>> import typing\n" ">>> isinstance(int | str, typing.Union)\n" @@ -8963,7 +8988,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: cannot create 'typing.Union' instances" -#: ../../library/stdtypes.rst:6047 +#: ../../library/stdtypes.rst:6060 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 " @@ -8972,7 +8997,7 @@ msgstr "" "新增了型別物件的 :meth:`!__or__` 方法來支援 ``X | Y`` 語法。如果元類別有實" "作 :meth:`!__or__`,則 Union 可以覆寫 (override) 它: ::" -#: ../../library/stdtypes.rst:6051 +#: ../../library/stdtypes.rst:6064 msgid "" ">>> class M(type):\n" "... def __or__(self, other):\n" @@ -8998,32 +9023,32 @@ msgstr "" ">>> int | C\n" "int | C" -#: ../../library/stdtypes.rst:6067 +#: ../../library/stdtypes.rst:6080 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr ":pep:`604` -- PEP 提出 ``X | Y`` 語法和聯合型別。" -#: ../../library/stdtypes.rst:6073 +#: ../../library/stdtypes.rst:6086 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:6080 +#: ../../library/stdtypes.rst:6093 msgid "Other Built-in Types" msgstr "其他內建型別" -#: ../../library/stdtypes.rst:6082 +#: ../../library/stdtypes.rst:6095 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:6089 +#: ../../library/stdtypes.rst:6102 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:6091 +#: ../../library/stdtypes.rst:6104 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 " @@ -9034,7 +9059,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:6098 +#: ../../library/stdtypes.rst:6111 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -9045,32 +9070,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:6106 +#: ../../library/stdtypes.rst:6119 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:6114 +#: ../../library/stdtypes.rst:6127 msgid "Classes and Class Instances" msgstr "類別與類別實例" -#: ../../library/stdtypes.rst:6116 +#: ../../library/stdtypes.rst:6129 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "請見 :ref:`objects` 和 :ref:`class`。" -#: ../../library/stdtypes.rst:6122 +#: ../../library/stdtypes.rst:6135 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:6124 +#: ../../library/stdtypes.rst:6137 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:6127 +#: ../../library/stdtypes.rst:6140 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -9078,15 +9103,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:6131 +#: ../../library/stdtypes.rst:6144 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`。" -#: ../../library/stdtypes.rst:6137 +#: ../../library/stdtypes.rst:6150 msgid "Methods" msgstr "方法" -#: ../../library/stdtypes.rst:6141 +#: ../../library/stdtypes.rst:6154 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: :ref:`built-in methods ` (such as :meth:" @@ -9094,7 +9119,7 @@ msgid "" "methods>`. Built-in methods are described with the types that support them." msgstr "" -#: ../../library/stdtypes.rst:6147 +#: ../../library/stdtypes.rst:6160 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:" @@ -9107,7 +9132,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:6158 +#: ../../library/stdtypes.rst:6171 msgid "" "Like :ref:`function objects `, bound method objects " "support getting arbitrary attributes. However, since method attributes are " @@ -9118,7 +9143,7 @@ msgid "" "underlying function object:" msgstr "" -#: ../../library/stdtypes.rst:6166 +#: ../../library/stdtypes.rst:6179 msgid "" ">>> class C:\n" "... def method(self):\n" @@ -9146,15 +9171,15 @@ msgstr "" ">>> c.method.whoami\n" "'my name is method'" -#: ../../library/stdtypes.rst:6181 +#: ../../library/stdtypes.rst:6194 msgid "See :ref:`instance-methods` for more information." msgstr "更多資訊請見 :ref:`instance-methods`。" -#: ../../library/stdtypes.rst:6189 +#: ../../library/stdtypes.rst:6202 msgid "Code Objects" msgstr "程式碼物件" -#: ../../library/stdtypes.rst:6195 +#: ../../library/stdtypes.rst:6208 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -9164,7 +9189,7 @@ msgid "" "`~function.__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:6202 +#: ../../library/stdtypes.rst:6215 msgid "" "Accessing :attr:`~function.__code__` raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and " @@ -9173,21 +9198,21 @@ msgstr "" "存取 :attr:`~function.__code__` 會引發一個附帶引數 ``obj`` 與 " "``\"__code__\"`` 的\\ :ref:`稽核事件 ` ``object.__getattr__``。" -#: ../../library/stdtypes.rst:6209 +#: ../../library/stdtypes.rst:6222 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:6212 +#: ../../library/stdtypes.rst:6225 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`。" -#: ../../library/stdtypes.rst:6218 +#: ../../library/stdtypes.rst:6231 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:6224 +#: ../../library/stdtypes.rst:6237 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 " @@ -9195,30 +9220,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:6229 +#: ../../library/stdtypes.rst:6242 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:6235 +#: ../../library/stdtypes.rst:6248 msgid "The Null Object" msgstr "Null 物件" -#: ../../library/stdtypes.rst:6237 +#: ../../library/stdtypes.rst:6250 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:6241 +#: ../../library/stdtypes.rst:6254 msgid "It is written as ``None``." msgstr "它被寫為 ``None``。" -#: ../../library/stdtypes.rst:6248 +#: ../../library/stdtypes.rst:6261 msgid "The Ellipsis Object" msgstr "Ellipsis 物件" -#: ../../library/stdtypes.rst:6250 +#: ../../library/stdtypes.rst:6263 msgid "" "This object is commonly used to indicate that something is omitted. It " "supports no special operations. There is exactly one ellipsis object, " @@ -9226,63 +9251,63 @@ msgid "" "the :const:`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:6255 +#: ../../library/stdtypes.rst:6268 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "它被寫為 ``Ellipsis`` 或 ``...``。" -#: ../../library/stdtypes.rst:6257 +#: ../../library/stdtypes.rst:6270 msgid "" "In typical use, ``...`` as the ``Ellipsis`` object appears in a few " "different places, for instance:" msgstr "" -#: ../../library/stdtypes.rst:6260 +#: ../../library/stdtypes.rst:6273 msgid "" "In type annotations, such as :ref:`callable arguments ` or :ref:`tuple elements `." msgstr "" -#: ../../library/stdtypes.rst:6263 +#: ../../library/stdtypes.rst:6276 msgid "" "As the body of a function instead of a :ref:`pass statement `." msgstr "" -#: ../../library/stdtypes.rst:6265 +#: ../../library/stdtypes.rst:6278 msgid "" "In third-party libraries, such as `Numpy's slicing and striding `_." msgstr "" -#: ../../library/stdtypes.rst:6268 +#: ../../library/stdtypes.rst:6281 msgid "" "Python also uses three dots in ways that are not ``Ellipsis`` objects, for " "instance:" msgstr "" -#: ../../library/stdtypes.rst:6270 +#: ../../library/stdtypes.rst:6283 msgid "" "Doctest's :const:`ELLIPSIS `, as a pattern for missing " "content." msgstr "" -#: ../../library/stdtypes.rst:6272 +#: ../../library/stdtypes.rst:6285 msgid "" "The default Python prompt of the :term:`interactive` shell when partial " "input is incomplete." msgstr "" -#: ../../library/stdtypes.rst:6274 +#: ../../library/stdtypes.rst:6287 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:6282 +#: ../../library/stdtypes.rst:6295 msgid "The NotImplemented Object" msgstr "NotImplemented 物件" -#: ../../library/stdtypes.rst:6284 +#: ../../library/stdtypes.rst:6297 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 " @@ -9290,64 +9315,64 @@ msgid "" "`type(NotImplemented)()` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:6289 +#: ../../library/stdtypes.rst:6302 msgid "It is written as :code:`NotImplemented`." msgstr "它被寫為 :code:`NotImplemented`。" -#: ../../library/stdtypes.rst:6295 +#: ../../library/stdtypes.rst:6308 msgid "Internal Objects" msgstr "內部物件" -#: ../../library/stdtypes.rst:6297 +#: ../../library/stdtypes.rst:6310 msgid "" "See :ref:`types` for this information. It describes :ref:`stack frame " "objects `, :ref:`traceback objects `, and " "slice objects." msgstr "" -#: ../../library/stdtypes.rst:6305 +#: ../../library/stdtypes.rst:6318 msgid "Special Attributes" msgstr "特殊屬性" -#: ../../library/stdtypes.rst:6307 +#: ../../library/stdtypes.rst:6320 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:6314 +#: ../../library/stdtypes.rst:6327 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:6320 +#: ../../library/stdtypes.rst:6333 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:6328 +#: ../../library/stdtypes.rst:6341 msgid "The name of the module in which a class or function was defined." msgstr "" -#: ../../library/stdtypes.rst:6333 +#: ../../library/stdtypes.rst:6346 msgid "" "The documentation string of a class or function, or ``None`` if undefined." msgstr "" -#: ../../library/stdtypes.rst:6338 +#: ../../library/stdtypes.rst:6351 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:6348 +#: ../../library/stdtypes.rst:6361 msgid "Integer string conversion length limitation" msgstr "" -#: ../../library/stdtypes.rst:6350 +#: ../../library/stdtypes.rst:6363 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 " @@ -9355,7 +9380,7 @@ msgid "" "binary conversions are unlimited. The limit can be configured." msgstr "" -#: ../../library/stdtypes.rst:6355 +#: ../../library/stdtypes.rst:6368 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 " @@ -9365,24 +9390,24 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:6362 +#: ../../library/stdtypes.rst:6375 msgid "" "Limiting conversion size offers a practical way to avoid :cve:`2020-10735`." msgstr "" -#: ../../library/stdtypes.rst:6364 +#: ../../library/stdtypes.rst:6377 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:6368 +#: ../../library/stdtypes.rst:6381 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:6370 +#: ../../library/stdtypes.rst:6383 msgid "" ">>> import sys\n" ">>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default.\n" @@ -9406,7 +9431,7 @@ msgid "" ">>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited." msgstr "" -#: ../../library/stdtypes.rst:6390 +#: ../../library/stdtypes.rst:6403 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -9414,11 +9439,11 @@ msgid "" "str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:6395 +#: ../../library/stdtypes.rst:6408 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:6397 +#: ../../library/stdtypes.rst:6410 msgid "" ">>> import sys\n" ">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" @@ -9436,11 +9461,11 @@ msgstr "" "... '571186405732').to_bytes(53, 'big')\n" "..." -#: ../../library/stdtypes.rst:6410 +#: ../../library/stdtypes.rst:6423 msgid "Affected APIs" msgstr "受影響的 API" -#: ../../library/stdtypes.rst:6412 +#: ../../library/stdtypes.rst:6425 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" @@ -9448,74 +9473,74 @@ msgstr "" "此限制僅適用於 :class:`int` 與 :class:`str` 或 :class:`bytes` 之間可能較慢的" "轉換:" -#: ../../library/stdtypes.rst:6415 +#: ../../library/stdtypes.rst:6428 msgid "``int(string)`` with default base 10." msgstr "``int(string)`` 以預設的 10 為底。" -#: ../../library/stdtypes.rst:6416 +#: ../../library/stdtypes.rst:6429 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "``int(string, base)`` 用於所有非 2 冪次方的底。" -#: ../../library/stdtypes.rst:6417 +#: ../../library/stdtypes.rst:6430 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:6418 +#: ../../library/stdtypes.rst:6431 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:6419 +#: ../../library/stdtypes.rst:6432 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:6422 +#: ../../library/stdtypes.rst:6435 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:6424 +#: ../../library/stdtypes.rst:6437 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "``int(string, base)`` 以 2、4、8、16 或 32 為底。" -#: ../../library/stdtypes.rst:6425 +#: ../../library/stdtypes.rst:6438 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr ":func:`int.from_bytes` 和 :func:`int.to_bytes`。" -#: ../../library/stdtypes.rst:6426 +#: ../../library/stdtypes.rst:6439 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr ":func:`hex`、:func:`oct`、:func:`bin`。" -#: ../../library/stdtypes.rst:6427 +#: ../../library/stdtypes.rst:6440 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr ":ref:`formatspec` 用於十六進位、八進位和二進位數字。" -#: ../../library/stdtypes.rst:6428 +#: ../../library/stdtypes.rst:6441 msgid ":class:`str` to :class:`float`." msgstr ":class:`str` 轉換為 :class:`float`。" -#: ../../library/stdtypes.rst:6429 +#: ../../library/stdtypes.rst:6442 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr ":class:`str` 轉換為 :class:`decimal.Decimal`。" -#: ../../library/stdtypes.rst:6432 +#: ../../library/stdtypes.rst:6445 msgid "Configuring the limit" msgstr "設定限制" -#: ../../library/stdtypes.rst:6434 +#: ../../library/stdtypes.rst:6447 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:6437 +#: ../../library/stdtypes.rst:6450 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:6440 +#: ../../library/stdtypes.rst:6453 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" @@ -9523,7 +9548,7 @@ msgstr "" ":option:`-X int_max_str_digits <-X>`,例如 ``python3 -X " "int_max_str_digits=640``" -#: ../../library/stdtypes.rst:6442 +#: ../../library/stdtypes.rst:6455 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 " @@ -9532,38 +9557,38 @@ msgid "" "int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:6448 +#: ../../library/stdtypes.rst:6461 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:6451 +#: ../../library/stdtypes.rst:6464 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:6455 +#: ../../library/stdtypes.rst:6468 msgid "" "Information about the default and minimum can be found in :data:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:6457 +#: ../../library/stdtypes.rst:6470 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:6459 +#: ../../library/stdtypes.rst:6472 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:6466 +#: ../../library/stdtypes.rst:6479 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 " @@ -9575,7 +9600,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:6475 +#: ../../library/stdtypes.rst:6488 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 " @@ -9583,11 +9608,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:6481 +#: ../../library/stdtypes.rst:6494 msgid "Recommended configuration" msgstr "建議的配置" -#: ../../library/stdtypes.rst:6483 +#: ../../library/stdtypes.rst:6496 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 " @@ -9595,11 +9620,11 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.12." msgstr "" -#: ../../library/stdtypes.rst:6488 +#: ../../library/stdtypes.rst:6501 msgid "Example::" msgstr "範例: ::" -#: ../../library/stdtypes.rst:6490 +#: ../../library/stdtypes.rst:6503 msgid "" ">>> import sys\n" ">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" @@ -9621,38 +9646,38 @@ msgstr "" "... elif current_limit < lower_bound:\n" "... sys.set_int_max_str_digits(lower_bound)" -#: ../../library/stdtypes.rst:6500 +#: ../../library/stdtypes.rst:6513 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:6504 +#: ../../library/stdtypes.rst:6517 msgid "Footnotes" msgstr "註腳" -#: ../../library/stdtypes.rst:6505 +#: ../../library/stdtypes.rst:6518 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:6508 +#: ../../library/stdtypes.rst:6521 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:6511 +#: ../../library/stdtypes.rst:6524 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:6513 +#: ../../library/stdtypes.rst:6526 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:6516 +#: ../../library/stdtypes.rst:6529 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." @@ -9665,13 +9690,13 @@ msgstr "built-in(內建)" #: ../../library/stdtypes.rst:13 ../../library/stdtypes.rst:324 #: ../../library/stdtypes.rst:401 ../../library/stdtypes.rst:994 #: ../../library/stdtypes.rst:1184 ../../library/stdtypes.rst:1206 -#: ../../library/stdtypes.rst:1221 ../../library/stdtypes.rst:5224 -#: ../../library/stdtypes.rst:6220 +#: ../../library/stdtypes.rst:1221 ../../library/stdtypes.rst:5237 +#: ../../library/stdtypes.rst:6233 msgid "types" msgstr "type(型別)" #: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:1221 -#: ../../library/stdtypes.rst:5224 +#: ../../library/stdtypes.rst:5237 msgid "statement" msgstr "statement(陳述式)" @@ -9793,11 +9818,11 @@ msgstr "is not" #: ../../library/stdtypes.rst:1206 ../../library/stdtypes.rst:1371 #: ../../library/stdtypes.rst:1553 ../../library/stdtypes.rst:1597 #: ../../library/stdtypes.rst:1718 ../../library/stdtypes.rst:1848 -#: ../../library/stdtypes.rst:3245 ../../library/stdtypes.rst:3264 -#: ../../library/stdtypes.rst:3377 ../../library/stdtypes.rst:5013 -#: ../../library/stdtypes.rst:5224 ../../library/stdtypes.rst:5707 -#: ../../library/stdtypes.rst:5964 ../../library/stdtypes.rst:6139 -#: ../../library/stdtypes.rst:6184 +#: ../../library/stdtypes.rst:3258 ../../library/stdtypes.rst:3277 +#: ../../library/stdtypes.rst:3390 ../../library/stdtypes.rst:5026 +#: ../../library/stdtypes.rst:5237 ../../library/stdtypes.rst:5720 +#: ../../library/stdtypes.rst:5977 ../../library/stdtypes.rst:6152 +#: ../../library/stdtypes.rst:6197 msgid "object" msgstr "object(物件)" @@ -9889,9 +9914,9 @@ msgid "arithmetic" msgstr "arithmetic(算術)" #: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:994 -#: ../../library/stdtypes.rst:1184 ../../library/stdtypes.rst:5224 -#: ../../library/stdtypes.rst:6191 ../../library/stdtypes.rst:6205 -#: ../../library/stdtypes.rst:6220 +#: ../../library/stdtypes.rst:1184 ../../library/stdtypes.rst:5237 +#: ../../library/stdtypes.rst:6204 ../../library/stdtypes.rst:6218 +#: ../../library/stdtypes.rst:6233 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -9907,8 +9932,8 @@ msgstr "float" msgid "complex" msgstr "complex(複數)" -#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3121 -#: ../../library/stdtypes.rst:4381 +#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3134 +#: ../../library/stdtypes.rst:4394 msgid "+ (plus)" msgstr "+ (加號)" @@ -9920,13 +9945,13 @@ msgstr "unary operator(一元運算子)" msgid "binary operator" msgstr "binary operator(二元運算子)" -#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3121 -#: ../../library/stdtypes.rst:4381 +#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3134 +#: ../../library/stdtypes.rst:4394 msgid "- (minus)" msgstr "- (減號)" -#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3078 -#: ../../library/stdtypes.rst:4338 +#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3091 +#: ../../library/stdtypes.rst:4351 msgid "* (asterisk)" msgstr "* (星號)" @@ -9938,8 +9963,8 @@ msgstr "/ (斜線)" msgid "//" msgstr "//" -#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3041 -#: ../../library/stdtypes.rst:4306 +#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3054 +#: ../../library/stdtypes.rst:4319 msgid "% (percent)" msgstr "% (百分號)" @@ -9949,7 +9974,7 @@ msgstr "**" #: ../../library/stdtypes.rst:324 ../../library/stdtypes.rst:401 #: ../../library/stdtypes.rst:994 ../../library/stdtypes.rst:1221 -#: ../../library/stdtypes.rst:5224 +#: ../../library/stdtypes.rst:5237 msgid "operations on" msgstr "operations on(操作於)" @@ -9958,7 +9983,7 @@ msgid "conjugate() (complex number method)" msgstr "conjugate()(複數方法)" #: ../../library/stdtypes.rst:343 ../../library/stdtypes.rst:1916 -#: ../../library/stdtypes.rst:3245 ../../library/stdtypes.rst:6220 +#: ../../library/stdtypes.rst:3258 ../../library/stdtypes.rst:6233 msgid "module" msgstr "模組" @@ -10026,7 +10051,7 @@ msgstr "values" msgid "iterator protocol" msgstr "iterator protocol(疊代器協定)" -#: ../../library/stdtypes.rst:891 ../../library/stdtypes.rst:5620 +#: ../../library/stdtypes.rst:891 ../../library/stdtypes.rst:5633 msgid "protocol" msgstr "protocol(協定)" @@ -10052,7 +10077,7 @@ msgstr "container(容器)" msgid "iteration over" msgstr "iteration over(疊代於)" -#: ../../library/stdtypes.rst:994 ../../library/stdtypes.rst:5224 +#: ../../library/stdtypes.rst:994 ../../library/stdtypes.rst:5237 msgid "len" msgstr "len" @@ -10121,14 +10146,14 @@ msgstr "mutable(可變)" msgid "list" msgstr "list(串列)" -#: ../../library/stdtypes.rst:1206 ../../library/stdtypes.rst:3245 -#: ../../library/stdtypes.rst:3377 ../../library/stdtypes.rst:3487 -#: ../../library/stdtypes.rst:4306 +#: ../../library/stdtypes.rst:1206 ../../library/stdtypes.rst:3258 +#: ../../library/stdtypes.rst:3390 ../../library/stdtypes.rst:3500 +#: ../../library/stdtypes.rst:4319 msgid "bytearray" msgstr "bytearray(位元組陣列)" -#: ../../library/stdtypes.rst:1221 ../../library/stdtypes.rst:5224 -#: ../../library/stdtypes.rst:5964 ../../library/stdtypes.rst:6220 +#: ../../library/stdtypes.rst:1221 ../../library/stdtypes.rst:5237 +#: ../../library/stdtypes.rst:5977 ../../library/stdtypes.rst:6233 msgid "type" msgstr "type(型別)" @@ -10136,7 +10161,7 @@ msgstr "type(型別)" msgid "assignment" msgstr "assignment(賦值)" -#: ../../library/stdtypes.rst:1221 ../../library/stdtypes.rst:5224 +#: ../../library/stdtypes.rst:1221 ../../library/stdtypes.rst:5237 msgid "del" msgstr "del" @@ -10145,8 +10170,8 @@ msgid "range" msgstr "range" #: ../../library/stdtypes.rst:1718 ../../library/stdtypes.rst:1861 -#: ../../library/stdtypes.rst:1908 ../../library/stdtypes.rst:2869 -#: ../../library/stdtypes.rst:3041 +#: ../../library/stdtypes.rst:1908 ../../library/stdtypes.rst:2882 +#: ../../library/stdtypes.rst:3054 msgid "string" msgstr "string(字串)" @@ -10167,17 +10192,17 @@ msgstr "(亦請見 string)" msgid "io.StringIO" msgstr "io.StringIO" -#: ../../library/stdtypes.rst:1881 ../../library/stdtypes.rst:3237 +#: ../../library/stdtypes.rst:1881 ../../library/stdtypes.rst:3250 msgid "buffer protocol" msgstr "buffer protocol(緩衝區協定)" -#: ../../library/stdtypes.rst:1881 ../../library/stdtypes.rst:3245 -#: ../../library/stdtypes.rst:3264 ../../library/stdtypes.rst:3487 -#: ../../library/stdtypes.rst:4306 +#: ../../library/stdtypes.rst:1881 ../../library/stdtypes.rst:3258 +#: ../../library/stdtypes.rst:3277 ../../library/stdtypes.rst:3500 +#: ../../library/stdtypes.rst:4319 msgid "bytes" msgstr "bytes(位元組)" -#: ../../library/stdtypes.rst:1908 ../../library/stdtypes.rst:3487 +#: ../../library/stdtypes.rst:1908 ../../library/stdtypes.rst:3500 msgid "methods" msgstr "methods(方法)" @@ -10185,7 +10210,7 @@ msgstr "methods(方法)" msgid "re" msgstr "re" -#: ../../library/stdtypes.rst:2681 ../../library/stdtypes.rst:4160 +#: ../../library/stdtypes.rst:2681 ../../library/stdtypes.rst:4173 msgid "universal newlines" msgstr "universal newlines" @@ -10193,231 +10218,231 @@ msgstr "universal newlines" msgid "str.splitlines method" msgstr "str.splitlines 方法" -#: ../../library/stdtypes.rst:2869 +#: ../../library/stdtypes.rst:2882 msgid "! formatted string literal" msgstr "! formatted string literals(! 格式化字串常數)" -#: ../../library/stdtypes.rst:2869 +#: ../../library/stdtypes.rst:2882 msgid "formatted string literals" msgstr "formatted string literals(格式化字串常數)" -#: ../../library/stdtypes.rst:2869 +#: ../../library/stdtypes.rst:2882 msgid "! f-string" msgstr "! f-string(! f 字串)" -#: ../../library/stdtypes.rst:2869 +#: ../../library/stdtypes.rst:2882 msgid "f-strings" msgstr "f-string(f 字串)" -#: ../../library/stdtypes.rst:2869 +#: ../../library/stdtypes.rst:2882 msgid "fstring" msgstr "fstring(f 字串)" -#: ../../library/stdtypes.rst:2869 +#: ../../library/stdtypes.rst:2882 msgid "interpolated string literal" msgstr "interpolated string literal(插值字串常數)" -#: ../../library/stdtypes.rst:2869 +#: ../../library/stdtypes.rst:2882 msgid "formatted literal" msgstr "formatted literal(格式化常數)" -#: ../../library/stdtypes.rst:2869 +#: ../../library/stdtypes.rst:2882 msgid "interpolated literal" msgstr "interpolated literal(插值常數)" -#: ../../library/stdtypes.rst:2869 +#: ../../library/stdtypes.rst:2882 msgid "{} (curly brackets)" msgstr "{} (花括號)" -#: ../../library/stdtypes.rst:2869 +#: ../../library/stdtypes.rst:2882 msgid "in formatted string literal" msgstr "於格式化字串常數中" -#: ../../library/stdtypes.rst:2869 +#: ../../library/stdtypes.rst:2882 msgid "! (exclamation mark)" msgstr "! (驚嘆號)" -#: ../../library/stdtypes.rst:2869 +#: ../../library/stdtypes.rst:2882 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/stdtypes.rst:2869 +#: ../../library/stdtypes.rst:2882 msgid "= (equals)" msgstr "= (等號)" -#: ../../library/stdtypes.rst:2869 +#: ../../library/stdtypes.rst:2882 msgid "for help in debugging using string literals" msgstr "" -#: ../../library/stdtypes.rst:3041 +#: ../../library/stdtypes.rst:3054 msgid "formatting, string (%)" msgstr "formatting(格式化)、字串 (%)" -#: ../../library/stdtypes.rst:3041 +#: ../../library/stdtypes.rst:3054 msgid "interpolation, string (%)" msgstr "interpolation(插值)、字串 (%)" -#: ../../library/stdtypes.rst:3041 +#: ../../library/stdtypes.rst:3054 msgid "formatting, printf" msgstr "formatting(格式化)、printf" -#: ../../library/stdtypes.rst:3041 +#: ../../library/stdtypes.rst:3054 msgid "interpolation, printf" msgstr "interpolation(插值)、printf" -#: ../../library/stdtypes.rst:3041 ../../library/stdtypes.rst:4306 +#: ../../library/stdtypes.rst:3054 ../../library/stdtypes.rst:4319 msgid "printf-style formatting" msgstr "printf 風格格式化" -#: ../../library/stdtypes.rst:3041 ../../library/stdtypes.rst:4306 +#: ../../library/stdtypes.rst:3054 ../../library/stdtypes.rst:4319 msgid "sprintf-style formatting" msgstr "sprintf 風格格式化" -#: ../../library/stdtypes.rst:3078 ../../library/stdtypes.rst:4338 +#: ../../library/stdtypes.rst:3091 ../../library/stdtypes.rst:4351 msgid "() (parentheses)" msgstr "() (圓括號)" -#: ../../library/stdtypes.rst:3078 ../../library/stdtypes.rst:3121 -#: ../../library/stdtypes.rst:4338 ../../library/stdtypes.rst:4381 +#: ../../library/stdtypes.rst:3091 ../../library/stdtypes.rst:3134 +#: ../../library/stdtypes.rst:4351 ../../library/stdtypes.rst:4394 msgid "in printf-style formatting" msgstr "於 printf 風格格式化" -#: ../../library/stdtypes.rst:3078 ../../library/stdtypes.rst:4338 +#: ../../library/stdtypes.rst:3091 ../../library/stdtypes.rst:4351 msgid ". (dot)" msgstr ". (點)" -#: ../../library/stdtypes.rst:3121 ../../library/stdtypes.rst:4381 +#: ../../library/stdtypes.rst:3134 ../../library/stdtypes.rst:4394 msgid "# (hash)" msgstr "# (井字號)" -#: ../../library/stdtypes.rst:3121 ../../library/stdtypes.rst:4381 +#: ../../library/stdtypes.rst:3134 ../../library/stdtypes.rst:4394 msgid "space" msgstr "space(空白)" -#: ../../library/stdtypes.rst:3237 +#: ../../library/stdtypes.rst:3250 msgid "binary sequence types" msgstr "binary sequence types(二進位序列型別)" -#: ../../library/stdtypes.rst:3245 +#: ../../library/stdtypes.rst:3258 msgid "memoryview" msgstr "memoryview(記憶體視圖)" -#: ../../library/stdtypes.rst:3245 +#: ../../library/stdtypes.rst:3258 msgid "array" msgstr "array(陣列)" -#: ../../library/stdtypes.rst:4160 +#: ../../library/stdtypes.rst:4173 msgid "bytes.splitlines method" msgstr "bytes.splitlines 方法" -#: ../../library/stdtypes.rst:4160 +#: ../../library/stdtypes.rst:4173 msgid "bytearray.splitlines method" msgstr "bytearray.splitlines 方法" -#: ../../library/stdtypes.rst:4306 +#: ../../library/stdtypes.rst:4319 msgid "formatting" msgstr "formatting(格式化)" -#: ../../library/stdtypes.rst:4306 +#: ../../library/stdtypes.rst:4319 msgid "bytes (%)" msgstr "bytes (%)" -#: ../../library/stdtypes.rst:4306 +#: ../../library/stdtypes.rst:4319 msgid "bytearray (%)" msgstr "bytearray (%)" -#: ../../library/stdtypes.rst:4306 +#: ../../library/stdtypes.rst:4319 msgid "interpolation" msgstr "interpolation(插值)" -#: ../../library/stdtypes.rst:5013 +#: ../../library/stdtypes.rst:5026 msgid "set" msgstr "set(集合)" -#: ../../library/stdtypes.rst:5224 +#: ../../library/stdtypes.rst:5237 msgid "mapping" msgstr "mapping(對映)" -#: ../../library/stdtypes.rst:5224 +#: ../../library/stdtypes.rst:5237 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../library/stdtypes.rst:5331 +#: ../../library/stdtypes.rst:5344 msgid "__missing__()" msgstr "__missing__()" -#: ../../library/stdtypes.rst:5620 +#: ../../library/stdtypes.rst:5633 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../library/stdtypes.rst:5620 +#: ../../library/stdtypes.rst:5633 msgid "context management protocol" msgstr "context management protocol(情境管理協定)" -#: ../../library/stdtypes.rst:5620 +#: ../../library/stdtypes.rst:5633 msgid "context management" msgstr "context management(情境管理)" -#: ../../library/stdtypes.rst:5695 +#: ../../library/stdtypes.rst:5708 msgid "annotation" msgstr "annotation(註記)" -#: ../../library/stdtypes.rst:5695 +#: ../../library/stdtypes.rst:5708 msgid "type annotation; type hint" msgstr "type annotation(型別註記);type hint(型別提示)" -#: ../../library/stdtypes.rst:5707 +#: ../../library/stdtypes.rst:5720 msgid "GenericAlias" msgstr "GenericAlias(泛型別名)" -#: ../../library/stdtypes.rst:5707 +#: ../../library/stdtypes.rst:5720 msgid "Generic" msgstr "Generic(泛型)" -#: ../../library/stdtypes.rst:5707 +#: ../../library/stdtypes.rst:5720 msgid "Alias" msgstr "Alias(別名)" -#: ../../library/stdtypes.rst:5964 +#: ../../library/stdtypes.rst:5977 msgid "Union" msgstr "Union(聯合)" -#: ../../library/stdtypes.rst:5964 +#: ../../library/stdtypes.rst:5977 msgid "union" msgstr "union(聯集)" -#: ../../library/stdtypes.rst:6139 +#: ../../library/stdtypes.rst:6152 msgid "method" msgstr "method(方法)" -#: ../../library/stdtypes.rst:6184 +#: ../../library/stdtypes.rst:6197 msgid "code" msgstr "code(程式碼)" -#: ../../library/stdtypes.rst:6184 +#: ../../library/stdtypes.rst:6197 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../library/stdtypes.rst:6191 +#: ../../library/stdtypes.rst:6204 msgid "compile" msgstr "compile(編譯)" -#: ../../library/stdtypes.rst:6191 +#: ../../library/stdtypes.rst:6204 msgid "__code__ (function object attribute)" msgstr "__code__(函式物件屬性)" -#: ../../library/stdtypes.rst:6205 +#: ../../library/stdtypes.rst:6218 msgid "exec" msgstr "exec" -#: ../../library/stdtypes.rst:6205 +#: ../../library/stdtypes.rst:6218 msgid "eval" msgstr "eval" -#: ../../library/stdtypes.rst:6244 +#: ../../library/stdtypes.rst:6257 msgid "..." msgstr "..." -#: ../../library/stdtypes.rst:6244 +#: ../../library/stdtypes.rst:6257 msgid "ellipsis literal" msgstr "ellipsis literal(刪節號字面值)" diff --git a/library/urllib.robotparser.po b/library/urllib.robotparser.po index 7fdc274c41..962d370154 100644 --- a/library/urllib.robotparser.po +++ b/library/urllib.robotparser.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-05 00:16+0000\n" +"POT-Creation-Date: 2026-02-05 00:20+0000\n" "PO-Revision-Date: 2022-01-27 13:40+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -122,23 +122,23 @@ msgid "" msgstr "下面的範例展示了 :class:`RobotFileParser` 類別的基本用法: ::" #: ../../library/urllib.robotparser.rst:92 +#, fuzzy msgid "" ">>> import urllib.robotparser\n" ">>> rp = urllib.robotparser.RobotFileParser()\n" -">>> rp.set_url(\"http://www.musi-cal.com/robots.txt\")\n" +">>> rp.set_url(\"http://www.pythontest.net/robots.txt\")\n" ">>> rp.read()\n" ">>> rrate = rp.request_rate(\"*\")\n" ">>> rrate.requests\n" -"3\n" +"1\n" ">>> rrate.seconds\n" -"20\n" +"1\n" ">>> rp.crawl_delay(\"*\")\n" "6\n" -">>> rp.can_fetch(\"*\", \"http://www.musi-cal.com/cgi-bin/search?" -"city=San+Francisco\")\n" -"False\n" -">>> rp.can_fetch(\"*\", \"http://www.musi-cal.com/\")\n" -"True" +">>> rp.can_fetch(\"*\", \"http://www.pythontest.net/\")\n" +"True\n" +">>> rp.can_fetch(\"*\", \"http://www.pythontest.net/no-robots-here/\")\n" +"False" msgstr "" ">>> import urllib.robotparser\n" ">>> rp = urllib.robotparser.RobotFileParser()\n" From c737bf289a41fbcd75dab6b2f8c76b553973bdf5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Feb 2026 14:11:41 +0000 Subject: [PATCH 09/11] sync with cpython f27896c3 --- glossary.po | 581 ++++++------ library/functions.po | 22 +- reference/datamodel.po | 1872 +++++++++++++++++++------------------ reference/expressions.po | 1034 +++++++++++--------- reference/simple_stmts.po | 650 +++++++------ 5 files changed, 2192 insertions(+), 1967 deletions(-) diff --git a/glossary.po b/glossary.po index 51123960cf..219ecfc4ff 100644 --- a/glossary.po +++ b/glossary.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-03 00:20+0000\n" +"POT-Creation-Date: 2026-02-05 14:10+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1759,10 +1759,38 @@ msgstr "" "`loader`\\ (載入器)物件。" #: ../../glossary.rst:788 +#, fuzzy +msgid "index" +msgstr "finder(尋檢器)" + +#: ../../glossary.rst:790 +msgid "" +"A numeric value that represents the position of an element in a :term:" +"`sequence`." +msgstr "" + +#: ../../glossary.rst:793 +msgid "" +"In Python, indexing starts at zero. For example, ``things[0]`` names the " +"*first* element of ``things``; ``things[1]`` names the second one." +msgstr "" + +#: ../../glossary.rst:797 +msgid "" +"In some contexts, Python allows negative indexes for counting from the end " +"of a sequence, and indexing using :term:`slices `." +msgstr "" + +#: ../../glossary.rst:800 +#, fuzzy +msgid "See also :term:`subscript`." +msgstr "另請參閱 :term:`module`\\ (模組)。" + +#: ../../glossary.rst:801 msgid "interactive" msgstr "interactive(互動的)" -#: ../../glossary.rst:790 +#: ../../glossary.rst:803 msgid "" "Python has an interactive interpreter which means you can enter statements " "and expressions at the interpreter prompt, immediately execute them and see " @@ -1776,11 +1804,11 @@ msgstr "" "從你的電腦的主選單選擇它)。這是測試新想法或檢查模組和包的非常強大的方法(請" "記住help(x))。更多互動式模式相關資訊請見 :ref:`tut-interac`。" -#: ../../glossary.rst:797 +#: ../../glossary.rst:810 msgid "interpreted" msgstr "interpreted(直譯的)" -#: ../../glossary.rst:799 +#: ../../glossary.rst:812 msgid "" "Python is an interpreted language, as opposed to a compiled one, though the " "distinction can be blurry because of the presence of the bytecode compiler. " @@ -1794,11 +1822,11 @@ msgstr "" "一個執行檔,然後再執行它。直譯語言通常比編譯語言有更短的開發/除錯週期,不過" "它們的程式通常也運行得較慢。另請參閱 :term:`interactive`\\ (互動的)。" -#: ../../glossary.rst:806 +#: ../../glossary.rst:819 msgid "interpreter shutdown" msgstr "interpreter shutdown(直譯器關閉)" -#: ../../glossary.rst:808 +#: ../../glossary.rst:821 msgid "" "When asked to shut down, the Python interpreter enters a special phase where " "it gradually releases all allocated resources, such as modules and various " @@ -1816,18 +1844,18 @@ msgstr "" "段被執行的程式碼會遇到各種例外,因為它所依賴的資源可能不再有作用了(常見的例" "子是函式庫模組或是警告機制)。" -#: ../../glossary.rst:817 +#: ../../glossary.rst:830 msgid "" "The main reason for interpreter shutdown is that the ``__main__`` module or " "the script being run has finished executing." msgstr "" "直譯器關閉的主要原因,是 ``__main__`` 模組或正被運行的腳本已經執行完成。" -#: ../../glossary.rst:819 +#: ../../glossary.rst:832 msgid "iterable" msgstr "iterable(可疊代物件)" -#: ../../glossary.rst:821 +#: ../../glossary.rst:834 msgid "" "An object capable of returning its members one at a time. Examples of " "iterables include all sequence types (such as :class:`list`, :class:`str`, " @@ -1842,7 +1870,7 @@ msgstr "" "只要那些 class 有實作 :term:`sequence`\\ (序列)語意的 :meth:`~object." "__iter__` 或是 :meth:`~object.__getitem__` method,該物件就是可疊代物件。" -#: ../../glossary.rst:829 +#: ../../glossary.rst:842 msgid "" "Iterables can be used in a :keyword:`for` loop and in many other places " "where a sequence is needed (:func:`zip`, :func:`map`, ...). When an " @@ -1862,11 +1890,11 @@ msgstr "" "數,用於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、:" "term:`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" -#: ../../glossary.rst:839 +#: ../../glossary.rst:852 msgid "iterator" msgstr "iterator(疊代器)" -#: ../../glossary.rst:841 +#: ../../glossary.rst:854 msgid "" "An object representing a stream of data. Repeated calls to the iterator's :" "meth:`~iterator.__next__` method (or passing it to the built-in function :" @@ -1895,11 +1923,11 @@ msgstr "" "此事(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一個已被用盡的疊代器物" "件,使其看起來就像一個空的容器。" -#: ../../glossary.rst:856 +#: ../../glossary.rst:869 msgid "More information can be found in :ref:`typeiter`." msgstr "在\\ :ref:`typeiter`\\ 文中可以找到更多資訊。" -#: ../../glossary.rst:860 +#: ../../glossary.rst:873 msgid "" "CPython does not consistently apply the requirement that an iterator define :" "meth:`~iterator.__iter__`. And also please note that :term:`free-threaded " @@ -1911,11 +1939,21 @@ msgstr "" "threading>` CPython 不保證疊代器操作的\\ :term:`執行緒安全 ` 行" "為。" -#: ../../glossary.rst:866 +#: ../../glossary.rst:878 +msgid "key" +msgstr "" + +#: ../../glossary.rst:880 +msgid "" +"A value that identifies an entry in a :term:`mapping`. See also :term:" +"`subscript`." +msgstr "" + +#: ../../glossary.rst:882 msgid "key function" msgstr "key function(鍵函式)" -#: ../../glossary.rst:868 +#: ../../glossary.rst:884 msgid "" "A key function or collation function is a callable that returns a value used " "for sorting or ordering. For example, :func:`locale.strxfrm` is used to " @@ -1925,7 +1963,7 @@ msgstr "" "一個用於排序 (sorting) 或定序 (ordering) 的值。例如,:func:`locale.strxfrm` " "被用來產生一個了解區域特定排序慣例的排序鍵。" -#: ../../glossary.rst:873 +#: ../../glossary.rst:889 msgid "" "A number of tools in Python accept key functions to control how elements are " "ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`, :" @@ -1937,7 +1975,7 @@ msgstr "" "merge`、:func:`heapq.nsmallest`、:func:`heapq.nlargest` 和 :func:`itertools." "groupby`。" -#: ../../glossary.rst:879 +#: ../../glossary.rst:895 msgid "" "There are several ways to create a key function. For example. the :meth:" "`str.casefold` method can serve as a key function for case insensitive " @@ -1954,19 +1992,19 @@ msgstr "" "式 (constructor)。關於如何建立和使用鍵函式的範例,請參閱\\ :ref:`如何排序 " "`。" -#: ../../glossary.rst:886 +#: ../../glossary.rst:902 msgid "keyword argument" msgstr "keyword argument(關鍵字引數)" -#: ../../glossary.rst:888 ../../glossary.rst:1255 +#: ../../glossary.rst:904 ../../glossary.rst:1271 msgid "See :term:`argument`." msgstr "請參閱 :term:`argument`\\ (引數)。" -#: ../../glossary.rst:889 +#: ../../glossary.rst:905 msgid "lambda" msgstr "lambda" -#: ../../glossary.rst:891 +#: ../../glossary.rst:907 msgid "" "An anonymous inline function consisting of a single :term:`expression` which " "is evaluated when the function is called. The syntax to create a lambda " @@ -1976,11 +2014,11 @@ msgstr "" "function),於該函式被呼叫時求值。建立 lambda 函式的語法是 ``lambda " "[parameters]: expression``" -#: ../../glossary.rst:894 +#: ../../glossary.rst:910 msgid "LBYL" msgstr "LBYL" -#: ../../glossary.rst:896 +#: ../../glossary.rst:912 msgid "" "Look before you leap. This coding style explicitly tests for pre-conditions " "before making calls or lookups. This style contrasts with the :term:`EAFP` " @@ -1991,7 +2029,7 @@ msgstr "" "地測試先決條件。這種風格與 :term:`EAFP` 方式形成對比,且它的特色是會有許多 :" "keyword:`if` 陳述式的存在。" -#: ../../glossary.rst:901 +#: ../../glossary.rst:917 msgid "" "In a multi-threaded environment, the LBYL approach can risk introducing a :" "term:`race condition` between \"the looking\" and \"the leaping\". For " @@ -2006,19 +2044,19 @@ msgstr "" "了 *key*,則該程式碼就會失效。這個問題可以用\\ :term:`鎖 `\\ 或使用 :" "term:`EAFP` 編碼方式來解決。另請參閱\\ :term:`執行緒安全 `。" -#: ../../glossary.rst:907 +#: ../../glossary.rst:923 msgid "lexical analyzer" msgstr "lexical analyzer(詞法分析器)" -#: ../../glossary.rst:910 +#: ../../glossary.rst:926 msgid "Formal name for the *tokenizer*; see :term:`token`." msgstr "tokenizer 的正式名稱;請參閱 :term:`token`。" -#: ../../glossary.rst:911 +#: ../../glossary.rst:927 msgid "list" msgstr "list(串列)" -#: ../../glossary.rst:913 +#: ../../glossary.rst:929 msgid "" "A built-in Python :term:`sequence`. Despite its name it is more akin to an " "array in other languages than to a linked list since access to elements is " @@ -2028,11 +2066,11 @@ msgstr "" "似其他語言中的一個陣列 (array) 而較不像一個鏈結串列 (linked list),因為存取元" "素的時間複雜度是 *O*\\ (1)。" -#: ../../glossary.rst:916 +#: ../../glossary.rst:932 msgid "list comprehension" msgstr "list comprehension(串列綜合運算)" -#: ../../glossary.rst:918 +#: ../../glossary.rst:934 msgid "" "A compact way to process all or part of the elements in a sequence and " "return a list with the results. ``result = ['{:#04x}'.format(x) for x in " @@ -2046,11 +2084,11 @@ msgstr "" "keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所有元素都會被" "處理。" -#: ../../glossary.rst:924 +#: ../../glossary.rst:940 msgid "lock" msgstr "lock(鎖)" -#: ../../glossary.rst:926 +#: ../../glossary.rst:942 msgid "" "A :term:`synchronization primitive` that allows only one thread at a time to " "access a shared resource. A thread must acquire a lock before accessing the " @@ -2065,11 +2103,11 @@ msgid "" "`reentrant`." msgstr "" -#: ../../glossary.rst:937 +#: ../../glossary.rst:953 msgid "loader" msgstr "loader(載入器)" -#: ../../glossary.rst:939 +#: ../../glossary.rst:955 msgid "" "An object that loads a module. It must define the :meth:`!exec_module` and :" "meth:`!create_module` methods to implement the :class:`~importlib.abc." @@ -2080,23 +2118,23 @@ msgstr "" "create_module` 方法以實作 :class:`~importlib.abc.Loader` 介面。載入器通常是" "被 :term:`finder`\\ (尋檢器)回傳。更多細節請參閱:" -#: ../../glossary.rst:945 +#: ../../glossary.rst:961 msgid ":ref:`finders-and-loaders`" msgstr ":ref:`finders-and-loaders`" -#: ../../glossary.rst:946 +#: ../../glossary.rst:962 msgid ":class:`importlib.abc.Loader`" msgstr ":class:`importlib.abc.Loader`" -#: ../../glossary.rst:947 +#: ../../glossary.rst:963 msgid ":pep:`302`" msgstr ":pep:`302`" -#: ../../glossary.rst:948 +#: ../../glossary.rst:964 msgid "locale encoding" msgstr "locale encoding(區域編碼)" -#: ../../glossary.rst:950 +#: ../../glossary.rst:966 msgid "" "On Unix, it is the encoding of the LC_CTYPE locale. It can be set with :func:" "`locale.setlocale(locale.LC_CTYPE, new_locale) `." @@ -2104,36 +2142,36 @@ msgstr "" "在 Unix 上,它是 LC_CTYPE 區域設定的編碼。它可以用 :func:`locale." "setlocale(locale.LC_CTYPE, new_locale) ` 來設定。" -#: ../../glossary.rst:953 +#: ../../glossary.rst:969 msgid "On Windows, it is the ANSI code page (ex: ``\"cp1252\"``)." msgstr "在 Windows 上,它是 ANSI 碼頁(code page,例如 ``\"cp1252\"``\\ )。" -#: ../../glossary.rst:955 +#: ../../glossary.rst:971 msgid "" "On Android and VxWorks, Python uses ``\"utf-8\"`` as the locale encoding." msgstr "在 Android 和 VxWorks 上,Python 使用 ``\"utf-8\"`` 作為區域編碼。" -#: ../../glossary.rst:957 +#: ../../glossary.rst:973 msgid ":func:`locale.getencoding` can be used to get the locale encoding." msgstr ":func:`locale.getencoding` 可以用來取得區域編碼。" -#: ../../glossary.rst:959 +#: ../../glossary.rst:975 msgid "See also the :term:`filesystem encoding and error handler`." msgstr "也請參考 :term:`filesystem encoding and error handler`。" -#: ../../glossary.rst:960 +#: ../../glossary.rst:976 msgid "magic method" msgstr "magic method(魔術方法)" -#: ../../glossary.rst:964 +#: ../../glossary.rst:980 msgid "An informal synonym for :term:`special method`." msgstr ":term:`special method`\\ (特殊方法)的一個非正式同義詞。" -#: ../../glossary.rst:965 +#: ../../glossary.rst:981 msgid "mapping" msgstr "mapping(對映)" -#: ../../glossary.rst:967 +#: ../../glossary.rst:983 msgid "" "A container object that supports arbitrary key lookups and implements the " "methods specified in the :class:`collections.abc.Mapping` or :class:" @@ -2148,11 +2186,11 @@ msgstr "" "包括 :class:`dict`、:class:`collections.defaultdict`、:class:`collections." "OrderedDict` 和 :class:`collections.Counter`。" -#: ../../glossary.rst:973 +#: ../../glossary.rst:989 msgid "meta path finder" msgstr "meta path finder(元路徑尋檢器)" -#: ../../glossary.rst:975 +#: ../../glossary.rst:991 msgid "" "A :term:`finder` returned by a search of :data:`sys.meta_path`. Meta path " "finders are related to, but different from :term:`path entry finders ` " "相關但是不同。" -#: ../../glossary.rst:979 +#: ../../glossary.rst:995 msgid "" "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " "finders implement." msgstr "" "關於元路徑尋檢器實作的 method,請參閱 :class:`importlib.abc.MetaPathFinder`。" -#: ../../glossary.rst:981 +#: ../../glossary.rst:997 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../glossary.rst:983 +#: ../../glossary.rst:999 msgid "" "The class of a class. Class definitions create a class name, a class " "dictionary, and a list of base classes. The metaclass is responsible for " @@ -2193,15 +2231,15 @@ msgstr "" "性存取、增加執行緒安全性、追蹤物件建立、實作單例模式 (singleton),以及許多其" "他的任務。" -#: ../../glossary.rst:993 +#: ../../glossary.rst:1009 msgid "More information can be found in :ref:`metaclasses`." msgstr "更多資訊可以在\\ :ref:`metaclasses`\\ 章節中找到。" -#: ../../glossary.rst:962 ../../glossary.rst:994 ../../glossary.rst:1437 +#: ../../glossary.rst:978 ../../glossary.rst:1010 ../../glossary.rst:1454 msgid "method" msgstr "method(方法)" -#: ../../glossary.rst:996 +#: ../../glossary.rst:1012 msgid "" "A function which is defined inside a class body. If called as an attribute " "of an instance of that class, the method will get the instance object as its " @@ -2213,11 +2251,11 @@ msgstr "" "通常被稱為 ``self``)。請參閱 :term:`function`\\ (函式)和 :term:`nested " "scope`\\ (巢狀作用域)。" -#: ../../glossary.rst:1000 +#: ../../glossary.rst:1016 msgid "method resolution order" msgstr "method resolution order(方法解析順序)" -#: ../../glossary.rst:1002 +#: ../../glossary.rst:1018 msgid "" "Method Resolution Order is the order in which base classes are searched for " "a member during lookup. See :ref:`python_2.3_mro` for details of the " @@ -2226,11 +2264,11 @@ msgstr "" "方法解析順序是在查找某個成員的過程中,base class(基底類別)被搜尋的順序。關" "於 Python 自 2.3 版直譯器所使用的演算法細節,請參閱 :ref:`python_2.3_mro`。" -#: ../../glossary.rst:1005 +#: ../../glossary.rst:1021 msgid "module" msgstr "module(模組)" -#: ../../glossary.rst:1007 +#: ../../glossary.rst:1023 msgid "" "An object that serves as an organizational unit of Python code. Modules " "have a namespace containing arbitrary Python objects. Modules are loaded " @@ -2240,15 +2278,15 @@ msgstr "" "空間,它包含任意的 Python 物件。模組是藉由 :term:`importing` 的過程,被載入" "至 Python。" -#: ../../glossary.rst:1011 +#: ../../glossary.rst:1027 msgid "See also :term:`package`." msgstr "另請參閱 :term:`package`\\ (套件)。" -#: ../../glossary.rst:1012 +#: ../../glossary.rst:1028 msgid "module spec" msgstr "module spec(模組規格)" -#: ../../glossary.rst:1014 +#: ../../glossary.rst:1030 msgid "" "A namespace containing the import-related information used to load a module. " "An instance of :class:`importlib.machinery.ModuleSpec`." @@ -2256,23 +2294,23 @@ msgstr "" "一個命名空間,它包含用於載入模組的 import 相關資訊。它是 :class:`importlib." "machinery.ModuleSpec` 的一個實例。" -#: ../../glossary.rst:1017 +#: ../../glossary.rst:1033 msgid "See also :ref:`module-specs`." msgstr "另請參閱 :ref:`module-specs`。" -#: ../../glossary.rst:1018 +#: ../../glossary.rst:1034 msgid "MRO" msgstr "MRO" -#: ../../glossary.rst:1020 +#: ../../glossary.rst:1036 msgid "See :term:`method resolution order`." msgstr "請參閱 :term:`method resolution order`\\ (方法解析順序)。" -#: ../../glossary.rst:1021 +#: ../../glossary.rst:1037 msgid "mutable" msgstr "mutable(可變物件)" -#: ../../glossary.rst:1023 +#: ../../glossary.rst:1039 msgid "" "An :term:`object` with state that is allowed to change during the course of " "the program. In multi-threaded programs, mutable objects that are shared " @@ -2281,11 +2319,11 @@ msgid "" "safe`, and :term:`concurrent modification`." msgstr "" -#: ../../glossary.rst:1028 +#: ../../glossary.rst:1044 msgid "named tuple" msgstr "named tuple(附名元組)" -#: ../../glossary.rst:1030 +#: ../../glossary.rst:1046 msgid "" "The term \"named tuple\" applies to any type or class that inherits from " "tuple and whose indexable elements are also accessible using named " @@ -2295,7 +2333,7 @@ msgstr "" "索引 (indexable) 元素也可以用附名屬性來存取。這些型別或 class 也可以具有其他" "的特性。" -#: ../../glossary.rst:1034 +#: ../../glossary.rst:1050 msgid "" "Several built-in types are named tuples, including the values returned by :" "func:`time.localtime` and :func:`os.stat`. Another example is :data:`sys." @@ -2304,7 +2342,7 @@ msgstr "" "有些內建型別是 named tuple,包括由 :func:`time.localtime` 和 :func:`os.stat` " "回傳的值。另一個例子是 :data:`sys.float_info`: ::" -#: ../../glossary.rst:1038 +#: ../../glossary.rst:1054 msgid "" ">>> sys.float_info[1] # indexed access\n" "1024\n" @@ -2320,7 +2358,7 @@ msgstr "" ">>> isinstance(sys.float_info, tuple) # 屬於 tuple 型別\n" "True" -#: ../../glossary.rst:1045 +#: ../../glossary.rst:1061 msgid "" "Some named tuples are built-in types (such as the above examples). " "Alternatively, a named tuple can be created from a regular class definition " @@ -2337,11 +2375,11 @@ msgstr "" "namedtuple` 來建立。後者技術也增加了一些額外的 method,這些 method 可能是在手" "寫或內建的 named tuple 中,無法找到的。" -#: ../../glossary.rst:1053 +#: ../../glossary.rst:1069 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../glossary.rst:1055 +#: ../../glossary.rst:1071 msgid "" "The place where a variable is stored. Namespaces are implemented as " "dictionaries. There are the local, global and built-in namespaces as well " @@ -2361,11 +2399,11 @@ msgstr "" "func:`itertools.islice` 明確地表示,這些函式分別是由 :mod:`random` 和 :mod:" "`itertools` 模組在實作。" -#: ../../glossary.rst:1065 +#: ../../glossary.rst:1081 msgid "namespace package" msgstr "namespace package(命名空間套件)" -#: ../../glossary.rst:1067 +#: ../../glossary.rst:1083 msgid "" "A :term:`package` which serves only as a container for subpackages. " "Namespace packages may have no physical representation, and specifically are " @@ -2375,7 +2413,7 @@ msgstr "" "名空間套件可能沒有實體的表示法,而且具體來說它們不像是一個 :term:`regular " "package`\\ (正規套件),因為它們並沒有 ``__init__.py`` 這個檔案。" -#: ../../glossary.rst:1072 +#: ../../glossary.rst:1088 msgid "" "Namespace packages allow several individually installable packages to have a " "common parent package. Otherwise, it is recommended to use a :term:`regular " @@ -2384,20 +2422,20 @@ msgstr "" "命名空間套件允許數個可獨立安裝的套件擁有一個共同的父套件。除此之外,建議使" "用 :term:`regular package`。" -#: ../../glossary.rst:1075 +#: ../../glossary.rst:1091 msgid "" "For more information, see :pep:`420` and :ref:`reference-namespace-package`." msgstr "更多資訊,請參閱 :pep:`420` 和 :ref:`reference-namespace-package`。" -#: ../../glossary.rst:1077 +#: ../../glossary.rst:1093 msgid "See also :term:`module`." msgstr "另請參閱 :term:`module`\\ (模組)。" -#: ../../glossary.rst:1078 +#: ../../glossary.rst:1094 msgid "native code" msgstr "" -#: ../../glossary.rst:1080 +#: ../../glossary.rst:1096 msgid "" "Code that is compiled to machine instructions and runs directly on the " "processor, as opposed to code that is interpreted or runs in a virtual " @@ -2406,11 +2444,11 @@ msgid "" "can be called from Python. See also :term:`extension module`." msgstr "" -#: ../../glossary.rst:1085 +#: ../../glossary.rst:1101 msgid "nested scope" msgstr "nested scope(巢狀作用域)" -#: ../../glossary.rst:1087 +#: ../../glossary.rst:1103 msgid "" "The ability to refer to a variable in an enclosing definition. For " "instance, a function defined inside another function can refer to variables " @@ -2425,11 +2463,11 @@ msgstr "" "寫入。同樣地,全域變數是在全域命名空間中讀取及寫入。:keyword:`nonlocal` 容許" "對外層作用域進行寫入。" -#: ../../glossary.rst:1094 +#: ../../glossary.rst:1110 msgid "new-style class" msgstr "new-style class(新式類別)" -#: ../../glossary.rst:1096 +#: ../../glossary.rst:1112 msgid "" "Old name for the flavor of classes now used for all class objects. In " "earlier Python versions, only new-style classes could use Python's newer, " @@ -2441,11 +2479,11 @@ msgstr "" "__slots__`、描述器 (descriptor)、屬性 (property)、:meth:`~object." "__getattribute__`、class method(類別方法)和 static method(靜態方法)。" -#: ../../glossary.rst:1101 +#: ../../glossary.rst:1117 msgid "non-deterministic" msgstr "" -#: ../../glossary.rst:1103 +#: ../../glossary.rst:1119 msgid "" "Behavior where the outcome of a program can vary between executions with the " "same inputs. In multi-threaded programs, non-deterministic behavior often " @@ -2455,11 +2493,11 @@ msgid "" "` helps ensure deterministic behavior." msgstr "" -#: ../../glossary.rst:1110 +#: ../../glossary.rst:1126 msgid "object" msgstr "object(物件)" -#: ../../glossary.rst:1112 +#: ../../glossary.rst:1128 msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." @@ -2467,11 +2505,11 @@ msgstr "" "具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任何 :term:" "`new-style class`\\ (新式類別)的最終 base class(基底類別)。" -#: ../../glossary.rst:1115 +#: ../../glossary.rst:1131 msgid "optimized scope" msgstr "optimized scope(最佳化作用域)" -#: ../../glossary.rst:1117 +#: ../../glossary.rst:1133 msgid "" "A scope where target local variable names are reliably known to the compiler " "when the code is compiled, allowing optimization of read and write access to " @@ -2482,11 +2520,11 @@ msgid "" "to optimized scopes." msgstr "" -#: ../../glossary.rst:1124 +#: ../../glossary.rst:1140 msgid "optional module" msgstr "optional module(可選模組)" -#: ../../glossary.rst:1126 +#: ../../glossary.rst:1142 msgid "" "An :term:`extension module` that is part of the :term:`standard library`, " "but may be absent in some builds of :term:`CPython`, usually due to missing " @@ -2494,17 +2532,17 @@ msgid "" "platform." msgstr "" -#: ../../glossary.rst:1131 +#: ../../glossary.rst:1147 msgid "" "See :ref:`optional-module-requirements` for a list of optional modules that " "require third-party libraries." msgstr "" -#: ../../glossary.rst:1133 +#: ../../glossary.rst:1149 msgid "package" msgstr "package(套件)" -#: ../../glossary.rst:1135 +#: ../../glossary.rst:1151 msgid "" "A Python :term:`module` which can contain submodules or recursively, " "subpackages. Technically, a package is a Python module with a ``__path__`` " @@ -2514,17 +2552,17 @@ msgstr "" "迴的子套件 (subpackage)。技術上而言,套件就是具有 ``__path__`` 屬性的一個 " "Python 模組。" -#: ../../glossary.rst:1139 +#: ../../glossary.rst:1155 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr "" "另請參閱 :term:`regular package`\\ (正規套件)和 :term:`namespace " "package`\\ (命名空間套件)。" -#: ../../glossary.rst:1140 +#: ../../glossary.rst:1156 msgid "parallelism" msgstr "" -#: ../../glossary.rst:1142 +#: ../../glossary.rst:1158 msgid "" "Executing multiple operations at the same time (e.g. on multiple CPU " "cores). In Python builds with the :term:`global interpreter lock (GIL) " @@ -2535,11 +2573,11 @@ msgid "" "threads can run Python code simultaneously on different cores." msgstr "" -#: ../../glossary.rst:1150 +#: ../../glossary.rst:1166 msgid "parameter" msgstr "parameter(參數)" -#: ../../glossary.rst:1152 +#: ../../glossary.rst:1168 msgid "" "A named entity in a :term:`function` (or method) definition that specifies " "an :term:`argument` (or in some cases, arguments) that the function can " @@ -2549,7 +2587,7 @@ msgstr "" "它指明該函式能夠接受的一個 :term:`argument`\\ (引數),或在某些情況下指示多" "個引數。共有有五種不同的參數類型:" -#: ../../glossary.rst:1156 +#: ../../glossary.rst:1172 msgid "" ":dfn:`positional-or-keyword`: specifies an argument that can be passed " "either :term:`positionally ` or as a :term:`keyword argument " @@ -2560,11 +2598,11 @@ msgstr "" "置 `\\ 或是作為\\ :term:`關鍵字引數 `\\ 被傳遞的引數。這" "是參數的預設類型,例如以下的 *foo* 和 *bar*: ::" -#: ../../glossary.rst:1161 +#: ../../glossary.rst:1177 msgid "def func(foo, bar=None): ..." msgstr "def func(foo, bar=None): ..." -#: ../../glossary.rst:1165 +#: ../../glossary.rst:1181 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " @@ -2575,11 +2613,11 @@ msgstr "" "式定義的參數列表中包含一個 ``/`` 字元,就可以在該字元前面定義僅限位置參數,例" "如以下的 *posonly1* 和 *posonly2*: ::" -#: ../../glossary.rst:1170 +#: ../../glossary.rst:1186 msgid "def func(posonly1, posonly2, /, positional_or_keyword): ..." msgstr "def func(posonly1, posonly2, /, positional_or_keyword): ..." -#: ../../glossary.rst:1174 +#: ../../glossary.rst:1190 msgid "" ":dfn:`keyword-only`: specifies an argument that can be supplied only by " "keyword. Keyword-only parameters can be defined by including a single var-" @@ -2592,11 +2630,11 @@ msgstr "" "單純的 ``*`` 字元,就可以在其後方定義僅限關鍵字參數,例如以下的 *kw_only1* " "和 *kw_only2*: ::" -#: ../../glossary.rst:1180 +#: ../../glossary.rst:1196 msgid "def func(arg, *, kw_only1, kw_only2): ..." msgstr "def func(arg, *, kw_only1, kw_only2): ..." -#: ../../glossary.rst:1182 +#: ../../glossary.rst:1198 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " "arguments can be provided (in addition to any positional arguments already " @@ -2608,11 +2646,11 @@ msgstr "" "數(在已被其他參數接受的任何位置引數之外)。這類參數是透過在其參數名稱字首加" "上 ``*`` 來定義的,例如以下的 *args*: ::" -#: ../../glossary.rst:1188 +#: ../../glossary.rst:1204 msgid "def func(*args, **kwargs): ..." msgstr "def func(*args, **kwargs): ..." -#: ../../glossary.rst:1190 +#: ../../glossary.rst:1206 msgid "" ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " "provided (in addition to any keyword arguments already accepted by other " @@ -2623,14 +2661,14 @@ msgstr "" "已被其他參數接受的任何關鍵字引數之外)。這類參數是透過在其參數名稱字首加上 " "``**`` 來定義的,例如上面範例中的 *kwargs*。" -#: ../../glossary.rst:1196 +#: ../../glossary.rst:1212 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." msgstr "" "參數可以指明引數是選擇性的或必需的,也可以為一些選擇性的引數指定預設值。" -#: ../../glossary.rst:1199 +#: ../../glossary.rst:1215 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " @@ -2641,11 +2679,11 @@ msgstr "" "參數之間的差異 `、:class:`inspect.Parameter` " "class、:ref:`function`\\ 章節,以及 :pep:`362`。" -#: ../../glossary.rst:1203 +#: ../../glossary.rst:1219 msgid "path entry" msgstr "path entry(路徑項目)" -#: ../../glossary.rst:1205 +#: ../../glossary.rst:1221 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." @@ -2653,11 +2691,11 @@ msgstr "" "在 :term:`import path`\\ (引入路徑)中的一個位置,而 :term:`path based " "finder` (基於路徑的尋檢器)會參考該位置來尋找要 import 的模組。" -#: ../../glossary.rst:1207 +#: ../../glossary.rst:1223 msgid "path entry finder" msgstr "path entry finder(路徑項目尋檢器)" -#: ../../glossary.rst:1209 +#: ../../glossary.rst:1225 msgid "" "A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :" "term:`path entry hook`) which knows how to locate modules given a :term:" @@ -2667,7 +2705,7 @@ msgstr "" "`path entry hook`\\ )所回傳的一種 :term:`finder`,它知道如何以一個 :term:" "`path entry`\\ 定位模組。" -#: ../../glossary.rst:1213 +#: ../../glossary.rst:1229 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." @@ -2675,11 +2713,11 @@ msgstr "" "關於路徑項目尋檢器實作的 method,請參閱 :class:`importlib.abc." "PathEntryFinder`。" -#: ../../glossary.rst:1215 +#: ../../glossary.rst:1231 msgid "path entry hook" msgstr "path entry hook(路徑項目鉤)" -#: ../../glossary.rst:1217 +#: ../../glossary.rst:1233 msgid "" "A callable on the :data:`sys.path_hooks` list which returns a :term:`path " "entry finder` if it knows how to find modules on a specific :term:`path " @@ -2689,11 +2727,11 @@ msgstr "" "個特定的 :term:`path entry` 中尋找模組,則會回傳一個 :term:`path entry " "finder`\\ (路徑項目尋檢器)。" -#: ../../glossary.rst:1220 +#: ../../glossary.rst:1236 msgid "path based finder" msgstr "path based finder(基於路徑的尋檢器)" -#: ../../glossary.rst:1222 +#: ../../glossary.rst:1238 msgid "" "One of the default :term:`meta path finders ` which " "searches an :term:`import path` for modules." @@ -2701,11 +2739,11 @@ msgstr "" "預設的\\ :term:`元路徑尋檢器 (meta path finder) ` 之一,它" "會在一個 :term:`import path` 中搜尋模組。" -#: ../../glossary.rst:1224 +#: ../../glossary.rst:1240 msgid "path-like object" msgstr "path-like object(類路徑物件)" -#: ../../glossary.rst:1226 +#: ../../glossary.rst:1242 msgid "" "An object representing a file system path. A path-like object is either a :" "class:`str` or :class:`bytes` object representing a path, or an object " @@ -2723,11 +2761,11 @@ msgstr "" "`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。由 :" "pep:`519` 引入。" -#: ../../glossary.rst:1234 +#: ../../glossary.rst:1250 msgid "PEP" msgstr "PEP" -#: ../../glossary.rst:1236 +#: ../../glossary.rst:1252 msgid "" "Python Enhancement Proposal. A PEP is a design document providing " "information to the Python community, or describing a new feature for Python " @@ -2738,7 +2776,7 @@ msgstr "" "為 Python 社群提供資訊,或是描述 Python 的一個新功能或該功能的程序和環境。" "PEP 應該要提供簡潔的技術規範以及被提案功能的運作原理。" -#: ../../glossary.rst:1242 +#: ../../glossary.rst:1258 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " @@ -2750,15 +2788,15 @@ msgstr "" "已納入 Python 的設計決策的記錄,這些過程的主要機制。PEP 的作者要負責在社群內" "建立共識並記錄反對意見。" -#: ../../glossary.rst:1248 +#: ../../glossary.rst:1264 msgid "See :pep:`1`." msgstr "請參閱 :pep:`1`。" -#: ../../glossary.rst:1249 +#: ../../glossary.rst:1265 msgid "portion" msgstr "portion(部分)" -#: ../../glossary.rst:1251 +#: ../../glossary.rst:1267 msgid "" "A set of files in a single directory (possibly stored in a zip file) that " "contribute to a namespace package, as defined in :pep:`420`." @@ -2766,15 +2804,15 @@ msgstr "" "在單一目錄中的一組檔案(也可能儲存在一個 zip 檔中),這些檔案能對一個命名空間" "套件 (namespace package) 有所貢獻,如同 :pep:`420` 中的定義。" -#: ../../glossary.rst:1253 +#: ../../glossary.rst:1269 msgid "positional argument" msgstr "positional argument(位置引數)" -#: ../../glossary.rst:1256 +#: ../../glossary.rst:1272 msgid "provisional API" msgstr "provisional API(暫行 API)" -#: ../../glossary.rst:1258 +#: ../../glossary.rst:1274 msgid "" "A provisional API is one which has been deliberately excluded from the " "standard library's backwards compatibility guarantees. While major changes " @@ -2790,7 +2828,7 @@ msgstr "" "該介面)。這種變更並不會無端地產生——只有 API 被納入之前未察覺的嚴重基本缺陷被" "揭露時,它們才會發生。" -#: ../../glossary.rst:1267 +#: ../../glossary.rst:1283 msgid "" "Even for provisional APIs, backwards incompatible changes are seen as a " "\"solution of last resort\" - every attempt will still be made to find a " @@ -2799,7 +2837,7 @@ msgstr "" "即使對於暫行 API,向後不相容的變更也會被視為「最後的解決方案」——對於任何被發" "現的問題,仍然會盡可能找出一個向後相容的解決方案。" -#: ../../glossary.rst:1271 +#: ../../glossary.rst:1287 msgid "" "This process allows the standard library to continue to evolve over time, " "without locking in problematic design errors for extended periods of time. " @@ -2808,19 +2846,19 @@ msgstr "" "這個過程使得標準函式庫能隨著時間不斷進化,而避免耗費過長的時間去鎖定有問題的" "設計錯誤。請參閱 :pep:`411` 了解更多細節。" -#: ../../glossary.rst:1274 +#: ../../glossary.rst:1290 msgid "provisional package" msgstr "provisional package(暫行套件)" -#: ../../glossary.rst:1276 +#: ../../glossary.rst:1292 msgid "See :term:`provisional API`." msgstr "請參閱 :term:`provisional API`\\ (暫行 API)。" -#: ../../glossary.rst:1277 +#: ../../glossary.rst:1293 msgid "Python 3000" msgstr "Python 3000" -#: ../../glossary.rst:1279 +#: ../../glossary.rst:1295 msgid "" "Nickname for the Python 3.x release line (coined long ago when the release " "of version 3 was something in the distant future.) This is also abbreviated " @@ -2829,11 +2867,11 @@ msgstr "" "Python 3.x 系列版本的暱稱(很久以前創造的,當時第 3 版的發布是在遙遠的未" "來。)也可以縮寫為「Py3k」。" -#: ../../glossary.rst:1282 +#: ../../glossary.rst:1298 msgid "Pythonic" msgstr "Pythonic(Python 風格的)" -#: ../../glossary.rst:1284 +#: ../../glossary.rst:1300 msgid "" "An idea or piece of code which closely follows the most common idioms of the " "Python language, rather than implementing code using concepts common to " @@ -2847,7 +2885,7 @@ msgstr "" "keyword:`for` 陳述式,對一個可疊代物件的所有元素進行迴圈。許多其他語言並沒有" "這種類型的架構,所以不熟悉 Python 的人有時會使用一個數值計數器來代替: ::" -#: ../../glossary.rst:1291 +#: ../../glossary.rst:1307 msgid "" "for i in range(len(food)):\n" " print(food[i])" @@ -2855,11 +2893,11 @@ msgstr "" "for i in range(len(food)):\n" " print(food[i])" -#: ../../glossary.rst:1294 +#: ../../glossary.rst:1310 msgid "As opposed to the cleaner, Pythonic method::" msgstr "相較之下,以下方法更簡潔、更具有 Python 風格: ::" -#: ../../glossary.rst:1296 +#: ../../glossary.rst:1312 msgid "" "for piece in food:\n" " print(piece)" @@ -2867,11 +2905,11 @@ msgstr "" "for piece in food:\n" " print(piece)" -#: ../../glossary.rst:1298 +#: ../../glossary.rst:1314 msgid "qualified name" msgstr "qualified name(限定名稱)" -#: ../../glossary.rst:1300 +#: ../../glossary.rst:1316 msgid "" "A dotted name showing the \"path\" from a module's global scope to a class, " "function or method defined in that module, as defined in :pep:`3155`. For " @@ -2882,7 +2920,7 @@ msgstr "" "或 method 的「路徑」,如 :pep:`3155` 中的定義。對於頂層的函式和 class 而言," "限定名稱與其物件名稱相同: ::" -#: ../../glossary.rst:1305 +#: ../../glossary.rst:1321 msgid "" ">>> class C:\n" "... class D:\n" @@ -2908,7 +2946,7 @@ msgstr "" ">>> C.D.meth.__qualname__\n" "'C.D.meth'" -#: ../../glossary.rst:1317 +#: ../../glossary.rst:1333 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " "dotted path to the module, including any parent packages, e.g. ``email.mime." @@ -2917,7 +2955,7 @@ msgstr "" "當用於引用模組時,*完全限定名稱 (fully qualified name)* 是表示該模組的完整點" "分隔路徑,包括任何的父套件,例如 ``email.mime.text``: ::" -#: ../../glossary.rst:1321 +#: ../../glossary.rst:1337 msgid "" ">>> import email.mime.text\n" ">>> email.mime.text.__name__\n" @@ -2927,11 +2965,11 @@ msgstr "" ">>> email.mime.text.__name__\n" "'email.mime.text'" -#: ../../glossary.rst:1324 +#: ../../glossary.rst:1340 msgid "race condition" msgstr "" -#: ../../glossary.rst:1326 +#: ../../glossary.rst:1342 msgid "" "A condition of a program where the its behavior depends on the relative " "timing or ordering of events, particularly in multi-threaded programs. Race " @@ -2943,11 +2981,11 @@ msgid "" "primitives ` helps prevent race conditions." msgstr "" -#: ../../glossary.rst:1336 +#: ../../glossary.rst:1352 msgid "reference count" msgstr "reference count(參照計數)" -#: ../../glossary.rst:1338 +#: ../../glossary.rst:1354 msgid "" "The number of references to an object. When the reference count of an " "object drops to zero, it is deallocated. Some objects are :term:`immortal` " @@ -2963,7 +3001,7 @@ msgstr "" "看不到,但它卻是 :term:`CPython` 實作的一個關鍵元素。程式設計師可以呼叫 :" "func:`~sys.getrefcount` 函式來回傳一個特定物件的參照計數。" -#: ../../glossary.rst:1347 +#: ../../glossary.rst:1363 msgid "" "In :term:`CPython`, reference counts are not considered to be stable or well-" "defined values; the number of references to an object, and how that number " @@ -2972,11 +3010,11 @@ msgstr "" "在 :term:`CPython` 中,參照計數不被視為穩定或明確定義的值;對物件的參照數量," "以及該數量如何受到 Python 程式碼的影響,在不同版本之間可能會有所不同。" -#: ../../glossary.rst:1351 +#: ../../glossary.rst:1367 msgid "regular package" msgstr "regular package(正規套件)" -#: ../../glossary.rst:1353 +#: ../../glossary.rst:1369 msgid "" "A traditional :term:`package`, such as a directory containing an ``__init__." "py`` file." @@ -2984,22 +3022,22 @@ msgstr "" "一個傳統的 :term:`package`\\ (套件),例如一個包含 ``__init__.py`` 檔案的目" "錄。" -#: ../../glossary.rst:1356 +#: ../../glossary.rst:1372 msgid "See also :term:`namespace package`." msgstr "另請參閱 :term:`namespace package`\\ (命名空間套件)。" -#: ../../glossary.rst:1357 +#: ../../glossary.rst:1373 msgid "reentrant" msgstr "" -#: ../../glossary.rst:1359 +#: ../../glossary.rst:1375 msgid "" "A property of a function or :term:`lock` that allows it to be called or " "acquired multiple times by the same thread without causing errors or a :term:" "`deadlock`." msgstr "" -#: ../../glossary.rst:1363 +#: ../../glossary.rst:1379 msgid "" "For functions, reentrancy means the function can be safely called again " "before a previous invocation has completed, which is important when " @@ -3008,7 +3046,7 @@ msgid "" "a multithreaded program." msgstr "" -#: ../../glossary.rst:1369 +#: ../../glossary.rst:1385 msgid "" "For locks, Python's :class:`threading.RLock` (reentrant lock) is reentrant, " "meaning a thread that already holds the lock can acquire it again without " @@ -3016,15 +3054,15 @@ msgid "" "attempting to acquire it twice from the same thread will cause a deadlock." msgstr "" -#: ../../glossary.rst:1375 +#: ../../glossary.rst:1391 msgid "See also :term:`lock` and :term:`deadlock`." msgstr "另請參閱 :term:`lock` 和 :term:`deadlock`。" -#: ../../glossary.rst:1376 +#: ../../glossary.rst:1392 msgid "REPL" msgstr "REPL" -#: ../../glossary.rst:1378 +#: ../../glossary.rst:1394 msgid "" "An acronym for the \"read–eval–print loop\", another name for the :term:" "`interactive` interpreter shell." @@ -3032,11 +3070,11 @@ msgstr "" "「read-eval-print 迴圈 (read–eval–print loop)」的縮寫,是\\ :term:`互動式 " "`\\ 直譯器 shell 的另一個名稱。" -#: ../../glossary.rst:1380 +#: ../../glossary.rst:1396 msgid "__slots__" msgstr "__slots__" -#: ../../glossary.rst:1382 +#: ../../glossary.rst:1398 msgid "" "A declaration inside a class that saves memory by pre-declaring space for " "instance attributes and eliminating instance dictionaries. Though popular, " @@ -3049,11 +3087,11 @@ msgstr "" "最好保留給那種在一個記憶體關鍵 (memory-critical) 的應用程式中存在大量實例的罕" "見情況。" -#: ../../glossary.rst:1387 +#: ../../glossary.rst:1403 msgid "sequence" msgstr "sequence(序列)" -#: ../../glossary.rst:1389 +#: ../../glossary.rst:1405 msgid "" "An :term:`iterable` which supports efficient element access using integer " "indices via the :meth:`~object.__getitem__` special method and defines a :" @@ -3072,7 +3110,7 @@ msgstr "" "為對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`hashable` 鍵," "而不是整數。" -#: ../../glossary.rst:1398 +#: ../../glossary.rst:1414 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " "richer interface that goes beyond just :meth:`~object.__getitem__` and :meth:" @@ -3089,11 +3127,11 @@ msgstr "" "別,可以使用 :func:`~abc.ABCMeta.register` 被明確地註冊。更多關於序列方法的文" "件,請見\\ :ref:`常見序列操作 `。" -#: ../../glossary.rst:1408 +#: ../../glossary.rst:1424 msgid "set comprehension" msgstr "set comprehension(集合綜合運算)" -#: ../../glossary.rst:1410 +#: ../../glossary.rst:1426 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a set with the results. ``results = {c for c in 'abracadabra' if c " @@ -3104,11 +3142,11 @@ msgstr "" "set 回傳。``results = {c for c in 'abracadabra' if c not in 'abc'}`` 會產生一" "個字串 set:``{'r', 'd'}``。請參閱\\ :ref:`comprehensions`。" -#: ../../glossary.rst:1414 +#: ../../glossary.rst:1430 msgid "single dispatch" msgstr "single dispatch(單一調度)" -#: ../../glossary.rst:1416 +#: ../../glossary.rst:1432 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." @@ -3116,27 +3154,23 @@ msgstr "" ":term:`generic function`\\ (泛型函式)調度的一種形式,在此,實作的選擇是基於" "單一引數的型別。" -#: ../../glossary.rst:1418 +#: ../../glossary.rst:1434 msgid "slice" msgstr "slice(切片)" -#: ../../glossary.rst:1420 +#: ../../glossary.rst:1436 msgid "" -"An object usually containing a portion of a :term:`sequence`. A slice is " -"created using the subscript notation, ``[]`` with colons between numbers " -"when several are given, such as in ``variable_name[1:3:5]``. The bracket " -"(subscript) notation uses :class:`slice` objects internally." +"An object of type :class:`slice`, used to describe a portion of a :term:" +"`sequence`. A slice object is created when using the :ref:`slicing " +"` form of :ref:`subscript notation `, with colons " +"inside square brackets, such as in ``variable_name[1:3:5]``." msgstr "" -"一個物件,它通常包含一段 :term:`sequence`\\ (序列)的某一部分。建立一段切片" -"的方法是使用下標符號 (subscript notation) ``[]``,若要給出多個數字,則在數字" -"之間使用冒號,例如 ``variable_name[1:3:5]``。在括號(下標)符號的內部,會使" -"用 :class:`slice` 物件。" -#: ../../glossary.rst:1424 +#: ../../glossary.rst:1441 msgid "soft deprecated" msgstr "soft deprecated(軟性棄用)" -#: ../../glossary.rst:1426 +#: ../../glossary.rst:1443 msgid "" "A soft deprecated API should not be used in new code, but it is safe for " "already existing code to use it. The API remains documented and tested, but " @@ -3145,13 +3179,13 @@ msgstr "" "被軟性棄用的 API 代表不應再用於新程式碼中,但在現有程式碼中繼續使用它仍會是安" "全的。API 仍會以文件記錄並會被測試,但不會被繼續改進。" -#: ../../glossary.rst:1430 +#: ../../glossary.rst:1447 msgid "" "Soft deprecation, unlike normal deprecation, does not plan on removing the " "API and will not emit warnings." msgstr "與正常棄用不同,軟性棄用沒有刪除 API 的規劃,也不會發出警告。" -#: ../../glossary.rst:1433 +#: ../../glossary.rst:1450 msgid "" "See `PEP 387: Soft Deprecation `_." @@ -3159,11 +3193,11 @@ msgstr "" "請參閱 `PEP 387:軟性棄用 `_。" -#: ../../glossary.rst:1435 +#: ../../glossary.rst:1452 msgid "special method" msgstr "special method(特殊方法)" -#: ../../glossary.rst:1439 +#: ../../glossary.rst:1456 msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " @@ -3174,11 +3208,11 @@ msgstr "" "種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在\\ :ref:" "`specialnames`\\ 中有詳細說明。" -#: ../../glossary.rst:1443 +#: ../../glossary.rst:1460 msgid "standard library" msgstr "標準函式庫" -#: ../../glossary.rst:1445 +#: ../../glossary.rst:1462 msgid "" "The collection of :term:`packages `, :term:`modules ` and :" "term:`extension modules ` distributed as a part of the " @@ -3191,7 +3225,7 @@ msgstr "" "行。該集合的成員可能會因平台、可用的系統函式庫或其他條件而有所不同。相關文件" "可以在 :ref:`library-index` 中找到。" -#: ../../glossary.rst:1451 +#: ../../glossary.rst:1468 msgid "" "See also :data:`sys.stdlib_module_names` for a list of all possible standard " "library module names." @@ -3199,11 +3233,11 @@ msgstr "" "請參閱 :data:`sys.stdlib_module_names` 以取得所有可能的標準函式庫模組名稱的列" "表。" -#: ../../glossary.rst:1453 +#: ../../glossary.rst:1470 msgid "statement" msgstr "statement(陳述式)" -#: ../../glossary.rst:1455 +#: ../../glossary.rst:1472 msgid "" "A statement is part of a suite (a \"block\" of code). A statement is either " "an :term:`expression` or one of several constructs with a keyword, such as :" @@ -3213,11 +3247,11 @@ msgstr "" "term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`、:keyword:" "`while` 或 :keyword:`for`\\ )的多種結構之一。" -#: ../../glossary.rst:1458 +#: ../../glossary.rst:1475 msgid "static type checker" msgstr "static type checker(靜態型別檢查器)" -#: ../../glossary.rst:1460 +#: ../../glossary.rst:1477 msgid "" "An external tool that reads Python code and analyzes it, looking for issues " "such as incorrect types. See also :term:`type hints ` and the :" @@ -3227,19 +3261,19 @@ msgstr "" "另請參閱\\ :term:`型別提示 (type hints) ` 以及 :mod:`typing` 模" "組。" -#: ../../glossary.rst:1463 +#: ../../glossary.rst:1480 msgid "stdlib" msgstr "stdlib(標準函式庫)" -#: ../../glossary.rst:1465 +#: ../../glossary.rst:1482 msgid "An abbreviation of :term:`standard library`." msgstr ":term:`standard library` 的縮寫。" -#: ../../glossary.rst:1466 +#: ../../glossary.rst:1483 msgid "strong reference" msgstr "strong reference(強參照)" -#: ../../glossary.rst:1468 +#: ../../glossary.rst:1485 msgid "" "In Python's C API, a strong reference is a reference to an object which is " "owned by the code holding the reference. The strong reference is taken by " @@ -3250,7 +3284,7 @@ msgstr "" "有。建立參照時透過呼叫 :c:func:`Py_INCREF` 來獲得強參照、刪除參照時透過 :c:" "func:`Py_DECREF` 釋放強參照。" -#: ../../glossary.rst:1474 +#: ../../glossary.rst:1491 msgid "" "The :c:func:`Py_NewRef` function can be used to create a strong reference to " "an object. Usually, the :c:func:`Py_DECREF` function must be called on the " @@ -3260,15 +3294,29 @@ msgstr "" ":c:func:`Py_NewRef` 函式可用於建立一個對物件的強參照。通常,在退出強參照的作" "用域之前,必須在該強參照上呼叫 :c:func:`Py_DECREF` 函式,以避免洩漏一個參照。" -#: ../../glossary.rst:1479 +#: ../../glossary.rst:1496 msgid "See also :term:`borrowed reference`." msgstr "另請參閱 :term:`borrowed reference`\\ (借用參照)。" -#: ../../glossary.rst:1480 +#: ../../glossary.rst:1497 +#, fuzzy +msgid "subscript" +msgstr "descriptor(描述器)" + +#: ../../glossary.rst:1499 +msgid "" +"The expression in square brackets of a :ref:`subscription expression " +"`, for example, the ``3`` in ``items[3]``. Usually used to " +"select an element of a container. Also called a :term:`key` when " +"subscripting a :term:`mapping`, or an :term:`index` when subscripting a :" +"term:`sequence`." +msgstr "" + +#: ../../glossary.rst:1505 msgid "synchronization primitive" msgstr "" -#: ../../glossary.rst:1482 +#: ../../glossary.rst:1507 msgid "" "A basic building block for coordinating (synchronizing) the execution of " "multiple threads to ensure :term:`thread-safe` access to shared resources. " @@ -3282,15 +3330,15 @@ msgid "" "term:`lock`." msgstr "" -#: ../../glossary.rst:1492 +#: ../../glossary.rst:1517 msgid "t-string" msgstr "t-string(t 字串)" -#: ../../glossary.rst:1493 +#: ../../glossary.rst:1518 msgid "t-strings" msgstr "t-strings(t 字串)" -#: ../../glossary.rst:1495 +#: ../../glossary.rst:1520 msgid "" "String literals prefixed with ``t`` or ``T`` are commonly called \"t-" "strings\" which is short for :ref:`template string literals `." @@ -3298,11 +3346,11 @@ msgstr "" "以 ``t`` 或 ``T`` 為前綴的字串文本通常被稱為「t 字串」,它是\\ :ref:`模板化的" "字串文本 `\\ 的縮寫。" -#: ../../glossary.rst:1498 +#: ../../glossary.rst:1523 msgid "text encoding" msgstr "text encoding(文字編碼)" -#: ../../glossary.rst:1500 +#: ../../glossary.rst:1525 msgid "" "A string in Python is a sequence of Unicode code points (in range " "``U+0000``--``U+10FFFF``). To store or transfer a string, it needs to be " @@ -3312,7 +3360,7 @@ msgstr "" "``U+0000`` -- ``U+10FFFF`` 之間)。若要儲存或傳送一個字串,它必須被序列化為一" "個位元組序列。" -#: ../../glossary.rst:1504 +#: ../../glossary.rst:1529 msgid "" "Serializing a string into a sequence of bytes is known as \"encoding\", and " "recreating the string from the sequence of bytes is known as \"decoding\"." @@ -3320,7 +3368,7 @@ msgstr "" "將一個字串序列化為位元組序列,稱為「編碼」,而從位元組序列重新建立該字串則稱" "為「解碼 (decoding)」。" -#: ../../glossary.rst:1507 +#: ../../glossary.rst:1532 msgid "" "There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." @@ -3328,11 +3376,11 @@ msgstr "" "有多種不同的文字序列化編解碼器 (:ref:`codecs `),它們被統" "稱為「文字編碼」。" -#: ../../glossary.rst:1510 +#: ../../glossary.rst:1535 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1512 +#: ../../glossary.rst:1537 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " "text file actually accesses a byte-oriented datastream and handles the :term:" @@ -3346,7 +3394,7 @@ msgstr "" "有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、:data:`sys.stdin`、:data:" "`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1519 +#: ../../glossary.rst:1544 msgid "" "See also :term:`binary file` for a file object able to read and write :term:" "`bytes-like objects `." @@ -3354,32 +3402,32 @@ msgstr "" "另請參閱 :term:`binary file`\\ (二進位檔案),它是一個能夠讀取和寫入\\ :" "term:`類位元組串物件 (bytes-like object) ` 的檔案物件。" -#: ../../glossary.rst:1521 +#: ../../glossary.rst:1546 msgid "thread state" msgstr "" -#: ../../glossary.rst:1524 +#: ../../glossary.rst:1549 msgid "" "The information used by the :term:`CPython` runtime to run in an OS thread. " "For example, this includes the current exception, if any, and the state of " "the bytecode interpreter." msgstr "" -#: ../../glossary.rst:1528 +#: ../../glossary.rst:1553 msgid "" "Each thread state is bound to a single OS thread, but threads may have many " "thread states available. At most, one of them may be :term:`attached " "` at once." msgstr "" -#: ../../glossary.rst:1532 +#: ../../glossary.rst:1557 msgid "" "An :term:`attached thread state` is required to call most of Python's C API, " "unless a function explicitly documents otherwise. The bytecode interpreter " "only runs under an attached thread state." msgstr "" -#: ../../glossary.rst:1536 +#: ../../glossary.rst:1561 msgid "" "Each thread state belongs to a single interpreter, but each interpreter may " "have many thread states, including multiple for the same OS thread. Thread " @@ -3388,17 +3436,17 @@ msgid "" "given moment." msgstr "" -#: ../../glossary.rst:1542 +#: ../../glossary.rst:1567 msgid "" "See :ref:`Thread State and the Global Interpreter Lock ` for more " "information." msgstr "" -#: ../../glossary.rst:1544 +#: ../../glossary.rst:1569 msgid "thread-safe" msgstr "" -#: ../../glossary.rst:1546 +#: ../../glossary.rst:1571 msgid "" "A module, function, or class that behaves correctly when used by multiple " "threads concurrently. Thread-safe code uses appropriate :term:" @@ -3412,11 +3460,11 @@ msgid "" "` when used in multi-threaded programs." msgstr "" -#: ../../glossary.rst:1557 +#: ../../glossary.rst:1582 msgid "token" msgstr "token" -#: ../../glossary.rst:1560 +#: ../../glossary.rst:1585 msgid "" "A small unit of source code, generated by the :ref:`lexical analyzer " "` (also called the *tokenizer*). Names, numbers, strings, " @@ -3425,7 +3473,7 @@ msgstr "" "原始碼的小單位,由 :ref:`詞法分析器 ` (也稱為 *tokenizer*)產生。名" "稱、數字、字串、運算子、換行符號等都以 token 表示。" -#: ../../glossary.rst:1565 +#: ../../glossary.rst:1590 msgid "" "The :mod:`tokenize` module exposes Python's lexical analyzer. The :mod:" "`token` module contains information on the various types of tokens." @@ -3433,11 +3481,11 @@ msgstr "" ":mod:`tokenize` 模組公開了 Python 的詞法分析器。:mod:`token` 模組包含各種 " "token 類型的資訊。" -#: ../../glossary.rst:1568 +#: ../../glossary.rst:1593 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1570 +#: ../../glossary.rst:1595 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -3452,11 +3500,11 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1577 +#: ../../glossary.rst:1602 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1579 +#: ../../glossary.rst:1604 msgid "" "The type of a Python object determines what kind of object it is; every " "object has a type. An object's type is accessible as its :attr:`~object." @@ -3466,22 +3514,22 @@ msgstr "" "件的型別可以用它的 :attr:`~object.__class__` 屬性來存取,或以 ``type(obj)`` " "來檢索。" -#: ../../glossary.rst:1583 +#: ../../glossary.rst:1608 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1585 +#: ../../glossary.rst:1610 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1587 +#: ../../glossary.rst:1612 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" msgstr "" "型別別名對於簡化\\ :term:`型別提示 (type hint) ` 很有用。例如: ::" -#: ../../glossary.rst:1590 +#: ../../glossary.rst:1615 msgid "" "def remove_gray_shades(\n" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" @@ -3491,11 +3539,11 @@ msgstr "" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" " pass" -#: ../../glossary.rst:1594 +#: ../../glossary.rst:1619 msgid "could be made more readable like this::" msgstr "可以寫成這樣,更具有可讀性: ::" -#: ../../glossary.rst:1596 +#: ../../glossary.rst:1621 msgid "" "Color = tuple[int, int, int]\n" "\n" @@ -3507,15 +3555,15 @@ msgstr "" "def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" " pass" -#: ../../glossary.rst:1601 ../../glossary.rst:1615 +#: ../../glossary.rst:1626 ../../glossary.rst:1640 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "請參閱 :mod:`typing` 和 :pep:`484`,有此功能的描述。" -#: ../../glossary.rst:1602 +#: ../../glossary.rst:1627 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1604 +#: ../../glossary.rst:1629 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -3523,7 +3571,7 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1607 +#: ../../glossary.rst:1632 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to :term:`static type checkers `. They can also aid " @@ -3533,7 +3581,7 @@ msgstr "" "(static type checkers) `\\ 很有用,並能協助 IDE 完成程式" "碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1611 +#: ../../glossary.rst:1636 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." @@ -3541,11 +3589,11 @@ msgstr "" "全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" "`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1616 +#: ../../glossary.rst:1641 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1618 +#: ../../glossary.rst:1643 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " @@ -3558,20 +3606,20 @@ msgstr "" "``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`,以及用於 :func:`bytes." "splitlines` 的附加用途。" -#: ../../glossary.rst:1623 +#: ../../glossary.rst:1648 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1625 +#: ../../glossary.rst:1650 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1627 +#: ../../glossary.rst:1652 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "註釋變數或 class 屬性時,賦值是選擇性的: ::" -#: ../../glossary.rst:1629 +#: ../../glossary.rst:1654 msgid "" "class C:\n" " field: 'annotation'" @@ -3579,7 +3627,7 @@ msgstr "" "class C:\n" " field: 'annotation'" -#: ../../glossary.rst:1632 +#: ../../glossary.rst:1657 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" @@ -3587,15 +3635,15 @@ msgstr "" "變數註釋通常用於\\ :term:`型別提示 (type hint) `:例如,這個變數預" "期會取得 :class:`int`\\ (整數)值: ::" -#: ../../glossary.rst:1636 +#: ../../glossary.rst:1661 msgid "count: int = 0" msgstr "count: int = 0" -#: ../../glossary.rst:1638 +#: ../../glossary.rst:1663 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1640 +#: ../../glossary.rst:1665 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " @@ -3604,11 +3652,11 @@ msgstr "" "請參閱 :term:`function annotation`\\ (函式註釋)、:pep:`484` 和 :pep:`526`," "皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:1644 +#: ../../glossary.rst:1669 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1646 +#: ../../glossary.rst:1671 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -3619,15 +3667,15 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1651 +#: ../../glossary.rst:1676 msgid "See also :mod:`venv`." msgstr "另請參閱 :mod:`venv`。" -#: ../../glossary.rst:1652 +#: ../../glossary.rst:1677 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1654 +#: ../../glossary.rst:1679 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." @@ -3635,22 +3683,22 @@ msgstr "" "一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" "`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1656 +#: ../../glossary.rst:1681 msgid "walrus operator" msgstr "walrus operator(海象運算子)" -#: ../../glossary.rst:1658 +#: ../../glossary.rst:1683 msgid "" "A light-hearted way to refer to the :ref:`assignment expression ` operator ``:=`` because it looks a bit like a walrus if you " "turn your head." msgstr "" -#: ../../glossary.rst:1661 +#: ../../glossary.rst:1686 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1663 +#: ../../glossary.rst:1688 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " @@ -3675,14 +3723,25 @@ msgstr "C-contiguous(C 連續的)" msgid "Fortran contiguous" msgstr "Fortran contiguous(Fortran 連續的)" -#: ../../glossary.rst:962 +#: ../../glossary.rst:978 msgid "magic" msgstr "magic" -#: ../../glossary.rst:1437 +#: ../../glossary.rst:1454 msgid "special" msgstr "special" +#~ msgid "" +#~ "An object usually containing a portion of a :term:`sequence`. A slice is " +#~ "created using the subscript notation, ``[]`` with colons between numbers " +#~ "when several are given, such as in ``variable_name[1:3:5]``. The bracket " +#~ "(subscript) notation uses :class:`slice` objects internally." +#~ msgstr "" +#~ "一個物件,它通常包含一段 :term:`sequence`\\ (序列)的某一部分。建立一段切" +#~ "片的方法是使用下標符號 (subscript notation) ``[]``,若要給出多個數字,則在" +#~ "數字之間使用冒號,例如 ``variable_name[1:3:5]``。在括號(下標)符號的內" +#~ "部,會使用 :class:`slice` 物件。" + #~ msgid "" #~ "Mutable objects can change their value but keep their :func:`id`. See " #~ "also :term:`immutable`." diff --git a/library/functions.po b/library/functions.po index 544e51bc1e..3396abc77c 100644 --- a/library/functions.po +++ b/library/functions.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-22 16:55+0000\n" +"POT-Creation-Date: 2026-02-05 14:10+0000\n" "PO-Revision-Date: 2024-05-06 17:06+0800\n" "Last-Translator: KNChiu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3179,17 +3179,21 @@ msgstr "" #: ../../library/functions.rst:1846 msgid "" -"Slice objects have read-only data attributes :attr:`!start`, :attr:`!stop`, " -"and :attr:`!step` which merely return the argument values (or their " -"default). They have no other explicit functionality; however, they are used " -"by NumPy and other third-party packages." +"Slice objects are also generated when :ref:`slicing syntax ` is " +"used. For example: ``a[start:stop:step]`` or ``a[start:stop, i]``." msgstr "" -#: ../../library/functions.rst:1855 +#: ../../library/functions.rst:1849 msgid "" -"Slice objects are also generated when extended indexing syntax is used. For " -"example: ``a[start:stop:step]`` or ``a[start:stop, i]``. See :func:" -"`itertools.islice` for an alternate version that returns an :term:`iterator`." +"See :func:`itertools.islice` for an alternate version that returns an :term:" +"`iterator`." +msgstr "" + +#: ../../library/functions.rst:1856 +msgid "" +"These read-only attributes are set to the argument values (or their " +"default). They have no other explicit functionality; however, they are used " +"by NumPy and other third-party packages." msgstr "" #: ../../library/functions.rst:1860 diff --git a/reference/datamodel.po b/reference/datamodel.po index 271faf793f..909cc08bef 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-27 00:17+0000\n" +"POT-Creation-Date: 2026-02-05 14:10+0000\n" "PO-Revision-Date: 2024-09-24 19:03+0900\n" "Last-Translator: Kisaragi Hiu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -402,11 +402,11 @@ msgid "" "retrieved through the read-only attributes ``z.real`` and ``z.imag``." msgstr "" -#: ../../reference/datamodel.rst:295 +#: ../../reference/datamodel.rst:296 msgid "Sequences" msgstr "" -#: ../../reference/datamodel.rst:304 +#: ../../reference/datamodel.rst:305 msgid "" "These represent finite ordered sets indexed by non-negative numbers. The " "built-in function :func:`len` returns the number of items of a sequence. " @@ -417,30 +417,45 @@ msgid "" "second to last item of sequence a with length ``n``." msgstr "" -#: ../../reference/datamodel.rst:314 +#: ../../reference/datamodel.rst:313 msgid "" -"Sequences also support slicing: ``a[i:j]`` selects all items with index *k* " -"such that *i* ``<=`` *k* ``<`` *j*. When used as an expression, a slice is " -"a sequence of the same type. The comment above about negative indexes also " -"applies to negative slice positions." +"The resulting value must be a nonnegative integer less than the number of " +"items in the sequence. If it is not, an :exc:`IndexError` is raised." msgstr "" -#: ../../reference/datamodel.rst:319 +#: ../../reference/datamodel.rst:322 +msgid "" +"Sequences also support slicing: ``a[start:stop]`` selects all items with " +"index *k* such that *start* ``<=`` *k* ``<`` *stop*. When used as an " +"expression, a slice is a sequence of the same type. The comment above about " +"negative subscripts also applies to negative slice positions. Note that no " +"error is raised if a slice position is less than zero or larger than the " +"length of the sequence." +msgstr "" + +#: ../../reference/datamodel.rst:329 +msgid "" +"If *start* is missing or :data:`None`, slicing behaves as if *start* was " +"zero. If *stop* is missing or ``None``, slicing behaves as if *stop* was " +"equal to the length of the sequence." +msgstr "" + +#: ../../reference/datamodel.rst:333 msgid "" "Some sequences also support \"extended slicing\" with a third \"step\" " "parameter: ``a[i:j:k]`` selects all items of *a* with index *x* where ``x = " "i + n*k``, *n* ``>=`` ``0`` and *i* ``<=`` *x* ``<`` *j*." msgstr "" -#: ../../reference/datamodel.rst:323 +#: ../../reference/datamodel.rst:337 msgid "Sequences are distinguished according to their mutability:" msgstr "" -#: ../../reference/datamodel.rst:327 +#: ../../reference/datamodel.rst:341 msgid "Immutable sequences" msgstr "" -#: ../../reference/datamodel.rst:333 +#: ../../reference/datamodel.rst:347 msgid "" "An object of an immutable sequence type cannot change once it is created. " "(If the object contains references to other objects, these other objects may " @@ -448,92 +463,101 @@ msgid "" "referenced by an immutable object cannot change.)" msgstr "" -#: ../../reference/datamodel.rst:338 +#: ../../reference/datamodel.rst:352 msgid "The following types are immutable sequences:" msgstr "" -#: ../../reference/datamodel.rst:343 +#: ../../reference/datamodel.rst:357 msgid "Strings" msgstr "字串 (String)" -#: ../../reference/datamodel.rst:351 +#: ../../reference/datamodel.rst:365 +msgid "" +"A string (:class:`str`) is a sequence of values that represent :dfn:" +"`characters`, or more formally, *Unicode code points*. All the code points " +"in the range ``0`` to ``0x10FFFF`` can be represented in a string." +msgstr "" + +#: ../../reference/datamodel.rst:370 +msgid "" +"Python doesn't have a dedicated *character* type. Instead, every code point " +"in the string is represented as a string object with length ``1``." +msgstr "" + +#: ../../reference/datamodel.rst:374 msgid "" -"A string is a sequence of values that represent Unicode code points. All the " -"code points in the range ``U+0000 - U+10FFFF`` can be represented in a " -"string. Python doesn't have a :c:expr:`char` type; instead, every code " -"point in the string is represented as a string object with length ``1``. " "The built-in function :func:`ord` converts a code point from its string form " -"to an integer in the range ``0 - 10FFFF``; :func:`chr` converts an integer " -"in the range ``0 - 10FFFF`` to the corresponding length ``1`` string " -"object. :meth:`str.encode` can be used to convert a :class:`str` to :class:" -"`bytes` using the given text encoding, and :meth:`bytes.decode` can be used " -"to achieve the opposite." +"to an integer in the range ``0`` to ``0x10FFFF``; :func:`chr` converts an " +"integer in the range ``0`` to ``0x10FFFF`` to the corresponding length ``1`` " +"string object. :meth:`str.encode` can be used to convert a :class:`str` to :" +"class:`bytes` using the given text encoding, and :meth:`bytes.decode` can be " +"used to achieve the opposite." msgstr "" -#: ../../reference/datamodel.rst:363 +#: ../../reference/datamodel.rst:382 msgid "Tuples" msgstr "Tuple(元組)" -#: ../../reference/datamodel.rst:369 +#: ../../reference/datamodel.rst:388 msgid "" -"The items of a tuple are arbitrary Python objects. Tuples of two or more " -"items are formed by comma-separated lists of expressions. A tuple of one " -"item (a 'singleton') can be formed by affixing a comma to an expression (an " -"expression by itself does not create a tuple, since parentheses must be " +"The items of a :class:`tuple` are arbitrary Python objects. Tuples of two or " +"more items are formed by comma-separated lists of expressions. A tuple of " +"one item (a 'singleton') can be formed by affixing a comma to an expression " +"(an expression by itself does not create a tuple, since parentheses must be " "usable for grouping of expressions). An empty tuple can be formed by an " "empty pair of parentheses." msgstr "" -#: ../../reference/datamodel.rst:376 +#: ../../reference/datamodel.rst:395 msgid "Bytes" msgstr "位元組" -#: ../../reference/datamodel.rst:379 +#: ../../reference/datamodel.rst:398 msgid "" -"A bytes object is an immutable array. The items are 8-bit bytes, " +"A :class:`bytes` object is an immutable array. The items are 8-bit bytes, " "represented by integers in the range 0 <= x < 256. Bytes literals (like " "``b'abc'``) and the built-in :func:`bytes` constructor can be used to create " "bytes objects. Also, bytes objects can be decoded to strings via the :meth:" "`~bytes.decode` method." msgstr "" -#: ../../reference/datamodel.rst:387 +#: ../../reference/datamodel.rst:406 msgid "Mutable sequences" msgstr "可變序列" -#: ../../reference/datamodel.rst:396 +#: ../../reference/datamodel.rst:415 msgid "" "Mutable sequences can be changed after they are created. The subscription " "and slicing notations can be used as the target of assignment and :keyword:" "`del` (delete) statements." msgstr "" -#: ../../reference/datamodel.rst:404 +#: ../../reference/datamodel.rst:423 msgid "" "The :mod:`collections` and :mod:`array` module provide additional examples " "of mutable sequence types." msgstr "" -#: ../../reference/datamodel.rst:407 +#: ../../reference/datamodel.rst:426 msgid "There are currently two intrinsic mutable sequence types:" msgstr "" -#: ../../reference/datamodel.rst:409 +#: ../../reference/datamodel.rst:428 msgid "Lists" msgstr "List(串列)" -#: ../../reference/datamodel.rst:412 +#: ../../reference/datamodel.rst:431 msgid "" "The items of a list are arbitrary Python objects. Lists are formed by " "placing a comma-separated list of expressions in square brackets. (Note that " "there are no special cases needed to form lists of length 0 or 1.)" msgstr "" -#: ../../reference/datamodel.rst:416 +#: ../../reference/datamodel.rst:435 msgid "Byte Arrays" msgstr "位元組陣列" -#: ../../reference/datamodel.rst:419 +#: ../../reference/datamodel.rst:438 msgid "" "A bytearray object is a mutable array. They are created by the built-in :" "func:`bytearray` constructor. Aside from being mutable (and hence " @@ -541,11 +565,11 @@ msgid "" "functionality as immutable :class:`bytes` objects." msgstr "" -#: ../../reference/datamodel.rst:426 +#: ../../reference/datamodel.rst:445 msgid "Set types" msgstr "Set(集合)型別" -#: ../../reference/datamodel.rst:432 +#: ../../reference/datamodel.rst:451 msgid "" "These represent unordered, finite sets of unique, immutable objects. As " "such, they cannot be indexed by any subscript. However, they can be iterated " @@ -555,7 +579,7 @@ msgid "" "union, difference, and symmetric difference." msgstr "" -#: ../../reference/datamodel.rst:439 +#: ../../reference/datamodel.rst:458 msgid "" "For set elements, the same immutability rules apply as for dictionary keys. " "Note that numeric types obey the normal rules for numeric comparison: if two " @@ -563,37 +587,37 @@ msgid "" "contained in a set." msgstr "" -#: ../../reference/datamodel.rst:444 +#: ../../reference/datamodel.rst:463 msgid "There are currently two intrinsic set types:" msgstr "" -#: ../../reference/datamodel.rst:447 +#: ../../reference/datamodel.rst:466 msgid "Sets" msgstr "Set(集合)" -#: ../../reference/datamodel.rst:450 +#: ../../reference/datamodel.rst:469 msgid "" "These represent a mutable set. They are created by the built-in :func:`set` " "constructor and can be modified afterwards by several methods, such as :meth:" "`~set.add`." msgstr "" -#: ../../reference/datamodel.rst:455 +#: ../../reference/datamodel.rst:474 msgid "Frozen sets" msgstr "Frozen set(凍結集合)" -#: ../../reference/datamodel.rst:458 +#: ../../reference/datamodel.rst:477 msgid "" "These represent an immutable set. They are created by the built-in :func:" "`frozenset` constructor. As a frozenset is immutable and :term:`hashable`, " "it can be used again as an element of another set, or as a dictionary key." msgstr "" -#: ../../reference/datamodel.rst:465 +#: ../../reference/datamodel.rst:486 msgid "Mappings" msgstr "對映" -#: ../../reference/datamodel.rst:472 +#: ../../reference/datamodel.rst:493 msgid "" "These represent finite sets of objects indexed by arbitrary index sets. The " "subscript notation ``a[k]`` selects the item indexed by ``k`` from the " @@ -602,15 +626,15 @@ msgid "" "returns the number of items in a mapping." msgstr "" -#: ../../reference/datamodel.rst:478 +#: ../../reference/datamodel.rst:499 msgid "There is currently a single intrinsic mapping type:" msgstr "" -#: ../../reference/datamodel.rst:482 +#: ../../reference/datamodel.rst:503 msgid "Dictionaries" msgstr "字典" -#: ../../reference/datamodel.rst:486 +#: ../../reference/datamodel.rst:507 msgid "" "These represent finite sets of objects indexed by nearly arbitrary values. " "The only types of values not acceptable as keys are values containing lists " @@ -622,7 +646,7 @@ msgid "" "interchangeably to index the same dictionary entry." msgstr "" -#: ../../reference/datamodel.rst:495 +#: ../../reference/datamodel.rst:516 msgid "" "Dictionaries preserve insertion order, meaning that keys will be produced in " "the same order they were added sequentially over the dictionary. Replacing " @@ -630,137 +654,137 @@ msgid "" "inserting it will add it to the end instead of keeping its old place." msgstr "" -#: ../../reference/datamodel.rst:500 +#: ../../reference/datamodel.rst:521 msgid "" "Dictionaries are mutable; they can be created by the ``{}`` notation (see " "section :ref:`dict`)." msgstr "" -#: ../../reference/datamodel.rst:507 +#: ../../reference/datamodel.rst:528 msgid "" "The extension modules :mod:`dbm.ndbm` and :mod:`dbm.gnu` provide additional " "examples of mapping types, as does the :mod:`collections` module." msgstr "" -#: ../../reference/datamodel.rst:511 +#: ../../reference/datamodel.rst:532 msgid "" "Dictionaries did not preserve insertion order in versions of Python before " "3.6. In CPython 3.6, insertion order was preserved, but it was considered an " "implementation detail at that time rather than a language guarantee." msgstr "" -#: ../../reference/datamodel.rst:518 +#: ../../reference/datamodel.rst:539 msgid "Callable types" msgstr "可呼叫型別" -#: ../../reference/datamodel.rst:526 +#: ../../reference/datamodel.rst:547 msgid "" "These are the types to which the function call operation (see section :ref:" "`calls`) can be applied:" msgstr "" -#: ../../reference/datamodel.rst:533 +#: ../../reference/datamodel.rst:554 msgid "User-defined functions" msgstr "自訂函式" -#: ../../reference/datamodel.rst:540 +#: ../../reference/datamodel.rst:561 msgid "" "A user-defined function object is created by a function definition (see " "section :ref:`function`). It should be called with an argument list " "containing the same number of items as the function's formal parameter list." msgstr "" -#: ../../reference/datamodel.rst:546 ../../reference/datamodel.rst:1454 -#: ../../reference/datamodel.rst:1655 +#: ../../reference/datamodel.rst:567 ../../reference/datamodel.rst:1475 +#: ../../reference/datamodel.rst:1676 msgid "Special read-only attributes" msgstr "特殊唯讀屬性" -#: ../../reference/datamodel.rst:557 ../../reference/datamodel.rst:599 -#: ../../reference/datamodel.rst:1202 +#: ../../reference/datamodel.rst:578 ../../reference/datamodel.rst:620 +#: ../../reference/datamodel.rst:1223 msgid "Attribute" msgstr "屬性" -#: ../../reference/datamodel.rst:558 ../../reference/datamodel.rst:600 -#: ../../reference/datamodel.rst:1203 +#: ../../reference/datamodel.rst:579 ../../reference/datamodel.rst:621 +#: ../../reference/datamodel.rst:1224 msgid "Meaning" msgstr "含義" -#: ../../reference/datamodel.rst:561 +#: ../../reference/datamodel.rst:582 msgid "" "A reference to the :class:`dictionary ` that holds the function's " "builtins namespace." msgstr "" -#: ../../reference/datamodel.rst:567 +#: ../../reference/datamodel.rst:588 msgid "" "A reference to the :class:`dictionary ` that holds the function's :ref:" "`global variables ` -- the global namespace of the module in which " "the function was defined." msgstr "" -#: ../../reference/datamodel.rst:572 +#: ../../reference/datamodel.rst:593 msgid "" "``None`` or a :class:`tuple` of cells that contain bindings for the names " "specified in the :attr:`~codeobject.co_freevars` attribute of the " "function's :attr:`code object `." msgstr "" -#: ../../reference/datamodel.rst:576 +#: ../../reference/datamodel.rst:597 msgid "" "A cell object has the attribute ``cell_contents``. This can be used to get " "the value of the cell, as well as set the value." msgstr "" -#: ../../reference/datamodel.rst:580 ../../reference/datamodel.rst:1703 +#: ../../reference/datamodel.rst:601 ../../reference/datamodel.rst:1724 msgid "Special writable attributes" msgstr "特殊可寫屬性" -#: ../../reference/datamodel.rst:594 +#: ../../reference/datamodel.rst:615 msgid "Most of these attributes check the type of the assigned value:" msgstr "" -#: ../../reference/datamodel.rst:603 +#: ../../reference/datamodel.rst:624 msgid "The function's documentation string, or ``None`` if unavailable." msgstr "函式的文件字串,若不可用則為 ``None``。" -#: ../../reference/datamodel.rst:606 +#: ../../reference/datamodel.rst:627 msgid "" "The function's name. See also: :attr:`__name__ attributes `." msgstr "" -#: ../../reference/datamodel.rst:610 +#: ../../reference/datamodel.rst:631 msgid "" "The function's :term:`qualified name`. See also: :attr:`__qualname__ " "attributes `." msgstr "" -#: ../../reference/datamodel.rst:616 +#: ../../reference/datamodel.rst:637 msgid "" "The name of the module the function was defined in, or ``None`` if " "unavailable." msgstr "" -#: ../../reference/datamodel.rst:620 +#: ../../reference/datamodel.rst:641 msgid "" "A :class:`tuple` containing default :term:`parameter` values for those " "parameters that have defaults, or ``None`` if no parameters have a default " "value." msgstr "" -#: ../../reference/datamodel.rst:625 +#: ../../reference/datamodel.rst:646 msgid "" "The :ref:`code object ` representing the compiled function " "body." msgstr "代表編譯函式主體的\\ :ref:`程式碼物件 `。" -#: ../../reference/datamodel.rst:629 +#: ../../reference/datamodel.rst:650 msgid "" "The namespace supporting arbitrary function attributes. See also: :attr:" "`__dict__ attributes `." msgstr "" -#: ../../reference/datamodel.rst:633 +#: ../../reference/datamodel.rst:654 msgid "" "A :class:`dictionary ` containing annotations of :term:`parameters " "`. The keys of the dictionary are the parameter names, and " @@ -768,101 +792,101 @@ msgid "" "__annotations__`." msgstr "" -#: ../../reference/datamodel.rst:639 ../../reference/datamodel.rst:1108 -#: ../../reference/datamodel.rst:1260 +#: ../../reference/datamodel.rst:660 ../../reference/datamodel.rst:1129 +#: ../../reference/datamodel.rst:1281 msgid "" "Annotations are now :ref:`lazily evaluated `. See :pep:" "`649`." msgstr "" -#: ../../reference/datamodel.rst:644 +#: ../../reference/datamodel.rst:665 msgid "" "The :term:`annotate function` for this function, or ``None`` if the function " "has no annotations. See :attr:`object.__annotate__`." msgstr "" -#: ../../reference/datamodel.rst:650 +#: ../../reference/datamodel.rst:671 msgid "" "A :class:`dictionary ` containing defaults for keyword-only :term:" "`parameters `." msgstr "" -#: ../../reference/datamodel.rst:654 +#: ../../reference/datamodel.rst:675 msgid "" "A :class:`tuple` containing the :ref:`type parameters ` of a :" "ref:`generic function `." msgstr "" -#: ../../reference/datamodel.rst:659 +#: ../../reference/datamodel.rst:680 msgid "" "Function objects also support getting and setting arbitrary attributes, " "which can be used, for example, to attach metadata to functions. Regular " "attribute dot-notation is used to get and set such attributes." msgstr "" -#: ../../reference/datamodel.rst:665 +#: ../../reference/datamodel.rst:686 msgid "" "CPython's current implementation only supports function attributes on user-" "defined functions. Function attributes on :ref:`built-in functions ` may be supported in the future." msgstr "" -#: ../../reference/datamodel.rst:670 +#: ../../reference/datamodel.rst:691 msgid "" "Additional information about a function's definition can be retrieved from " "its :ref:`code object ` (accessible via the :attr:`~function." "__code__` attribute)." msgstr "" -#: ../../reference/datamodel.rst:678 +#: ../../reference/datamodel.rst:699 msgid "Instance methods" msgstr "實例方法" -#: ../../reference/datamodel.rst:685 +#: ../../reference/datamodel.rst:706 msgid "" "An instance method object combines a class, a class instance and any " "callable object (normally a user-defined function)." msgstr "" -#: ../../reference/datamodel.rst:695 ../../reference/datamodel.rst:1799 +#: ../../reference/datamodel.rst:716 ../../reference/datamodel.rst:1820 msgid "Special read-only attributes:" msgstr "特殊唯讀屬性:" -#: ../../reference/datamodel.rst:700 +#: ../../reference/datamodel.rst:721 msgid "" "Refers to the class instance object to which the method is :ref:`bound " "`" msgstr "" -#: ../../reference/datamodel.rst:704 +#: ../../reference/datamodel.rst:725 msgid "Refers to the original :ref:`function object `" msgstr "" -#: ../../reference/datamodel.rst:707 +#: ../../reference/datamodel.rst:728 msgid "" "The method's documentation (same as :attr:`method.__func__.__doc__ `). A :class:`string ` if the original function had a " "docstring, else ``None``." msgstr "" -#: ../../reference/datamodel.rst:713 +#: ../../reference/datamodel.rst:734 msgid "" "The name of the method (same as :attr:`method.__func__.__name__ `)" msgstr "" -#: ../../reference/datamodel.rst:717 +#: ../../reference/datamodel.rst:738 msgid "" "The name of the module the method was defined in, or ``None`` if unavailable." msgstr "" -#: ../../reference/datamodel.rst:720 +#: ../../reference/datamodel.rst:741 msgid "" "Methods also support accessing (but not setting) the arbitrary function " "attributes on the underlying :ref:`function object `." msgstr "" -#: ../../reference/datamodel.rst:723 +#: ../../reference/datamodel.rst:744 msgid "" "User-defined method objects may be created when getting an attribute of a " "class (perhaps via an instance of that class), if that attribute is a user-" @@ -870,7 +894,7 @@ msgid "" "`classmethod` object." msgstr "" -#: ../../reference/datamodel.rst:730 +#: ../../reference/datamodel.rst:751 msgid "" "When an instance method object is created by retrieving a user-defined :ref:" "`function object ` from a class via one of its " @@ -879,7 +903,7 @@ msgid "" "__func__` attribute is the original function object." msgstr "" -#: ../../reference/datamodel.rst:736 +#: ../../reference/datamodel.rst:757 msgid "" "When an instance method object is created by retrieving a :class:" "`classmethod` object from a class or instance, its :attr:`~method.__self__` " @@ -887,7 +911,7 @@ msgid "" "the function object underlying the class method." msgstr "" -#: ../../reference/datamodel.rst:741 +#: ../../reference/datamodel.rst:762 msgid "" "When an instance method object is called, the underlying function (:attr:" "`~method.__func__`) is called, inserting the class instance (:attr:`~method." @@ -897,7 +921,7 @@ msgid "" "f(x, 1)``." msgstr "" -#: ../../reference/datamodel.rst:748 +#: ../../reference/datamodel.rst:769 msgid "" "When an instance method object is derived from a :class:`classmethod` " "object, the \"class instance\" stored in :attr:`~method.__self__` will " @@ -906,18 +930,18 @@ msgid "" "function." msgstr "" -#: ../../reference/datamodel.rst:753 +#: ../../reference/datamodel.rst:774 msgid "" "It is important to note that user-defined functions which are attributes of " "a class instance are not converted to bound methods; this *only* happens " "when the function is an attribute of the class." msgstr "" -#: ../../reference/datamodel.rst:760 +#: ../../reference/datamodel.rst:781 msgid "Generator functions" msgstr "產生器函式" -#: ../../reference/datamodel.rst:766 +#: ../../reference/datamodel.rst:787 msgid "" "A function or method which uses the :keyword:`yield` statement (see section :" "ref:`yield`) is called a :dfn:`generator function`. Such a function, when " @@ -930,11 +954,11 @@ msgid "" "values to be returned." msgstr "" -#: ../../reference/datamodel.rst:778 +#: ../../reference/datamodel.rst:799 msgid "Coroutine functions" msgstr "Coroutine(協程)函式" -#: ../../reference/datamodel.rst:783 +#: ../../reference/datamodel.rst:804 msgid "" "A function or method which is defined using :keyword:`async def` is called " "a :dfn:`coroutine function`. Such a function, when called, returns a :term:" @@ -943,11 +967,11 @@ msgid "" "ref:`coroutine-objects` section." msgstr "" -#: ../../reference/datamodel.rst:791 +#: ../../reference/datamodel.rst:812 msgid "Asynchronous generator functions" msgstr "非同步產生器函式" -#: ../../reference/datamodel.rst:797 +#: ../../reference/datamodel.rst:818 msgid "" "A function or method which is defined using :keyword:`async def` and which " "uses the :keyword:`yield` statement is called a :dfn:`asynchronous generator " @@ -956,7 +980,7 @@ msgid "" "execute the body of the function." msgstr "" -#: ../../reference/datamodel.rst:803 +#: ../../reference/datamodel.rst:824 msgid "" "Calling the asynchronous iterator's :meth:`aiterator.__anext__ ` method will return an :term:`awaitable` which when awaited will " @@ -967,11 +991,11 @@ msgid "" "yielded." msgstr "" -#: ../../reference/datamodel.rst:816 +#: ../../reference/datamodel.rst:837 msgid "Built-in functions" msgstr "內建函式" -#: ../../reference/datamodel.rst:823 +#: ../../reference/datamodel.rst:844 msgid "" "A built-in function object is a wrapper around a C function. Examples of " "built-in functions are :func:`len` and :func:`math.sin` (:mod:`math` is a " @@ -982,7 +1006,7 @@ msgstr "" "func:`math.sin`\\ (\\ :mod:`math` 是一個標準的內建模組)。內建函式的引數數量" "與其型別由其包裝的 C 函式所決定。特殊唯讀屬性:" -#: ../../reference/datamodel.rst:828 +#: ../../reference/datamodel.rst:849 msgid "" ":attr:`!__doc__` is the function's documentation string, or ``None`` if " "unavailable. See :attr:`function.__doc__`." @@ -990,26 +1014,26 @@ msgstr "" ":attr:`!__doc__` 是函式的文件字串,若不可用則為 ``None``。請見 :attr:" "`function.__doc__`。" -#: ../../reference/datamodel.rst:830 +#: ../../reference/datamodel.rst:851 msgid "" ":attr:`!__name__` is the function's name. See :attr:`function.__name__`." msgstr ":attr:`!__name__` 是函式的名稱。請見 :attr:`function.__name__`。" -#: ../../reference/datamodel.rst:831 +#: ../../reference/datamodel.rst:852 msgid ":attr:`!__self__` is set to ``None`` (but see the next item)." msgstr "" -#: ../../reference/datamodel.rst:832 +#: ../../reference/datamodel.rst:853 msgid "" ":attr:`!__module__` is the name of the module the function was defined in or " "``None`` if unavailable. See :attr:`function.__module__`." msgstr "" -#: ../../reference/datamodel.rst:840 +#: ../../reference/datamodel.rst:861 msgid "Built-in methods" msgstr "內建方法" -#: ../../reference/datamodel.rst:847 +#: ../../reference/datamodel.rst:868 msgid "" "This is really a different disguise of a built-in function, this time " "containing an object passed to the C function as an implicit extra " @@ -1020,11 +1044,11 @@ msgid "" "__self__>`.)" msgstr "" -#: ../../reference/datamodel.rst:857 +#: ../../reference/datamodel.rst:878 msgid "Classes" msgstr "" -#: ../../reference/datamodel.rst:859 +#: ../../reference/datamodel.rst:880 msgid "" "Classes are callable. These objects normally act as factories for new " "instances of themselves, but variations are possible for class types that " @@ -1033,21 +1057,21 @@ msgid "" "initialize the new instance." msgstr "" -#: ../../reference/datamodel.rst:867 +#: ../../reference/datamodel.rst:888 msgid "Class Instances" msgstr "類別實例" -#: ../../reference/datamodel.rst:869 +#: ../../reference/datamodel.rst:890 msgid "" "Instances of arbitrary classes can be made callable by defining a :meth:" "`~object.__call__` method in their class." msgstr "" -#: ../../reference/datamodel.rst:876 +#: ../../reference/datamodel.rst:897 msgid "Modules" msgstr "模組" -#: ../../reference/datamodel.rst:882 +#: ../../reference/datamodel.rst:903 msgid "" "Modules are a basic organizational unit of Python code, and are created by " "the :ref:`import system ` as invoked either by the :keyword:" @@ -1062,17 +1086,17 @@ msgid "" "done)." msgstr "" -#: ../../reference/datamodel.rst:895 +#: ../../reference/datamodel.rst:916 msgid "" "Attribute assignment updates the module's namespace dictionary, e.g., ``m.x " "= 1`` is equivalent to ``m.__dict__[\"x\"] = 1``." msgstr "" -#: ../../reference/datamodel.rst:914 +#: ../../reference/datamodel.rst:935 msgid "Import-related attributes on module objects" msgstr "" -#: ../../reference/datamodel.rst:916 +#: ../../reference/datamodel.rst:937 msgid "" "Module objects have the following attributes that relate to the :ref:`import " "system `. When a module is created using the machinery " @@ -1081,7 +1105,7 @@ msgid "" "and loads the module." msgstr "" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:943 msgid "" "To create a module dynamically rather than using the import system, it's " "recommended to use :func:`importlib.util.module_from_spec`, which will set " @@ -1092,7 +1116,7 @@ msgid "" "approach." msgstr "" -#: ../../reference/datamodel.rst:932 +#: ../../reference/datamodel.rst:953 msgid "" "With the exception of :attr:`~module.__name__`, it is **strongly** " "recommended that you rely on :attr:`~module.__spec__` and its attributes " @@ -1101,7 +1125,7 @@ msgid "" "corresponding attribute on the module itself:" msgstr "" -#: ../../reference/datamodel.rst:938 +#: ../../reference/datamodel.rst:959 msgid "" ">>> import typing\n" ">>> typing.__name__, typing.__spec__.name\n" @@ -1123,34 +1147,34 @@ msgstr "" ">>> typing.__name__, typing.__spec__.name\n" "('keyboard_smashing', 'spelling')" -#: ../../reference/datamodel.rst:952 +#: ../../reference/datamodel.rst:973 msgid "" "The name used to uniquely identify the module in the import system. For a " "directly executed module, this will be set to ``\"__main__\"``." msgstr "" -#: ../../reference/datamodel.rst:955 +#: ../../reference/datamodel.rst:976 msgid "" "This attribute must be set to the fully qualified name of the module. It is " "expected to match the value of :attr:`module.__spec__.name `." msgstr "" -#: ../../reference/datamodel.rst:961 +#: ../../reference/datamodel.rst:982 msgid "A record of the module's import-system-related state." msgstr "" -#: ../../reference/datamodel.rst:963 +#: ../../reference/datamodel.rst:984 msgid "" "Set to the :class:`module spec ` that was " "used when importing the module. See :ref:`module-specs` for more details." msgstr "" -#: ../../reference/datamodel.rst:970 +#: ../../reference/datamodel.rst:991 msgid "The :term:`package` a module belongs to." msgstr "" -#: ../../reference/datamodel.rst:972 +#: ../../reference/datamodel.rst:993 msgid "" "If the module is top-level (that is, not a part of any specific package) " "then the attribute should be set to ``''`` (the empty string). Otherwise, it " @@ -1159,7 +1183,7 @@ msgid "" "for further details." msgstr "" -#: ../../reference/datamodel.rst:978 +#: ../../reference/datamodel.rst:999 msgid "" "This attribute is used instead of :attr:`~module.__name__` to calculate " "explicit relative imports for main modules. It defaults to ``None`` for " @@ -1168,7 +1192,7 @@ msgid "" "is set to a :class:`str`." msgstr "" -#: ../../reference/datamodel.rst:984 +#: ../../reference/datamodel.rst:1005 msgid "" "It is **strongly** recommended that you use :attr:`module.__spec__.parent " "` instead of :attr:`!module." @@ -1176,14 +1200,14 @@ msgid "" "__spec__.parent` is not set, and this fallback path is deprecated." msgstr "" -#: ../../reference/datamodel.rst:990 ../../reference/datamodel.rst:1031 +#: ../../reference/datamodel.rst:1011 ../../reference/datamodel.rst:1052 msgid "" "This attribute now defaults to ``None`` for modules created dynamically " "using the :class:`types.ModuleType` constructor. Previously the attribute " "was optional." msgstr "" -#: ../../reference/datamodel.rst:995 +#: ../../reference/datamodel.rst:1016 msgid "" "The value of :attr:`!__package__` is expected to be the same as :attr:" "`__spec__.parent `. :attr:" @@ -1191,38 +1215,38 @@ msgid "" "attr:`!__spec__.parent` is not defined." msgstr "" -#: ../../reference/datamodel.rst:1001 +#: ../../reference/datamodel.rst:1022 msgid "" ":exc:`ImportWarning` is raised if an import resolution falls back to :attr:`!" "__package__` instead of :attr:`__spec__.parent `." msgstr "" -#: ../../reference/datamodel.rst:1006 +#: ../../reference/datamodel.rst:1027 msgid "" "Raise :exc:`DeprecationWarning` instead of :exc:`ImportWarning` when falling " "back to :attr:`!__package__` during import resolution." msgstr "" -#: ../../reference/datamodel.rst:1010 +#: ../../reference/datamodel.rst:1031 msgid "" ":attr:`!__package__` will cease to be set or taken into consideration by the " "import system or standard library." msgstr "" -#: ../../reference/datamodel.rst:1016 +#: ../../reference/datamodel.rst:1037 msgid "" "The :term:`loader` object that the import machinery used to load the module." msgstr "" -#: ../../reference/datamodel.rst:1018 +#: ../../reference/datamodel.rst:1039 msgid "" "This attribute is mostly useful for introspection, but can be used for " "additional loader-specific functionality, for example getting data " "associated with a loader." msgstr "" -#: ../../reference/datamodel.rst:1022 +#: ../../reference/datamodel.rst:1043 msgid "" ":attr:`!__loader__` defaults to ``None`` for modules created dynamically " "using the :class:`types.ModuleType` constructor; use :func:`importlib.util." @@ -1230,14 +1254,14 @@ msgid "" "object." msgstr "" -#: ../../reference/datamodel.rst:1027 +#: ../../reference/datamodel.rst:1048 msgid "" "It is **strongly** recommended that you use :attr:`module.__spec__.loader " "` instead of :attr:`!module." "__loader__`." msgstr "" -#: ../../reference/datamodel.rst:1036 +#: ../../reference/datamodel.rst:1057 msgid "" "Setting :attr:`!__loader__` on a module while failing to set :attr:`!" "__spec__.loader` is deprecated. In Python 3.16, :attr:`!__loader__` will " @@ -1248,7 +1272,7 @@ msgstr "" "被棄用。在 Python 3.16 中,引入系統或標準函式庫將不再設定或考慮 :attr:`!" "__loader__`。" -#: ../../reference/datamodel.rst:1044 +#: ../../reference/datamodel.rst:1065 msgid "" "A (possibly empty) :term:`sequence` of strings enumerating the locations " "where the package's submodules will be found. Non-package modules should not " @@ -1256,21 +1280,21 @@ msgid "" "details." msgstr "" -#: ../../reference/datamodel.rst:1049 +#: ../../reference/datamodel.rst:1070 msgid "" "It is **strongly** recommended that you use :attr:`module.__spec__." "submodule_search_locations ` instead of :attr:`!module.__path__`." msgstr "" -#: ../../reference/datamodel.rst:1056 +#: ../../reference/datamodel.rst:1077 msgid "" ":attr:`!__file__` and :attr:`!__cached__` are both optional attributes that " "may or may not be set. Both attributes should be a :class:`str` when they " "are available." msgstr "" -#: ../../reference/datamodel.rst:1060 +#: ../../reference/datamodel.rst:1081 msgid "" ":attr:`!__file__` indicates the pathname of the file from which the module " "was loaded (if loaded from a file), or the pathname of the shared library " @@ -1281,7 +1305,7 @@ msgid "" "example, a module loaded from a database)." msgstr "" -#: ../../reference/datamodel.rst:1068 +#: ../../reference/datamodel.rst:1089 msgid "" "If :attr:`!__file__` is set then the :attr:`!__cached__` attribute might " "also be set, which is the path to any compiled version of the code (for " @@ -1290,7 +1314,7 @@ msgid "" "exist (see :pep:`3147`)." msgstr "" -#: ../../reference/datamodel.rst:1074 +#: ../../reference/datamodel.rst:1095 msgid "" "Note that :attr:`!__cached__` may be set even if :attr:`!__file__` is not " "set. However, that scenario is quite atypical. Ultimately, the :term:" @@ -1300,14 +1324,14 @@ msgid "" "file, that atypical scenario may be appropriate." msgstr "" -#: ../../reference/datamodel.rst:1081 +#: ../../reference/datamodel.rst:1102 msgid "" "It is **strongly** recommended that you use :attr:`module.__spec__.cached " "` instead of :attr:`!module." "__cached__`." msgstr "" -#: ../../reference/datamodel.rst:1085 +#: ../../reference/datamodel.rst:1106 msgid "" "Setting :attr:`!__cached__` on a module while failing to set :attr:`!" "__spec__.cached` is deprecated. In Python 3.15, :attr:`!__cached__` will " @@ -1315,17 +1339,17 @@ msgid "" "library." msgstr "" -#: ../../reference/datamodel.rst:1092 +#: ../../reference/datamodel.rst:1113 msgid "Other writable attributes on module objects" msgstr "模組物件的其他可寫入屬性" -#: ../../reference/datamodel.rst:1094 +#: ../../reference/datamodel.rst:1115 msgid "" "As well as the import-related attributes listed above, module objects also " "have the following writable attributes:" msgstr "" -#: ../../reference/datamodel.rst:1099 +#: ../../reference/datamodel.rst:1120 msgid "" "The module's documentation string, or ``None`` if unavailable. See also: :" "attr:`__doc__ attributes `." @@ -1333,35 +1357,35 @@ msgstr "" "模組的文件字串,若不可用則為 ``None``。請見 :attr:`__doc__ attributes " "`。" -#: ../../reference/datamodel.rst:1104 +#: ../../reference/datamodel.rst:1125 msgid "" "A dictionary containing :term:`variable annotations ` " "collected during module body execution. For best practices on working with :" "attr:`!__annotations__`, see :mod:`annotationlib`." msgstr "" -#: ../../reference/datamodel.rst:1114 +#: ../../reference/datamodel.rst:1135 msgid "" "The :term:`annotate function` for this module, or ``None`` if the module has " "no annotations. See also: :attr:`~object.__annotate__` attributes." msgstr "" -#: ../../reference/datamodel.rst:1120 +#: ../../reference/datamodel.rst:1141 msgid "Module dictionaries" msgstr "模組字典" -#: ../../reference/datamodel.rst:1122 +#: ../../reference/datamodel.rst:1143 msgid "Module objects also have the following special read-only attribute:" msgstr "" -#: ../../reference/datamodel.rst:1127 +#: ../../reference/datamodel.rst:1148 msgid "" "The module's namespace as a dictionary object. Uniquely among the attributes " "listed here, :attr:`!__dict__` cannot be accessed as a global variable from " "within a module; it can only be accessed as an attribute on module objects." msgstr "" -#: ../../reference/datamodel.rst:1133 +#: ../../reference/datamodel.rst:1154 msgid "" "Because of the way CPython clears module dictionaries, the module dictionary " "will be cleared when the module falls out of scope even if the dictionary " @@ -1369,11 +1393,11 @@ msgid "" "module around while using its dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:1142 +#: ../../reference/datamodel.rst:1163 msgid "Custom classes" msgstr "" -#: ../../reference/datamodel.rst:1144 +#: ../../reference/datamodel.rst:1165 msgid "" "Custom class types are typically created by class definitions (see section :" "ref:`class`). A class has a namespace implemented by a dictionary object. " @@ -1388,7 +1412,7 @@ msgid "" "found at :ref:`python_2.3_mro`." msgstr "" -#: ../../reference/datamodel.rst:1165 +#: ../../reference/datamodel.rst:1186 msgid "" "When a class attribute reference (for class :class:`!C`, say) would yield a " "class method object, it is transformed into an instance method object whose :" @@ -1399,80 +1423,80 @@ msgid "" "contained in its :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:1176 +#: ../../reference/datamodel.rst:1197 msgid "" "Class attribute assignments update the class's dictionary, never the " "dictionary of a base class." msgstr "" -#: ../../reference/datamodel.rst:1181 +#: ../../reference/datamodel.rst:1202 msgid "" "A class object can be called (see above) to yield a class instance (see " "below)." msgstr "" -#: ../../reference/datamodel.rst:1184 ../../reference/datamodel.rst:1360 +#: ../../reference/datamodel.rst:1205 ../../reference/datamodel.rst:1381 msgid "Special attributes" msgstr "特殊屬性" -#: ../../reference/datamodel.rst:1206 +#: ../../reference/datamodel.rst:1227 msgid "" "The class's name. See also: :attr:`__name__ attributes `." msgstr "" -#: ../../reference/datamodel.rst:1210 +#: ../../reference/datamodel.rst:1231 msgid "" "The class's :term:`qualified name`. See also: :attr:`__qualname__ attributes " "`." msgstr "" -#: ../../reference/datamodel.rst:1214 +#: ../../reference/datamodel.rst:1235 msgid "The name of the module in which the class was defined." msgstr "" -#: ../../reference/datamodel.rst:1217 +#: ../../reference/datamodel.rst:1238 msgid "" "A :class:`mapping proxy ` providing a read-only view " "of the class's namespace. See also: :attr:`__dict__ attributes `." msgstr "" -#: ../../reference/datamodel.rst:1222 +#: ../../reference/datamodel.rst:1243 msgid "" "A :class:`tuple` containing the class's bases. In most cases, for a class " "defined as ``class X(A, B, C)``, ``X.__bases__`` will be exactly equal to " "``(A, B, C)``." msgstr "" -#: ../../reference/datamodel.rst:1229 +#: ../../reference/datamodel.rst:1250 msgid "" "The single base class in the inheritance chain that is responsible for the " "memory layout of instances. This attribute corresponds to :c:member:" "`~PyTypeObject.tp_base` at the C level." msgstr "" -#: ../../reference/datamodel.rst:1234 +#: ../../reference/datamodel.rst:1255 msgid "" "The class's documentation string, or ``None`` if undefined. Not inherited by " "subclasses." msgstr "" -#: ../../reference/datamodel.rst:1238 +#: ../../reference/datamodel.rst:1259 msgid "" "A dictionary containing :term:`variable annotations ` " "collected during class body execution. See also: :attr:`__annotations__ " "attributes `." msgstr "" -#: ../../reference/datamodel.rst:1243 +#: ../../reference/datamodel.rst:1264 msgid "" "For best practices on working with :attr:`~object.__annotations__`, please " "see :mod:`annotationlib`. Use :func:`annotationlib.get_annotations` instead " "of accessing this attribute directly." msgstr "" -#: ../../reference/datamodel.rst:1250 +#: ../../reference/datamodel.rst:1271 msgid "" "Accessing the :attr:`!__annotations__` attribute directly on a class object " "may return annotations for the wrong class, specifically in certain cases " @@ -1481,69 +1505,69 @@ msgid "" "details." msgstr "" -#: ../../reference/datamodel.rst:1256 +#: ../../reference/datamodel.rst:1277 msgid "" "This attribute does not exist on certain builtin classes. On user-defined " "classes without ``__annotations__``, it is an empty dictionary." msgstr "" -#: ../../reference/datamodel.rst:1265 +#: ../../reference/datamodel.rst:1286 msgid "" "The :term:`annotate function` for this class, or ``None`` if the class has " "no annotations. See also: :attr:`__annotate__ attributes `." msgstr "" -#: ../../reference/datamodel.rst:1272 +#: ../../reference/datamodel.rst:1293 msgid "" "A :class:`tuple` containing the :ref:`type parameters ` of a :" "ref:`generic class `." msgstr "" -#: ../../reference/datamodel.rst:1278 +#: ../../reference/datamodel.rst:1299 msgid "" "A :class:`tuple` containing names of attributes of this class which are " "assigned through ``self.X`` from any function in its body." msgstr "" -#: ../../reference/datamodel.rst:1284 +#: ../../reference/datamodel.rst:1305 msgid "" "The line number of the first line of the class definition, including " "decorators. Setting the :attr:`~type.__module__` attribute removes the :attr:" "`!__firstlineno__` item from the type's dictionary." msgstr "" -#: ../../reference/datamodel.rst:1292 +#: ../../reference/datamodel.rst:1313 msgid "" "The :class:`tuple` of classes that are considered when looking for base " "classes during method resolution." msgstr "" -#: ../../reference/datamodel.rst:1297 +#: ../../reference/datamodel.rst:1318 msgid "Special methods" msgstr "特殊方法" -#: ../../reference/datamodel.rst:1299 +#: ../../reference/datamodel.rst:1320 msgid "" "In addition to the special attributes described above, all Python classes " "also have the following two methods available:" msgstr "" -#: ../../reference/datamodel.rst:1304 +#: ../../reference/datamodel.rst:1325 msgid "" "This method can be overridden by a metaclass to customize the method " "resolution order for its instances. It is called at class instantiation, " "and its result is stored in :attr:`~type.__mro__`." msgstr "" -#: ../../reference/datamodel.rst:1310 +#: ../../reference/datamodel.rst:1331 msgid "" "Each class keeps a list of weak references to its immediate subclasses. This " "method returns a list of all those references still alive. The list is in " "definition order. Example:" msgstr "" -#: ../../reference/datamodel.rst:1314 +#: ../../reference/datamodel.rst:1335 msgid "" ">>> class A: pass\n" ">>> class B(A): pass\n" @@ -1555,11 +1579,11 @@ msgstr "" ">>> A.__subclasses__()\n" "[]" -#: ../../reference/datamodel.rst:1322 +#: ../../reference/datamodel.rst:1343 msgid "Class instances" msgstr "類別實例" -#: ../../reference/datamodel.rst:1330 +#: ../../reference/datamodel.rst:1351 msgid "" "A class instance is created by calling a class object (see above). A class " "instance has a namespace implemented as a dictionary which is the first " @@ -1576,7 +1600,7 @@ msgid "" "__getattr__` method, that is called to satisfy the lookup." msgstr "" -#: ../../reference/datamodel.rst:1346 +#: ../../reference/datamodel.rst:1367 msgid "" "Attribute assignments and deletions update the instance's dictionary, never " "a class's dictionary. If the class has a :meth:`~object.__setattr__` or :" @@ -1584,28 +1608,28 @@ msgid "" "instance dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:1356 +#: ../../reference/datamodel.rst:1377 msgid "" "Class instances can pretend to be numbers, sequences, or mappings if they " "have methods with certain special names. See section :ref:`specialnames`." msgstr "" -#: ../../reference/datamodel.rst:1368 +#: ../../reference/datamodel.rst:1389 msgid "The class to which a class instance belongs." msgstr "" -#: ../../reference/datamodel.rst:1372 +#: ../../reference/datamodel.rst:1393 msgid "" "A dictionary or other mapping object used to store an object's (writable) " "attributes. Not all instances have a :attr:`!__dict__` attribute; see the " "section on :ref:`slots` for more details." msgstr "" -#: ../../reference/datamodel.rst:1378 +#: ../../reference/datamodel.rst:1399 msgid "I/O objects (also known as file objects)" msgstr "" -#: ../../reference/datamodel.rst:1393 +#: ../../reference/datamodel.rst:1414 msgid "" "A :term:`file object` represents an open file. Various shortcuts are " "available to create file objects: the :func:`open` built-in function, and " @@ -1614,7 +1638,7 @@ msgid "" "methods provided by extension modules)." msgstr "" -#: ../../reference/datamodel.rst:1399 +#: ../../reference/datamodel.rst:1420 msgid "" "The objects ``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` are initialized " "to file objects corresponding to the interpreter's standard input, output " @@ -1622,22 +1646,22 @@ msgid "" "interface defined by the :class:`io.TextIOBase` abstract class." msgstr "" -#: ../../reference/datamodel.rst:1407 +#: ../../reference/datamodel.rst:1428 msgid "Internal types" msgstr "" -#: ../../reference/datamodel.rst:1413 +#: ../../reference/datamodel.rst:1434 msgid "" "A few types used internally by the interpreter are exposed to the user. " "Their definitions may change with future versions of the interpreter, but " "they are mentioned here for completeness." msgstr "" -#: ../../reference/datamodel.rst:1421 +#: ../../reference/datamodel.rst:1442 msgid "Code objects" msgstr "程式碼物件" -#: ../../reference/datamodel.rst:1425 +#: ../../reference/datamodel.rst:1446 msgid "" "Code objects represent *byte-compiled* executable Python code, or :term:" "`bytecode`. The difference between a code object and a function object is " @@ -1649,111 +1673,111 @@ msgid "" "no references (directly or indirectly) to mutable objects." msgstr "" -#: ../../reference/datamodel.rst:1459 +#: ../../reference/datamodel.rst:1480 msgid "The function name" msgstr "函式名稱" -#: ../../reference/datamodel.rst:1462 +#: ../../reference/datamodel.rst:1483 msgid "The fully qualified function name" msgstr "" -#: ../../reference/datamodel.rst:1467 +#: ../../reference/datamodel.rst:1488 msgid "" "The total number of positional :term:`parameters ` (including " "positional-only parameters and parameters with default values) that the " "function has" msgstr "" -#: ../../reference/datamodel.rst:1472 +#: ../../reference/datamodel.rst:1493 msgid "" "The number of positional-only :term:`parameters ` (including " "arguments with default values) that the function has" msgstr "" -#: ../../reference/datamodel.rst:1476 +#: ../../reference/datamodel.rst:1497 msgid "" "The number of keyword-only :term:`parameters ` (including " "arguments with default values) that the function has" msgstr "" -#: ../../reference/datamodel.rst:1480 +#: ../../reference/datamodel.rst:1501 msgid "" "The number of :ref:`local variables ` used by the function " "(including parameters)" msgstr "" -#: ../../reference/datamodel.rst:1484 +#: ../../reference/datamodel.rst:1505 msgid "" "A :class:`tuple` containing the names of the local variables in the function " "(starting with the parameter names)" msgstr "" -#: ../../reference/datamodel.rst:1488 +#: ../../reference/datamodel.rst:1509 msgid "" "A :class:`tuple` containing the names of :ref:`local variables ` " "that are referenced from at least one :term:`nested scope` inside the " "function" msgstr "" -#: ../../reference/datamodel.rst:1492 +#: ../../reference/datamodel.rst:1513 msgid "" "A :class:`tuple` containing the names of :term:`free (closure) variables " "` that a :term:`nested scope` references in an outer " "scope. See also :attr:`function.__closure__`." msgstr "" -#: ../../reference/datamodel.rst:1496 +#: ../../reference/datamodel.rst:1517 msgid "Note: references to global and builtin names are *not* included." msgstr "" -#: ../../reference/datamodel.rst:1499 +#: ../../reference/datamodel.rst:1520 msgid "" "A string representing the sequence of :term:`bytecode` instructions in the " "function" msgstr "" -#: ../../reference/datamodel.rst:1503 +#: ../../reference/datamodel.rst:1524 msgid "" "A :class:`tuple` containing the literals used by the :term:`bytecode` in the " "function" msgstr "" -#: ../../reference/datamodel.rst:1507 +#: ../../reference/datamodel.rst:1528 msgid "" "A :class:`tuple` containing the names used by the :term:`bytecode` in the " "function" msgstr "" -#: ../../reference/datamodel.rst:1511 +#: ../../reference/datamodel.rst:1532 msgid "The name of the file from which the code was compiled" msgstr "" -#: ../../reference/datamodel.rst:1514 +#: ../../reference/datamodel.rst:1535 msgid "The line number of the first line of the function" msgstr "" -#: ../../reference/datamodel.rst:1517 +#: ../../reference/datamodel.rst:1538 msgid "" "A string encoding the mapping from :term:`bytecode` offsets to line numbers. " "For details, see the source code of the interpreter." msgstr "" -#: ../../reference/datamodel.rst:1520 +#: ../../reference/datamodel.rst:1541 msgid "" "This attribute of code objects is deprecated, and may be removed in Python " "3.15." msgstr "" -#: ../../reference/datamodel.rst:1525 +#: ../../reference/datamodel.rst:1546 msgid "The required stack size of the code object" msgstr "" -#: ../../reference/datamodel.rst:1528 +#: ../../reference/datamodel.rst:1549 msgid "" "An :class:`integer ` encoding a number of flags for the interpreter." msgstr "" -#: ../../reference/datamodel.rst:1533 +#: ../../reference/datamodel.rst:1554 msgid "" "The following flag bits are defined for :attr:`~codeobject.co_flags`: bit " "``0x04`` is set if the function uses the ``*arguments`` syntax to accept an " @@ -1764,7 +1788,7 @@ msgid "" "might be present." msgstr "" -#: ../../reference/datamodel.rst:1541 +#: ../../reference/datamodel.rst:1562 msgid "" "Future feature declarations (for example, ``from __future__ import " "division``) also use bits in :attr:`~codeobject.co_flags` to indicate " @@ -1772,12 +1796,12 @@ msgid "" "attr:`~__future__._Feature.compiler_flag`." msgstr "" -#: ../../reference/datamodel.rst:1545 +#: ../../reference/datamodel.rst:1566 msgid "" "Other bits in :attr:`~codeobject.co_flags` are reserved for internal use." msgstr "" -#: ../../reference/datamodel.rst:1549 +#: ../../reference/datamodel.rst:1570 msgid "" "If a code object represents a function and has a docstring, the :data:" "`~inspect.CO_HAS_DOCSTRING` bit is set in :attr:`~codeobject.co_flags` and " @@ -1785,17 +1809,17 @@ msgid "" "function." msgstr "" -#: ../../reference/datamodel.rst:1555 +#: ../../reference/datamodel.rst:1576 msgid "Methods on code objects" msgstr "用於程式碼物件的方法" -#: ../../reference/datamodel.rst:1559 +#: ../../reference/datamodel.rst:1580 msgid "" "Returns an iterable over the source code positions of each :term:`bytecode` " "instruction in the code object." msgstr "" -#: ../../reference/datamodel.rst:1562 +#: ../../reference/datamodel.rst:1583 msgid "" "The iterator returns :class:`tuple`\\s containing the ``(start_line, " "end_line, start_column, end_column)``. The *i-th* tuple corresponds to the " @@ -1803,37 +1827,37 @@ msgid "" "information is 0-indexed utf-8 byte offsets on the given source line." msgstr "" -#: ../../reference/datamodel.rst:1568 +#: ../../reference/datamodel.rst:1589 msgid "" "This positional information can be missing. A non-exhaustive lists of cases " "where this may happen:" msgstr "" -#: ../../reference/datamodel.rst:1571 +#: ../../reference/datamodel.rst:1592 msgid "Running the interpreter with :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1572 +#: ../../reference/datamodel.rst:1593 msgid "" "Loading a pyc file compiled while using :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1573 +#: ../../reference/datamodel.rst:1594 msgid "Position tuples corresponding to artificial instructions." msgstr "" -#: ../../reference/datamodel.rst:1574 +#: ../../reference/datamodel.rst:1595 msgid "" "Line and column numbers that can't be represented due to implementation " "specific limitations." msgstr "" -#: ../../reference/datamodel.rst:1577 +#: ../../reference/datamodel.rst:1598 msgid "" "When this occurs, some or all of the tuple elements can be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:1583 +#: ../../reference/datamodel.rst:1604 msgid "" "This feature requires storing column positions in code objects which may " "result in a small increase of disk usage of compiled Python files or " @@ -1843,100 +1867,100 @@ msgid "" "environment variable can be used." msgstr "" -#: ../../reference/datamodel.rst:1592 +#: ../../reference/datamodel.rst:1613 msgid "" "Returns an iterator that yields information about successive ranges of :term:" "`bytecode`\\s. Each item yielded is a ``(start, end, lineno)`` :class:" "`tuple`:" msgstr "" -#: ../../reference/datamodel.rst:1596 +#: ../../reference/datamodel.rst:1617 msgid "" "``start`` (an :class:`int`) represents the offset (inclusive) of the start " "of the :term:`bytecode` range" msgstr "" -#: ../../reference/datamodel.rst:1598 +#: ../../reference/datamodel.rst:1619 msgid "" "``end`` (an :class:`int`) represents the offset (exclusive) of the end of " "the :term:`bytecode` range" msgstr "" -#: ../../reference/datamodel.rst:1600 +#: ../../reference/datamodel.rst:1621 msgid "" "``lineno`` is an :class:`int` representing the line number of the :term:" "`bytecode` range, or ``None`` if the bytecodes in the given range have no " "line number" msgstr "" -#: ../../reference/datamodel.rst:1604 +#: ../../reference/datamodel.rst:1625 msgid "The items yielded will have the following properties:" msgstr "" -#: ../../reference/datamodel.rst:1606 +#: ../../reference/datamodel.rst:1627 msgid "The first range yielded will have a ``start`` of 0." msgstr "" -#: ../../reference/datamodel.rst:1607 +#: ../../reference/datamodel.rst:1628 msgid "" "The ``(start, end)`` ranges will be non-decreasing and consecutive. That is, " "for any pair of :class:`tuple`\\s, the ``start`` of the second will be equal " "to the ``end`` of the first." msgstr "" -#: ../../reference/datamodel.rst:1610 +#: ../../reference/datamodel.rst:1631 msgid "No range will be backwards: ``end >= start`` for all triples." msgstr "" -#: ../../reference/datamodel.rst:1611 +#: ../../reference/datamodel.rst:1632 msgid "" "The last :class:`tuple` yielded will have ``end`` equal to the size of the :" "term:`bytecode`." msgstr "" -#: ../../reference/datamodel.rst:1614 +#: ../../reference/datamodel.rst:1635 msgid "" "Zero-width ranges, where ``start == end``, are allowed. Zero-width ranges " "are used for lines that are present in the source code, but have been " "eliminated by the :term:`bytecode` compiler." msgstr "" -#: ../../reference/datamodel.rst:1622 +#: ../../reference/datamodel.rst:1643 msgid ":pep:`626` - Precise line numbers for debugging and other tools." msgstr "" -#: ../../reference/datamodel.rst:1623 +#: ../../reference/datamodel.rst:1644 msgid "The PEP that introduced the :meth:`!co_lines` method." msgstr "" -#: ../../reference/datamodel.rst:1627 +#: ../../reference/datamodel.rst:1648 msgid "" "Return a copy of the code object with new values for the specified fields." msgstr "" -#: ../../reference/datamodel.rst:1629 +#: ../../reference/datamodel.rst:1650 msgid "" "Code objects are also supported by the generic function :func:`copy.replace`." msgstr "" -#: ../../reference/datamodel.rst:1637 +#: ../../reference/datamodel.rst:1658 msgid "Frame objects" msgstr "" -#: ../../reference/datamodel.rst:1641 +#: ../../reference/datamodel.rst:1662 msgid "" "Frame objects represent execution frames. They may occur in :ref:`traceback " "objects `, and are also passed to registered trace " "functions." msgstr "" -#: ../../reference/datamodel.rst:1660 +#: ../../reference/datamodel.rst:1681 msgid "" "Points to the previous stack frame (towards the caller), or ``None`` if this " "is the bottom stack frame" msgstr "" -#: ../../reference/datamodel.rst:1664 +#: ../../reference/datamodel.rst:1685 msgid "" "The :ref:`code object ` being executed in this frame. " "Accessing this attribute raises an :ref:`auditing event ` ``object." @@ -1946,61 +1970,61 @@ msgstr "" "這個屬性會引發一個附帶引數 ``obj`` 與 ``\"f_code\"`` 的\\ :ref:`稽核事件 " "` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1669 +#: ../../reference/datamodel.rst:1690 msgid "" "The mapping used by the frame to look up :ref:`local variables `. If " "the frame refers to an :term:`optimized scope`, this may return a write-" "through proxy object." msgstr "" -#: ../../reference/datamodel.rst:1674 +#: ../../reference/datamodel.rst:1695 msgid "Return a proxy for optimized scopes." msgstr "" -#: ../../reference/datamodel.rst:1678 +#: ../../reference/datamodel.rst:1699 msgid "" "The dictionary used by the frame to look up :ref:`global variables `" msgstr "" -#: ../../reference/datamodel.rst:1682 +#: ../../reference/datamodel.rst:1703 msgid "" "The dictionary used by the frame to look up :ref:`built-in (intrinsic) names " "`" msgstr "" -#: ../../reference/datamodel.rst:1686 +#: ../../reference/datamodel.rst:1707 msgid "" "The \"precise instruction\" of the frame object (this is an index into the :" "term:`bytecode` string of the :ref:`code object `)" msgstr "" -#: ../../reference/datamodel.rst:1691 +#: ../../reference/datamodel.rst:1712 msgid "" "The :term:`generator` or :term:`coroutine` object that owns this frame, or " "``None`` if the frame is a normal function." msgstr "" -#: ../../reference/datamodel.rst:1708 +#: ../../reference/datamodel.rst:1729 msgid "" "If not ``None``, this is a function called for various events during code " "execution (this is used by debuggers). Normally an event is triggered for " "each new source line (see :attr:`~frame.f_trace_lines`)." msgstr "" -#: ../../reference/datamodel.rst:1713 +#: ../../reference/datamodel.rst:1734 msgid "" "Set this attribute to :const:`False` to disable triggering a tracing event " "for each source line." msgstr "" -#: ../../reference/datamodel.rst:1717 +#: ../../reference/datamodel.rst:1738 msgid "" "Set this attribute to :const:`True` to allow per-opcode events to be " "requested. Note that this may lead to undefined interpreter behaviour if " "exceptions raised by the trace function escape to the function being traced." msgstr "" -#: ../../reference/datamodel.rst:1723 +#: ../../reference/datamodel.rst:1744 msgid "" "The current line number of the frame -- writing to this from within a trace " "function jumps to the given line (only for the bottom-most frame). A " @@ -2008,15 +2032,15 @@ msgid "" "this attribute." msgstr "" -#: ../../reference/datamodel.rst:1729 +#: ../../reference/datamodel.rst:1750 msgid "Frame object methods" msgstr "" -#: ../../reference/datamodel.rst:1731 +#: ../../reference/datamodel.rst:1752 msgid "Frame objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1735 +#: ../../reference/datamodel.rst:1756 msgid "" "This method clears all references to :ref:`local variables ` held by " "the frame. Also, if the frame belonged to a :term:`generator`, the " @@ -2025,34 +2049,34 @@ msgid "" "and storing its :ref:`traceback ` for later use)." msgstr "" -#: ../../reference/datamodel.rst:1741 +#: ../../reference/datamodel.rst:1762 msgid "" ":exc:`RuntimeError` is raised if the frame is currently executing or " "suspended." msgstr "" -#: ../../reference/datamodel.rst:1746 +#: ../../reference/datamodel.rst:1767 msgid "" "Attempting to clear a suspended frame raises :exc:`RuntimeError` (as has " "always been the case for executing frames)." msgstr "" -#: ../../reference/datamodel.rst:1754 +#: ../../reference/datamodel.rst:1775 msgid "Traceback objects" msgstr "" -#: ../../reference/datamodel.rst:1767 +#: ../../reference/datamodel.rst:1788 msgid "" "Traceback objects represent the stack trace of an :ref:`exception `. A traceback object is implicitly created when an exception occurs, " "and may also be explicitly created by calling :class:`types.TracebackType`." msgstr "" -#: ../../reference/datamodel.rst:1772 +#: ../../reference/datamodel.rst:1793 msgid "Traceback objects can now be explicitly instantiated from Python code." msgstr "" -#: ../../reference/datamodel.rst:1775 +#: ../../reference/datamodel.rst:1796 msgid "" "For implicitly created tracebacks, when the search for an exception handler " "unwinds the execution stack, at each unwound level a traceback object is " @@ -2063,7 +2087,7 @@ msgid "" "the caught exception." msgstr "" -#: ../../reference/datamodel.rst:1784 +#: ../../reference/datamodel.rst:1805 msgid "" "When the program contains no suitable handler, the stack trace is written " "(nicely formatted) to the standard error stream; if the interpreter is " @@ -2071,19 +2095,19 @@ msgid "" "last_traceback`." msgstr "" -#: ../../reference/datamodel.rst:1789 +#: ../../reference/datamodel.rst:1810 msgid "" "For explicitly created tracebacks, it is up to the creator of the traceback " "to determine how the :attr:`~traceback.tb_next` attributes should be linked " "to form a full stack trace." msgstr "" -#: ../../reference/datamodel.rst:1804 +#: ../../reference/datamodel.rst:1825 msgid "" "Points to the execution :ref:`frame ` of the current level." msgstr "" -#: ../../reference/datamodel.rst:1807 +#: ../../reference/datamodel.rst:1828 msgid "" "Accessing this attribute raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." @@ -2091,15 +2115,15 @@ msgstr "" "存取此屬性會引發一個附帶引數 ``obj`` 與 ``\"tb_frame\"`` 的\\ :ref:`稽核事件 " "` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1812 +#: ../../reference/datamodel.rst:1833 msgid "Gives the line number where the exception occurred" msgstr "" -#: ../../reference/datamodel.rst:1815 +#: ../../reference/datamodel.rst:1836 msgid "Indicates the \"precise instruction\"." msgstr "" -#: ../../reference/datamodel.rst:1817 +#: ../../reference/datamodel.rst:1838 msgid "" "The line number and last instruction in the traceback may differ from the " "line number of its :ref:`frame object ` if the exception " @@ -2107,39 +2131,39 @@ msgid "" "with a :keyword:`finally` clause." msgstr "" -#: ../../reference/datamodel.rst:1828 +#: ../../reference/datamodel.rst:1849 msgid "" "The special writable attribute :attr:`!tb_next` is the next level in the " "stack trace (towards the frame where the exception occurred), or ``None`` if " "there is no next level." msgstr "" -#: ../../reference/datamodel.rst:1832 +#: ../../reference/datamodel.rst:1853 msgid "This attribute is now writable" msgstr "此屬性現在可寫入" -#: ../../reference/datamodel.rst:1837 +#: ../../reference/datamodel.rst:1858 msgid "Slice objects" msgstr "" -#: ../../reference/datamodel.rst:1841 +#: ../../reference/datamodel.rst:1862 msgid "" "Slice objects are used to represent slices for :meth:`~object.__getitem__` " "methods. They are also created by the built-in :func:`slice` function." msgstr "" -#: ../../reference/datamodel.rst:1850 +#: ../../reference/datamodel.rst:1871 msgid "" "Special read-only attributes: :attr:`~slice.start` is the lower bound; :attr:" "`~slice.stop` is the upper bound; :attr:`~slice.step` is the step value; " "each is ``None`` if omitted. These attributes can have any type." msgstr "" -#: ../../reference/datamodel.rst:1854 +#: ../../reference/datamodel.rst:1875 msgid "Slice objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1858 +#: ../../reference/datamodel.rst:1879 msgid "" "This method takes a single integer argument *length* and computes " "information about the slice that the slice object would describe if applied " @@ -2149,11 +2173,11 @@ msgid "" "a manner consistent with regular slices." msgstr "" -#: ../../reference/datamodel.rst:1867 +#: ../../reference/datamodel.rst:1888 msgid "Static method objects" msgstr "" -#: ../../reference/datamodel.rst:1869 +#: ../../reference/datamodel.rst:1890 msgid "" "Static method objects provide a way of defeating the transformation of " "function objects to method objects described above. A static method object " @@ -2164,11 +2188,11 @@ msgid "" "method objects are created by the built-in :func:`staticmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1879 +#: ../../reference/datamodel.rst:1900 msgid "Class method objects" msgstr "" -#: ../../reference/datamodel.rst:1881 +#: ../../reference/datamodel.rst:1902 msgid "" "A class method object, like a static method object, is a wrapper around " "another object that alters the way in which that object is retrieved from " @@ -2178,11 +2202,11 @@ msgid "" "`classmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1891 +#: ../../reference/datamodel.rst:1912 msgid "Special method names" msgstr "" -#: ../../reference/datamodel.rst:1897 +#: ../../reference/datamodel.rst:1918 msgid "" "A class can implement certain operations that are invoked by special syntax " "(such as arithmetic operations or subscripting and slicing) by defining " @@ -2196,7 +2220,7 @@ msgid "" "`TypeError`)." msgstr "" -#: ../../reference/datamodel.rst:1908 +#: ../../reference/datamodel.rst:1929 msgid "" "Setting a special method to ``None`` indicates that the corresponding " "operation is not available. For example, if a class sets :meth:`~object." @@ -2205,7 +2229,7 @@ msgid "" "`~object.__getitem__`). [#]_" msgstr "" -#: ../../reference/datamodel.rst:1914 +#: ../../reference/datamodel.rst:1935 msgid "" "When implementing a class that emulates any built-in type, it is important " "that the emulation only be implemented to the degree that it makes sense for " @@ -2215,11 +2239,11 @@ msgid "" "in the W3C's Document Object Model.)" msgstr "" -#: ../../reference/datamodel.rst:1925 +#: ../../reference/datamodel.rst:1946 msgid "Basic customization" msgstr "" -#: ../../reference/datamodel.rst:1931 +#: ../../reference/datamodel.rst:1952 msgid "" "Called to create a new instance of class *cls*. :meth:`__new__` is a static " "method (special-cased so you need not declare it as such) that takes the " @@ -2229,7 +2253,7 @@ msgid "" "new object instance (usually an instance of *cls*)." msgstr "" -#: ../../reference/datamodel.rst:1938 +#: ../../reference/datamodel.rst:1959 msgid "" "Typical implementations create a new instance of the class by invoking the " "superclass's :meth:`__new__` method using ``super().__new__(cls[, ...])`` " @@ -2237,7 +2261,7 @@ msgid "" "necessary before returning it." msgstr "" -#: ../../reference/datamodel.rst:1943 +#: ../../reference/datamodel.rst:1964 msgid "" "If :meth:`__new__` is invoked during object construction and it returns an " "instance of *cls*, then the new instance’s :meth:`__init__` method will be " @@ -2246,13 +2270,13 @@ msgid "" "constructor." msgstr "" -#: ../../reference/datamodel.rst:1948 +#: ../../reference/datamodel.rst:1969 msgid "" "If :meth:`__new__` does not return an instance of *cls*, then the new " "instance's :meth:`__init__` method will not be invoked." msgstr "" -#: ../../reference/datamodel.rst:1951 +#: ../../reference/datamodel.rst:1972 msgid "" ":meth:`__new__` is intended mainly to allow subclasses of immutable types " "(like int, str, or tuple) to customize instance creation. It is also " @@ -2260,7 +2284,7 @@ msgid "" "creation." msgstr "" -#: ../../reference/datamodel.rst:1960 +#: ../../reference/datamodel.rst:1981 msgid "" "Called after the instance has been created (by :meth:`__new__`), but before " "it is returned to the caller. The arguments are those passed to the class " @@ -2270,7 +2294,7 @@ msgid "" "example: ``super().__init__([args...])``." msgstr "" -#: ../../reference/datamodel.rst:1967 +#: ../../reference/datamodel.rst:1988 msgid "" "Because :meth:`__new__` and :meth:`__init__` work together in constructing " "objects (:meth:`__new__` to create it, and :meth:`__init__` to customize " @@ -2278,7 +2302,7 @@ msgid "" "will cause a :exc:`TypeError` to be raised at runtime." msgstr "" -#: ../../reference/datamodel.rst:1980 +#: ../../reference/datamodel.rst:2001 msgid "" "Called when the instance is about to be destroyed. This is also called a " "finalizer or (improperly) a destructor. If a base class has a :meth:" @@ -2287,7 +2311,7 @@ msgid "" "instance." msgstr "" -#: ../../reference/datamodel.rst:1986 +#: ../../reference/datamodel.rst:2007 msgid "" "It is possible (though not recommended!) for the :meth:`__del__` method to " "postpone destruction of the instance by creating a new reference to it. " @@ -2297,7 +2321,7 @@ msgid "" "it once." msgstr "" -#: ../../reference/datamodel.rst:1993 +#: ../../reference/datamodel.rst:2014 msgid "" "It is not guaranteed that :meth:`__del__` methods are called for objects " "that still exist when the interpreter exits. :class:`weakref.finalize` " @@ -2305,14 +2329,14 @@ msgid "" "when an object is garbage collected." msgstr "" -#: ../../reference/datamodel.rst:2000 +#: ../../reference/datamodel.rst:2021 msgid "" "``del x`` doesn't directly call ``x.__del__()`` --- the former decrements " "the reference count for ``x`` by one, and the latter is only called when " "``x``'s reference count reaches zero." msgstr "" -#: ../../reference/datamodel.rst:2005 +#: ../../reference/datamodel.rst:2026 msgid "" "It is possible for a reference cycle to prevent the reference count of an " "object from going to zero. In this case, the cycle will be later detected " @@ -2323,18 +2347,18 @@ msgid "" "caught in the traceback." msgstr "" -#: ../../reference/datamodel.rst:2015 +#: ../../reference/datamodel.rst:2036 msgid "Documentation for the :mod:`gc` module." msgstr ":mod:`gc` 模組的文件。" -#: ../../reference/datamodel.rst:2019 +#: ../../reference/datamodel.rst:2040 msgid "" "Due to the precarious circumstances under which :meth:`__del__` methods are " "invoked, exceptions that occur during their execution are ignored, and a " "warning is printed to ``sys.stderr`` instead. In particular:" msgstr "" -#: ../../reference/datamodel.rst:2023 +#: ../../reference/datamodel.rst:2044 msgid "" ":meth:`__del__` can be invoked when arbitrary code is being executed, " "including from any arbitrary thread. If :meth:`__del__` needs to take a " @@ -2343,7 +2367,7 @@ msgid "" "`__del__`." msgstr "" -#: ../../reference/datamodel.rst:2029 +#: ../../reference/datamodel.rst:2050 msgid "" ":meth:`__del__` can be executed during interpreter shutdown. As a " "consequence, the global variables it needs to access (including other " @@ -2354,7 +2378,7 @@ msgid "" "still available at the time when the :meth:`__del__` method is called." msgstr "" -#: ../../reference/datamodel.rst:2044 +#: ../../reference/datamodel.rst:2065 msgid "" "Called by the :func:`repr` built-in function to compute the \"official\" " "string representation of an object. If at all possible, this should look " @@ -2366,14 +2390,14 @@ msgid "" "an \"informal\" string representation of instances of that class is required." msgstr "" -#: ../../reference/datamodel.rst:2053 +#: ../../reference/datamodel.rst:2074 msgid "" "This is typically used for debugging, so it is important that the " "representation is information-rich and unambiguous. A default implementation " "is provided by the :class:`object` class itself." msgstr "" -#: ../../reference/datamodel.rst:2065 +#: ../../reference/datamodel.rst:2086 msgid "" "Called by :func:`str(object) `, the default :meth:`__format__` " "implementation, and the built-in function :func:`print`, to compute the " @@ -2381,27 +2405,27 @@ msgid "" "return value must be a :ref:`str ` object." msgstr "" -#: ../../reference/datamodel.rst:2070 +#: ../../reference/datamodel.rst:2091 msgid "" "This method differs from :meth:`object.__repr__` in that there is no " "expectation that :meth:`__str__` return a valid Python expression: a more " "convenient or concise representation can be used." msgstr "" -#: ../../reference/datamodel.rst:2074 +#: ../../reference/datamodel.rst:2095 msgid "" "The default implementation defined by the built-in type :class:`object` " "calls :meth:`object.__repr__`." msgstr "" -#: ../../reference/datamodel.rst:2084 +#: ../../reference/datamodel.rst:2105 msgid "" "Called by :ref:`bytes ` to compute a byte-string representation " "of an object. This should return a :class:`bytes` object. The :class:" "`object` class itself does not provide this method." msgstr "" -#: ../../reference/datamodel.rst:2096 +#: ../../reference/datamodel.rst:2117 msgid "" "Called by the :func:`format` built-in function, and by extension, evaluation " "of :ref:`formatted string literals ` and the :meth:`str.format` " @@ -2413,34 +2437,34 @@ msgid "" "formatting option syntax." msgstr "" -#: ../../reference/datamodel.rst:2106 +#: ../../reference/datamodel.rst:2127 msgid "" "See :ref:`formatspec` for a description of the standard formatting syntax." msgstr "" -#: ../../reference/datamodel.rst:2108 +#: ../../reference/datamodel.rst:2129 msgid "The return value must be a string object." msgstr "回傳值必須是個字串物件。" -#: ../../reference/datamodel.rst:2110 +#: ../../reference/datamodel.rst:2131 msgid "" "The default implementation by the :class:`object` class should be given an " "empty *format_spec* string. It delegates to :meth:`__str__`." msgstr "" -#: ../../reference/datamodel.rst:2113 +#: ../../reference/datamodel.rst:2134 msgid "" "The __format__ method of ``object`` itself raises a :exc:`TypeError` if " "passed any non-empty string." msgstr "" -#: ../../reference/datamodel.rst:2117 +#: ../../reference/datamodel.rst:2138 msgid "" "``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than " "``format(str(x), '')``." msgstr "" -#: ../../reference/datamodel.rst:2133 +#: ../../reference/datamodel.rst:2154 msgid "" "These are the so-called \"rich comparison\" methods. The correspondence " "between operator symbols and method names is as follows: ``x.__hash__``." msgstr "" -#: ../../reference/datamodel.rst:2231 +#: ../../reference/datamodel.rst:2252 msgid "" "If a class that does not override :meth:`__eq__` wishes to suppress hash " "support, it should include ``__hash__ = None`` in the class definition. A " @@ -2584,7 +2608,7 @@ msgid "" "``isinstance(obj, collections.abc.Hashable)`` call." msgstr "" -#: ../../reference/datamodel.rst:2240 +#: ../../reference/datamodel.rst:2261 msgid "" "By default, the :meth:`__hash__` values of str and bytes objects are " "\"salted\" with an unpredictable random value. Although they remain " @@ -2592,7 +2616,7 @@ msgid "" "between repeated invocations of Python." msgstr "" -#: ../../reference/datamodel.rst:2245 +#: ../../reference/datamodel.rst:2266 msgid "" "This is intended to provide protection against a denial-of-service caused by " "carefully chosen inputs that exploit the worst case performance of a dict " @@ -2600,22 +2624,22 @@ msgid "" "advisories/ocert-2011-003.html for details." msgstr "" -#: ../../reference/datamodel.rst:2250 +#: ../../reference/datamodel.rst:2271 msgid "" "Changing hash values affects the iteration order of sets. Python has never " "made guarantees about this ordering (and it typically varies between 32-bit " "and 64-bit builds)." msgstr "" -#: ../../reference/datamodel.rst:2254 +#: ../../reference/datamodel.rst:2275 msgid "See also :envvar:`PYTHONHASHSEED`." msgstr "另請參閱 :envvar:`PYTHONHASHSEED`。" -#: ../../reference/datamodel.rst:2256 +#: ../../reference/datamodel.rst:2277 msgid "Hash randomization is enabled by default." msgstr "" -#: ../../reference/datamodel.rst:2264 +#: ../../reference/datamodel.rst:2285 msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " @@ -2625,18 +2649,18 @@ msgid "" "class itself), all its instances are considered true." msgstr "" -#: ../../reference/datamodel.rst:2275 +#: ../../reference/datamodel.rst:2296 msgid "Customizing attribute access" msgstr "" -#: ../../reference/datamodel.rst:2277 +#: ../../reference/datamodel.rst:2298 msgid "" "The following methods can be defined to customize the meaning of attribute " "access (use of, assignment to, or deletion of ``x.name``) for class " "instances." msgstr "" -#: ../../reference/datamodel.rst:2285 +#: ../../reference/datamodel.rst:2306 msgid "" "Called when the default attribute access fails with an :exc:`AttributeError` " "(either :meth:`__getattribute__` raises an :exc:`AttributeError` because " @@ -2647,7 +2671,7 @@ msgid "" "`object` class itself does not provide this method." msgstr "" -#: ../../reference/datamodel.rst:2293 +#: ../../reference/datamodel.rst:2314 msgid "" "Note that if the attribute is found through the normal mechanism, :meth:" "`__getattr__` is not called. (This is an intentional asymmetry between :" @@ -2660,7 +2684,7 @@ msgid "" "actually get total control over attribute access." msgstr "" -#: ../../reference/datamodel.rst:2306 +#: ../../reference/datamodel.rst:2327 msgid "" "Called unconditionally to implement attribute accesses for instances of the " "class. If the class also defines :meth:`__getattr__`, the latter will not be " @@ -2672,64 +2696,64 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" -#: ../../reference/datamodel.rst:2317 +#: ../../reference/datamodel.rst:2338 msgid "" "This method may still be bypassed when looking up special methods as the " "result of implicit invocation via language syntax or :ref:`built-in " "functions `. See :ref:`special-lookup`." msgstr "" -#: ../../reference/datamodel.rst:2322 ../../reference/datamodel.rst:2324 +#: ../../reference/datamodel.rst:2343 ../../reference/datamodel.rst:2345 msgid "" "For certain sensitive attribute accesses, raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:2331 +#: ../../reference/datamodel.rst:2352 msgid "" "Called when an attribute assignment is attempted. This is called instead of " "the normal mechanism (i.e. store the value in the instance dictionary). " "*name* is the attribute name, *value* is the value to be assigned to it." msgstr "" -#: ../../reference/datamodel.rst:2335 +#: ../../reference/datamodel.rst:2356 msgid "" "If :meth:`__setattr__` wants to assign to an instance attribute, it should " "call the base class method with the same name, for example, ``object." "__setattr__(self, name, value)``." msgstr "" -#: ../../reference/datamodel.rst:2339 ../../reference/datamodel.rst:2341 +#: ../../reference/datamodel.rst:2360 ../../reference/datamodel.rst:2362 msgid "" "For certain sensitive attribute assignments, raises an :ref:`auditing event " "` ``object.__setattr__`` with arguments ``obj``, ``name``, " "``value``." msgstr "" -#: ../../reference/datamodel.rst:2348 +#: ../../reference/datamodel.rst:2369 msgid "" "Like :meth:`__setattr__` but for attribute deletion instead of assignment. " "This should only be implemented if ``del obj.name`` is meaningful for the " "object." msgstr "" -#: ../../reference/datamodel.rst:2351 ../../reference/datamodel.rst:2353 +#: ../../reference/datamodel.rst:2372 ../../reference/datamodel.rst:2374 msgid "" "For certain sensitive attribute deletions, raises an :ref:`auditing event " "` ``object.__delattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:2360 +#: ../../reference/datamodel.rst:2381 msgid "" "Called when :func:`dir` is called on the object. An iterable must be " "returned. :func:`dir` converts the returned iterable to a list and sorts it." msgstr "" -#: ../../reference/datamodel.rst:2365 +#: ../../reference/datamodel.rst:2386 msgid "Customizing module attribute access" msgstr "" -#: ../../reference/datamodel.rst:2375 +#: ../../reference/datamodel.rst:2396 msgid "" "Special names ``__getattr__`` and ``__dir__`` can be also used to customize " "access to module attributes. The ``__getattr__`` function at the module " @@ -2741,21 +2765,21 @@ msgid "" "with the attribute name and the result is returned." msgstr "" -#: ../../reference/datamodel.rst:2384 +#: ../../reference/datamodel.rst:2405 msgid "" "The ``__dir__`` function should accept no arguments, and return an iterable " "of strings that represents the names accessible on module. If present, this " "function overrides the standard :func:`dir` search on a module." msgstr "" -#: ../../reference/datamodel.rst:2390 +#: ../../reference/datamodel.rst:2411 msgid "" "For a more fine grained customization of the module behavior (setting " "attributes, properties, etc.), one can set the ``__class__`` attribute of a " "module object to a subclass of :class:`types.ModuleType`. For example::" msgstr "" -#: ../../reference/datamodel.rst:2394 +#: ../../reference/datamodel.rst:2415 msgid "" "import sys\n" "from types import ModuleType\n" @@ -2783,7 +2807,7 @@ msgstr "" "\n" "sys.modules[__name__].__class__ = VerboseModule" -#: ../../reference/datamodel.rst:2408 +#: ../../reference/datamodel.rst:2429 msgid "" "Defining module ``__getattr__`` and setting module ``__class__`` only affect " "lookups made using the attribute access syntax -- directly accessing the " @@ -2791,27 +2815,27 @@ msgid "" "module's globals dictionary) is unaffected." msgstr "" -#: ../../reference/datamodel.rst:2413 +#: ../../reference/datamodel.rst:2434 msgid "``__class__`` module attribute is now writable." msgstr "``__class__`` 模組屬性現在是可寫入的。" -#: ../../reference/datamodel.rst:2416 +#: ../../reference/datamodel.rst:2437 msgid "``__getattr__`` and ``__dir__`` module attributes." msgstr "``__getattr__`` 和 ``__dir__`` 模組屬性。" -#: ../../reference/datamodel.rst:2421 +#: ../../reference/datamodel.rst:2442 msgid ":pep:`562` - Module __getattr__ and __dir__" msgstr ":pep:`562` - 模組 __getattr__ 和 __dir__" -#: ../../reference/datamodel.rst:2422 +#: ../../reference/datamodel.rst:2443 msgid "Describes the ``__getattr__`` and ``__dir__`` functions on modules." msgstr "" -#: ../../reference/datamodel.rst:2428 +#: ../../reference/datamodel.rst:2449 msgid "Implementing Descriptors" msgstr "實作描述器" -#: ../../reference/datamodel.rst:2430 +#: ../../reference/datamodel.rst:2451 msgid "" "The following methods only apply when an instance of the class containing " "the method (a so-called *descriptor* class) appears in an *owner* class (the " @@ -2822,7 +2846,7 @@ msgid "" "does not implement any of these protocols." msgstr "" -#: ../../reference/datamodel.rst:2440 +#: ../../reference/datamodel.rst:2461 msgid "" "Called to get the attribute of the owner class (class attribute access) or " "of an instance of that class (instance attribute access). The optional " @@ -2831,13 +2855,13 @@ msgid "" "accessed through the *owner*." msgstr "" -#: ../../reference/datamodel.rst:2446 +#: ../../reference/datamodel.rst:2467 msgid "" "This method should return the computed attribute value or raise an :exc:" "`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:2449 +#: ../../reference/datamodel.rst:2470 msgid "" ":PEP:`252` specifies that :meth:`__get__` is callable with one or two " "arguments. Python's own built-in descriptors support this specification; " @@ -2847,31 +2871,31 @@ msgid "" "not." msgstr "" -#: ../../reference/datamodel.rst:2458 +#: ../../reference/datamodel.rst:2479 msgid "" "Called to set the attribute on an instance *instance* of the owner class to " "a new value, *value*." msgstr "" -#: ../../reference/datamodel.rst:2461 +#: ../../reference/datamodel.rst:2482 msgid "" "Note, adding :meth:`__set__` or :meth:`__delete__` changes the kind of " "descriptor to a \"data descriptor\". See :ref:`descriptor-invocation` for " "more details." msgstr "" -#: ../../reference/datamodel.rst:2467 +#: ../../reference/datamodel.rst:2488 msgid "" "Called to delete the attribute on an instance *instance* of the owner class." msgstr "" -#: ../../reference/datamodel.rst:2469 +#: ../../reference/datamodel.rst:2490 msgid "" "Instances of descriptors may also have the :attr:`!__objclass__` attribute " "present:" msgstr "" -#: ../../reference/datamodel.rst:2474 +#: ../../reference/datamodel.rst:2495 msgid "" "The attribute :attr:`!__objclass__` is interpreted by the :mod:`inspect` " "module as specifying the class where this object was defined (setting this " @@ -2882,11 +2906,11 @@ msgid "" "are implemented in C)." msgstr "" -#: ../../reference/datamodel.rst:2485 +#: ../../reference/datamodel.rst:2506 msgid "Invoking Descriptors" msgstr "" -#: ../../reference/datamodel.rst:2487 +#: ../../reference/datamodel.rst:2508 msgid "" "In general, a descriptor is an object attribute with \"binding behavior\", " "one whose attribute access has been overridden by methods in the descriptor " @@ -2895,7 +2919,7 @@ msgid "" "is said to be a descriptor." msgstr "" -#: ../../reference/datamodel.rst:2493 +#: ../../reference/datamodel.rst:2514 msgid "" "The default behavior for attribute access is to get, set, or delete the " "attribute from an object's dictionary. For instance, ``a.x`` has a lookup " @@ -2903,7 +2927,7 @@ msgid "" "continuing through the base classes of ``type(a)`` excluding metaclasses." msgstr "" -#: ../../reference/datamodel.rst:2498 +#: ../../reference/datamodel.rst:2519 msgid "" "However, if the looked-up value is an object defining one of the descriptor " "methods, then Python may override the default behavior and invoke the " @@ -2911,54 +2935,54 @@ msgid "" "depends on which descriptor methods were defined and how they were called." msgstr "" -#: ../../reference/datamodel.rst:2503 +#: ../../reference/datamodel.rst:2524 msgid "" "The starting point for descriptor invocation is a binding, ``a.x``. How the " "arguments are assembled depends on ``a``:" msgstr "" -#: ../../reference/datamodel.rst:2506 +#: ../../reference/datamodel.rst:2527 msgid "Direct Call" msgstr "直接呼叫" -#: ../../reference/datamodel.rst:2507 +#: ../../reference/datamodel.rst:2528 msgid "" "The simplest and least common call is when user code directly invokes a " "descriptor method: ``x.__get__(a)``." msgstr "" -#: ../../reference/datamodel.rst:2510 +#: ../../reference/datamodel.rst:2531 msgid "Instance Binding" msgstr "" -#: ../../reference/datamodel.rst:2511 +#: ../../reference/datamodel.rst:2532 msgid "" "If binding to an object instance, ``a.x`` is transformed into the call: " "``type(a).__dict__['x'].__get__(a, type(a))``." msgstr "" -#: ../../reference/datamodel.rst:2514 +#: ../../reference/datamodel.rst:2535 msgid "Class Binding" msgstr "" -#: ../../reference/datamodel.rst:2515 +#: ../../reference/datamodel.rst:2536 msgid "" "If binding to a class, ``A.x`` is transformed into the call: ``A." "__dict__['x'].__get__(None, A)``." msgstr "" -#: ../../reference/datamodel.rst:2518 +#: ../../reference/datamodel.rst:2539 msgid "Super Binding" msgstr "" -#: ../../reference/datamodel.rst:2519 +#: ../../reference/datamodel.rst:2540 msgid "" "A dotted lookup such as ``super(A, a).x`` searches ``a.__class__.__mro__`` " "for a base class ``B`` following ``A`` and then returns ``B.__dict__['x']." "__get__(a, A)``. If not a descriptor, ``x`` is returned unchanged." msgstr "" -#: ../../reference/datamodel.rst:2556 +#: ../../reference/datamodel.rst:2577 msgid "" "For instance bindings, the precedence of descriptor invocation depends on " "which descriptor methods are defined. A descriptor can define any " @@ -2976,7 +3000,7 @@ msgid "" "instances." msgstr "" -#: ../../reference/datamodel.rst:2571 +#: ../../reference/datamodel.rst:2592 msgid "" "Python methods (including those decorated with :deco:`staticmethod` and :" "deco:`classmethod`) are implemented as non-data descriptors. Accordingly, " @@ -2985,30 +3009,30 @@ msgid "" "class." msgstr "" -#: ../../reference/datamodel.rst:2577 +#: ../../reference/datamodel.rst:2598 msgid "" "The :func:`property` function is implemented as a data descriptor. " "Accordingly, instances cannot override the behavior of a property." msgstr "" -#: ../../reference/datamodel.rst:2584 +#: ../../reference/datamodel.rst:2605 msgid "__slots__" msgstr "__slots__" -#: ../../reference/datamodel.rst:2586 +#: ../../reference/datamodel.rst:2607 msgid "" "*__slots__* allow us to explicitly declare data members (like properties) " "and deny the creation of :attr:`~object.__dict__` and *__weakref__* (unless " "explicitly declared in *__slots__* or available in a parent.)" msgstr "" -#: ../../reference/datamodel.rst:2590 +#: ../../reference/datamodel.rst:2611 msgid "" "The space saved over using :attr:`~object.__dict__` can be significant. " "Attribute lookup speed can be significantly improved as well." msgstr "" -#: ../../reference/datamodel.rst:2595 +#: ../../reference/datamodel.rst:2616 msgid "" "This class variable can be assigned a string, iterable, or sequence of " "strings with variable names used by instances. *__slots__* reserves space " @@ -3016,18 +3040,18 @@ msgid "" "`~object.__dict__` and *__weakref__* for each instance." msgstr "" -#: ../../reference/datamodel.rst:2604 +#: ../../reference/datamodel.rst:2625 msgid "Notes on using *__slots__*:" msgstr "" -#: ../../reference/datamodel.rst:2606 +#: ../../reference/datamodel.rst:2627 msgid "" "When inheriting from a class without *__slots__*, the :attr:`~object." "__dict__` and *__weakref__* attribute of the instances will always be " "accessible." msgstr "" -#: ../../reference/datamodel.rst:2610 +#: ../../reference/datamodel.rst:2631 msgid "" "Without a :attr:`~object.__dict__` variable, instances cannot be assigned " "new variables not listed in the *__slots__* definition. Attempts to assign " @@ -3036,7 +3060,7 @@ msgid "" "sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2617 +#: ../../reference/datamodel.rst:2638 msgid "" "Without a *__weakref__* variable for each instance, classes defining " "*__slots__* do not support :mod:`weak references ` to its " @@ -3044,7 +3068,7 @@ msgid "" "to the sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2623 +#: ../../reference/datamodel.rst:2644 msgid "" "*__slots__* are implemented at the class level by creating :ref:`descriptors " "` for each variable name. As a result, class attributes cannot " @@ -3052,7 +3076,7 @@ msgid "" "otherwise, the class attribute would overwrite the descriptor assignment." msgstr "" -#: ../../reference/datamodel.rst:2629 +#: ../../reference/datamodel.rst:2650 msgid "" "The action of a *__slots__* declaration is not limited to the class where it " "is defined. *__slots__* declared in parents are available in child classes. " @@ -3061,7 +3085,7 @@ msgid "" "only contain names of any *additional* slots)." msgstr "" -#: ../../reference/datamodel.rst:2635 +#: ../../reference/datamodel.rst:2656 msgid "" "If a class defines a slot also defined in a base class, the instance " "variable defined by the base class slot is inaccessible (except by " @@ -3070,7 +3094,7 @@ msgid "" "prevent this." msgstr "" -#: ../../reference/datamodel.rst:2640 +#: ../../reference/datamodel.rst:2661 msgid "" ":exc:`TypeError` will be raised if nonempty *__slots__* are defined for a " "class derived from a :c:member:`\"variable-length\" built-in type " @@ -3078,11 +3102,11 @@ msgid "" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:2645 +#: ../../reference/datamodel.rst:2666 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2647 +#: ../../reference/datamodel.rst:2668 msgid "" "If a :class:`dictionary ` is used to assign *__slots__*, the " "dictionary keys will be used as the slot names. The values of the dictionary " @@ -3090,13 +3114,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:2652 +#: ../../reference/datamodel.rst:2673 msgid "" ":attr:`~object.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2655 +#: ../../reference/datamodel.rst:2676 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -3104,18 +3128,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2661 +#: ../../reference/datamodel.rst:2682 msgid "" "If an :term:`iterator` is used for *__slots__* then a :term:`descriptor` is " "created for each of the iterator's values. However, the *__slots__* " "attribute will be an empty iterator." msgstr "" -#: ../../reference/datamodel.rst:2669 +#: ../../reference/datamodel.rst:2690 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:2671 +#: ../../reference/datamodel.rst:2692 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -3125,14 +3149,14 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:2680 +#: ../../reference/datamodel.rst:2701 msgid "" "This method is called whenever the containing class is subclassed. *cls* is " "then the new subclass. If defined as a normal instance method, this method " "is implicitly converted to a class method." msgstr "" -#: ../../reference/datamodel.rst:2684 +#: ../../reference/datamodel.rst:2705 msgid "" "Keyword arguments which are given to a new class are passed to the parent " "class's ``__init_subclass__``. For compatibility with other classes using " @@ -3140,7 +3164,7 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2690 +#: ../../reference/datamodel.rst:2711 msgid "" "class Philosopher:\n" " def __init_subclass__(cls, /, default_name, **kwargs):\n" @@ -3158,13 +3182,13 @@ msgstr "" "class AustralianPhilosopher(Philosopher, default_name=\"Bruce\"):\n" " pass" -#: ../../reference/datamodel.rst:2698 +#: ../../reference/datamodel.rst:2719 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2703 +#: ../../reference/datamodel.rst:2724 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -3172,19 +3196,19 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2711 +#: ../../reference/datamodel.rst:2732 msgid "" "When a class is created, :meth:`!type.__new__` scans the class variables and " "makes callbacks to those with a :meth:`~object.__set_name__` hook." msgstr "" -#: ../../reference/datamodel.rst:2716 +#: ../../reference/datamodel.rst:2737 msgid "" "Automatically called at the time the owning class *owner* is created. The " "object has been assigned to *name* in that class::" msgstr "" -#: ../../reference/datamodel.rst:2719 +#: ../../reference/datamodel.rst:2740 msgid "" "class A:\n" " x = C() # Automatically calls: x.__set_name__(A, 'x')" @@ -3192,14 +3216,14 @@ msgstr "" "class A:\n" " x = C() # 自動呼叫:x.__set_name__(A, 'x')" -#: ../../reference/datamodel.rst:2722 +#: ../../reference/datamodel.rst:2743 msgid "" "If the class variable is assigned after the class is created, :meth:" "`__set_name__` will not be called automatically. If needed, :meth:" "`__set_name__` can be called directly::" msgstr "" -#: ../../reference/datamodel.rst:2726 +#: ../../reference/datamodel.rst:2747 msgid "" "class A:\n" " pass\n" @@ -3209,22 +3233,22 @@ msgid "" "c.__set_name__(A, 'x') # Manually invoke the hook" msgstr "" -#: ../../reference/datamodel.rst:2733 +#: ../../reference/datamodel.rst:2754 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`。" -#: ../../reference/datamodel.rst:2741 +#: ../../reference/datamodel.rst:2762 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2748 +#: ../../reference/datamodel.rst:2769 msgid "" "By default, classes are constructed using :func:`type`. The class body is " "executed in a new namespace and the class name is bound locally to the " "result of ``type(name, bases, namespace)``." msgstr "" -#: ../../reference/datamodel.rst:2752 +#: ../../reference/datamodel.rst:2773 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -3232,7 +3256,7 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2757 +#: ../../reference/datamodel.rst:2778 msgid "" "class Meta(type):\n" " pass\n" @@ -3252,41 +3276,41 @@ msgstr "" "class MySubclass(MyClass):\n" " pass" -#: ../../reference/datamodel.rst:2766 +#: ../../reference/datamodel.rst:2787 msgid "" "Any other keyword arguments that are specified in the class definition are " "passed through to all metaclass operations described below." msgstr "" -#: ../../reference/datamodel.rst:2769 +#: ../../reference/datamodel.rst:2790 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2771 +#: ../../reference/datamodel.rst:2792 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2772 +#: ../../reference/datamodel.rst:2793 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2773 +#: ../../reference/datamodel.rst:2794 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2774 +#: ../../reference/datamodel.rst:2795 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2775 +#: ../../reference/datamodel.rst:2796 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2779 +#: ../../reference/datamodel.rst:2800 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2783 +#: ../../reference/datamodel.rst:2804 msgid "" "If a base that appears in a class definition is not an instance of :class:" "`type`, then an :meth:`!__mro_entries__` method is searched on the base. If " @@ -3298,59 +3322,59 @@ msgid "" "is ignored." msgstr "" -#: ../../reference/datamodel.rst:2794 +#: ../../reference/datamodel.rst:2815 msgid ":func:`types.resolve_bases`" msgstr ":func:`types.resolve_bases`" -#: ../../reference/datamodel.rst:2795 +#: ../../reference/datamodel.rst:2816 msgid "Dynamically resolve bases that are not instances of :class:`type`." msgstr "" -#: ../../reference/datamodel.rst:2797 +#: ../../reference/datamodel.rst:2818 msgid ":func:`types.get_original_bases`" msgstr ":func:`types.get_original_bases`" -#: ../../reference/datamodel.rst:2798 +#: ../../reference/datamodel.rst:2819 msgid "" "Retrieve a class's \"original bases\" prior to modifications by :meth:" "`~object.__mro_entries__`." msgstr "" -#: ../../reference/datamodel.rst:2801 +#: ../../reference/datamodel.rst:2822 msgid ":pep:`560`" msgstr ":pep:`560`" -#: ../../reference/datamodel.rst:2802 +#: ../../reference/datamodel.rst:2823 msgid "Core support for typing module and generic types." msgstr "" -#: ../../reference/datamodel.rst:2806 +#: ../../reference/datamodel.rst:2827 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2810 +#: ../../reference/datamodel.rst:2831 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2812 +#: ../../reference/datamodel.rst:2833 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2813 +#: ../../reference/datamodel.rst:2834 msgid "" "if an explicit metaclass is given and it is *not* an instance of :func:" "`type`, then it is used directly as the metaclass;" msgstr "" -#: ../../reference/datamodel.rst:2815 +#: ../../reference/datamodel.rst:2836 msgid "" "if an instance of :func:`type` is given as the explicit metaclass, or bases " "are defined, then the most derived metaclass is used." msgstr "" -#: ../../reference/datamodel.rst:2818 +#: ../../reference/datamodel.rst:2839 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -3359,11 +3383,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2828 +#: ../../reference/datamodel.rst:2849 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2833 +#: ../../reference/datamodel.rst:2854 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -3375,25 +3399,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2842 +#: ../../reference/datamodel.rst:2863 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2847 +#: ../../reference/datamodel.rst:2868 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2848 +#: ../../reference/datamodel.rst:2869 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2852 +#: ../../reference/datamodel.rst:2873 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2857 +#: ../../reference/datamodel.rst:2878 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -3402,7 +3426,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2863 +#: ../../reference/datamodel.rst:2884 msgid "" "However, even when the class definition occurs inside the function, methods " "defined inside the class still cannot see names defined at the class scope. " @@ -3411,11 +3435,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2872 +#: ../../reference/datamodel.rst:2893 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2879 +#: ../../reference/datamodel.rst:2900 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -3423,7 +3447,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2884 +#: ../../reference/datamodel.rst:2905 msgid "" "This class object is the one that will be referenced by the zero-argument " "form of :func:`super`. ``__class__`` is an implicit closure reference " @@ -3434,7 +3458,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2894 +#: ../../reference/datamodel.rst:2915 msgid "" "In CPython 3.6 and later, the ``__class__`` cell is passed to the metaclass " "as a ``__classcell__`` entry in the class namespace. If present, this must " @@ -3443,39 +3467,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2900 +#: ../../reference/datamodel.rst:2921 msgid "" "When using the default metaclass :class:`type`, or any metaclass that " "ultimately calls ``type.__new__``, the following additional customization " "steps are invoked after creating the class object:" msgstr "" -#: ../../reference/datamodel.rst:2904 +#: ../../reference/datamodel.rst:2925 msgid "" "The ``type.__new__`` method collects all of the attributes in the class " "namespace that define a :meth:`~object.__set_name__` method;" msgstr "" -#: ../../reference/datamodel.rst:2906 +#: ../../reference/datamodel.rst:2927 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2908 +#: ../../reference/datamodel.rst:2929 msgid "" "The :meth:`~object.__init_subclass__` hook is called on the immediate parent " "of the new class in its method resolution order." msgstr "" -#: ../../reference/datamodel.rst:2911 +#: ../../reference/datamodel.rst:2932 msgid "" "After the class object is created, it is passed to the class decorators " "included in the class definition (if any) and the resulting object is bound " "in the local namespace as the defined class." msgstr "" -#: ../../reference/datamodel.rst:2915 +#: ../../reference/datamodel.rst:2936 msgid "" "When a new class is created by ``type.__new__``, the object provided as the " "namespace parameter is copied to a new ordered mapping and the original " @@ -3483,19 +3507,19 @@ msgid "" "becomes the :attr:`~type.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2922 +#: ../../reference/datamodel.rst:2943 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2923 +#: ../../reference/datamodel.rst:2944 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2927 +#: ../../reference/datamodel.rst:2948 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2929 +#: ../../reference/datamodel.rst:2950 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -3503,17 +3527,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2936 +#: ../../reference/datamodel.rst:2957 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2938 +#: ../../reference/datamodel.rst:2959 msgid "" "The following methods are used to override the default behavior of the :func:" "`isinstance` and :func:`issubclass` built-in functions." msgstr "" -#: ../../reference/datamodel.rst:2941 +#: ../../reference/datamodel.rst:2962 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -3521,21 +3545,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2948 +#: ../../reference/datamodel.rst:2969 msgid "" "Return true if *instance* should be considered a (direct or indirect) " "instance of *class*. If defined, called to implement ``isinstance(instance, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2955 +#: ../../reference/datamodel.rst:2976 msgid "" "Return true if *subclass* should be considered a (direct or indirect) " "subclass of *class*. If defined, called to implement ``issubclass(subclass, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2960 +#: ../../reference/datamodel.rst:2981 msgid "" "Note that these methods are looked up on the type (metaclass) of a class. " "They cannot be defined as class methods in the actual class. This is " @@ -3543,11 +3567,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2967 +#: ../../reference/datamodel.rst:2988 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2968 +#: ../../reference/datamodel.rst:2989 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~type.__instancecheck__` and :meth:" @@ -3556,11 +3580,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2976 +#: ../../reference/datamodel.rst:2997 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2978 +#: ../../reference/datamodel.rst:2999 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -3568,65 +3592,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2985 +#: ../../reference/datamodel.rst:3006 msgid ":pep:`484` - Type Hints" msgstr ":pep:`484` - 型別提示" -#: ../../reference/datamodel.rst:2986 +#: ../../reference/datamodel.rst:3007 msgid "Introducing Python's framework for type annotations" msgstr "引入 Python 的型別註釋框架" -#: ../../reference/datamodel.rst:2988 +#: ../../reference/datamodel.rst:3009 msgid ":ref:`Generic Alias Types`" msgstr ":ref:`泛型別名型別 `" -#: ../../reference/datamodel.rst:2989 +#: ../../reference/datamodel.rst:3010 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2991 +#: ../../reference/datamodel.rst:3012 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2992 +#: ../../reference/datamodel.rst:3013 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2995 +#: ../../reference/datamodel.rst:3016 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:3000 +#: ../../reference/datamodel.rst:3021 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:3003 +#: ../../reference/datamodel.rst:3024 msgid "" "When defined on a class, ``__class_getitem__()`` is automatically a class " "method. As such, there is no need for it to be decorated with :deco:" "`classmethod` when it is defined." msgstr "" -#: ../../reference/datamodel.rst:3009 +#: ../../reference/datamodel.rst:3030 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:3011 +#: ../../reference/datamodel.rst:3032 msgid "" "The purpose of :meth:`~object.__class_getitem__` is to allow runtime " "parameterization of standard-library generic classes in order to more easily " "apply :term:`type hints` to these classes." msgstr "" -#: ../../reference/datamodel.rst:3015 +#: ../../reference/datamodel.rst:3036 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -3635,7 +3659,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:3021 +#: ../../reference/datamodel.rst:3042 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -3643,11 +3667,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:3031 +#: ../../reference/datamodel.rst:3052 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:3033 +#: ../../reference/datamodel.rst:3054 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -3657,14 +3681,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:3040 +#: ../../reference/datamodel.rst:3061 msgid "" "Presented with the :term:`expression` ``obj[x]``, the Python interpreter " "follows something like the following process to decide whether :meth:" "`~object.__getitem__` or :meth:`~object.__class_getitem__` should be called::" msgstr "" -#: ../../reference/datamodel.rst:3045 +#: ../../reference/datamodel.rst:3066 msgid "" "from inspect import isclass\n" "\n" @@ -3690,7 +3714,7 @@ msgid "" " )" msgstr "" -#: ../../reference/datamodel.rst:3068 +#: ../../reference/datamodel.rst:3089 msgid "" "In Python, all classes are themselves instances of other classes. The class " "of a class is known as that class's :term:`metaclass`, and most classes have " @@ -3700,7 +3724,7 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:3075 +#: ../../reference/datamodel.rst:3096 msgid "" ">>> # list has class \"type\" as its metaclass, like most classes:\n" ">>> type(list)\n" @@ -3715,14 +3739,14 @@ msgid "" "" msgstr "" -#: ../../reference/datamodel.rst:3087 +#: ../../reference/datamodel.rst:3108 msgid "" "However, if a class has a custom metaclass that defines :meth:`~object." "__getitem__`, subscribing the class may result in different behaviour. An " "example of this can be found in the :mod:`enum` module::" msgstr "" -#: ../../reference/datamodel.rst:3091 +#: ../../reference/datamodel.rst:3112 msgid "" ">>> from enum import Enum\n" ">>> class Menu(Enum):\n" @@ -3742,33 +3766,33 @@ msgid "" "" msgstr "" -#: ../../reference/datamodel.rst:3110 +#: ../../reference/datamodel.rst:3131 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:3111 +#: ../../reference/datamodel.rst:3132 msgid "" "Introducing :meth:`~object.__class_getitem__`, and outlining when a :ref:" "`subscription` results in ``__class_getitem__()`` being " "called instead of :meth:`~object.__getitem__`" msgstr "" -#: ../../reference/datamodel.rst:3119 +#: ../../reference/datamodel.rst:3140 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:3126 +#: ../../reference/datamodel.rst:3147 msgid "" "Called when the instance is \"called\" as a function; if this method is " "defined, ``x(arg1, arg2, ...)`` roughly translates to ``type(x).__call__(x, " "arg1, ...)``. The :class:`object` class itself does not provide this method." msgstr "" -#: ../../reference/datamodel.rst:3134 +#: ../../reference/datamodel.rst:3155 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:3136 +#: ../../reference/datamodel.rst:3157 msgid "" "The following methods can be defined to implement container objects. None of " "them are provided by the :class:`object` class itself. Containers usually " @@ -3789,7 +3813,7 @@ msgid "" "__setitem__`, :meth:`~object.__delitem__`, and :meth:`!keys`." msgstr "" -#: ../../reference/datamodel.rst:3155 +#: ../../reference/datamodel.rst:3176 msgid "" "Mutable sequences should provide methods :meth:`~sequence.append`, :meth:" "`~sequence.clear`, :meth:`~sequence.count`, :meth:`~sequence.extend`, :meth:" @@ -3803,7 +3827,7 @@ msgid "" "numerical operators." msgstr "" -#: ../../reference/datamodel.rst:3167 +#: ../../reference/datamodel.rst:3188 msgid "" "It is recommended that both mappings and sequences implement the :meth:" "`~object.__contains__` method to allow efficient use of the ``in`` operator; " @@ -3815,7 +3839,7 @@ msgid "" "iterate through the values." msgstr "" -#: ../../reference/datamodel.rst:3182 +#: ../../reference/datamodel.rst:3203 msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " @@ -3823,7 +3847,7 @@ msgid "" "returns zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:3189 +#: ../../reference/datamodel.rst:3210 msgid "" "In CPython, the length is required to be at most :data:`sys.maxsize`. If the " "length is larger than :data:`!sys.maxsize` some features (such as :func:" @@ -3832,7 +3856,7 @@ msgid "" "`~object.__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:3198 +#: ../../reference/datamodel.rst:3219 msgid "" "Called to implement :func:`operator.length_hint`. Should return an estimated " "length for the object (which may be greater or less than the actual length). " @@ -3842,53 +3866,76 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:3212 +#: ../../reference/datamodel.rst:3233 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:3214 +#: ../../reference/datamodel.rst:3235 msgid "a[1:2] = b" msgstr "a[1:2] = b" -#: ../../reference/datamodel.rst:3216 +#: ../../reference/datamodel.rst:3237 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:3218 +#: ../../reference/datamodel.rst:3239 msgid "a[slice(1, 2, None)] = b" msgstr "a[slice(1, 2, None)] = b" -#: ../../reference/datamodel.rst:3220 +#: ../../reference/datamodel.rst:3241 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:3225 +#: ../../reference/datamodel.rst:3246 msgid "" -"Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " -"the accepted keys should be integers. Optionally, they may support :class:" -"`slice` objects as well. Negative index support is also optional. If *key* " -"is of an inappropriate type, :exc:`TypeError` may be raised; if *key* is a " -"value outside the set of indexes for the sequence (after any special " -"interpretation of negative values), :exc:`IndexError` should be raised. For :" -"term:`mapping` types, if *key* is missing (not in the container), :exc:" -"`KeyError` should be raised." +"Called to implement *subscription*, that is, ``self[subscript]``. See :ref:" +"`subscriptions` for details on the syntax." msgstr "" -#: ../../reference/datamodel.rst:3237 +#: ../../reference/datamodel.rst:3249 +msgid "" +"There are two types of built-in objects that support subscription via :meth:" +"`!__getitem__`:" +msgstr "" + +#: ../../reference/datamodel.rst:3252 +msgid "" +"**sequences**, where *subscript* (also called :term:`index`) should be an " +"integer or a :class:`slice` object. See the :ref:`sequence documentation " +"` for the expected behavior, including handling :class:" +"`slice` objects and negative indices." +msgstr "" + +#: ../../reference/datamodel.rst:3256 +msgid "" +"**mappings**, where *subscript* is also called the :term:`key`. See :ref:" +"`mapping documentation ` for the expected behavior." +msgstr "" + +#: ../../reference/datamodel.rst:3260 +msgid "" +"If *subscript* is of an inappropriate type, :meth:`!__getitem__` should " +"raise :exc:`TypeError`. If *subscript* has an inappropriate value, :meth:`!" +"__getitem__` should raise an :exc:`LookupError` or one of its subclasses (:" +"exc:`IndexError` for sequences; :exc:`KeyError` for mappings)." +msgstr "" + +#: ../../reference/datamodel.rst:3268 msgid "" -":keyword:`for` loops expect that an :exc:`IndexError` will be raised for " -"illegal indexes to allow proper detection of the end of the sequence." +"The sequence iteration protocol (used, for example, in :keyword:`for` " +"loops), expects that an :exc:`IndexError` will be raised for illegal indexes " +"to allow proper detection of the end of a sequence." msgstr "" -#: ../../reference/datamodel.rst:3242 +#: ../../reference/datamodel.rst:3274 msgid "" -"When :ref:`subscripting` a *class*, the special class method :" -"meth:`~object.__class_getitem__` may be called instead of ``__getitem__()``. " -"See :ref:`classgetitem-versus-getitem` for more details." +"When :ref:`subscripting ` a *class*, the special class " +"method :meth:`~object.__class_getitem__` may be called instead of :meth:`!" +"__getitem__`. See :ref:`classgetitem-versus-getitem` for more details." msgstr "" -#: ../../reference/datamodel.rst:3250 +#: ../../reference/datamodel.rst:3282 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3897,7 +3944,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:3259 +#: ../../reference/datamodel.rst:3291 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3906,13 +3953,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:3268 +#: ../../reference/datamodel.rst:3300 msgid "" "Called by :class:`dict`\\ .\\ :meth:`__getitem__` to implement ``self[key]`` " "for dict subclasses when key is not in the dictionary." msgstr "" -#: ../../reference/datamodel.rst:3274 +#: ../../reference/datamodel.rst:3306 msgid "" "This method is called when an :term:`iterator` is required for a container. " "This method should return a new iterator object that can iterate over all " @@ -3920,14 +3967,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:3282 +#: ../../reference/datamodel.rst:3314 msgid "" "Called (if present) by the :func:`reversed` built-in to implement reverse " "iteration. It should return a new iterator object that iterates over all " "the objects in the container in reverse order." msgstr "" -#: ../../reference/datamodel.rst:3286 +#: ../../reference/datamodel.rst:3318 msgid "" "If the :meth:`__reversed__` method is not provided, the :func:`reversed` " "built-in will fall back to using the sequence protocol (:meth:`__len__` and :" @@ -3936,7 +3983,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:3293 +#: ../../reference/datamodel.rst:3325 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3944,14 +3991,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:3300 +#: ../../reference/datamodel.rst:3332 msgid "" "Called to implement membership test operators. Should return true if *item* " "is in *self*, false otherwise. For mapping objects, this should consider " "the keys of the mapping rather than the values or the key-item pairs." msgstr "" -#: ../../reference/datamodel.rst:3304 +#: ../../reference/datamodel.rst:3336 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3959,11 +4006,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:3313 +#: ../../reference/datamodel.rst:3345 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:3315 +#: ../../reference/datamodel.rst:3347 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3971,7 +4018,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:3341 +#: ../../reference/datamodel.rst:3373 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3985,13 +4032,13 @@ msgid "" "`pow` function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:3352 +#: ../../reference/datamodel.rst:3384 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return :data:`NotImplemented`." msgstr "" -#: ../../reference/datamodel.rst:3375 +#: ../../reference/datamodel.rst:3407 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -4005,21 +4052,21 @@ msgid "" "`NotImplemented` or ``type(y)`` is a subclass of ``type(x)``. [#]_" msgstr "" -#: ../../reference/datamodel.rst:3386 +#: ../../reference/datamodel.rst:3418 msgid "" "Note that :meth:`__rpow__` should be defined to accept an optional third " "argument if the three-argument version of the built-in :func:`pow` function " "is to be supported." msgstr "" -#: ../../reference/datamodel.rst:3392 +#: ../../reference/datamodel.rst:3424 msgid "" "Three-argument :func:`pow` now try calling :meth:`~object.__rpow__` if " "necessary. Previously it was only called in two-argument :func:`!pow` and " "the binary power operator." msgstr "" -#: ../../reference/datamodel.rst:3398 +#: ../../reference/datamodel.rst:3430 msgid "" "If the right operand's type is a subclass of the left operand's type and " "that subclass provides a different implementation of the reflected method " @@ -4028,7 +4075,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:3418 +#: ../../reference/datamodel.rst:3450 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -4046,19 +4093,19 @@ msgid "" "data model." msgstr "" -#: ../../reference/datamodel.rst:3441 +#: ../../reference/datamodel.rst:3473 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:3454 +#: ../../reference/datamodel.rst:3486 msgid "" "Called to implement the built-in functions :func:`complex`, :func:`int` and :" "func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:3461 +#: ../../reference/datamodel.rst:3493 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -4067,14 +4114,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:3467 +#: ../../reference/datamodel.rst:3499 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:3479 +#: ../../reference/datamodel.rst:3511 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -4083,16 +4130,16 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:3485 +#: ../../reference/datamodel.rst:3517 msgid "" ":func:`int` no longer delegates to the :meth:`~object.__trunc__` method." msgstr "" -#: ../../reference/datamodel.rst:3492 +#: ../../reference/datamodel.rst:3524 msgid "With Statement Context Managers" msgstr "With 陳述式的情境管理器" -#: ../../reference/datamodel.rst:3494 +#: ../../reference/datamodel.rst:3526 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -4102,34 +4149,34 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:3505 +#: ../../reference/datamodel.rst:3537 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:3508 +#: ../../reference/datamodel.rst:3540 msgid "" "For more information on context managers, see :ref:`typecontextmanager`. " "The :class:`object` class itself does not provide the context manager " "methods." msgstr "" -#: ../../reference/datamodel.rst:3514 +#: ../../reference/datamodel.rst:3546 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:3521 +#: ../../reference/datamodel.rst:3553 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:3525 +#: ../../reference/datamodel.rst:3557 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -4137,27 +4184,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:3529 +#: ../../reference/datamodel.rst:3561 msgid "" "Note that :meth:`~object.__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:3535 +#: ../../reference/datamodel.rst:3567 msgid ":pep:`343` - The \"with\" statement" msgstr ":pep:`343` - \"with\" 陳述式" -#: ../../reference/datamodel.rst:3536 +#: ../../reference/datamodel.rst:3568 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3543 +#: ../../reference/datamodel.rst:3575 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:3545 +#: ../../reference/datamodel.rst:3577 msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " @@ -4165,7 +4212,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:3552 +#: ../../reference/datamodel.rst:3584 msgid "" "This class variable can be assigned a tuple of strings. When this class is " "used in a class pattern with positional arguments, each positional argument " @@ -4174,7 +4221,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:3558 +#: ../../reference/datamodel.rst:3590 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -4184,19 +4231,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:3568 +#: ../../reference/datamodel.rst:3600 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:3569 +#: ../../reference/datamodel.rst:3601 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:3575 +#: ../../reference/datamodel.rst:3607 msgid "Emulating buffer types" msgstr "" -#: ../../reference/datamodel.rst:3577 +#: ../../reference/datamodel.rst:3609 msgid "" "The :ref:`buffer protocol ` provides a way for Python objects " "to expose efficient access to a low-level memory array. This protocol is " @@ -4204,13 +4251,13 @@ msgid "" "and third-party libraries may define additional buffer types." msgstr "" -#: ../../reference/datamodel.rst:3582 +#: ../../reference/datamodel.rst:3614 msgid "" "While buffer types are usually implemented in C, it is also possible to " "implement the protocol in Python." msgstr "" -#: ../../reference/datamodel.rst:3587 +#: ../../reference/datamodel.rst:3619 msgid "" "Called when a buffer is requested from *self* (for example, by the :class:" "`memoryview` constructor). The *flags* argument is an integer representing " @@ -4220,7 +4267,7 @@ msgid "" "`memoryview` object." msgstr "" -#: ../../reference/datamodel.rst:3596 +#: ../../reference/datamodel.rst:3628 msgid "" "Called when a buffer is no longer needed. The *buffer* argument is a :class:" "`memoryview` object that was previously returned by :meth:`~object." @@ -4229,35 +4276,35 @@ msgid "" "to perform any cleanup are not required to implement this method." msgstr "" -#: ../../reference/datamodel.rst:3607 +#: ../../reference/datamodel.rst:3639 msgid ":pep:`688` - Making the buffer protocol accessible in Python" msgstr "" -#: ../../reference/datamodel.rst:3608 +#: ../../reference/datamodel.rst:3640 msgid "" "Introduces the Python ``__buffer__`` and ``__release_buffer__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3610 +#: ../../reference/datamodel.rst:3642 msgid ":class:`collections.abc.Buffer`" msgstr ":class:`collections.abc.Buffer`" -#: ../../reference/datamodel.rst:3611 +#: ../../reference/datamodel.rst:3643 msgid "ABC for buffer types." msgstr "" -#: ../../reference/datamodel.rst:3614 +#: ../../reference/datamodel.rst:3646 msgid "Annotations" msgstr "" -#: ../../reference/datamodel.rst:3616 +#: ../../reference/datamodel.rst:3648 msgid "" "Functions, classes, and modules may contain :term:`annotations " "`, which are a way to associate information (usually :term:`type " "hints `) with a symbol." msgstr "" -#: ../../reference/datamodel.rst:3622 +#: ../../reference/datamodel.rst:3654 msgid "" "This attribute contains the annotations for an object. It is :ref:`lazily " "evaluated `, so accessing the attribute may execute " @@ -4265,24 +4312,24 @@ msgid "" "attribute is set to a dictionary mapping from variable names to annotations." msgstr "" -#: ../../reference/datamodel.rst:3627 +#: ../../reference/datamodel.rst:3659 msgid "Annotations are now lazily evaluated." msgstr "" -#: ../../reference/datamodel.rst:3632 +#: ../../reference/datamodel.rst:3664 msgid "" "An :term:`annotate function`. Returns a new dictionary object mapping " "attribute/parameter names to their annotation values." msgstr "" -#: ../../reference/datamodel.rst:3635 +#: ../../reference/datamodel.rst:3667 msgid "" "Takes a format parameter specifying the format in which annotations values " "should be provided. It must be a member of the :class:`annotationlib.Format` " "enum, or an integer with a value corresponding to a member of the enum." msgstr "" -#: ../../reference/datamodel.rst:3639 +#: ../../reference/datamodel.rst:3671 msgid "" "If an annotate function doesn't support the requested format, it must raise :" "exc:`NotImplementedError`. Annotate functions must always support :attr:" @@ -4290,34 +4337,34 @@ msgid "" "`NotImplementedError()` when called with this format." msgstr "" -#: ../../reference/datamodel.rst:3644 +#: ../../reference/datamodel.rst:3676 msgid "" "When called with :attr:`~annotationlib.Format.VALUE` format, an annotate " "function may raise :exc:`NameError`; it must not raise :exc:`!NameError` " "when called requesting any other format." msgstr "" -#: ../../reference/datamodel.rst:3647 +#: ../../reference/datamodel.rst:3679 msgid "" "If an object does not have any annotations, :attr:`~object.__annotate__` " "should preferably be set to ``None`` (it can’t be deleted), rather than set " "to a function that returns an empty dict." msgstr "" -#: ../../reference/datamodel.rst:3654 +#: ../../reference/datamodel.rst:3686 msgid ":pep:`649` --- Deferred evaluation of annotation using descriptors" msgstr "" -#: ../../reference/datamodel.rst:3655 +#: ../../reference/datamodel.rst:3687 msgid "" "Introduces lazy evaluation of annotations and the ``__annotate__`` function." msgstr "" -#: ../../reference/datamodel.rst:3661 +#: ../../reference/datamodel.rst:3693 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:3663 +#: ../../reference/datamodel.rst:3695 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -4325,7 +4372,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:3668 +#: ../../reference/datamodel.rst:3700 msgid "" ">>> class C:\n" "... pass\n" @@ -4347,7 +4394,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: object of type 'C' has no len()" -#: ../../reference/datamodel.rst:3678 +#: ../../reference/datamodel.rst:3710 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -4356,7 +4403,7 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:3685 +#: ../../reference/datamodel.rst:3717 msgid "" ">>> 1 .__hash__() == hash(1)\n" "True\n" @@ -4372,14 +4419,14 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: descriptor '__hash__' of 'int' object needs an argument" -#: ../../reference/datamodel.rst:3692 +#: ../../reference/datamodel.rst:3724 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:3696 +#: ../../reference/datamodel.rst:3728 msgid "" ">>> type(1).__hash__(1) == hash(1)\n" "True\n" @@ -4391,14 +4438,14 @@ msgstr "" ">>> type(int).__hash__(int) == hash(int)\n" "True" -#: ../../reference/datamodel.rst:3701 +#: ../../reference/datamodel.rst:3733 msgid "" "In addition to bypassing any instance attributes in the interest of " "correctness, implicit special method lookup generally also bypasses the :" "meth:`~object.__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:3705 +#: ../../reference/datamodel.rst:3737 msgid "" ">>> class Meta(type):\n" "... def __getattribute__(*args):\n" @@ -4423,7 +4470,7 @@ msgid "" "10" msgstr "" -#: ../../reference/datamodel.rst:3727 +#: ../../reference/datamodel.rst:3759 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -4432,29 +4479,29 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:3738 +#: ../../reference/datamodel.rst:3770 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:3742 +#: ../../reference/datamodel.rst:3774 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:3744 +#: ../../reference/datamodel.rst:3776 msgid "" "An :term:`awaitable` object generally implements an :meth:`~object." "__await__` method. :term:`Coroutine objects ` returned from :" "keyword:`async def` functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:3750 +#: ../../reference/datamodel.rst:3782 msgid "" "The :term:`generator iterator` objects returned from generators decorated " "with :func:`types.coroutine` are also awaitable, but they do not implement :" "meth:`~object.__await__`." msgstr "" -#: ../../reference/datamodel.rst:3756 +#: ../../reference/datamodel.rst:3788 msgid "" "Must return an :term:`iterator`. Should be used to implement :term:" "`awaitable` objects. For instance, :class:`asyncio.Future` implements this " @@ -4462,7 +4509,7 @@ msgid "" "`object` class itself is not awaitable and does not provide this method." msgstr "" -#: ../../reference/datamodel.rst:3764 +#: ../../reference/datamodel.rst:3796 msgid "" "The language doesn't place any restriction on the type or value of the " "objects yielded by the iterator returned by ``__await__``, as this is " @@ -4470,15 +4517,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:3772 +#: ../../reference/datamodel.rst:3804 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:3778 +#: ../../reference/datamodel.rst:3810 msgid "Coroutine Objects" msgstr "協程物件" -#: ../../reference/datamodel.rst:3780 +#: ../../reference/datamodel.rst:3812 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -4489,18 +4536,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:3788 +#: ../../reference/datamodel.rst:3820 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:3792 +#: ../../reference/datamodel.rst:3824 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:3798 +#: ../../reference/datamodel.rst:3830 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -4511,7 +4558,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3809 +#: ../../reference/datamodel.rst:3841 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -4522,13 +4569,13 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3820 +#: ../../reference/datamodel.rst:3852 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:3825 +#: ../../reference/datamodel.rst:3857 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -4538,46 +4585,46 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3833 +#: ../../reference/datamodel.rst:3865 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3839 +#: ../../reference/datamodel.rst:3871 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3841 +#: ../../reference/datamodel.rst:3873 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3844 +#: ../../reference/datamodel.rst:3876 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3846 ../../reference/datamodel.rst:3895 +#: ../../reference/datamodel.rst:3878 ../../reference/datamodel.rst:3927 msgid "The :class:`object` class itself does not provide these methods." msgstr "" -#: ../../reference/datamodel.rst:3851 +#: ../../reference/datamodel.rst:3883 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3855 +#: ../../reference/datamodel.rst:3887 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:3858 +#: ../../reference/datamodel.rst:3890 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3860 +#: ../../reference/datamodel.rst:3892 msgid "" "class Reader:\n" " async def readline(self):\n" @@ -4605,53 +4652,53 @@ msgstr "" " raise StopAsyncIteration\n" " return val" -#: ../../reference/datamodel.rst:3875 +#: ../../reference/datamodel.rst:3907 msgid "" "Prior to Python 3.7, :meth:`~object.__aiter__` could return an *awaitable* " "that would resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:3880 +#: ../../reference/datamodel.rst:3912 msgid "" "Starting with Python 3.7, :meth:`~object.__aiter__` must return an " "asynchronous iterator object. Returning anything else will result in a :exc:" "`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:3888 +#: ../../reference/datamodel.rst:3920 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3890 +#: ../../reference/datamodel.rst:3922 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3893 +#: ../../reference/datamodel.rst:3925 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3899 +#: ../../reference/datamodel.rst:3931 msgid "" "Semantically similar to :meth:`~object.__enter__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3904 +#: ../../reference/datamodel.rst:3936 msgid "" "Semantically similar to :meth:`~object.__exit__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3907 +#: ../../reference/datamodel.rst:3939 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3909 +#: ../../reference/datamodel.rst:3941 msgid "" "class AsyncContextManager:\n" " async def __aenter__(self):\n" @@ -4667,18 +4714,18 @@ msgstr "" " async def __aexit__(self, exc_type, exc, tb):\n" " await log('exiting context')" -#: ../../reference/datamodel.rst:3920 +#: ../../reference/datamodel.rst:3952 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3921 +#: ../../reference/datamodel.rst:3953 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:3925 +#: ../../reference/datamodel.rst:3957 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, :meth:`~object.__contains__`, :meth:`~object." @@ -4687,7 +4734,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3932 +#: ../../reference/datamodel.rst:3964 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns :data:`NotImplemented`. Do not set the method to ``None`` if " @@ -4695,14 +4742,14 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3938 +#: ../../reference/datamodel.rst:3970 msgid "" "For operands of the same type, it is assumed that if the non-reflected " "method (such as :meth:`~object.__add__`) fails then the operation is not " "supported, which is why the reflected method is not called." msgstr "" -#: ../../reference/datamodel.rst:3942 +#: ../../reference/datamodel.rst:3974 msgid "" "If the right operand's type is a subclass of the left operand's type, the " "reflected method having precedence allows subclasses to override their " @@ -4713,19 +4760,19 @@ msgstr "" #: ../../reference/datamodel.rst:159 ../../reference/datamodel.rst:183 #: ../../reference/datamodel.rst:195 ../../reference/datamodel.rst:228 #: ../../reference/datamodel.rst:249 ../../reference/datamodel.rst:266 -#: ../../reference/datamodel.rst:284 ../../reference/datamodel.rst:297 -#: ../../reference/datamodel.rst:329 ../../reference/datamodel.rst:364 -#: ../../reference/datamodel.rst:389 ../../reference/datamodel.rst:410 -#: ../../reference/datamodel.rst:428 ../../reference/datamodel.rst:448 -#: ../../reference/datamodel.rst:456 ../../reference/datamodel.rst:467 -#: ../../reference/datamodel.rst:484 ../../reference/datamodel.rst:520 -#: ../../reference/datamodel.rst:535 ../../reference/datamodel.rst:680 -#: ../../reference/datamodel.rst:818 ../../reference/datamodel.rst:842 -#: ../../reference/datamodel.rst:878 ../../reference/datamodel.rst:1156 -#: ../../reference/datamodel.rst:1324 ../../reference/datamodel.rst:1351 -#: ../../reference/datamodel.rst:1423 ../../reference/datamodel.rst:1531 -#: ../../reference/datamodel.rst:1639 ../../reference/datamodel.rst:1756 -#: ../../reference/datamodel.rst:2181 ../../reference/datamodel.rst:3208 +#: ../../reference/datamodel.rst:284 ../../reference/datamodel.rst:298 +#: ../../reference/datamodel.rst:343 ../../reference/datamodel.rst:383 +#: ../../reference/datamodel.rst:408 ../../reference/datamodel.rst:429 +#: ../../reference/datamodel.rst:447 ../../reference/datamodel.rst:467 +#: ../../reference/datamodel.rst:475 ../../reference/datamodel.rst:488 +#: ../../reference/datamodel.rst:505 ../../reference/datamodel.rst:541 +#: ../../reference/datamodel.rst:556 ../../reference/datamodel.rst:701 +#: ../../reference/datamodel.rst:839 ../../reference/datamodel.rst:863 +#: ../../reference/datamodel.rst:899 ../../reference/datamodel.rst:1177 +#: ../../reference/datamodel.rst:1345 ../../reference/datamodel.rst:1372 +#: ../../reference/datamodel.rst:1444 ../../reference/datamodel.rst:1552 +#: ../../reference/datamodel.rst:1660 ../../reference/datamodel.rst:1777 +#: ../../reference/datamodel.rst:2202 ../../reference/datamodel.rst:3229 msgid "object" msgstr "object(物件)" @@ -4733,15 +4780,15 @@ msgstr "object(物件)" msgid "data" msgstr "data(資料)" -#: ../../reference/datamodel.rst:22 ../../reference/datamodel.rst:297 -#: ../../reference/datamodel.rst:344 ../../reference/datamodel.rst:428 -#: ../../reference/datamodel.rst:467 ../../reference/datamodel.rst:818 -#: ../../reference/datamodel.rst:1380 ../../reference/datamodel.rst:1839 -#: ../../reference/datamodel.rst:2082 ../../reference/datamodel.rst:2088 -#: ../../reference/datamodel.rst:2181 ../../reference/datamodel.rst:2743 -#: ../../reference/datamodel.rst:3178 ../../reference/datamodel.rst:3336 -#: ../../reference/datamodel.rst:3371 ../../reference/datamodel.rst:3439 -#: ../../reference/datamodel.rst:3449 ../../reference/datamodel.rst:3477 +#: ../../reference/datamodel.rst:22 ../../reference/datamodel.rst:298 +#: ../../reference/datamodel.rst:358 ../../reference/datamodel.rst:447 +#: ../../reference/datamodel.rst:488 ../../reference/datamodel.rst:839 +#: ../../reference/datamodel.rst:1401 ../../reference/datamodel.rst:1860 +#: ../../reference/datamodel.rst:2103 ../../reference/datamodel.rst:2109 +#: ../../reference/datamodel.rst:2202 ../../reference/datamodel.rst:2764 +#: ../../reference/datamodel.rst:3199 ../../reference/datamodel.rst:3368 +#: ../../reference/datamodel.rst:3403 ../../reference/datamodel.rst:3471 +#: ../../reference/datamodel.rst:3481 ../../reference/datamodel.rst:3509 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -4750,7 +4797,7 @@ msgid "id" msgstr "id" #: ../../reference/datamodel.rst:22 ../../reference/datamodel.rst:122 -#: ../../reference/datamodel.rst:2743 +#: ../../reference/datamodel.rst:2764 msgid "type" msgstr "type(型別)" @@ -4786,7 +4833,7 @@ msgstr "reference counting(參照計數)" msgid "unreachable object" msgstr "unreachable object(不可達物件)" -#: ../../reference/datamodel.rst:91 ../../reference/datamodel.rst:1156 +#: ../../reference/datamodel.rst:91 ../../reference/datamodel.rst:1177 msgid "container" msgstr "container(容器)" @@ -4798,26 +4845,26 @@ msgstr "hierarchy(階層)" msgid "extension" msgstr "extension(擴充)" -#: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:401 -#: ../../reference/datamodel.rst:402 ../../reference/datamodel.rst:503 -#: ../../reference/datamodel.rst:878 ../../reference/datamodel.rst:898 -#: ../../reference/datamodel.rst:1380 +#: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:420 +#: ../../reference/datamodel.rst:421 ../../reference/datamodel.rst:524 +#: ../../reference/datamodel.rst:899 ../../reference/datamodel.rst:919 +#: ../../reference/datamodel.rst:1401 msgid "module" msgstr "module(模組)" #: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:266 -#: ../../reference/datamodel.rst:818 +#: ../../reference/datamodel.rst:839 msgid "C" msgstr "C" #: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:266 -#: ../../reference/datamodel.rst:818 +#: ../../reference/datamodel.rst:839 msgid "language" msgstr "language(語言)" -#: ../../reference/datamodel.rst:135 ../../reference/datamodel.rst:1156 -#: ../../reference/datamodel.rst:1174 ../../reference/datamodel.rst:1324 -#: ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:135 ../../reference/datamodel.rst:1177 +#: ../../reference/datamodel.rst:1195 ../../reference/datamodel.rst:1345 +#: ../../reference/datamodel.rst:1365 msgid "attribute" msgstr "attribute(屬性)" @@ -4837,12 +4884,11 @@ msgstr "..." msgid "ellipsis literal" msgstr "ellipsis literal(刪節號字面值)" -#: ../../reference/datamodel.rst:195 ../../reference/datamodel.rst:1351 +#: ../../reference/datamodel.rst:195 ../../reference/datamodel.rst:1372 msgid "numeric" msgstr "numeric(數值)" #: ../../reference/datamodel.rst:228 ../../reference/datamodel.rst:234 -#: ../../reference/datamodel.rst:344 msgid "integer" msgstr "integer(整數)" @@ -4874,840 +4920,844 @@ msgstr "number(數字)" msgid "Java" msgstr "Java" -#: ../../reference/datamodel.rst:284 ../../reference/datamodel.rst:3449 +#: ../../reference/datamodel.rst:284 ../../reference/datamodel.rst:3481 msgid "complex" msgstr "complex(複數)" -#: ../../reference/datamodel.rst:297 ../../reference/datamodel.rst:428 -#: ../../reference/datamodel.rst:467 ../../reference/datamodel.rst:3178 +#: ../../reference/datamodel.rst:298 ../../reference/datamodel.rst:447 +#: ../../reference/datamodel.rst:488 ../../reference/datamodel.rst:3199 msgid "len" msgstr "len" -#: ../../reference/datamodel.rst:297 ../../reference/datamodel.rst:1351 +#: ../../reference/datamodel.rst:298 ../../reference/datamodel.rst:1372 msgid "sequence" msgstr "sequence(序列)" -#: ../../reference/datamodel.rst:297 +#: ../../reference/datamodel.rst:298 msgid "index operation" msgstr "index operation(索引操作)" -#: ../../reference/datamodel.rst:297 +#: ../../reference/datamodel.rst:298 msgid "item selection" msgstr "item selection(項目選取)" -#: ../../reference/datamodel.rst:297 ../../reference/datamodel.rst:389 -#: ../../reference/datamodel.rst:467 +#: ../../reference/datamodel.rst:298 ../../reference/datamodel.rst:408 +#: ../../reference/datamodel.rst:488 msgid "subscription" msgstr "subscription(下標)" -#: ../../reference/datamodel.rst:312 ../../reference/datamodel.rst:389 +#: ../../reference/datamodel.rst:316 ../../reference/datamodel.rst:408 msgid "slicing" msgstr "slice(切片)" -#: ../../reference/datamodel.rst:329 +#: ../../reference/datamodel.rst:316 ../../reference/datamodel.rst:1866 +msgid "start (slice object attribute)" +msgstr "start (slice 物件屬性)" + +#: ../../reference/datamodel.rst:316 ../../reference/datamodel.rst:1866 +msgid "stop (slice object attribute)" +msgstr "stop (slice 物件屬性)" + +#: ../../reference/datamodel.rst:316 ../../reference/datamodel.rst:1866 +msgid "step (slice object attribute)" +msgstr "step (slice 物件屬性)" + +#: ../../reference/datamodel.rst:343 msgid "immutable sequence" msgstr "immutable sequence(不可變序列)" -#: ../../reference/datamodel.rst:329 +#: ../../reference/datamodel.rst:343 msgid "immutable" msgstr "immutable(不可變)" -#: ../../reference/datamodel.rst:340 ../../reference/datamodel.rst:2057 -#: ../../reference/datamodel.rst:2088 +#: ../../reference/datamodel.rst:354 ../../reference/datamodel.rst:358 +#: ../../reference/datamodel.rst:2078 ../../reference/datamodel.rst:2109 msgid "string" msgstr "string(字串)" -#: ../../reference/datamodel.rst:340 +#: ../../reference/datamodel.rst:354 msgid "immutable sequences" msgstr "immutable sequences(不可變序列)" -#: ../../reference/datamodel.rst:344 +#: ../../reference/datamodel.rst:358 msgid "chr" msgstr "chr" -#: ../../reference/datamodel.rst:344 +#: ../../reference/datamodel.rst:358 msgid "ord" msgstr "ord" -#: ../../reference/datamodel.rst:344 +#: ../../reference/datamodel.rst:358 msgid "character" msgstr "character(字元)" -#: ../../reference/datamodel.rst:344 +#: ../../reference/datamodel.rst:358 +msgid "item" +msgstr "" + +#: ../../reference/datamodel.rst:358 msgid "Unicode" msgstr "Unicode" -#: ../../reference/datamodel.rst:364 +#: ../../reference/datamodel.rst:383 msgid "tuple" msgstr "tuple(元組)" -#: ../../reference/datamodel.rst:364 +#: ../../reference/datamodel.rst:383 msgid "singleton" msgstr "singleton(單例)" -#: ../../reference/datamodel.rst:364 +#: ../../reference/datamodel.rst:383 msgid "empty" msgstr "empty(空的)" -#: ../../reference/datamodel.rst:377 ../../reference/datamodel.rst:2082 +#: ../../reference/datamodel.rst:396 ../../reference/datamodel.rst:2103 msgid "bytes" msgstr "bytes(位元組)" -#: ../../reference/datamodel.rst:377 +#: ../../reference/datamodel.rst:396 msgid "byte" msgstr "byte(位元組)" -#: ../../reference/datamodel.rst:389 +#: ../../reference/datamodel.rst:408 msgid "mutable sequence" msgstr "mutable sequence(可變序列)" -#: ../../reference/datamodel.rst:389 +#: ../../reference/datamodel.rst:408 msgid "mutable" msgstr "mutable(可變的)" -#: ../../reference/datamodel.rst:389 ../../reference/datamodel.rst:1174 -#: ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:408 ../../reference/datamodel.rst:1195 +#: ../../reference/datamodel.rst:1365 msgid "assignment" msgstr "assignment(賦值)" -#: ../../reference/datamodel.rst:389 ../../reference/datamodel.rst:878 -#: ../../reference/datamodel.rst:1793 ../../reference/datamodel.rst:1975 -#: ../../reference/datamodel.rst:3501 +#: ../../reference/datamodel.rst:408 ../../reference/datamodel.rst:899 +#: ../../reference/datamodel.rst:1814 ../../reference/datamodel.rst:1996 +#: ../../reference/datamodel.rst:3533 msgid "statement" msgstr "statement(陳述式)" -#: ../../reference/datamodel.rst:401 +#: ../../reference/datamodel.rst:420 msgid "array" msgstr "array(陣列)" -#: ../../reference/datamodel.rst:402 +#: ../../reference/datamodel.rst:421 msgid "collections" msgstr "collections" -#: ../../reference/datamodel.rst:410 +#: ../../reference/datamodel.rst:429 msgid "list" msgstr "list(串列)" -#: ../../reference/datamodel.rst:417 +#: ../../reference/datamodel.rst:436 msgid "bytearray" msgstr "bytearray(位元組陣列)" -#: ../../reference/datamodel.rst:428 +#: ../../reference/datamodel.rst:447 msgid "set type" msgstr "set type(集合型別)" -#: ../../reference/datamodel.rst:448 +#: ../../reference/datamodel.rst:467 msgid "set" msgstr "set(集合)" -#: ../../reference/datamodel.rst:456 +#: ../../reference/datamodel.rst:475 msgid "frozenset" msgstr "frozenset(凍結集合)" -#: ../../reference/datamodel.rst:467 ../../reference/datamodel.rst:1351 +#: ../../reference/datamodel.rst:488 ../../reference/datamodel.rst:1372 msgid "mapping" msgstr "mapping(對映)" -#: ../../reference/datamodel.rst:484 ../../reference/datamodel.rst:1156 -#: ../../reference/datamodel.rst:2181 +#: ../../reference/datamodel.rst:505 ../../reference/datamodel.rst:1177 +#: ../../reference/datamodel.rst:2202 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../reference/datamodel.rst:503 +#: ../../reference/datamodel.rst:524 msgid "dbm.ndbm" msgstr "dbm.ndbm" -#: ../../reference/datamodel.rst:503 +#: ../../reference/datamodel.rst:524 msgid "dbm.gnu" msgstr "dbm.gnu" -#: ../../reference/datamodel.rst:520 +#: ../../reference/datamodel.rst:541 msgid "callable" msgstr "callable(可呼叫物件)" -#: ../../reference/datamodel.rst:520 ../../reference/datamodel.rst:535 -#: ../../reference/datamodel.rst:762 ../../reference/datamodel.rst:780 -#: ../../reference/datamodel.rst:793 ../../reference/datamodel.rst:818 +#: ../../reference/datamodel.rst:541 ../../reference/datamodel.rst:556 +#: ../../reference/datamodel.rst:783 ../../reference/datamodel.rst:801 +#: ../../reference/datamodel.rst:814 ../../reference/datamodel.rst:839 msgid "function" msgstr "function (函式)" -#: ../../reference/datamodel.rst:520 ../../reference/datamodel.rst:1156 -#: ../../reference/datamodel.rst:1179 ../../reference/datamodel.rst:3124 +#: ../../reference/datamodel.rst:541 ../../reference/datamodel.rst:1177 +#: ../../reference/datamodel.rst:1200 ../../reference/datamodel.rst:3145 msgid "call" msgstr "call(呼叫)" -#: ../../reference/datamodel.rst:520 +#: ../../reference/datamodel.rst:541 msgid "invocation" msgstr "invocation(呼叫)" -#: ../../reference/datamodel.rst:520 +#: ../../reference/datamodel.rst:541 msgid "argument" msgstr "argument(引數)" -#: ../../reference/datamodel.rst:535 ../../reference/datamodel.rst:680 +#: ../../reference/datamodel.rst:556 ../../reference/datamodel.rst:701 msgid "user-defined" msgstr "user-defined(使用者定義)" -#: ../../reference/datamodel.rst:535 +#: ../../reference/datamodel.rst:556 msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" -#: ../../reference/datamodel.rst:548 +#: ../../reference/datamodel.rst:569 msgid "__builtins__ (function attribute)" msgstr "__builtins__ (函式屬性)" -#: ../../reference/datamodel.rst:548 +#: ../../reference/datamodel.rst:569 msgid "__closure__ (function attribute)" msgstr "__closure__ (函式屬性)" -#: ../../reference/datamodel.rst:548 +#: ../../reference/datamodel.rst:569 msgid "__globals__ (function attribute)" msgstr "__globals__ (函式屬性)" -#: ../../reference/datamodel.rst:548 +#: ../../reference/datamodel.rst:569 msgid "global" msgstr "global(全域)" -#: ../../reference/datamodel.rst:548 ../../reference/datamodel.rst:898 +#: ../../reference/datamodel.rst:569 ../../reference/datamodel.rst:919 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../reference/datamodel.rst:582 +#: ../../reference/datamodel.rst:603 msgid "__doc__ (function attribute)" msgstr "__doc__ (函式屬性)" -#: ../../reference/datamodel.rst:582 +#: ../../reference/datamodel.rst:603 msgid "__name__ (function attribute)" msgstr "__name__ (函式屬性)" -#: ../../reference/datamodel.rst:582 +#: ../../reference/datamodel.rst:603 msgid "__module__ (function attribute)" msgstr "__module__ (函式屬性)" -#: ../../reference/datamodel.rst:582 +#: ../../reference/datamodel.rst:603 msgid "__dict__ (function attribute)" msgstr "__dict__ (函式屬性)" -#: ../../reference/datamodel.rst:582 +#: ../../reference/datamodel.rst:603 msgid "__defaults__ (function attribute)" msgstr "__defaults__ (函式屬性)" -#: ../../reference/datamodel.rst:582 +#: ../../reference/datamodel.rst:603 msgid "__code__ (function attribute)" msgstr "__code__ (函式屬性)" -#: ../../reference/datamodel.rst:582 +#: ../../reference/datamodel.rst:603 msgid "__annotations__ (function attribute)" msgstr "__annotations__ (函式屬性)" -#: ../../reference/datamodel.rst:582 +#: ../../reference/datamodel.rst:603 msgid "__annotate__ (function attribute)" msgstr "__annotate__ (函式屬性)" -#: ../../reference/datamodel.rst:582 +#: ../../reference/datamodel.rst:603 msgid "__kwdefaults__ (function attribute)" msgstr "__kwdefaults__ (函式屬性)" -#: ../../reference/datamodel.rst:582 +#: ../../reference/datamodel.rst:603 msgid "__type_params__ (function attribute)" msgstr "__type_params__ (函式屬性)" -#: ../../reference/datamodel.rst:680 ../../reference/datamodel.rst:842 +#: ../../reference/datamodel.rst:701 ../../reference/datamodel.rst:863 msgid "method" msgstr "method(方法)" -#: ../../reference/datamodel.rst:680 +#: ../../reference/datamodel.rst:701 msgid "user-defined method" msgstr "user-defined method(使用者定義方法)" -#: ../../reference/datamodel.rst:688 +#: ../../reference/datamodel.rst:709 msgid "__func__ (method attribute)" msgstr "__func__ (方法屬性)" -#: ../../reference/datamodel.rst:688 +#: ../../reference/datamodel.rst:709 msgid "__self__ (method attribute)" msgstr "__self__ (方法屬性)" -#: ../../reference/datamodel.rst:688 +#: ../../reference/datamodel.rst:709 msgid "__doc__ (method attribute)" msgstr "__doc__ (方法屬性)" -#: ../../reference/datamodel.rst:688 +#: ../../reference/datamodel.rst:709 msgid "__name__ (method attribute)" msgstr "__name__ (方法屬性)" -#: ../../reference/datamodel.rst:688 +#: ../../reference/datamodel.rst:709 msgid "__module__ (method attribute)" msgstr "__module__ (方法屬性)" -#: ../../reference/datamodel.rst:762 ../../reference/datamodel.rst:1531 +#: ../../reference/datamodel.rst:783 ../../reference/datamodel.rst:1552 msgid "generator" msgstr "generator(產生器)" -#: ../../reference/datamodel.rst:762 +#: ../../reference/datamodel.rst:783 msgid "iterator" msgstr "itorator(疊代器)" -#: ../../reference/datamodel.rst:780 ../../reference/datamodel.rst:3734 +#: ../../reference/datamodel.rst:801 ../../reference/datamodel.rst:3766 msgid "coroutine" msgstr "coroutine(協程)" -#: ../../reference/datamodel.rst:793 +#: ../../reference/datamodel.rst:814 msgid "asynchronous generator" msgstr "asynchronous generator(非同步產生器)" -#: ../../reference/datamodel.rst:793 +#: ../../reference/datamodel.rst:814 msgid "asynchronous iterator" msgstr "asynchronous iterator(非同步疊代器)" -#: ../../reference/datamodel.rst:842 +#: ../../reference/datamodel.rst:863 msgid "built-in method" msgstr "built-in method(內建方法)" -#: ../../reference/datamodel.rst:842 +#: ../../reference/datamodel.rst:863 msgid "built-in" msgstr "built-in(內建)" -#: ../../reference/datamodel.rst:878 +#: ../../reference/datamodel.rst:899 msgid "import" msgstr "import(引入)" -#: ../../reference/datamodel.rst:898 +#: ../../reference/datamodel.rst:919 msgid "__name__ (module attribute)" msgstr "__name__ (模組屬性)" -#: ../../reference/datamodel.rst:898 +#: ../../reference/datamodel.rst:919 msgid "__spec__ (module attribute)" msgstr "__spec__ (模組屬性)" -#: ../../reference/datamodel.rst:898 +#: ../../reference/datamodel.rst:919 msgid "__package__ (module attribute)" msgstr "__package__ (模組屬性)" -#: ../../reference/datamodel.rst:898 +#: ../../reference/datamodel.rst:919 msgid "__loader__ (module attribute)" msgstr "__loader__ (模組屬性)" -#: ../../reference/datamodel.rst:898 +#: ../../reference/datamodel.rst:919 msgid "__path__ (module attribute)" msgstr "__path__ (模組屬性)" -#: ../../reference/datamodel.rst:898 +#: ../../reference/datamodel.rst:919 msgid "__file__ (module attribute)" msgstr "__file__ (模組屬性)" -#: ../../reference/datamodel.rst:898 +#: ../../reference/datamodel.rst:919 msgid "__cached__ (module attribute)" msgstr "__cached__ (模組屬性)" -#: ../../reference/datamodel.rst:898 +#: ../../reference/datamodel.rst:919 msgid "__doc__ (module attribute)" msgstr "__doc__ (模組屬性)" -#: ../../reference/datamodel.rst:898 +#: ../../reference/datamodel.rst:919 msgid "__annotations__ (module attribute)" msgstr "__annotations__ (模組屬性)" -#: ../../reference/datamodel.rst:898 +#: ../../reference/datamodel.rst:919 msgid "__annotate__ (module attribute)" msgstr "__annotate__ (模組屬性)" -#: ../../reference/datamodel.rst:1124 +#: ../../reference/datamodel.rst:1145 msgid "__dict__ (module attribute)" msgstr "__dict__ (模組屬性)" -#: ../../reference/datamodel.rst:1156 ../../reference/datamodel.rst:1174 -#: ../../reference/datamodel.rst:1324 ../../reference/datamodel.rst:1958 -#: ../../reference/datamodel.rst:2854 +#: ../../reference/datamodel.rst:1177 ../../reference/datamodel.rst:1195 +#: ../../reference/datamodel.rst:1345 ../../reference/datamodel.rst:1979 +#: ../../reference/datamodel.rst:2875 msgid "class" msgstr "class(類別)" -#: ../../reference/datamodel.rst:1156 ../../reference/datamodel.rst:1324 -#: ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:1177 ../../reference/datamodel.rst:1345 +#: ../../reference/datamodel.rst:1365 msgid "class instance" msgstr "class instance(類別實例)" -#: ../../reference/datamodel.rst:1156 ../../reference/datamodel.rst:1324 -#: ../../reference/datamodel.rst:3124 +#: ../../reference/datamodel.rst:1177 ../../reference/datamodel.rst:1345 +#: ../../reference/datamodel.rst:3145 msgid "instance" msgstr "instance(實例)" -#: ../../reference/datamodel.rst:1156 ../../reference/datamodel.rst:1179 +#: ../../reference/datamodel.rst:1177 ../../reference/datamodel.rst:1200 msgid "class object" msgstr "class object(類別物件)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1207 msgid "__name__ (class attribute)" msgstr "__name__ (類別屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1207 msgid "__module__ (class attribute)" msgstr "__module__ (類別屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1207 msgid "__dict__ (class attribute)" msgstr "__dict__ (類別屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1207 msgid "__bases__ (class attribute)" msgstr "__bases__ (類別屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1207 msgid "__base__ (class attribute)" msgstr "__base__ (類別屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1207 msgid "__doc__ (class attribute)" msgstr "__doc__ (類別屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1207 msgid "__annotations__ (class attribute)" msgstr "__annotations__ (類別屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1207 msgid "__annotate__ (class attribute)" msgstr "__annotate__ (類別屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1207 msgid "__type_params__ (class attribute)" msgstr "__type_params__ (類別屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1207 msgid "__static_attributes__ (class attribute)" msgstr "__static_attributes__ (類別屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1207 msgid "__firstlineno__ (class attribute)" msgstr "__firstlineno__ (類別屬性)" -#: ../../reference/datamodel.rst:1362 +#: ../../reference/datamodel.rst:1383 msgid "__dict__ (instance attribute)" msgstr "__dict__ (實例屬性)" -#: ../../reference/datamodel.rst:1362 +#: ../../reference/datamodel.rst:1383 msgid "__class__ (instance attribute)" msgstr "__class__ (實例屬性)" -#: ../../reference/datamodel.rst:1380 +#: ../../reference/datamodel.rst:1401 msgid "open" msgstr "open" -#: ../../reference/datamodel.rst:1380 +#: ../../reference/datamodel.rst:1401 msgid "io" msgstr "io" -#: ../../reference/datamodel.rst:1380 +#: ../../reference/datamodel.rst:1401 msgid "popen() (in module os)" msgstr "popen() (於 os 模組中)" -#: ../../reference/datamodel.rst:1380 +#: ../../reference/datamodel.rst:1401 msgid "makefile() (socket method)" msgstr "makefile() (socket 方法)" -#: ../../reference/datamodel.rst:1380 +#: ../../reference/datamodel.rst:1401 msgid "sys.stdin" msgstr "sys.stdin" -#: ../../reference/datamodel.rst:1380 +#: ../../reference/datamodel.rst:1401 msgid "sys.stdout" msgstr "sys.stdout" -#: ../../reference/datamodel.rst:1380 +#: ../../reference/datamodel.rst:1401 msgid "sys.stderr" msgstr "sys.stderr" -#: ../../reference/datamodel.rst:1380 +#: ../../reference/datamodel.rst:1401 msgid "stdio" msgstr "stdio" -#: ../../reference/datamodel.rst:1380 +#: ../../reference/datamodel.rst:1401 msgid "stdin (in module sys)" msgstr "stdin (sys 模組中)" -#: ../../reference/datamodel.rst:1380 +#: ../../reference/datamodel.rst:1401 msgid "stdout (in module sys)" msgstr "stdout (sys 模組中)" -#: ../../reference/datamodel.rst:1380 +#: ../../reference/datamodel.rst:1401 msgid "stderr (in module sys)" msgstr "stderr (sys 模組中)" -#: ../../reference/datamodel.rst:1409 +#: ../../reference/datamodel.rst:1430 msgid "internal type" msgstr "internal type(內部型別)" -#: ../../reference/datamodel.rst:1409 +#: ../../reference/datamodel.rst:1430 msgid "types, internal" msgstr "types(型別), internal(內部)" -#: ../../reference/datamodel.rst:1423 +#: ../../reference/datamodel.rst:1444 msgid "bytecode" msgstr "bytecode(位元組碼)" -#: ../../reference/datamodel.rst:1423 +#: ../../reference/datamodel.rst:1444 msgid "code" msgstr "code(程式碼)" -#: ../../reference/datamodel.rst:1423 +#: ../../reference/datamodel.rst:1444 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../reference/datamodel.rst:1434 +#: ../../reference/datamodel.rst:1455 msgid "co_argcount (code object attribute)" msgstr "co_argcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1434 +#: ../../reference/datamodel.rst:1455 msgid "co_posonlyargcount (code object attribute)" msgstr "co_posonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1434 +#: ../../reference/datamodel.rst:1455 msgid "co_kwonlyargcount (code object attribute)" msgstr "co_kwonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1434 +#: ../../reference/datamodel.rst:1455 msgid "co_code (code object attribute)" msgstr "co_code (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1434 +#: ../../reference/datamodel.rst:1455 msgid "co_consts (code object attribute)" msgstr "co_consts (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1434 +#: ../../reference/datamodel.rst:1455 msgid "co_filename (code object attribute)" msgstr "co_filename (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1434 +#: ../../reference/datamodel.rst:1455 msgid "co_firstlineno (code object attribute)" msgstr "co_firstlineno (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1434 +#: ../../reference/datamodel.rst:1455 msgid "co_flags (code object attribute)" msgstr "co_flags (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1434 +#: ../../reference/datamodel.rst:1455 msgid "co_lnotab (code object attribute)" msgstr "co_lnotab (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1434 +#: ../../reference/datamodel.rst:1455 msgid "co_name (code object attribute)" msgstr "co_name (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1434 +#: ../../reference/datamodel.rst:1455 msgid "co_names (code object attribute)" msgstr "co_names (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1434 +#: ../../reference/datamodel.rst:1455 msgid "co_nlocals (code object attribute)" msgstr "co_nlocals (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1434 +#: ../../reference/datamodel.rst:1455 msgid "co_stacksize (code object attribute)" msgstr "co_stacksize (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1434 +#: ../../reference/datamodel.rst:1455 msgid "co_varnames (code object attribute)" msgstr "co_varnames (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1434 +#: ../../reference/datamodel.rst:1455 msgid "co_cellvars (code object attribute)" msgstr "co_cellvars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1434 +#: ../../reference/datamodel.rst:1455 msgid "co_freevars (code object attribute)" msgstr "co_freevars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1434 +#: ../../reference/datamodel.rst:1455 msgid "co_qualname (code object attribute)" msgstr "co_qualname (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1547 +#: ../../reference/datamodel.rst:1568 msgid "documentation string" msgstr "documentation string(文件字串)" -#: ../../reference/datamodel.rst:1639 +#: ../../reference/datamodel.rst:1660 msgid "frame" msgstr "frame" -#: ../../reference/datamodel.rst:1645 +#: ../../reference/datamodel.rst:1666 msgid "f_back (frame attribute)" msgstr "f_back (frame 屬性)" -#: ../../reference/datamodel.rst:1645 +#: ../../reference/datamodel.rst:1666 msgid "f_code (frame attribute)" msgstr "f_code (frame 屬性)" -#: ../../reference/datamodel.rst:1645 +#: ../../reference/datamodel.rst:1666 msgid "f_globals (frame attribute)" msgstr "f_globals (frame 屬性)" -#: ../../reference/datamodel.rst:1645 +#: ../../reference/datamodel.rst:1666 msgid "f_locals (frame attribute)" msgstr "f_locals (frame 屬性)" -#: ../../reference/datamodel.rst:1645 +#: ../../reference/datamodel.rst:1666 msgid "f_lasti (frame attribute)" msgstr "f_lasti (frame 屬性)" -#: ../../reference/datamodel.rst:1645 +#: ../../reference/datamodel.rst:1666 msgid "f_builtins (frame attribute)" msgstr "f_builtins (frame 屬性)" -#: ../../reference/datamodel.rst:1645 +#: ../../reference/datamodel.rst:1666 msgid "f_generator (frame attribute)" msgstr "f_generator (frame 屬性)" -#: ../../reference/datamodel.rst:1696 +#: ../../reference/datamodel.rst:1717 msgid "f_trace (frame attribute)" msgstr "f_trace (frame 屬性)" -#: ../../reference/datamodel.rst:1696 +#: ../../reference/datamodel.rst:1717 msgid "f_trace_lines (frame attribute)" msgstr "f_trace_lines (frame 屬性)" -#: ../../reference/datamodel.rst:1696 +#: ../../reference/datamodel.rst:1717 msgid "f_trace_opcodes (frame attribute)" msgstr "f_trace_opcodes (frame 屬性)" -#: ../../reference/datamodel.rst:1696 +#: ../../reference/datamodel.rst:1717 msgid "f_lineno (frame attribute)" msgstr "f_lineno (frame 屬性)" -#: ../../reference/datamodel.rst:1756 +#: ../../reference/datamodel.rst:1777 msgid "traceback" msgstr "traceback" -#: ../../reference/datamodel.rst:1756 +#: ../../reference/datamodel.rst:1777 msgid "stack" msgstr "stack(堆疊)" -#: ../../reference/datamodel.rst:1756 +#: ../../reference/datamodel.rst:1777 msgid "trace" msgstr "trace(追蹤)" -#: ../../reference/datamodel.rst:1756 +#: ../../reference/datamodel.rst:1777 msgid "exception" msgstr "exception(例外)" -#: ../../reference/datamodel.rst:1756 +#: ../../reference/datamodel.rst:1777 msgid "handler" msgstr "handler(處理器)" -#: ../../reference/datamodel.rst:1756 +#: ../../reference/datamodel.rst:1777 msgid "execution" msgstr "execution(執行)" -#: ../../reference/datamodel.rst:1756 +#: ../../reference/datamodel.rst:1777 msgid "exc_info (in module sys)" msgstr "exc_info (sys 模組中)" -#: ../../reference/datamodel.rst:1756 +#: ../../reference/datamodel.rst:1777 msgid "last_traceback (in module sys)" msgstr "last_traceback (sys 模組中)" -#: ../../reference/datamodel.rst:1756 +#: ../../reference/datamodel.rst:1777 msgid "sys.exc_info" msgstr "sys.exc_info" -#: ../../reference/datamodel.rst:1756 +#: ../../reference/datamodel.rst:1777 msgid "sys.exception" msgstr "sys.exception" -#: ../../reference/datamodel.rst:1756 +#: ../../reference/datamodel.rst:1777 msgid "sys.last_traceback" msgstr "sys.last_traceback" -#: ../../reference/datamodel.rst:1793 +#: ../../reference/datamodel.rst:1814 msgid "tb_frame (traceback attribute)" msgstr "tb_frame (traceback 屬性)" -#: ../../reference/datamodel.rst:1793 +#: ../../reference/datamodel.rst:1814 msgid "tb_lineno (traceback attribute)" msgstr "tb_lineno (traceback 屬性)" -#: ../../reference/datamodel.rst:1793 +#: ../../reference/datamodel.rst:1814 msgid "tb_lasti (traceback attribute)" msgstr "tb_lasti (traceback 屬性)" -#: ../../reference/datamodel.rst:1793 +#: ../../reference/datamodel.rst:1814 msgid "try" msgstr "try" -#: ../../reference/datamodel.rst:1823 +#: ../../reference/datamodel.rst:1844 msgid "tb_next (traceback attribute)" msgstr "tb_next (traceback 屬性)" -#: ../../reference/datamodel.rst:1839 ../../reference/datamodel.rst:3208 +#: ../../reference/datamodel.rst:1860 ../../reference/datamodel.rst:3229 msgid "slice" msgstr "slice(切片)" -#: ../../reference/datamodel.rst:1845 -msgid "start (slice object attribute)" -msgstr "start (slice 物件屬性)" - -#: ../../reference/datamodel.rst:1845 -msgid "stop (slice object attribute)" -msgstr "stop (slice 物件屬性)" - -#: ../../reference/datamodel.rst:1845 -msgid "step (slice object attribute)" -msgstr "step (slice 物件屬性)" - -#: ../../reference/datamodel.rst:1893 +#: ../../reference/datamodel.rst:1914 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/datamodel.rst:1893 +#: ../../reference/datamodel.rst:1914 msgid "overloading" msgstr "overloading(多載)" -#: ../../reference/datamodel.rst:1893 +#: ../../reference/datamodel.rst:1914 msgid "__getitem__() (mapping object method)" msgstr "__getitem__() (對映物件方法)" -#: ../../reference/datamodel.rst:1929 +#: ../../reference/datamodel.rst:1950 msgid "subclassing" msgstr "subclassing(子類別化)" -#: ../../reference/datamodel.rst:1929 +#: ../../reference/datamodel.rst:1950 msgid "immutable types" msgstr "immutable types(不可變型別)" -#: ../../reference/datamodel.rst:1958 +#: ../../reference/datamodel.rst:1979 msgid "constructor" msgstr "constructor(建構函式)" -#: ../../reference/datamodel.rst:1975 +#: ../../reference/datamodel.rst:1996 msgid "destructor" msgstr "destructor(解構函式)" -#: ../../reference/datamodel.rst:1975 +#: ../../reference/datamodel.rst:1996 msgid "finalizer" msgstr "finalizer(終結函式)" -#: ../../reference/datamodel.rst:1975 +#: ../../reference/datamodel.rst:1996 msgid "del" msgstr "del" -#: ../../reference/datamodel.rst:2039 +#: ../../reference/datamodel.rst:2060 msgid "repr() (built-in function)" msgstr "repr() (內建函式)" -#: ../../reference/datamodel.rst:2039 +#: ../../reference/datamodel.rst:2060 msgid "__repr__() (object method)" msgstr "__repr__() (物件方法)" -#: ../../reference/datamodel.rst:2057 +#: ../../reference/datamodel.rst:2078 msgid "__str__() (object method)" msgstr "__str__() (物件方法)" -#: ../../reference/datamodel.rst:2057 +#: ../../reference/datamodel.rst:2078 msgid "format() (built-in function)" msgstr "format() (內建函式)" -#: ../../reference/datamodel.rst:2057 +#: ../../reference/datamodel.rst:2078 msgid "print() (built-in function)" msgstr "print() (內建函式)" -#: ../../reference/datamodel.rst:2088 +#: ../../reference/datamodel.rst:2109 msgid "__format__() (object method)" msgstr "__format__() (物件方法)" -#: ../../reference/datamodel.rst:2088 +#: ../../reference/datamodel.rst:2109 msgid "conversion" msgstr "conversion" -#: ../../reference/datamodel.rst:2088 +#: ../../reference/datamodel.rst:2109 msgid "print" msgstr "print" -#: ../../reference/datamodel.rst:2130 +#: ../../reference/datamodel.rst:2151 msgid "comparisons" msgstr "comparison(比較)" -#: ../../reference/datamodel.rst:2181 +#: ../../reference/datamodel.rst:2202 msgid "hash" msgstr "hash(雜湊)" -#: ../../reference/datamodel.rst:2262 +#: ../../reference/datamodel.rst:2283 msgid "__len__() (mapping object method)" msgstr "__len__() (對映物件方法)" -#: ../../reference/datamodel.rst:2367 +#: ../../reference/datamodel.rst:2388 msgid "__getattr__ (module attribute)" msgstr "__getattr__ (模組屬性)" -#: ../../reference/datamodel.rst:2367 +#: ../../reference/datamodel.rst:2388 msgid "__dir__ (module attribute)" msgstr "__dir__ (模組屬性)" -#: ../../reference/datamodel.rst:2367 +#: ../../reference/datamodel.rst:2388 msgid "__class__ (module attribute)" msgstr "__class__ (模組屬性)" -#: ../../reference/datamodel.rst:2743 +#: ../../reference/datamodel.rst:2764 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../reference/datamodel.rst:2743 +#: ../../reference/datamodel.rst:2764 msgid "= (equals)" msgstr "= (等號)" -#: ../../reference/datamodel.rst:2743 +#: ../../reference/datamodel.rst:2764 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/datamodel.rst:2807 +#: ../../reference/datamodel.rst:2828 msgid "metaclass hint" msgstr "metaclass hint(元類別提示)" -#: ../../reference/datamodel.rst:2830 +#: ../../reference/datamodel.rst:2851 msgid "__prepare__ (metaclass method)" msgstr "__prepare__ (元類別方法)" -#: ../../reference/datamodel.rst:2854 +#: ../../reference/datamodel.rst:2875 msgid "body" msgstr "body" -#: ../../reference/datamodel.rst:2874 +#: ../../reference/datamodel.rst:2895 msgid "__class__ (method cell)" msgstr "__class__ (方法 cell)" -#: ../../reference/datamodel.rst:2874 +#: ../../reference/datamodel.rst:2895 msgid "__classcell__ (class namespace entry)" msgstr "__classcell__ (類別命名空間項目)" -#: ../../reference/datamodel.rst:3178 +#: ../../reference/datamodel.rst:3199 msgid "__bool__() (object method)" msgstr "__bool__() (物件方法)" -#: ../../reference/datamodel.rst:3336 ../../reference/datamodel.rst:3371 +#: ../../reference/datamodel.rst:3368 ../../reference/datamodel.rst:3403 msgid "divmod" msgstr "divmod" -#: ../../reference/datamodel.rst:3336 ../../reference/datamodel.rst:3371 +#: ../../reference/datamodel.rst:3368 ../../reference/datamodel.rst:3403 msgid "pow" msgstr "pow" -#: ../../reference/datamodel.rst:3439 +#: ../../reference/datamodel.rst:3471 msgid "abs" msgstr "abs" -#: ../../reference/datamodel.rst:3449 +#: ../../reference/datamodel.rst:3481 msgid "int" msgstr "int" -#: ../../reference/datamodel.rst:3449 +#: ../../reference/datamodel.rst:3481 msgid "float" msgstr "float" -#: ../../reference/datamodel.rst:3477 +#: ../../reference/datamodel.rst:3509 msgid "round" msgstr "round" -#: ../../reference/datamodel.rst:3501 +#: ../../reference/datamodel.rst:3533 msgid "with" msgstr "with" -#: ../../reference/datamodel.rst:3501 +#: ../../reference/datamodel.rst:3533 msgid "context manager" msgstr "context manager(情境管理器)" diff --git a/reference/expressions.po b/reference/expressions.po index e8fef8714c..d98b483f27 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-15 00:16+0000\n" +"POT-Creation-Date: 2026-02-05 14:10+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1101,141 +1101,265 @@ msgid "" msgstr "" #: ../../reference/expressions.rst:936 -msgid "Subscriptions" +msgid "Subscriptions and slicings" msgstr "" #: ../../reference/expressions.rst:951 msgid "" -"The subscription of an instance of a :ref:`container class ` " -"will generally select an element from the container. The subscription of a :" -"term:`generic class ` will generally return a :ref:" -"`GenericAlias ` object." +"The :dfn:`subscription` syntax is usually used for selecting an element from " +"a :ref:`container ` -- for example, to get a value from a :" +"class:`dict`::" +msgstr "" + +#: ../../reference/expressions.rst:955 +msgid "" +">>> digits_by_name = {'one': 1, 'two': 2}\n" +">>> digits_by_name['two'] # Subscripting a dictionary using the key 'two'\n" +"2" msgstr "" #: ../../reference/expressions.rst:959 msgid "" -"When an object is subscripted, the interpreter will evaluate the primary and " -"the expression list." +"In the subscription syntax, the object being subscribed -- a :ref:`primary " +"` -- is followed by a :dfn:`subscript` in square brackets. In the " +"simplest case, the subscript is a single expression." msgstr "" -#: ../../reference/expressions.rst:962 +#: ../../reference/expressions.rst:964 msgid "" -"The primary must evaluate to an object that supports subscription. An object " -"may support subscription through defining one or both of :meth:`~object." -"__getitem__` and :meth:`~object.__class_getitem__`. When the primary is " -"subscripted, the evaluated result of the expression list will be passed to " -"one of these methods. For more details on when ``__class_getitem__`` is " -"called instead of ``__getitem__``, see :ref:`classgetitem-versus-getitem`." +"Depending on the type of the object being subscribed, the subscript is " +"sometimes called a :term:`key` (for mappings), :term:`index` (for " +"sequences), or *type argument* (for :term:`generic types `). " +"Syntactically, these are all equivalent::" msgstr "" #: ../../reference/expressions.rst:969 msgid "" -"If the expression list contains at least one comma, or if any of the " -"expressions are starred, the expression list will evaluate to a :class:" -"`tuple` containing the items of the expression list. Otherwise, the " -"expression list will evaluate to the value of the list's sole member." +">>> colors = ['red', 'blue', 'green', 'black']\n" +">>> colors[3] # Subscripting a list using the index 3\n" +"'black'\n" +"\n" +">>> list[str] # Parameterizing the list type using the type argument str\n" +"list[str]" +msgstr "" + +#: ../../reference/expressions.rst:976 +msgid "" +"At runtime, the interpreter will evaluate the primary and the subscript, and " +"call the primary's :meth:`~object.__getitem__` or :meth:`~object." +"__class_getitem__` :term:`special method` with the subscript as argument. " +"For more details on which of these methods is called, see :ref:`classgetitem-" +"versus-getitem`." msgstr "" -#: ../../reference/expressions.rst:974 -msgid "Expressions in an expression list may be starred. See :pep:`646`." +#: ../../reference/expressions.rst:983 +msgid "" +"To show how subscription works, we can define a custom object that " +"implements :meth:`~object.__getitem__` and prints out the value of the " +"subscript::" msgstr "" -#: ../../reference/expressions.rst:977 +#: ../../reference/expressions.rst:987 msgid "" -"For built-in objects, there are two types of objects that support " -"subscription via :meth:`~object.__getitem__`:" +">>> class SubscriptionDemo:\n" +"... def __getitem__(self, key):\n" +"... print(f'subscripted with: {key!r}')\n" +"...\n" +">>> demo = SubscriptionDemo()\n" +">>> demo[1]\n" +"subscripted with: 1\n" +">>> demo['a' * 3]\n" +"subscripted with: 'aaa'" msgstr "" -#: ../../reference/expressions.rst:980 +#: ../../reference/expressions.rst:997 msgid "" -"Mappings. If the primary is a :term:`mapping`, the expression list must " -"evaluate to an object whose value is one of the keys of the mapping, and the " -"subscription selects the value in the mapping that corresponds to that key. " -"An example of a builtin mapping class is the :class:`dict` class." +"See :meth:`~object.__getitem__` documentation for how built-in types handle " +"subscription." msgstr "" -#: ../../reference/expressions.rst:984 +#: ../../reference/expressions.rst:1000 msgid "" -"Sequences. If the primary is a :term:`sequence`, the expression list must " -"evaluate to an :class:`int` or a :class:`slice` (as discussed in the " -"following section). Examples of builtin sequence classes include the :class:" -"`str`, :class:`list` and :class:`tuple` classes." +"Subscriptions may also be used as targets in :ref:`assignment ` " +"or :ref:`deletion ` statements. In these cases, the interpreter will " +"call the subscripted object's :meth:`~object.__setitem__` or :meth:`~object." +"__delitem__` :term:`special method`, respectively, instead of :meth:`~object." +"__getitem__`." msgstr "" -#: ../../reference/expressions.rst:989 +#: ../../reference/expressions.rst:1006 msgid "" -"The formal syntax makes no special provision for negative indices in :term:" -"`sequences `. However, built-in sequences all provide a :meth:" -"`~object.__getitem__` method that interprets negative indices by adding the " -"length of the sequence to the index so that, for example, ``x[-1]`` selects " -"the last item of ``x``. The resulting value must be a nonnegative integer " -"less than the number of items in the sequence, and the subscription selects " -"the item whose index is that value (counting from zero). Since the support " -"for negative indices and slicing occurs in the object's :meth:`~object." -"__getitem__` method, subclasses overriding this method will need to " -"explicitly add that support." +">>> colors = ['red', 'blue', 'green', 'black']\n" +">>> colors[3] = 'white' # Setting item at index\n" +">>> colors\n" +"['red', 'blue', 'green', 'white']\n" +">>> del colors[3] # Deleting item at index 3\n" +">>> colors\n" +"['red', 'blue', 'green']" msgstr "" -#: ../../reference/expressions.rst:1003 +#: ../../reference/expressions.rst:1016 msgid "" -"A :class:`string ` is a special kind of sequence whose items are " -"*characters*. A character is not a separate data type but a string of " -"exactly one character." +"All advanced forms of *subscript* documented in the following sections are " +"also usable for assignment and deletion." msgstr "" -#: ../../reference/expressions.rst:1011 +#: ../../reference/expressions.rst:1035 msgid "Slicings" msgstr "" -#: ../../reference/expressions.rst:1025 +#: ../../reference/expressions.rst:1037 +msgid "" +"A more advanced form of subscription, :dfn:`slicing`, is commonly used to " +"extract a portion of a :ref:`sequence `. In this form, " +"the subscript is a :term:`slice`: up to three expressions separated by " +"colons. Any of the expressions may be omitted, but a slice must contain at " +"least one colon::" +msgstr "" + +#: ../../reference/expressions.rst:1044 +msgid "" +">>> number_names = ['zero', 'one', 'two', 'three', 'four', 'five']\n" +">>> number_names[1:3]\n" +"['one', 'two']\n" +">>> number_names[1:]\n" +"['one', 'two', 'three', 'four', 'five']\n" +">>> number_names[:3]\n" +"['zero', 'one', 'two']\n" +">>> number_names[:]\n" +"['zero', 'one', 'two', 'three', 'four', 'five']\n" +">>> number_names[::2]\n" +"['zero', 'two', 'four']\n" +">>> number_names[:-3]\n" +"['zero', 'one', 'two']\n" +">>> del number_names[4:]\n" +">>> number_names\n" +"['zero', 'one', 'two', 'three']" +msgstr "" + +#: ../../reference/expressions.rst:1061 +msgid "" +"When a slice is evaluated, the interpreter constructs a :class:`slice` " +"object whose :attr:`~slice.start`, :attr:`~slice.stop` and :attr:`~slice." +"step` attributes, respectively, are the results of the expressions between " +"the colons. Any missing expression evaluates to :const:`None`. This :class:`!" +"slice` object is then passed to the :meth:`~object.__getitem__` or :meth:" +"`~object.__class_getitem__` :term:`special method`, as above. ::" +msgstr "" + +#: ../../reference/expressions.rst:1069 +msgid "" +"# continuing with the SubscriptionDemo instance defined above:\n" +">>> demo[2:3]\n" +"subscripted with: slice(2, 3, None)\n" +">>> demo[::'spam']\n" +"subscripted with: slice(None, None, 'spam')" +msgstr "" + +#: ../../reference/expressions.rst:1077 +msgid "Comma-separated subscripts" +msgstr "" + +#: ../../reference/expressions.rst:1079 +msgid "" +"The subscript can also be given as two or more comma-separated expressions " +"or slices::" +msgstr "" + +#: ../../reference/expressions.rst:1082 +msgid "" +"# continuing with the SubscriptionDemo instance defined above:\n" +">>> demo[1, 2, 3]\n" +"subscripted with: (1, 2, 3)\n" +">>> demo[1:2, 3]\n" +"subscripted with: (slice(1, 2, None), 3)" +msgstr "" + +#: ../../reference/expressions.rst:1088 +msgid "" +"This form is commonly used with numerical libraries for slicing multi-" +"dimensional data. In this case, the interpreter constructs a :class:`tuple` " +"of the results of the expressions or slices, and passes this tuple to the :" +"meth:`~object.__getitem__` or :meth:`~object.__class_getitem__` :term:" +"`special method`, as above." +msgstr "" + +#: ../../reference/expressions.rst:1094 +msgid "" +"The subscript may also be given as a single expression or slice followed by " +"a comma, to specify a one-element tuple::" +msgstr "" + +#: ../../reference/expressions.rst:1097 +msgid "" +">>> demo['spam',]\n" +"subscripted with: ('spam',)" +msgstr "" + +#: ../../reference/expressions.rst:1102 +#, fuzzy +msgid "\"Starred\" subscriptions" +msgstr "subscription(下標)" + +#: ../../reference/expressions.rst:1104 +msgid "Expressions in *tuple_slices* may be starred. See :pep:`646`." +msgstr "" + +#: ../../reference/expressions.rst:1107 +msgid "" +"The subscript can also contain a starred expression. In this case, the " +"interpreter unpacks the result into a tuple, and passes this tuple to :meth:" +"`~object.__getitem__` or :meth:`~object.__class_getitem__`::" +msgstr "" + +#: ../../reference/expressions.rst:1111 msgid "" -"A slicing selects a range of items in a sequence object (e.g., a string, " -"tuple or list). Slicings may be used as expressions or as targets in " -"assignment or :keyword:`del` statements. The syntax for a slicing:" +"# continuing with the SubscriptionDemo instance defined above:\n" +">>> demo[*range(10)]\n" +"subscripted with: (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)" msgstr "" -#: ../../reference/expressions.rst:1038 +#: ../../reference/expressions.rst:1115 msgid "" -"There is ambiguity in the formal syntax here: anything that looks like an " -"expression list also looks like a slice list, so any subscription can be " -"interpreted as a slicing. Rather than further complicating the syntax, this " -"is disambiguated by defining that in this case the interpretation as a " -"subscription takes priority over the interpretation as a slicing (this is " -"the case if the slice list contains no proper slice)." +"Starred expressions may be combined with comma-separated expressions and " +"slices::" msgstr "" -#: ../../reference/expressions.rst:1050 +#: ../../reference/expressions.rst:1118 msgid "" -"The semantics for a slicing are as follows. The primary is indexed (using " -"the same :meth:`~object.__getitem__` method as normal subscription) with a " -"key that is constructed from the slice list, as follows. If the slice list " -"contains at least one comma, the key is a tuple containing the conversion of " -"the slice items; otherwise, the conversion of the lone slice item is the " -"key. The conversion of a slice item that is an expression is that " -"expression. The conversion of a proper slice is a slice object (see " -"section :ref:`types`) whose :attr:`~slice.start`, :attr:`~slice.stop` and :" -"attr:`~slice.step` attributes are the values of the expressions given as " -"lower bound, upper bound and stride, respectively, substituting ``None`` for " -"missing expressions." +">>> demo['a', 'b', *range(3), 'c']\n" +"subscripted with: ('a', 'b', 0, 1, 2, 'c')" msgstr "" -#: ../../reference/expressions.rst:1074 +#: ../../reference/expressions.rst:1123 +#, fuzzy +msgid "Formal subscription grammar" +msgstr "subscription(下標)" + +#: ../../reference/expressions.rst:1134 +msgid "" +"Recall that the ``|`` operator :ref:`denotes ordered choice `. " +"Specifically, in :token:`!subscript`, if both alternatives would match, the " +"first (:token:`!single_subscript`) has priority." +msgstr "" + +#: ../../reference/expressions.rst:1149 msgid "Calls" msgstr "" -#: ../../reference/expressions.rst:1076 +#: ../../reference/expressions.rst:1151 msgid "" "A call calls a callable object (e.g., a :term:`function`) with a possibly " "empty series of :term:`arguments `:" msgstr "" -#: ../../reference/expressions.rst:1093 +#: ../../reference/expressions.rst:1168 msgid "" "An optional trailing comma may be present after the positional and keyword " "arguments but does not affect the semantics." msgstr "" -#: ../../reference/expressions.rst:1099 +#: ../../reference/expressions.rst:1174 msgid "" "The primary must evaluate to a callable object (user-defined functions, " "built-in functions, methods of built-in objects, class objects, methods of " @@ -1245,7 +1369,7 @@ msgid "" "formal :term:`parameter` lists." msgstr "" -#: ../../reference/expressions.rst:1107 +#: ../../reference/expressions.rst:1182 msgid "" "If keyword arguments are present, they are first converted to positional " "arguments, as follows. First, a list of unfilled slots is created for the " @@ -1266,7 +1390,7 @@ msgid "" "filled slots is used as the argument list for the call." msgstr "" -#: ../../reference/expressions.rst:1127 +#: ../../reference/expressions.rst:1202 msgid "" "An implementation may provide built-in functions whose positional parameters " "do not have names, even if they are 'named' for the purpose of " @@ -1275,7 +1399,7 @@ msgid "" "`PyArg_ParseTuple` to parse their arguments." msgstr "" -#: ../../reference/expressions.rst:1133 +#: ../../reference/expressions.rst:1208 msgid "" "If there are more positional arguments than there are formal parameter " "slots, a :exc:`TypeError` exception is raised, unless a formal parameter " @@ -1284,7 +1408,7 @@ msgid "" "empty tuple if there were no excess positional arguments)." msgstr "" -#: ../../reference/expressions.rst:1139 +#: ../../reference/expressions.rst:1214 msgid "" "If any keyword argument does not correspond to a formal parameter name, a :" "exc:`TypeError` exception is raised, unless a formal parameter using the " @@ -1294,7 +1418,7 @@ msgid "" "(new) empty dictionary if there were no excess keyword arguments." msgstr "" -#: ../../reference/expressions.rst:1150 +#: ../../reference/expressions.rst:1225 msgid "" "If the syntax ``*expression`` appears in the function call, ``expression`` " "must evaluate to an :term:`iterable`. Elements from these iterables are " @@ -1304,14 +1428,14 @@ msgid "" "*y1*, ..., *yM*, *x3*, *x4*." msgstr "" -#: ../../reference/expressions.rst:1157 +#: ../../reference/expressions.rst:1232 msgid "" "A consequence of this is that although the ``*expression`` syntax may appear " "*after* explicit keyword arguments, it is processed *before* the keyword " "arguments (and any ``**expression`` arguments -- see below). So::" msgstr "" -#: ../../reference/expressions.rst:1161 +#: ../../reference/expressions.rst:1236 msgid "" ">>> def f(a, b):\n" "... print(a, b)\n" @@ -1337,13 +1461,13 @@ msgstr "" ">>> f(1, *(2,))\n" "1 2" -#: ../../reference/expressions.rst:1173 +#: ../../reference/expressions.rst:1248 msgid "" "It is unusual for both keyword arguments and the ``*expression`` syntax to " "be used in the same call, so in practice this confusion does not often arise." msgstr "" -#: ../../reference/expressions.rst:1179 +#: ../../reference/expressions.rst:1254 msgid "" "If the syntax ``**expression`` appears in the function call, ``expression`` " "must evaluate to a :term:`mapping`, the contents of which are treated as " @@ -1352,7 +1476,7 @@ msgid "" "a :exc:`TypeError` exception is raised." msgstr "" -#: ../../reference/expressions.rst:1185 +#: ../../reference/expressions.rst:1260 msgid "" "When ``**expression`` is used, each key in this mapping must be a string. " "Each value from the mapping is assigned to the first formal parameter " @@ -1364,35 +1488,35 @@ msgid "" "is raised." msgstr "" -#: ../../reference/expressions.rst:1195 +#: ../../reference/expressions.rst:1270 msgid "" "Formal parameters using the syntax ``*identifier`` or ``**identifier`` " "cannot be used as positional argument slots or as keyword argument names." msgstr "" -#: ../../reference/expressions.rst:1198 +#: ../../reference/expressions.rst:1273 msgid "" "Function calls accept any number of ``*`` and ``**`` unpackings, positional " "arguments may follow iterable unpackings (``*``), and keyword arguments may " "follow dictionary unpackings (``**``). Originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:1204 +#: ../../reference/expressions.rst:1279 msgid "" "A call always returns some value, possibly ``None``, unless it raises an " "exception. How this value is computed depends on the type of the callable " "object." msgstr "" -#: ../../reference/expressions.rst:1208 +#: ../../reference/expressions.rst:1283 msgid "If it is---" msgstr "" -#: ../../reference/expressions.rst:1210 +#: ../../reference/expressions.rst:1285 msgid "a user-defined function:" msgstr "" -#: ../../reference/expressions.rst:1217 +#: ../../reference/expressions.rst:1292 msgid "" "The code block for the function is executed, passing it the argument list. " "The first thing the code block will do is bind the formal parameters to the " @@ -1403,73 +1527,73 @@ msgid "" "``None``." msgstr "" -#: ../../reference/expressions.rst:1224 +#: ../../reference/expressions.rst:1299 msgid "a built-in function or method:" msgstr "" -#: ../../reference/expressions.rst:1235 +#: ../../reference/expressions.rst:1310 msgid "" "The result is up to the interpreter; see :ref:`built-in-funcs` for the " "descriptions of built-in functions and methods." msgstr "" -#: ../../reference/expressions.rst:1238 +#: ../../reference/expressions.rst:1313 msgid "a class object:" msgstr "" -#: ../../reference/expressions.rst:1243 +#: ../../reference/expressions.rst:1318 msgid "A new instance of that class is returned." msgstr "" -#: ../../reference/expressions.rst:1245 +#: ../../reference/expressions.rst:1320 msgid "a class instance method:" msgstr "" -#: ../../reference/expressions.rst:1251 +#: ../../reference/expressions.rst:1326 msgid "" "The corresponding user-defined function is called, with an argument list " "that is one longer than the argument list of the call: the instance becomes " "the first argument." msgstr "" -#: ../../reference/expressions.rst:1255 +#: ../../reference/expressions.rst:1330 msgid "a class instance:" msgstr "" -#: ../../reference/expressions.rst:1260 +#: ../../reference/expressions.rst:1335 msgid "" "The class must define a :meth:`~object.__call__` method; the effect is then " "the same as if that method was called." msgstr "" -#: ../../reference/expressions.rst:1268 ../../reference/expressions.rst:2082 +#: ../../reference/expressions.rst:1343 ../../reference/expressions.rst:2157 msgid "Await expression" msgstr "" -#: ../../reference/expressions.rst:1270 +#: ../../reference/expressions.rst:1345 msgid "" "Suspend the execution of :term:`coroutine` on an :term:`awaitable` object. " "Can only be used inside a :term:`coroutine function`." msgstr "" -#: ../../reference/expressions.rst:1282 +#: ../../reference/expressions.rst:1357 msgid "The power operator" msgstr "" -#: ../../reference/expressions.rst:1288 +#: ../../reference/expressions.rst:1363 msgid "" "The power operator binds more tightly than unary operators on its left; it " "binds less tightly than unary operators on its right. The syntax is:" msgstr "" -#: ../../reference/expressions.rst:1294 +#: ../../reference/expressions.rst:1369 msgid "" "Thus, in an unparenthesized sequence of power and unary operators, the " "operators are evaluated from right to left (this does not constrain the " "evaluation order for the operands): ``-1**2`` results in ``-1``." msgstr "" -#: ../../reference/expressions.rst:1298 +#: ../../reference/expressions.rst:1373 msgid "" "The power operator has the same semantics as the built-in :func:`pow` " "function, when called with two arguments: it yields its left argument raised " @@ -1477,7 +1601,7 @@ msgid "" "converted to a common type, and the result is of that type." msgstr "" -#: ../../reference/expressions.rst:1303 +#: ../../reference/expressions.rst:1378 msgid "" "For int operands, the result has the same type as the operands unless the " "second argument is negative; in that case, all arguments are converted to " @@ -1485,41 +1609,41 @@ msgid "" "``100``, but ``10**-2`` returns ``0.01``." msgstr "" -#: ../../reference/expressions.rst:1308 +#: ../../reference/expressions.rst:1383 msgid "" "Raising ``0.0`` to a negative power results in a :exc:`ZeroDivisionError`. " "Raising a negative number to a fractional power results in a :class:" "`complex` number. (In earlier versions it raised a :exc:`ValueError`.)" msgstr "" -#: ../../reference/expressions.rst:1312 +#: ../../reference/expressions.rst:1387 msgid "" "This operation can be customized using the special :meth:`~object.__pow__` " "and :meth:`~object.__rpow__` methods." msgstr "" -#: ../../reference/expressions.rst:1318 +#: ../../reference/expressions.rst:1393 msgid "Unary arithmetic and bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1324 +#: ../../reference/expressions.rst:1399 msgid "All unary arithmetic and bitwise operations have the same priority:" msgstr "" -#: ../../reference/expressions.rst:1335 +#: ../../reference/expressions.rst:1410 msgid "" "The unary ``-`` (minus) operator yields the negation of its numeric " "argument; the operation can be overridden with the :meth:`~object.__neg__` " "special method." msgstr "" -#: ../../reference/expressions.rst:1343 +#: ../../reference/expressions.rst:1418 msgid "" "The unary ``+`` (plus) operator yields its numeric argument unchanged; the " "operation can be overridden with the :meth:`~object.__pos__` special method." msgstr "" -#: ../../reference/expressions.rst:1350 +#: ../../reference/expressions.rst:1425 msgid "" "The unary ``~`` (invert) operator yields the bitwise inversion of its " "integer argument. The bitwise inversion of ``x`` is defined as ``-(x+1)``. " @@ -1527,17 +1651,17 @@ msgid "" "meth:`~object.__invert__` special method." msgstr "" -#: ../../reference/expressions.rst:1359 +#: ../../reference/expressions.rst:1434 msgid "" "In all three cases, if the argument does not have the proper type, a :exc:" "`TypeError` exception is raised." msgstr "" -#: ../../reference/expressions.rst:1366 +#: ../../reference/expressions.rst:1441 msgid "Binary arithmetic operations" msgstr "" -#: ../../reference/expressions.rst:1370 +#: ../../reference/expressions.rst:1445 msgid "" "The binary arithmetic operations have the conventional priority levels. " "Note that some of these operations also apply to certain non-numeric types. " @@ -1545,7 +1669,7 @@ msgid "" "multiplicative operators and one for additive operators:" msgstr "" -#: ../../reference/expressions.rst:1385 +#: ../../reference/expressions.rst:1460 msgid "" "The ``*`` (multiplication) operator yields the product of its arguments. " "The arguments must either both be numbers, or one argument must be an " @@ -1555,32 +1679,32 @@ msgid "" "yields an empty sequence." msgstr "" -#: ../../reference/expressions.rst:1391 +#: ../../reference/expressions.rst:1466 msgid "" "This operation can be customized using the special :meth:`~object.__mul__` " "and :meth:`~object.__rmul__` methods." msgstr "" -#: ../../reference/expressions.rst:1394 ../../reference/expressions.rst:1471 -#: ../../reference/expressions.rst:1486 +#: ../../reference/expressions.rst:1469 ../../reference/expressions.rst:1546 +#: ../../reference/expressions.rst:1561 msgid "" "If only one operand is a complex number, the other operand is converted to a " "floating-point number." msgstr "" -#: ../../reference/expressions.rst:1402 +#: ../../reference/expressions.rst:1477 msgid "" "The ``@`` (at) operator is intended to be used for matrix multiplication. " "No builtin Python types implement this operator." msgstr "" -#: ../../reference/expressions.rst:1405 +#: ../../reference/expressions.rst:1480 msgid "" "This operation can be customized using the special :meth:`~object." "__matmul__` and :meth:`~object.__rmatmul__` methods." msgstr "" -#: ../../reference/expressions.rst:1416 +#: ../../reference/expressions.rst:1491 msgid "" "The ``/`` (division) and ``//`` (floor division) operators yield the " "quotient of their arguments. The numeric arguments are first converted to a " @@ -1590,7 +1714,7 @@ msgid "" "the :exc:`ZeroDivisionError` exception." msgstr "" -#: ../../reference/expressions.rst:1423 +#: ../../reference/expressions.rst:1498 msgid "" "The division operation can be customized using the special :meth:`~object." "__truediv__` and :meth:`~object.__rtruediv__` methods. The floor division " @@ -1598,7 +1722,7 @@ msgid "" "and :meth:`~object.__rfloordiv__` methods." msgstr "" -#: ../../reference/expressions.rst:1432 +#: ../../reference/expressions.rst:1507 msgid "" "The ``%`` (modulo) operator yields the remainder from the division of the " "first argument by the second. The numeric arguments are first converted to " @@ -1610,7 +1734,7 @@ msgid "" "absolute value of the second operand [#]_." msgstr "" -#: ../../reference/expressions.rst:1441 +#: ../../reference/expressions.rst:1516 msgid "" "The floor division and modulo operators are connected by the following " "identity: ``x == (x//y)*y + (x%y)``. Floor division and modulo are also " @@ -1618,7 +1742,7 @@ msgid "" "y, x%y)``. [#]_." msgstr "" -#: ../../reference/expressions.rst:1446 +#: ../../reference/expressions.rst:1521 msgid "" "In addition to performing the modulo operation on numbers, the ``%`` " "operator is also overloaded by string objects to perform old-style string " @@ -1627,20 +1751,20 @@ msgid "" "formatting`." msgstr "" -#: ../../reference/expressions.rst:1451 +#: ../../reference/expressions.rst:1526 msgid "" "The *modulo* operation can be customized using the special :meth:`~object." "__mod__` and :meth:`~object.__rmod__` methods." msgstr "" -#: ../../reference/expressions.rst:1454 +#: ../../reference/expressions.rst:1529 msgid "" "The floor division operator, the modulo operator, and the :func:`divmod` " "function are not defined for complex numbers. Instead, convert to a " "floating-point number using the :func:`abs` function if appropriate." msgstr "" -#: ../../reference/expressions.rst:1463 +#: ../../reference/expressions.rst:1538 msgid "" "The ``+`` (addition) operator yields the sum of its arguments. The " "arguments must either both be numbers or both be sequences of the same " @@ -1648,40 +1772,40 @@ msgid "" "and then added together. In the latter case, the sequences are concatenated." msgstr "" -#: ../../reference/expressions.rst:1468 +#: ../../reference/expressions.rst:1543 msgid "" "This operation can be customized using the special :meth:`~object.__add__` " "and :meth:`~object.__radd__` methods." msgstr "" -#: ../../reference/expressions.rst:1480 +#: ../../reference/expressions.rst:1555 msgid "" "The ``-`` (subtraction) operator yields the difference of its arguments. " "The numeric arguments are first converted to a common real type." msgstr "" -#: ../../reference/expressions.rst:1483 +#: ../../reference/expressions.rst:1558 msgid "" "This operation can be customized using the special :meth:`~object.__sub__` " "and :meth:`~object.__rsub__` methods." msgstr "" -#: ../../reference/expressions.rst:1494 +#: ../../reference/expressions.rst:1569 msgid "Shifting operations" msgstr "" -#: ../../reference/expressions.rst:1501 +#: ../../reference/expressions.rst:1576 msgid "" "The shifting operations have lower priority than the arithmetic operations:" msgstr "" -#: ../../reference/expressions.rst:1506 +#: ../../reference/expressions.rst:1581 msgid "" "These operators accept integers as arguments. They shift the first argument " "to the left or right by the number of bits given by the second argument." msgstr "" -#: ../../reference/expressions.rst:1509 +#: ../../reference/expressions.rst:1584 msgid "" "The left shift operation can be customized using the special :meth:`~object." "__lshift__` and :meth:`~object.__rlshift__` methods. The right shift " @@ -1689,46 +1813,46 @@ msgid "" "and :meth:`~object.__rrshift__` methods." msgstr "" -#: ../../reference/expressions.rst:1516 +#: ../../reference/expressions.rst:1591 msgid "" "A right shift by *n* bits is defined as floor division by ``pow(2,n)``. A " "left shift by *n* bits is defined as multiplication with ``pow(2,n)``." msgstr "" -#: ../../reference/expressions.rst:1523 +#: ../../reference/expressions.rst:1598 msgid "Binary bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1527 +#: ../../reference/expressions.rst:1602 msgid "Each of the three bitwise operations has a different priority level:" msgstr "" -#: ../../reference/expressions.rst:1538 +#: ../../reference/expressions.rst:1613 msgid "" "The ``&`` operator yields the bitwise AND of its arguments, which must be " "integers or one of them must be a custom object overriding :meth:`~object." "__and__` or :meth:`~object.__rand__` special methods." msgstr "" -#: ../../reference/expressions.rst:1547 +#: ../../reference/expressions.rst:1622 msgid "" "The ``^`` operator yields the bitwise XOR (exclusive OR) of its arguments, " "which must be integers or one of them must be a custom object overriding :" "meth:`~object.__xor__` or :meth:`~object.__rxor__` special methods." msgstr "" -#: ../../reference/expressions.rst:1556 +#: ../../reference/expressions.rst:1631 msgid "" "The ``|`` operator yields the bitwise (inclusive) OR of its arguments, which " "must be integers or one of them must be a custom object overriding :meth:" "`~object.__or__` or :meth:`~object.__ror__` special methods." msgstr "" -#: ../../reference/expressions.rst:1564 +#: ../../reference/expressions.rst:1639 msgid "Comparisons" msgstr "" -#: ../../reference/expressions.rst:1576 +#: ../../reference/expressions.rst:1651 msgid "" "Unlike C, all comparison operations in Python have the same priority, which " "is lower than that of any arithmetic, shifting or bitwise operation. Also " @@ -1736,14 +1860,14 @@ msgid "" "conventional in mathematics:" msgstr "" -#: ../../reference/expressions.rst:1586 +#: ../../reference/expressions.rst:1661 msgid "" "Comparisons yield boolean values: ``True`` or ``False``. Custom :dfn:`rich " "comparison methods` may return non-boolean values. In this case Python will " "call :func:`bool` on such value in boolean contexts." msgstr "" -#: ../../reference/expressions.rst:1592 +#: ../../reference/expressions.rst:1667 msgid "" "Comparisons can be chained arbitrarily, e.g., ``x < y <= z`` is equivalent " "to ``x < y and y <= z``, except that ``y`` is evaluated only once (but in " @@ -1751,7 +1875,7 @@ msgid "" "false)." msgstr "" -#: ../../reference/expressions.rst:1596 +#: ../../reference/expressions.rst:1671 msgid "" "Formally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*, " "*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y opN " @@ -1759,24 +1883,24 @@ msgid "" "each expression is evaluated at most once." msgstr "" -#: ../../reference/expressions.rst:1601 +#: ../../reference/expressions.rst:1676 msgid "" "Note that ``a op1 b op2 c`` doesn't imply any kind of comparison between *a* " "and *c*, so that, e.g., ``x < y > z`` is perfectly legal (though perhaps not " "pretty)." msgstr "" -#: ../../reference/expressions.rst:1608 +#: ../../reference/expressions.rst:1683 msgid "Value comparisons" msgstr "" -#: ../../reference/expressions.rst:1610 +#: ../../reference/expressions.rst:1685 msgid "" "The operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare the " "values of two objects. The objects do not need to have the same type." msgstr "" -#: ../../reference/expressions.rst:1613 +#: ../../reference/expressions.rst:1688 msgid "" "Chapter :ref:`objects` states that objects have a value (in addition to type " "and identity). The value of an object is a rather abstract notion in " @@ -1788,7 +1912,7 @@ msgid "" "indirectly, by means of their comparison implementation." msgstr "" -#: ../../reference/expressions.rst:1622 +#: ../../reference/expressions.rst:1697 msgid "" "Because all types are (direct or indirect) subtypes of :class:`object`, they " "inherit the default comparison behavior from :class:`object`. Types can " @@ -1796,7 +1920,7 @@ msgid "" "methods` like :meth:`~object.__lt__`, described in :ref:`customization`." msgstr "" -#: ../../reference/expressions.rst:1628 +#: ../../reference/expressions.rst:1703 msgid "" "The default behavior for equality comparison (``==`` and ``!=``) is based on " "the identity of the objects. Hence, equality comparison of instances with " @@ -1806,14 +1930,14 @@ msgid "" "``x is y`` implies ``x == y``)." msgstr "" -#: ../../reference/expressions.rst:1635 +#: ../../reference/expressions.rst:1710 msgid "" "A default order comparison (``<``, ``>``, ``<=``, and ``>=``) is not " "provided; an attempt raises :exc:`TypeError`. A motivation for this default " "behavior is the lack of a similar invariant as for equality." msgstr "" -#: ../../reference/expressions.rst:1639 +#: ../../reference/expressions.rst:1714 msgid "" "The behavior of the default equality comparison, that instances with " "different identities are always unequal, may be in contrast to what types " @@ -1822,13 +1946,13 @@ msgid "" "in fact, a number of built-in types have done that." msgstr "" -#: ../../reference/expressions.rst:1645 +#: ../../reference/expressions.rst:1720 msgid "" "The following list describes the comparison behavior of the most important " "built-in types." msgstr "" -#: ../../reference/expressions.rst:1648 +#: ../../reference/expressions.rst:1723 msgid "" "Numbers of built-in numeric types (:ref:`typesnumeric`) and of the standard " "library types :class:`fractions.Fraction` and :class:`decimal.Decimal` can " @@ -1838,7 +1962,7 @@ msgid "" "of precision." msgstr "" -#: ../../reference/expressions.rst:1655 +#: ../../reference/expressions.rst:1730 msgid "" "The not-a-number values ``float('NaN')`` and ``decimal.Decimal('NaN')`` are " "special. Any ordered comparison of a number to a not-a-number value is " @@ -1848,32 +1972,32 @@ msgid "" "is compliant with IEEE 754." msgstr "" -#: ../../reference/expressions.rst:1662 +#: ../../reference/expressions.rst:1737 msgid "" "``None`` and :data:`NotImplemented` are singletons. :PEP:`8` advises that " "comparisons for singletons should always be done with ``is`` or ``is not``, " "never the equality operators." msgstr "" -#: ../../reference/expressions.rst:1666 +#: ../../reference/expressions.rst:1741 msgid "" "Binary sequences (instances of :class:`bytes` or :class:`bytearray`) can be " "compared within and across their types. They compare lexicographically " "using the numeric values of their elements." msgstr "" -#: ../../reference/expressions.rst:1670 +#: ../../reference/expressions.rst:1745 msgid "" "Strings (instances of :class:`str`) compare lexicographically using the " "numerical Unicode code points (the result of the built-in function :func:" "`ord`) of their characters. [#]_" msgstr "" -#: ../../reference/expressions.rst:1674 +#: ../../reference/expressions.rst:1749 msgid "Strings and binary sequences cannot be directly compared." msgstr "" -#: ../../reference/expressions.rst:1676 +#: ../../reference/expressions.rst:1751 msgid "" "Sequences (instances of :class:`tuple`, :class:`list`, or :class:`range`) " "can be compared only within each of their types, with the restriction that " @@ -1882,7 +2006,7 @@ msgid "" "raises :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1682 +#: ../../reference/expressions.rst:1757 msgid "" "Sequences compare lexicographically using comparison of corresponding " "elements. The built-in containers typically assume identical objects are " @@ -1890,19 +2014,19 @@ msgid "" "objects to improve performance and to maintain their internal invariants." msgstr "" -#: ../../reference/expressions.rst:1687 +#: ../../reference/expressions.rst:1762 msgid "" "Lexicographical comparison between built-in collections works as follows:" msgstr "" -#: ../../reference/expressions.rst:1689 +#: ../../reference/expressions.rst:1764 msgid "" "For two collections to compare equal, they must be of the same type, have " "the same length, and each pair of corresponding elements must compare equal " "(for example, ``[1,2] == (1,2)`` is false because the type is not the same)." msgstr "" -#: ../../reference/expressions.rst:1694 +#: ../../reference/expressions.rst:1769 msgid "" "Collections that support order comparison are ordered the same as their " "first unequal elements (for example, ``[1,2,x] <= [1,2,y]`` has the same " @@ -1911,25 +2035,25 @@ msgid "" "true)." msgstr "" -#: ../../reference/expressions.rst:1700 +#: ../../reference/expressions.rst:1775 msgid "" "Mappings (instances of :class:`dict`) compare equal if and only if they have " "equal ``(key, value)`` pairs. Equality comparison of the keys and values " "enforces reflexivity." msgstr "" -#: ../../reference/expressions.rst:1704 +#: ../../reference/expressions.rst:1779 msgid "" "Order comparisons (``<``, ``>``, ``<=``, and ``>=``) raise :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1706 +#: ../../reference/expressions.rst:1781 msgid "" "Sets (instances of :class:`set` or :class:`frozenset`) can be compared " "within and across their types." msgstr "" -#: ../../reference/expressions.rst:1709 +#: ../../reference/expressions.rst:1784 msgid "" "They define order comparison operators to mean subset and superset tests. " "Those relations do not define total orderings (for example, the two sets " @@ -1940,110 +2064,110 @@ msgid "" "sets as inputs)." msgstr "" -#: ../../reference/expressions.rst:1717 +#: ../../reference/expressions.rst:1792 msgid "Comparison of sets enforces reflexivity of its elements." msgstr "" -#: ../../reference/expressions.rst:1719 +#: ../../reference/expressions.rst:1794 msgid "" "Most other built-in types have no comparison methods implemented, so they " "inherit the default comparison behavior." msgstr "" -#: ../../reference/expressions.rst:1722 +#: ../../reference/expressions.rst:1797 msgid "" "User-defined classes that customize their comparison behavior should follow " "some consistency rules, if possible:" msgstr "" -#: ../../reference/expressions.rst:1725 +#: ../../reference/expressions.rst:1800 msgid "" "Equality comparison should be reflexive. In other words, identical objects " "should compare equal:" msgstr "" -#: ../../reference/expressions.rst:1728 +#: ../../reference/expressions.rst:1803 msgid "``x is y`` implies ``x == y``" msgstr "" -#: ../../reference/expressions.rst:1730 +#: ../../reference/expressions.rst:1805 msgid "" "Comparison should be symmetric. In other words, the following expressions " "should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1733 +#: ../../reference/expressions.rst:1808 msgid "``x == y`` and ``y == x``" msgstr "``x == y`` 和 ``y == x``" -#: ../../reference/expressions.rst:1735 +#: ../../reference/expressions.rst:1810 msgid "``x != y`` and ``y != x``" msgstr "``x != y`` 和 ``y != x``" -#: ../../reference/expressions.rst:1737 +#: ../../reference/expressions.rst:1812 msgid "``x < y`` and ``y > x``" msgstr "``x < y`` 和 ``y > x``" -#: ../../reference/expressions.rst:1739 +#: ../../reference/expressions.rst:1814 msgid "``x <= y`` and ``y >= x``" msgstr "``x <= y`` 和 ``y >= x``" -#: ../../reference/expressions.rst:1741 +#: ../../reference/expressions.rst:1816 msgid "" "Comparison should be transitive. The following (non-exhaustive) examples " "illustrate that:" msgstr "" -#: ../../reference/expressions.rst:1744 +#: ../../reference/expressions.rst:1819 msgid "``x > y and y > z`` implies ``x > z``" msgstr "``x > y and y > z`` 暗示了 ``x > z``" -#: ../../reference/expressions.rst:1746 +#: ../../reference/expressions.rst:1821 msgid "``x < y and y <= z`` implies ``x < z``" msgstr "``x < y and y <= z`` 暗示了 ``x < z``" -#: ../../reference/expressions.rst:1748 +#: ../../reference/expressions.rst:1823 msgid "" "Inverse comparison should result in the boolean negation. In other words, " "the following expressions should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1751 +#: ../../reference/expressions.rst:1826 msgid "``x == y`` and ``not x != y``" msgstr "``x == y`` 和 ``not x != y``" -#: ../../reference/expressions.rst:1753 +#: ../../reference/expressions.rst:1828 msgid "``x < y`` and ``not x >= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1755 +#: ../../reference/expressions.rst:1830 msgid "``x > y`` and ``not x <= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1757 +#: ../../reference/expressions.rst:1832 msgid "" "The last two expressions apply to totally ordered collections (e.g. to " "sequences, but not to sets or mappings). See also the :func:`~functools." "total_ordering` decorator." msgstr "" -#: ../../reference/expressions.rst:1761 +#: ../../reference/expressions.rst:1836 msgid "" "The :func:`hash` result should be consistent with equality. Objects that are " "equal should either have the same hash value, or be marked as unhashable." msgstr "" -#: ../../reference/expressions.rst:1765 +#: ../../reference/expressions.rst:1840 msgid "" "Python does not enforce these consistency rules. In fact, the not-a-number " "values are an example for not following these rules." msgstr "" -#: ../../reference/expressions.rst:1774 +#: ../../reference/expressions.rst:1849 msgid "Membership test operations" msgstr "" -#: ../../reference/expressions.rst:1776 +#: ../../reference/expressions.rst:1851 msgid "" "The operators :keyword:`in` and :keyword:`not in` test for membership. ``x " "in s`` evaluates to ``True`` if *x* is a member of *s*, and ``False`` " @@ -2054,7 +2178,7 @@ msgid "" "expression ``x in y`` is equivalent to ``any(x is e or x == e for e in y)``." msgstr "" -#: ../../reference/expressions.rst:1784 +#: ../../reference/expressions.rst:1859 msgid "" "For the string and bytes types, ``x in y`` is ``True`` if and only if *x* is " "a substring of *y*. An equivalent test is ``y.find(x) != -1``. Empty " @@ -2062,14 +2186,14 @@ msgid "" "``\"\" in \"abc\"`` will return ``True``." msgstr "" -#: ../../reference/expressions.rst:1789 +#: ../../reference/expressions.rst:1864 msgid "" "For user-defined classes which define the :meth:`~object.__contains__` " "method, ``x in y`` returns ``True`` if ``y.__contains__(x)`` returns a true " "value, and ``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1793 +#: ../../reference/expressions.rst:1868 msgid "" "For user-defined classes which do not define :meth:`~object.__contains__` " "but do define :meth:`~object.__iter__`, ``x in y`` is ``True`` if some value " @@ -2078,7 +2202,7 @@ msgid "" "it is as if :keyword:`in` raised that exception." msgstr "" -#: ../../reference/expressions.rst:1799 +#: ../../reference/expressions.rst:1874 msgid "" "Lastly, the old-style iteration protocol is tried: if a class defines :meth:" "`~object.__getitem__`, ``x in y`` is ``True`` if and only if there is a non-" @@ -2087,17 +2211,17 @@ msgid "" "exception is raised, it is as if :keyword:`in` raised that exception)." msgstr "" -#: ../../reference/expressions.rst:1811 +#: ../../reference/expressions.rst:1886 msgid "" "The operator :keyword:`not in` is defined to have the inverse truth value " "of :keyword:`in`." msgstr "" -#: ../../reference/expressions.rst:1824 +#: ../../reference/expressions.rst:1899 msgid "Identity comparisons" msgstr "" -#: ../../reference/expressions.rst:1826 +#: ../../reference/expressions.rst:1901 msgid "" "The operators :keyword:`is` and :keyword:`is not` test for an object's " "identity: ``x is y`` is true if and only if *x* and *y* are the same " @@ -2105,11 +2229,11 @@ msgid "" "``x is not y`` yields the inverse truth value. [#]_" msgstr "" -#: ../../reference/expressions.rst:1838 +#: ../../reference/expressions.rst:1913 msgid "Boolean operations" msgstr "" -#: ../../reference/expressions.rst:1849 +#: ../../reference/expressions.rst:1924 msgid "" "In the context of Boolean operations, and also when expressions are used by " "control flow statements, the following values are interpreted as false: " @@ -2120,25 +2244,25 @@ msgid "" "__bool__` method." msgstr "" -#: ../../reference/expressions.rst:1858 +#: ../../reference/expressions.rst:1933 msgid "" "The operator :keyword:`not` yields ``True`` if its argument is false, " "``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1863 +#: ../../reference/expressions.rst:1938 msgid "" "The expression ``x and y`` first evaluates *x*; if *x* is false, its value " "is returned; otherwise, *y* is evaluated and the resulting value is returned." msgstr "" -#: ../../reference/expressions.rst:1868 +#: ../../reference/expressions.rst:1943 msgid "" "The expression ``x or y`` first evaluates *x*; if *x* is true, its value is " "returned; otherwise, *y* is evaluated and the resulting value is returned." msgstr "" -#: ../../reference/expressions.rst:1871 +#: ../../reference/expressions.rst:1946 msgid "" "Note that neither :keyword:`and` nor :keyword:`or` restrict the value and " "type they return to ``False`` and ``True``, but rather return the last " @@ -2149,11 +2273,11 @@ msgid "" "argument (for example, ``not 'foo'`` produces ``False`` rather than ``''``.)" msgstr "" -#: ../../reference/expressions.rst:1890 +#: ../../reference/expressions.rst:1965 msgid "Assignment expressions" msgstr "" -#: ../../reference/expressions.rst:1895 +#: ../../reference/expressions.rst:1970 msgid "" "An assignment expression (sometimes also called a \"named expression\" or " "\"walrus\") assigns an :token:`~python-grammar:expression` to an :token:" @@ -2161,11 +2285,11 @@ msgid "" "`~python-grammar:expression`." msgstr "" -#: ../../reference/expressions.rst:1900 +#: ../../reference/expressions.rst:1975 msgid "One common use case is when handling matched regular expressions:" msgstr "" -#: ../../reference/expressions.rst:1902 +#: ../../reference/expressions.rst:1977 msgid "" "if matching := pattern.search(data):\n" " do_something(matching)" @@ -2173,11 +2297,11 @@ msgstr "" "if matching := pattern.search(data):\n" " do_something(matching)" -#: ../../reference/expressions.rst:1907 +#: ../../reference/expressions.rst:1982 msgid "Or, when processing a file stream in chunks:" msgstr "" -#: ../../reference/expressions.rst:1909 +#: ../../reference/expressions.rst:1984 msgid "" "while chunk := file.read(9000):\n" " process(chunk)" @@ -2185,7 +2309,7 @@ msgstr "" "while chunk := file.read(9000):\n" " process(chunk)" -#: ../../reference/expressions.rst:1914 +#: ../../reference/expressions.rst:1989 msgid "" "Assignment expressions must be surrounded by parentheses when used as " "expression statements and when used as sub-expressions in slicing, " @@ -2195,37 +2319,37 @@ msgid "" "and ``while`` statements." msgstr "" -#: ../../reference/expressions.rst:1922 +#: ../../reference/expressions.rst:1997 msgid "See :pep:`572` for more details about assignment expressions." msgstr "" -#: ../../reference/expressions.rst:1929 +#: ../../reference/expressions.rst:2004 msgid "Conditional expressions" msgstr "" -#: ../../reference/expressions.rst:1941 +#: ../../reference/expressions.rst:2016 msgid "" "A conditional expression (sometimes called a \"ternary operator\") is an " "alternative to the if-else statement. As it is an expression, it returns a " "value and can appear as a sub-expression." msgstr "" -#: ../../reference/expressions.rst:1945 +#: ../../reference/expressions.rst:2020 msgid "" "The expression ``x if C else y`` first evaluates the condition, *C* rather " "than *x*. If *C* is true, *x* is evaluated and its value is returned; " "otherwise, *y* is evaluated and its value is returned." msgstr "" -#: ../../reference/expressions.rst:1949 +#: ../../reference/expressions.rst:2024 msgid "See :pep:`308` for more details about conditional expressions." msgstr "" -#: ../../reference/expressions.rst:1956 +#: ../../reference/expressions.rst:2031 msgid "Lambdas" msgstr "" -#: ../../reference/expressions.rst:1967 +#: ../../reference/expressions.rst:2042 msgid "" "Lambda expressions (sometimes called lambda forms) are used to create " "anonymous functions. The expression ``lambda parameters: expression`` yields " @@ -2233,7 +2357,7 @@ msgid "" "defined with:" msgstr "" -#: ../../reference/expressions.rst:1971 +#: ../../reference/expressions.rst:2046 msgid "" "def (parameters):\n" " return expression" @@ -2241,25 +2365,25 @@ msgstr "" "def (parameters):\n" " return expression" -#: ../../reference/expressions.rst:1976 +#: ../../reference/expressions.rst:2051 msgid "" "See section :ref:`function` for the syntax of parameter lists. Note that " "functions created with lambda expressions cannot contain statements or " "annotations." msgstr "" -#: ../../reference/expressions.rst:1984 +#: ../../reference/expressions.rst:2059 msgid "Expression lists" msgstr "" -#: ../../reference/expressions.rst:2000 +#: ../../reference/expressions.rst:2075 msgid "" "Except when part of a list or set display, an expression list containing at " "least one comma yields a tuple. The length of the tuple is the number of " "expressions in the list. The expressions are evaluated from left to right." msgstr "" -#: ../../reference/expressions.rst:2009 +#: ../../reference/expressions.rst:2084 msgid "" "An asterisk ``*`` denotes :dfn:`iterable unpacking`. Its operand must be " "an :term:`iterable`. The iterable is expanded into a sequence of items, " @@ -2267,16 +2391,16 @@ msgid "" "unpacking." msgstr "" -#: ../../reference/expressions.rst:2014 +#: ../../reference/expressions.rst:2089 msgid "" "Iterable unpacking in expression lists, originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:2017 +#: ../../reference/expressions.rst:2092 msgid "Any item in an expression list may be starred. See :pep:`646`." msgstr "" -#: ../../reference/expressions.rst:2022 +#: ../../reference/expressions.rst:2097 msgid "" "A trailing comma is required only to create a one-item tuple, such as ``1," "``; it is optional in all other cases. A single expression without a " @@ -2285,24 +2409,24 @@ msgid "" "``()``.)" msgstr "" -#: ../../reference/expressions.rst:2033 +#: ../../reference/expressions.rst:2108 msgid "Evaluation order" msgstr "" -#: ../../reference/expressions.rst:2037 +#: ../../reference/expressions.rst:2112 msgid "" "Python evaluates expressions from left to right. Notice that while " "evaluating an assignment, the right-hand side is evaluated before the left-" "hand side." msgstr "" -#: ../../reference/expressions.rst:2040 +#: ../../reference/expressions.rst:2115 msgid "" "In the following lines, expressions will be evaluated in the arithmetic " "order of their suffixes::" msgstr "" -#: ../../reference/expressions.rst:2043 +#: ../../reference/expressions.rst:2118 msgid "" "expr1, expr2, expr3, expr4\n" "(expr1, expr2, expr3, expr4)\n" @@ -2318,11 +2442,11 @@ msgstr "" "expr1(expr2, expr3, *expr4, **expr5)\n" "expr3, expr4 = expr1, expr2" -#: ../../reference/expressions.rst:2054 +#: ../../reference/expressions.rst:2129 msgid "Operator precedence" msgstr "" -#: ../../reference/expressions.rst:2059 +#: ../../reference/expressions.rst:2134 msgid "" "The following table summarizes the operator precedence in Python, from " "highest precedence (most binding) to lowest precedence (least binding). " @@ -2332,176 +2456,177 @@ msgid "" "group from right to left)." msgstr "" -#: ../../reference/expressions.rst:2065 +#: ../../reference/expressions.rst:2140 msgid "" "Note that comparisons, membership tests, and identity tests, all have the " "same precedence and have a left-to-right chaining feature as described in " "the :ref:`comparisons` section." msgstr "" -#: ../../reference/expressions.rst:2071 +#: ../../reference/expressions.rst:2146 msgid "Operator" msgstr "運算子" -#: ../../reference/expressions.rst:2071 +#: ../../reference/expressions.rst:2146 msgid "Description" msgstr "描述" -#: ../../reference/expressions.rst:2073 +#: ../../reference/expressions.rst:2148 msgid "``(expressions...)``," msgstr "``(expressions...)``," -#: ../../reference/expressions.rst:2075 +#: ../../reference/expressions.rst:2150 msgid "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" msgstr "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" -#: ../../reference/expressions.rst:2073 +#: ../../reference/expressions.rst:2148 msgid "" "Binding or parenthesized expression, list display, dictionary display, set " "display" msgstr "" -#: ../../reference/expressions.rst:2079 -msgid "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" +#: ../../reference/expressions.rst:2154 +#, fuzzy +msgid "``x[index]``, ``x[index:index]`` ``x(arguments...)``, ``x.attribute``" msgstr "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" -#: ../../reference/expressions.rst:2079 -msgid "Subscription, slicing, call, attribute reference" +#: ../../reference/expressions.rst:2154 +msgid "Subscription (including slicing), call, attribute reference" msgstr "" -#: ../../reference/expressions.rst:2082 +#: ../../reference/expressions.rst:2157 msgid ":keyword:`await x `" msgstr ":keyword:`await x `" -#: ../../reference/expressions.rst:2084 +#: ../../reference/expressions.rst:2159 msgid "``**``" msgstr "``**``" -#: ../../reference/expressions.rst:2084 +#: ../../reference/expressions.rst:2159 msgid "Exponentiation [#]_" msgstr "" -#: ../../reference/expressions.rst:2086 +#: ../../reference/expressions.rst:2161 msgid "``+x``, ``-x``, ``~x``" msgstr "``+x``, ``-x``, ``~x``" -#: ../../reference/expressions.rst:2086 +#: ../../reference/expressions.rst:2161 msgid "Positive, negative, bitwise NOT" msgstr "" -#: ../../reference/expressions.rst:2088 +#: ../../reference/expressions.rst:2163 msgid "``*``, ``@``, ``/``, ``//``, ``%``" msgstr "``*``, ``@``, ``/``, ``//``, ``%``" -#: ../../reference/expressions.rst:2088 +#: ../../reference/expressions.rst:2163 msgid "" "Multiplication, matrix multiplication, division, floor division, remainder " "[#]_" msgstr "" -#: ../../reference/expressions.rst:2092 +#: ../../reference/expressions.rst:2167 msgid "``+``, ``-``" msgstr "``+``, ``-``" -#: ../../reference/expressions.rst:2092 +#: ../../reference/expressions.rst:2167 msgid "Addition and subtraction" msgstr "" -#: ../../reference/expressions.rst:2094 +#: ../../reference/expressions.rst:2169 msgid "``<<``, ``>>``" msgstr "``<<``, ``>>``" -#: ../../reference/expressions.rst:2094 +#: ../../reference/expressions.rst:2169 msgid "Shifts" msgstr "" -#: ../../reference/expressions.rst:2096 +#: ../../reference/expressions.rst:2171 msgid "``&``" msgstr "``&``" -#: ../../reference/expressions.rst:2096 +#: ../../reference/expressions.rst:2171 msgid "Bitwise AND" msgstr "" -#: ../../reference/expressions.rst:2098 +#: ../../reference/expressions.rst:2173 msgid "``^``" msgstr "``^``" -#: ../../reference/expressions.rst:2098 +#: ../../reference/expressions.rst:2173 msgid "Bitwise XOR" msgstr "" -#: ../../reference/expressions.rst:2100 +#: ../../reference/expressions.rst:2175 msgid "``|``" msgstr "``|``" -#: ../../reference/expressions.rst:2100 +#: ../../reference/expressions.rst:2175 msgid "Bitwise OR" msgstr "" -#: ../../reference/expressions.rst:2102 +#: ../../reference/expressions.rst:2177 msgid "" ":keyword:`in`, :keyword:`not in`, :keyword:`is`, :keyword:`is not`, ``<``, " "``<=``, ``>``, ``>=``, ``!=``, ``==``" msgstr "" -#: ../../reference/expressions.rst:2102 +#: ../../reference/expressions.rst:2177 msgid "Comparisons, including membership tests and identity tests" msgstr "" -#: ../../reference/expressions.rst:2106 +#: ../../reference/expressions.rst:2181 msgid ":keyword:`not x `" msgstr ":keyword:`not x `" -#: ../../reference/expressions.rst:2106 +#: ../../reference/expressions.rst:2181 msgid "Boolean NOT" msgstr "" -#: ../../reference/expressions.rst:2108 +#: ../../reference/expressions.rst:2183 msgid ":keyword:`and`" msgstr ":keyword:`and`" -#: ../../reference/expressions.rst:2108 +#: ../../reference/expressions.rst:2183 msgid "Boolean AND" msgstr "" -#: ../../reference/expressions.rst:2110 +#: ../../reference/expressions.rst:2185 msgid ":keyword:`or`" msgstr ":keyword:`or`" -#: ../../reference/expressions.rst:2110 +#: ../../reference/expressions.rst:2185 msgid "Boolean OR" msgstr "" -#: ../../reference/expressions.rst:2112 +#: ../../reference/expressions.rst:2187 msgid ":keyword:`if ` -- :keyword:`!else`" msgstr ":keyword:`if ` -- :keyword:`!else`" -#: ../../reference/expressions.rst:2112 +#: ../../reference/expressions.rst:2187 msgid "Conditional expression" msgstr "" -#: ../../reference/expressions.rst:2114 +#: ../../reference/expressions.rst:2189 msgid ":keyword:`lambda`" msgstr ":keyword:`lambda`" -#: ../../reference/expressions.rst:2114 +#: ../../reference/expressions.rst:2189 msgid "Lambda expression" msgstr "" -#: ../../reference/expressions.rst:2116 +#: ../../reference/expressions.rst:2191 msgid "``:=``" msgstr "``:=``" -#: ../../reference/expressions.rst:2116 +#: ../../reference/expressions.rst:2191 msgid "Assignment expression" msgstr "" -#: ../../reference/expressions.rst:2121 +#: ../../reference/expressions.rst:2196 msgid "Footnotes" msgstr "註解" -#: ../../reference/expressions.rst:2122 +#: ../../reference/expressions.rst:2197 msgid "" "While ``abs(x%y) < abs(y)`` is true mathematically, for floats it may not be " "true numerically due to roundoff. For example, and assuming a platform on " @@ -2513,7 +2638,7 @@ msgid "" "approach is more appropriate depends on the application." msgstr "" -#: ../../reference/expressions.rst:2131 +#: ../../reference/expressions.rst:2206 msgid "" "If x is very close to an exact integer multiple of y, it's possible for ``x//" "y`` to be one larger than ``(x-x%y)//y`` due to rounding. In such cases, " @@ -2521,7 +2646,7 @@ msgid "" "* y + x % y`` be very close to ``x``." msgstr "" -#: ../../reference/expressions.rst:2136 +#: ../../reference/expressions.rst:2211 msgid "" "The Unicode standard distinguishes between :dfn:`code points` (e.g. U+0041) " "and :dfn:`abstract characters` (e.g. \"LATIN CAPITAL LETTER A\"). While most " @@ -2535,7 +2660,7 @@ msgid "" "(COMBINING CEDILLA)." msgstr "" -#: ../../reference/expressions.rst:2147 +#: ../../reference/expressions.rst:2222 msgid "" "The comparison operators on strings compare at the level of Unicode code " "points. This may be counter-intuitive to humans. For example, ``\"\\u00C7\" " @@ -2543,13 +2668,13 @@ msgid "" "same abstract character \"LATIN CAPITAL LETTER C WITH CEDILLA\"." msgstr "" -#: ../../reference/expressions.rst:2152 +#: ../../reference/expressions.rst:2227 msgid "" "To compare strings at the level of abstract characters (that is, in a way " "intuitive to humans), use :func:`unicodedata.normalize`." msgstr "" -#: ../../reference/expressions.rst:2155 +#: ../../reference/expressions.rst:2230 msgid "" "Due to automatic garbage-collection, free lists, and the dynamic nature of " "descriptors, you may notice seemingly unusual behaviour in certain uses of " @@ -2557,22 +2682,22 @@ msgid "" "instance methods, or constants. Check their documentation for more info." msgstr "" -#: ../../reference/expressions.rst:2160 +#: ../../reference/expressions.rst:2235 msgid "" "The power operator ``**`` binds less tightly than an arithmetic or bitwise " "unary operator on its right, that is, ``2**-1`` is ``0.5``." msgstr "" -#: ../../reference/expressions.rst:2163 +#: ../../reference/expressions.rst:2238 msgid "" "The ``%`` operator is also used for string formatting; the same precedence " "applies." msgstr "" #: ../../reference/expressions.rst:8 ../../reference/expressions.rst:448 -#: ../../reference/expressions.rst:504 ../../reference/expressions.rst:1840 -#: ../../reference/expressions.rst:1880 ../../reference/expressions.rst:1931 -#: ../../reference/expressions.rst:1958 ../../reference/expressions.rst:1986 +#: ../../reference/expressions.rst:504 ../../reference/expressions.rst:1915 +#: ../../reference/expressions.rst:1955 ../../reference/expressions.rst:2006 +#: ../../reference/expressions.rst:2033 ../../reference/expressions.rst:2061 msgid "expression" msgstr "" @@ -2580,8 +2705,8 @@ msgstr "" msgid "BNF" msgstr "BNF" -#: ../../reference/expressions.rst:28 ../../reference/expressions.rst:1320 -#: ../../reference/expressions.rst:1368 +#: ../../reference/expressions.rst:28 ../../reference/expressions.rst:1395 +#: ../../reference/expressions.rst:1443 msgid "arithmetic" msgstr "" @@ -2604,8 +2729,8 @@ msgstr "" #: ../../reference/expressions.rst:73 ../../reference/expressions.rst:625 #: ../../reference/expressions.rst:680 ../../reference/expressions.rst:811 #: ../../reference/expressions.rst:866 ../../reference/expressions.rst:913 -#: ../../reference/expressions.rst:1357 ../../reference/expressions.rst:1410 -#: ../../reference/expressions.rst:1514 +#: ../../reference/expressions.rst:1432 ../../reference/expressions.rst:1485 +#: ../../reference/expressions.rst:1589 msgid "exception" msgstr "" @@ -2646,10 +2771,10 @@ msgstr "type(型別)" #: ../../reference/expressions.rst:427 ../../reference/expressions.rst:448 #: ../../reference/expressions.rst:613 ../../reference/expressions.rst:801 #: ../../reference/expressions.rst:913 ../../reference/expressions.rst:942 -#: ../../reference/expressions.rst:1019 ../../reference/expressions.rst:1063 -#: ../../reference/expressions.rst:1211 ../../reference/expressions.rst:1225 -#: ../../reference/expressions.rst:1239 ../../reference/expressions.rst:1246 -#: ../../reference/expressions.rst:1805 ../../reference/expressions.rst:1998 +#: ../../reference/expressions.rst:1026 ../../reference/expressions.rst:1138 +#: ../../reference/expressions.rst:1286 ../../reference/expressions.rst:1300 +#: ../../reference/expressions.rst:1314 ../../reference/expressions.rst:1321 +#: ../../reference/expressions.rst:1880 ../../reference/expressions.rst:2073 msgid "object" msgstr "object(物件)" @@ -2658,7 +2783,7 @@ msgid "parenthesized form" msgstr "" #: ../../reference/expressions.rst:217 ../../reference/expressions.rst:448 -#: ../../reference/expressions.rst:1063 +#: ../../reference/expressions.rst:1138 msgid "() (parentheses)" msgstr "() (圓括號)" @@ -2671,18 +2796,18 @@ msgid "empty" msgstr "" #: ../../reference/expressions.rst:230 ../../reference/expressions.rst:942 -#: ../../reference/expressions.rst:1019 ../../reference/expressions.rst:1998 +#: ../../reference/expressions.rst:1026 ../../reference/expressions.rst:2073 msgid "tuple" msgstr "" -#: ../../reference/expressions.rst:236 ../../reference/expressions.rst:2020 +#: ../../reference/expressions.rst:236 ../../reference/expressions.rst:2095 msgid "comma" msgstr "" #: ../../reference/expressions.rst:236 ../../reference/expressions.rst:330 #: ../../reference/expressions.rst:356 ../../reference/expressions.rst:384 -#: ../../reference/expressions.rst:1013 ../../reference/expressions.rst:1063 -#: ../../reference/expressions.rst:1986 +#: ../../reference/expressions.rst:1020 ../../reference/expressions.rst:1138 +#: ../../reference/expressions.rst:2061 msgid ", (comma)" msgstr ", (逗號)" @@ -2699,7 +2824,7 @@ msgstr "for" msgid "in comprehensions" msgstr "於 comprehensions(綜合運算)" -#: ../../reference/expressions.rst:261 ../../reference/expressions.rst:1931 +#: ../../reference/expressions.rst:261 ../../reference/expressions.rst:2006 msgid "if" msgstr "if" @@ -2707,13 +2832,13 @@ msgstr "if" msgid "async for" msgstr "async for" -#: ../../reference/expressions.rst:296 ../../reference/expressions.rst:1264 +#: ../../reference/expressions.rst:296 ../../reference/expressions.rst:1339 msgid "await" msgstr "await" #: ../../reference/expressions.rst:330 ../../reference/expressions.rst:913 -#: ../../reference/expressions.rst:942 ../../reference/expressions.rst:1019 -#: ../../reference/expressions.rst:1986 +#: ../../reference/expressions.rst:942 ../../reference/expressions.rst:1026 +#: ../../reference/expressions.rst:2061 msgid "list" msgstr "list(串列)" @@ -2731,7 +2856,7 @@ msgid "list expression" msgstr "list expression(串列運算式)" #: ../../reference/expressions.rst:330 ../../reference/expressions.rst:356 -#: ../../reference/expressions.rst:1986 +#: ../../reference/expressions.rst:2061 msgid "expression list" msgstr "expression list(運算式串列)" @@ -2768,8 +2893,8 @@ msgstr "key/value pair(鍵/值對)" msgid "dictionary expression" msgstr "dictionary expression(字典運算式)" -#: ../../reference/expressions.rst:384 ../../reference/expressions.rst:1013 -#: ../../reference/expressions.rst:1958 +#: ../../reference/expressions.rst:384 ../../reference/expressions.rst:1020 +#: ../../reference/expressions.rst:2033 msgid ": (colon)" msgstr ": (冒號)" @@ -2781,13 +2906,13 @@ msgstr "於字典運算式" msgid "in dictionary displays" msgstr "於字典顯示" -#: ../../reference/expressions.rst:410 ../../reference/expressions.rst:1146 -#: ../../reference/expressions.rst:2005 +#: ../../reference/expressions.rst:410 ../../reference/expressions.rst:1221 +#: ../../reference/expressions.rst:2080 msgid "unpacking" msgstr "unpacking(解包)" -#: ../../reference/expressions.rst:410 ../../reference/expressions.rst:1176 -#: ../../reference/expressions.rst:1284 +#: ../../reference/expressions.rst:410 ../../reference/expressions.rst:1251 +#: ../../reference/expressions.rst:1359 msgid "**" msgstr "**" @@ -2804,7 +2929,7 @@ msgstr "generator(產生器)" msgid "generator expression" msgstr "generator expression(產生器運算式)" -#: ../../reference/expressions.rst:504 ../../reference/expressions.rst:1264 +#: ../../reference/expressions.rst:504 ../../reference/expressions.rst:1339 msgid "keyword" msgstr "keyword(關鍵字)" @@ -2816,8 +2941,8 @@ msgstr "yield" msgid "from" msgstr "from" -#: ../../reference/expressions.rst:504 ../../reference/expressions.rst:1211 -#: ../../reference/expressions.rst:1225 ../../reference/expressions.rst:1958 +#: ../../reference/expressions.rst:504 ../../reference/expressions.rst:1286 +#: ../../reference/expressions.rst:1300 ../../reference/expressions.rst:2033 msgid "function" msgstr "function (函式)" @@ -2881,8 +3006,8 @@ msgstr "module(模組)" msgid "subscription" msgstr "subscription(下標)" -#: ../../reference/expressions.rst:942 ../../reference/expressions.rst:1019 -#: ../../reference/expressions.rst:1805 +#: ../../reference/expressions.rst:942 ../../reference/expressions.rst:1026 +#: ../../reference/expressions.rst:1880 msgid "sequence" msgstr "sequence(序列)" @@ -2890,449 +3015,444 @@ msgstr "sequence(序列)" msgid "mapping" msgstr "mapping(對映)" -#: ../../reference/expressions.rst:942 ../../reference/expressions.rst:999 -#: ../../reference/expressions.rst:1019 +#: ../../reference/expressions.rst:942 ../../reference/expressions.rst:1026 msgid "string" msgstr "string(字串)" -#: ../../reference/expressions.rst:942 ../../reference/expressions.rst:999 +#: ../../reference/expressions.rst:942 msgid "item" msgstr "item(項目)" -#: ../../reference/expressions.rst:999 -msgid "character" -msgstr "character(字元)" - -#: ../../reference/expressions.rst:1013 +#: ../../reference/expressions.rst:1020 msgid "slicing" msgstr "slicing(切片)" -#: ../../reference/expressions.rst:1013 +#: ../../reference/expressions.rst:1020 msgid "slice" msgstr "slice(切片)" -#: ../../reference/expressions.rst:1045 -msgid "start (slice object attribute)" -msgstr "start(切片物件屬性)" - -#: ../../reference/expressions.rst:1045 -msgid "stop (slice object attribute)" -msgstr "stop(切片物件屬性)" - -#: ../../reference/expressions.rst:1045 -msgid "step (slice object attribute)" -msgstr "step(切片物件屬性)" - -#: ../../reference/expressions.rst:1063 +#: ../../reference/expressions.rst:1138 msgid "callable" msgstr "callable(可呼叫物件)" -#: ../../reference/expressions.rst:1063 ../../reference/expressions.rst:1211 -#: ../../reference/expressions.rst:1225 ../../reference/expressions.rst:1239 -#: ../../reference/expressions.rst:1246 ../../reference/expressions.rst:1256 +#: ../../reference/expressions.rst:1138 ../../reference/expressions.rst:1286 +#: ../../reference/expressions.rst:1300 ../../reference/expressions.rst:1314 +#: ../../reference/expressions.rst:1321 ../../reference/expressions.rst:1331 msgid "call" msgstr "call(呼叫)" -#: ../../reference/expressions.rst:1063 +#: ../../reference/expressions.rst:1138 msgid "argument" msgstr "argument(引數)" -#: ../../reference/expressions.rst:1063 ../../reference/expressions.rst:1096 +#: ../../reference/expressions.rst:1138 ../../reference/expressions.rst:1171 msgid "call semantics" msgstr "call semantics(呼叫語意)" -#: ../../reference/expressions.rst:1063 +#: ../../reference/expressions.rst:1138 msgid "argument list" msgstr "argument list(引數列表)" -#: ../../reference/expressions.rst:1063 +#: ../../reference/expressions.rst:1138 msgid "= (equals)" msgstr "= (等號)" -#: ../../reference/expressions.rst:1063 ../../reference/expressions.rst:1146 -#: ../../reference/expressions.rst:1176 +#: ../../reference/expressions.rst:1138 ../../reference/expressions.rst:1221 +#: ../../reference/expressions.rst:1251 msgid "in function calls" msgstr "於函式呼叫中" -#: ../../reference/expressions.rst:1096 +#: ../../reference/expressions.rst:1171 msgid "parameter" msgstr "parameter(參數)" -#: ../../reference/expressions.rst:1146 ../../reference/expressions.rst:1381 -#: ../../reference/expressions.rst:2005 +#: ../../reference/expressions.rst:1221 ../../reference/expressions.rst:1456 +#: ../../reference/expressions.rst:2080 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../reference/expressions.rst:1211 +#: ../../reference/expressions.rst:1286 msgid "user-defined" msgstr "user-defined(使用者定義)" -#: ../../reference/expressions.rst:1211 +#: ../../reference/expressions.rst:1286 msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" -#: ../../reference/expressions.rst:1225 +#: ../../reference/expressions.rst:1300 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../reference/expressions.rst:1225 +#: ../../reference/expressions.rst:1300 msgid "method" msgstr "method(方法)" -#: ../../reference/expressions.rst:1225 +#: ../../reference/expressions.rst:1300 msgid "built-in method" msgstr "built-in method(內建方法)" -#: ../../reference/expressions.rst:1239 +#: ../../reference/expressions.rst:1314 msgid "class" msgstr "class(類別)" -#: ../../reference/expressions.rst:1239 +#: ../../reference/expressions.rst:1314 msgid "class object" msgstr "class object(類別物件)" -#: ../../reference/expressions.rst:1246 +#: ../../reference/expressions.rst:1321 msgid "class instance" msgstr "class instance(類別實例)" -#: ../../reference/expressions.rst:1246 ../../reference/expressions.rst:1256 +#: ../../reference/expressions.rst:1321 ../../reference/expressions.rst:1331 msgid "instance" msgstr "instance(實例)" -#: ../../reference/expressions.rst:1256 +#: ../../reference/expressions.rst:1331 msgid "__call__() (object method)" msgstr "__call__() (物件方法)" -#: ../../reference/expressions.rst:1284 +#: ../../reference/expressions.rst:1359 msgid "power" msgstr "power(次方)" -#: ../../reference/expressions.rst:1284 ../../reference/expressions.rst:1320 -#: ../../reference/expressions.rst:1368 ../../reference/expressions.rst:1496 -#: ../../reference/expressions.rst:1525 ../../reference/expressions.rst:1840 +#: ../../reference/expressions.rst:1359 ../../reference/expressions.rst:1395 +#: ../../reference/expressions.rst:1443 ../../reference/expressions.rst:1571 +#: ../../reference/expressions.rst:1600 ../../reference/expressions.rst:1915 msgid "operation" msgstr "operation(操作)" -#: ../../reference/expressions.rst:1284 ../../reference/expressions.rst:1329 -#: ../../reference/expressions.rst:1338 ../../reference/expressions.rst:1346 -#: ../../reference/expressions.rst:1381 ../../reference/expressions.rst:1398 -#: ../../reference/expressions.rst:1410 ../../reference/expressions.rst:1428 -#: ../../reference/expressions.rst:1458 ../../reference/expressions.rst:1475 -#: ../../reference/expressions.rst:1496 ../../reference/expressions.rst:1534 -#: ../../reference/expressions.rst:1542 ../../reference/expressions.rst:1551 -#: ../../reference/expressions.rst:1566 ../../reference/expressions.rst:1805 -#: ../../reference/expressions.rst:1814 ../../reference/expressions.rst:1856 -#: ../../reference/expressions.rst:1861 ../../reference/expressions.rst:1866 -#: ../../reference/expressions.rst:1931 ../../reference/expressions.rst:2056 +#: ../../reference/expressions.rst:1359 ../../reference/expressions.rst:1404 +#: ../../reference/expressions.rst:1413 ../../reference/expressions.rst:1421 +#: ../../reference/expressions.rst:1456 ../../reference/expressions.rst:1473 +#: ../../reference/expressions.rst:1485 ../../reference/expressions.rst:1503 +#: ../../reference/expressions.rst:1533 ../../reference/expressions.rst:1550 +#: ../../reference/expressions.rst:1571 ../../reference/expressions.rst:1609 +#: ../../reference/expressions.rst:1617 ../../reference/expressions.rst:1626 +#: ../../reference/expressions.rst:1641 ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1889 ../../reference/expressions.rst:1931 +#: ../../reference/expressions.rst:1936 ../../reference/expressions.rst:1941 +#: ../../reference/expressions.rst:2006 ../../reference/expressions.rst:2131 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/expressions.rst:1320 +#: ../../reference/expressions.rst:1395 msgid "unary" msgstr "unary(一元)" -#: ../../reference/expressions.rst:1320 ../../reference/expressions.rst:1525 -#: ../../reference/expressions.rst:1534 ../../reference/expressions.rst:1542 -#: ../../reference/expressions.rst:1551 +#: ../../reference/expressions.rst:1395 ../../reference/expressions.rst:1600 +#: ../../reference/expressions.rst:1609 ../../reference/expressions.rst:1617 +#: ../../reference/expressions.rst:1626 msgid "bitwise" msgstr "bitwise(位元)" -#: ../../reference/expressions.rst:1329 +#: ../../reference/expressions.rst:1404 msgid "negation" msgstr "negation(否定)" -#: ../../reference/expressions.rst:1329 +#: ../../reference/expressions.rst:1404 msgid "minus" msgstr "minus(減)" -#: ../../reference/expressions.rst:1329 ../../reference/expressions.rst:1475 +#: ../../reference/expressions.rst:1404 ../../reference/expressions.rst:1550 msgid "- (minus)" msgstr "- (減號)" -#: ../../reference/expressions.rst:1329 ../../reference/expressions.rst:1338 +#: ../../reference/expressions.rst:1404 ../../reference/expressions.rst:1413 msgid "unary operator" msgstr "unary operator(一元運算子)" -#: ../../reference/expressions.rst:1338 +#: ../../reference/expressions.rst:1413 msgid "plus" msgstr "plus(加)" -#: ../../reference/expressions.rst:1338 ../../reference/expressions.rst:1458 +#: ../../reference/expressions.rst:1413 ../../reference/expressions.rst:1533 msgid "+ (plus)" msgstr "+ (加號)" -#: ../../reference/expressions.rst:1346 +#: ../../reference/expressions.rst:1421 msgid "inversion" msgstr "inversion(反轉)" -#: ../../reference/expressions.rst:1346 +#: ../../reference/expressions.rst:1421 msgid "~ (tilde)" msgstr "~ (波浪號)" -#: ../../reference/expressions.rst:1357 +#: ../../reference/expressions.rst:1432 msgid "TypeError" msgstr "TypeError" -#: ../../reference/expressions.rst:1368 ../../reference/expressions.rst:1525 +#: ../../reference/expressions.rst:1443 ../../reference/expressions.rst:1600 msgid "binary" msgstr "binary(二進位)" -#: ../../reference/expressions.rst:1381 +#: ../../reference/expressions.rst:1456 msgid "multiplication" msgstr "multiplication(乘)" -#: ../../reference/expressions.rst:1398 +#: ../../reference/expressions.rst:1473 msgid "matrix multiplication" msgstr "matrix multiplication(矩陣乘法)" -#: ../../reference/expressions.rst:1398 +#: ../../reference/expressions.rst:1473 msgid "@ (at)" msgstr "@ (在)" -#: ../../reference/expressions.rst:1410 +#: ../../reference/expressions.rst:1485 msgid "ZeroDivisionError" msgstr "ZeroDivisionError" -#: ../../reference/expressions.rst:1410 +#: ../../reference/expressions.rst:1485 msgid "division" msgstr "division(除)" -#: ../../reference/expressions.rst:1410 +#: ../../reference/expressions.rst:1485 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../reference/expressions.rst:1410 +#: ../../reference/expressions.rst:1485 msgid "//" msgstr "//" -#: ../../reference/expressions.rst:1428 +#: ../../reference/expressions.rst:1503 msgid "modulo" msgstr "modulo(餘數)" -#: ../../reference/expressions.rst:1428 +#: ../../reference/expressions.rst:1503 msgid "% (percent)" msgstr "% (百分號)" -#: ../../reference/expressions.rst:1458 +#: ../../reference/expressions.rst:1533 msgid "addition" msgstr "addition(加)" -#: ../../reference/expressions.rst:1458 ../../reference/expressions.rst:1475 +#: ../../reference/expressions.rst:1533 ../../reference/expressions.rst:1550 msgid "binary operator" msgstr "binary operator(二元運算子)" -#: ../../reference/expressions.rst:1475 +#: ../../reference/expressions.rst:1550 msgid "subtraction" msgstr "subtraction(減)" -#: ../../reference/expressions.rst:1496 +#: ../../reference/expressions.rst:1571 msgid "shifting" msgstr "shifting(移動)" -#: ../../reference/expressions.rst:1496 +#: ../../reference/expressions.rst:1571 msgid "<<" msgstr "<<" -#: ../../reference/expressions.rst:1496 +#: ../../reference/expressions.rst:1571 msgid ">>" msgstr ">>" -#: ../../reference/expressions.rst:1514 +#: ../../reference/expressions.rst:1589 msgid "ValueError" msgstr "ValueError" -#: ../../reference/expressions.rst:1534 ../../reference/expressions.rst:1861 +#: ../../reference/expressions.rst:1609 ../../reference/expressions.rst:1936 msgid "and" msgstr "and" -#: ../../reference/expressions.rst:1534 +#: ../../reference/expressions.rst:1609 msgid "& (ampersand)" msgstr "& (和號)" -#: ../../reference/expressions.rst:1542 +#: ../../reference/expressions.rst:1617 msgid "xor" msgstr "xor" -#: ../../reference/expressions.rst:1542 +#: ../../reference/expressions.rst:1617 msgid "exclusive" msgstr "exclusive(排外)" -#: ../../reference/expressions.rst:1542 ../../reference/expressions.rst:1551 -#: ../../reference/expressions.rst:1866 +#: ../../reference/expressions.rst:1617 ../../reference/expressions.rst:1626 +#: ../../reference/expressions.rst:1941 msgid "or" msgstr "or" -#: ../../reference/expressions.rst:1542 +#: ../../reference/expressions.rst:1617 msgid "^ (caret)" msgstr "^ (插入符號)" -#: ../../reference/expressions.rst:1551 +#: ../../reference/expressions.rst:1626 msgid "inclusive" msgstr "inclusive(包含)" -#: ../../reference/expressions.rst:1551 +#: ../../reference/expressions.rst:1626 msgid "| (vertical bar)" msgstr "| (垂直線)" -#: ../../reference/expressions.rst:1566 +#: ../../reference/expressions.rst:1641 msgid "comparison" msgstr "comparison(比較)" -#: ../../reference/expressions.rst:1566 +#: ../../reference/expressions.rst:1641 msgid "C" msgstr "C" -#: ../../reference/expressions.rst:1566 +#: ../../reference/expressions.rst:1641 msgid "language" msgstr "language(語言)" -#: ../../reference/expressions.rst:1566 +#: ../../reference/expressions.rst:1641 msgid "< (less)" msgstr "< (小於)" -#: ../../reference/expressions.rst:1566 +#: ../../reference/expressions.rst:1641 msgid "> (greater)" msgstr "> (大於)" -#: ../../reference/expressions.rst:1566 +#: ../../reference/expressions.rst:1641 msgid "<=" msgstr "<=" -#: ../../reference/expressions.rst:1566 +#: ../../reference/expressions.rst:1641 msgid ">=" msgstr ">=" -#: ../../reference/expressions.rst:1566 +#: ../../reference/expressions.rst:1641 msgid "==" msgstr "==" -#: ../../reference/expressions.rst:1566 +#: ../../reference/expressions.rst:1641 msgid "!=" msgstr "!=" -#: ../../reference/expressions.rst:1590 +#: ../../reference/expressions.rst:1665 msgid "chaining" msgstr "chaining(鏈接)" -#: ../../reference/expressions.rst:1590 +#: ../../reference/expressions.rst:1665 msgid "comparisons" msgstr "comparisons(比較)" -#: ../../reference/expressions.rst:1805 +#: ../../reference/expressions.rst:1880 msgid "in" msgstr "in" -#: ../../reference/expressions.rst:1805 +#: ../../reference/expressions.rst:1880 msgid "not in" msgstr "not in" -#: ../../reference/expressions.rst:1805 +#: ../../reference/expressions.rst:1880 msgid "membership" msgstr "membership(成員)" -#: ../../reference/expressions.rst:1805 ../../reference/expressions.rst:1814 +#: ../../reference/expressions.rst:1880 ../../reference/expressions.rst:1889 msgid "test" msgstr "test(測試)" -#: ../../reference/expressions.rst:1814 +#: ../../reference/expressions.rst:1889 msgid "is" msgstr "is" -#: ../../reference/expressions.rst:1814 +#: ../../reference/expressions.rst:1889 msgid "is not" msgstr "is not" -#: ../../reference/expressions.rst:1814 +#: ../../reference/expressions.rst:1889 msgid "identity" msgstr "identity" -#: ../../reference/expressions.rst:1840 +#: ../../reference/expressions.rst:1915 msgid "Conditional" msgstr "Conditional(條件式)" -#: ../../reference/expressions.rst:1840 +#: ../../reference/expressions.rst:1915 msgid "Boolean" msgstr "Boolean(布林)" -#: ../../reference/expressions.rst:1856 +#: ../../reference/expressions.rst:1931 msgid "not" msgstr "not" -#: ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1955 msgid ":= (colon equals)" msgstr ":= (冒號等於)" -#: ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1955 msgid "assignment expression" msgstr "assignment expression(賦值運算式)" -#: ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1955 msgid "walrus operator" msgstr "walrus operator(海象運算子)" -#: ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1955 msgid "named expression" msgstr "named expression(附名運算式)" -#: ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1955 msgid "assignment" msgstr "assignment(賦值)" -#: ../../reference/expressions.rst:1931 +#: ../../reference/expressions.rst:2006 msgid "conditional" msgstr "conditional(條件式)" -#: ../../reference/expressions.rst:1931 +#: ../../reference/expressions.rst:2006 msgid "ternary" msgstr "ternary(三元)" -#: ../../reference/expressions.rst:1931 +#: ../../reference/expressions.rst:2006 msgid "conditional expression" msgstr "conditional expression(條件運算式)" -#: ../../reference/expressions.rst:1931 +#: ../../reference/expressions.rst:2006 msgid "else" msgstr "else" -#: ../../reference/expressions.rst:1958 +#: ../../reference/expressions.rst:2033 msgid "lambda" msgstr "lambda" -#: ../../reference/expressions.rst:1958 +#: ../../reference/expressions.rst:2033 msgid "form" msgstr "form" -#: ../../reference/expressions.rst:1958 +#: ../../reference/expressions.rst:2033 msgid "anonymous" msgstr "anonymous(匿名)" -#: ../../reference/expressions.rst:1958 +#: ../../reference/expressions.rst:2033 msgid "lambda expression" msgstr "lambda expression(lambda 運算式)" -#: ../../reference/expressions.rst:2005 +#: ../../reference/expressions.rst:2080 msgid "iterable" msgstr "iterable(可疊代)" -#: ../../reference/expressions.rst:2005 +#: ../../reference/expressions.rst:2080 msgid "in expression lists" msgstr "於 expression list(運算式串列)" -#: ../../reference/expressions.rst:2020 +#: ../../reference/expressions.rst:2095 msgid "trailing" msgstr "trailing" -#: ../../reference/expressions.rst:2035 +#: ../../reference/expressions.rst:2110 msgid "evaluation" msgstr "evaluation" -#: ../../reference/expressions.rst:2035 +#: ../../reference/expressions.rst:2110 msgid "order" msgstr "order(順序)" -#: ../../reference/expressions.rst:2056 +#: ../../reference/expressions.rst:2131 msgid "precedence" msgstr "precedence(優先順序)" +#~ msgid "character" +#~ msgstr "character(字元)" + +#~ msgid "start (slice object attribute)" +#~ msgstr "start(切片物件屬性)" + +#~ msgid "stop (slice object attribute)" +#~ msgstr "stop(切片物件屬性)" + +#~ msgid "step (slice object attribute)" +#~ msgstr "step(切片物件屬性)" + #~ msgid "datum" #~ msgstr "datum(資料元)" diff --git a/reference/simple_stmts.po b/reference/simple_stmts.po index 1fc396d1e1..b862503a3b 100644 --- a/reference/simple_stmts.po +++ b/reference/simple_stmts.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-08 00:15+0000\n" +"POT-Creation-Date: 2026-02-05 14:10+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -65,13 +65,13 @@ msgid "" "attributes or items of mutable objects:" msgstr "" -#: ../../reference/simple_stmts.rst:97 +#: ../../reference/simple_stmts.rst:96 msgid "" -"(See section :ref:`primaries` for the syntax definitions for *attributeref*, " -"*subscription*, and *slicing*.)" +"(See section :ref:`primaries` for the syntax definitions for *attributeref* " +"and *subscription*.)" msgstr "" -#: ../../reference/simple_stmts.rst:100 +#: ../../reference/simple_stmts.rst:99 msgid "" "An assignment statement evaluates the expression list (remember that this " "can be a single expression or a comma-separated list, the latter yielding a " @@ -79,34 +79,33 @@ msgid "" "from left to right." msgstr "" -#: ../../reference/simple_stmts.rst:109 +#: ../../reference/simple_stmts.rst:108 msgid "" "Assignment is defined recursively depending on the form of the target " -"(list). When a target is part of a mutable object (an attribute reference, " -"subscription or slicing), the mutable object must ultimately perform the " -"assignment and decide about its validity, and may raise an exception if the " -"assignment is unacceptable. The rules observed by various types and the " -"exceptions raised are given with the definition of the object types (see " -"section :ref:`types`)." +"(list). When a target is part of a mutable object (an attribute reference or " +"subscription), the mutable object must ultimately perform the assignment and " +"decide about its validity, and may raise an exception if the assignment is " +"unacceptable. The rules observed by various types and the exceptions raised " +"are given with the definition of the object types (see section :ref:`types`)." msgstr "" -#: ../../reference/simple_stmts.rst:122 +#: ../../reference/simple_stmts.rst:121 msgid "" "Assignment of an object to a target list, optionally enclosed in parentheses " "or square brackets, is recursively defined as follows." msgstr "" -#: ../../reference/simple_stmts.rst:125 +#: ../../reference/simple_stmts.rst:124 msgid "" "If the target list is a single target with no trailing comma, optionally in " "parentheses, the object is assigned to that target." msgstr "" -#: ../../reference/simple_stmts.rst:128 +#: ../../reference/simple_stmts.rst:127 msgid "Else:" msgstr "" -#: ../../reference/simple_stmts.rst:130 +#: ../../reference/simple_stmts.rst:129 msgid "" "If the target list contains one target prefixed with an asterisk, called a " "\"starred\" target: The object must be an iterable with at least as many " @@ -117,43 +116,43 @@ msgid "" "then assigned to the starred target (the list can be empty)." msgstr "" -#: ../../reference/simple_stmts.rst:138 +#: ../../reference/simple_stmts.rst:137 msgid "" "Else: The object must be an iterable with the same number of items as there " "are targets in the target list, and the items are assigned, from left to " "right, to the corresponding targets." msgstr "" -#: ../../reference/simple_stmts.rst:142 +#: ../../reference/simple_stmts.rst:141 msgid "" "Assignment of an object to a single target is recursively defined as follows." msgstr "" -#: ../../reference/simple_stmts.rst:144 +#: ../../reference/simple_stmts.rst:143 msgid "If the target is an identifier (name):" msgstr "" -#: ../../reference/simple_stmts.rst:146 +#: ../../reference/simple_stmts.rst:145 msgid "" "If the name does not occur in a :keyword:`global` or :keyword:`nonlocal` " "statement in the current code block: the name is bound to the object in the " "current local namespace." msgstr "" -#: ../../reference/simple_stmts.rst:150 +#: ../../reference/simple_stmts.rst:149 msgid "" "Otherwise: the name is bound to the object in the global namespace or the " "outer namespace determined by :keyword:`nonlocal`, respectively." msgstr "" -#: ../../reference/simple_stmts.rst:155 +#: ../../reference/simple_stmts.rst:154 msgid "" "The name is rebound if it was already bound. This may cause the reference " "count for the object previously bound to the name to reach zero, causing the " "object to be deallocated and its destructor (if it has one) to be called." msgstr "" -#: ../../reference/simple_stmts.rst:161 +#: ../../reference/simple_stmts.rst:160 msgid "" "If the target is an attribute reference: The primary expression in the " "reference is evaluated. It should yield an object with assignable " @@ -163,7 +162,7 @@ msgid "" "necessarily :exc:`AttributeError`)." msgstr "" -#: ../../reference/simple_stmts.rst:170 +#: ../../reference/simple_stmts.rst:169 msgid "" "Note: If the object is a class instance and the attribute reference occurs " "on both sides of the assignment operator, the right-hand side expression, " @@ -175,7 +174,7 @@ msgid "" "side creates a new instance attribute as the target of the assignment::" msgstr "" -#: ../../reference/simple_stmts.rst:179 +#: ../../reference/simple_stmts.rst:178 msgid "" "class Cls:\n" " x = 3 # class variable\n" @@ -183,21 +182,28 @@ msgid "" "inst.x = inst.x + 1 # writes inst.x as 4 leaving Cls.x as 3" msgstr "" -#: ../../reference/simple_stmts.rst:184 +#: ../../reference/simple_stmts.rst:183 msgid "" "This description does not necessarily apply to descriptor attributes, such " "as properties created with :func:`property`." msgstr "" -#: ../../reference/simple_stmts.rst:191 +#: ../../reference/simple_stmts.rst:190 msgid "" "If the target is a subscription: The primary expression in the reference is " -"evaluated. It should yield either a mutable sequence object (such as a " -"list) or a mapping object (such as a dictionary). Next, the subscript " -"expression is evaluated." +"evaluated. Next, the subscript expression is evaluated. Then, the primary's :" +"meth:`~object.__setitem__` method is called with two arguments: the " +"subscript and the assigned object." msgstr "" -#: ../../reference/simple_stmts.rst:200 +#: ../../reference/simple_stmts.rst:196 +msgid "" +"Typically, :meth:`~object.__setitem__` is defined on mutable sequence " +"objects (such as lists) and mapping objects (such as dictionaries), and " +"behaves as follows." +msgstr "" + +#: ../../reference/simple_stmts.rst:204 msgid "" "If the primary is a mutable sequence object (such as a list), the subscript " "must yield an integer. If it is negative, the sequence's length is added to " @@ -208,7 +214,7 @@ msgid "" "items to a list)." msgstr "" -#: ../../reference/simple_stmts.rst:211 +#: ../../reference/simple_stmts.rst:215 msgid "" "If the primary is a mapping object (such as a dictionary), the subscript " "must have a type compatible with the mapping's key type, and the mapping is " @@ -218,35 +224,21 @@ msgid "" "value existed)." msgstr "" -#: ../../reference/simple_stmts.rst:217 +#: ../../reference/simple_stmts.rst:223 msgid "" -"For user-defined objects, the :meth:`~object.__setitem__` method is called " -"with appropriate arguments." -msgstr "" - -#: ../../reference/simple_stmts.rst:222 -msgid "" -"If the target is a slicing: The primary expression in the reference is " -"evaluated. It should yield a mutable sequence object (such as a list). The " -"assigned object should be a sequence object of the same type. Next, the " -"lower and upper bound expressions are evaluated, insofar they are present; " -"defaults are zero and the sequence's length. The bounds should evaluate to " -"integers. If either bound is negative, the sequence's length is added to " -"it. The resulting bounds are clipped to lie between zero and the sequence's " +"If the target is a slicing: The primary expression should evaluate to a " +"mutable sequence object (such as a list). The assigned object should be :" +"term:`iterable`. The slicing's lower and upper bounds should be integers; if " +"they are ``None`` (or not present), the defaults are zero and the sequence's " +"length. If either bound is negative, the sequence's length is added to it. " +"The resulting bounds are clipped to lie between zero and the sequence's " "length, inclusive. Finally, the sequence object is asked to replace the " "slice with the items of the assigned sequence. The length of the slice may " "be different from the length of the assigned sequence, thus changing the " "length of the target sequence, if the target sequence allows it." msgstr "" -#: ../../reference/simple_stmts.rst:236 -msgid "" -"In the current implementation, the syntax for targets is taken to be the " -"same as for expressions, and invalid syntax is rejected during the code " -"generation phase, causing less detailed error messages." -msgstr "" - -#: ../../reference/simple_stmts.rst:240 +#: ../../reference/simple_stmts.rst:235 msgid "" "Although the definition of assignment implies that overlaps between the left-" "hand side and the right-hand side are 'simultaneous' (for example ``a, b = " @@ -255,7 +247,7 @@ msgid "" "instance, the following program prints ``[0, 2]``::" msgstr "" -#: ../../reference/simple_stmts.rst:246 +#: ../../reference/simple_stmts.rst:241 msgid "" "x = [0, 1]\n" "i = 0\n" @@ -267,31 +259,31 @@ msgstr "" "i, x[i] = 1, 2 # i 先被更新,然後 x[i] 再被更新\n" "print(x)" -#: ../../reference/simple_stmts.rst:254 +#: ../../reference/simple_stmts.rst:249 msgid ":pep:`3132` - Extended Iterable Unpacking" msgstr "" -#: ../../reference/simple_stmts.rst:255 +#: ../../reference/simple_stmts.rst:250 msgid "The specification for the ``*target`` feature." msgstr "" -#: ../../reference/simple_stmts.rst:261 +#: ../../reference/simple_stmts.rst:256 msgid "Augmented assignment statements" msgstr "擴增賦值陳述式" -#: ../../reference/simple_stmts.rst:279 +#: ../../reference/simple_stmts.rst:274 msgid "" "Augmented assignment is the combination, in a single statement, of a binary " "operation and an assignment statement:" msgstr "" -#: ../../reference/simple_stmts.rst:288 +#: ../../reference/simple_stmts.rst:283 msgid "" "(See section :ref:`primaries` for the syntax definitions of the last three " "symbols.)" msgstr "" -#: ../../reference/simple_stmts.rst:291 +#: ../../reference/simple_stmts.rst:286 msgid "" "An augmented assignment evaluates the target (which, unlike normal " "assignment statements, cannot be an unpacking) and the expression list, " @@ -300,7 +292,7 @@ msgid "" "evaluated once." msgstr "" -#: ../../reference/simple_stmts.rst:296 +#: ../../reference/simple_stmts.rst:291 msgid "" "An augmented assignment statement like ``x += 1`` can be rewritten as ``x = " "x + 1`` to achieve a similar, but not exactly equal effect. In the augmented " @@ -309,7 +301,7 @@ msgid "" "object and assigning that to the target, the old object is modified instead." msgstr "" -#: ../../reference/simple_stmts.rst:302 +#: ../../reference/simple_stmts.rst:297 msgid "" "Unlike normal assignments, augmented assignments evaluate the left-hand side " "*before* evaluating the right-hand side. For example, ``a[i] += f(x)`` " @@ -317,7 +309,7 @@ msgid "" "addition, and lastly, it writes the result back to ``a[i]``." msgstr "" -#: ../../reference/simple_stmts.rst:307 +#: ../../reference/simple_stmts.rst:302 msgid "" "With the exception of assigning to tuples and multiple targets in a single " "statement, the assignment done by augmented assignment statements is handled " @@ -326,18 +318,18 @@ msgid "" "assignment is the same as the normal binary operations." msgstr "" -#: ../../reference/simple_stmts.rst:313 +#: ../../reference/simple_stmts.rst:308 msgid "" "For targets which are attribute references, the same :ref:`caveat about " "class and instance attributes ` applies as for regular " "assignments." msgstr "" -#: ../../reference/simple_stmts.rst:320 +#: ../../reference/simple_stmts.rst:315 msgid "Annotated assignment statements" msgstr "註釋賦值陳述式" -#: ../../reference/simple_stmts.rst:327 +#: ../../reference/simple_stmts.rst:322 msgid "" ":term:`Annotation ` assignment is the combination, in a " "single statement, of a variable or attribute annotation and an optional " @@ -346,13 +338,13 @@ msgstr "" ":term:`註釋 ` 賦值是將變數或屬性註釋與可選的賦值陳述式結" "合在一個陳述式中:" -#: ../../reference/simple_stmts.rst:334 +#: ../../reference/simple_stmts.rst:329 msgid "" "The difference from normal :ref:`assignment` is that only a single target is " "allowed." msgstr "" -#: ../../reference/simple_stmts.rst:336 +#: ../../reference/simple_stmts.rst:331 msgid "" "The assignment target is considered \"simple\" if it consists of a single " "name that is not enclosed in parentheses. For simple assignment targets, if " @@ -362,19 +354,19 @@ msgid "" "or module, or using the facilities in the :mod:`annotationlib` module." msgstr "" -#: ../../reference/simple_stmts.rst:345 +#: ../../reference/simple_stmts.rst:340 msgid "" "If the assignment target is not simple (an attribute, subscript node, or " "parenthesized name), the annotation is never evaluated." msgstr "" -#: ../../reference/simple_stmts.rst:348 +#: ../../reference/simple_stmts.rst:343 msgid "" "If a name is annotated in a function scope, then this name is local for that " "scope. Annotations are never evaluated and stored in function scopes." msgstr "" -#: ../../reference/simple_stmts.rst:351 +#: ../../reference/simple_stmts.rst:346 msgid "" "If the right hand side is present, an annotated assignment performs the " "actual assignment as if there was no annotation present. If the right hand " @@ -383,57 +375,57 @@ msgid "" "__setattr__` call." msgstr "" -#: ../../reference/simple_stmts.rst:359 +#: ../../reference/simple_stmts.rst:354 msgid ":pep:`526` - Syntax for Variable Annotations" msgstr "" -#: ../../reference/simple_stmts.rst:360 +#: ../../reference/simple_stmts.rst:355 msgid "" "The proposal that added syntax for annotating the types of variables " "(including class variables and instance variables), instead of expressing " "them through comments." msgstr "" -#: ../../reference/simple_stmts.rst:364 +#: ../../reference/simple_stmts.rst:359 msgid ":pep:`484` - Type hints" msgstr ":pep:`484` - 型別提示" -#: ../../reference/simple_stmts.rst:365 +#: ../../reference/simple_stmts.rst:360 msgid "" "The proposal that added the :mod:`typing` module to provide a standard " "syntax for type annotations that can be used in static analysis tools and " "IDEs." msgstr "" -#: ../../reference/simple_stmts.rst:369 +#: ../../reference/simple_stmts.rst:364 msgid "" "Now annotated assignments allow the same expressions in the right hand side " "as regular assignments. Previously, some expressions (like un-parenthesized " "tuple expressions) caused a syntax error." msgstr "" -#: ../../reference/simple_stmts.rst:374 +#: ../../reference/simple_stmts.rst:369 msgid "" "Annotations are now lazily evaluated in a separate :ref:`annotation scope " "`. If the assignment target is not simple, annotations " "are never evaluated." msgstr "" -#: ../../reference/simple_stmts.rst:382 +#: ../../reference/simple_stmts.rst:377 msgid "The :keyword:`!assert` statement" msgstr ":keyword:`!assert` 陳述式" -#: ../../reference/simple_stmts.rst:389 +#: ../../reference/simple_stmts.rst:384 msgid "" "Assert statements are a convenient way to insert debugging assertions into a " "program:" msgstr "" -#: ../../reference/simple_stmts.rst:395 +#: ../../reference/simple_stmts.rst:390 msgid "The simple form, ``assert expression``, is equivalent to ::" msgstr "" -#: ../../reference/simple_stmts.rst:397 +#: ../../reference/simple_stmts.rst:392 msgid "" "if __debug__:\n" " if not expression: raise AssertionError" @@ -441,12 +433,12 @@ msgstr "" "if __debug__:\n" " if not expression: raise AssertionError" -#: ../../reference/simple_stmts.rst:400 +#: ../../reference/simple_stmts.rst:395 msgid "" "The extended form, ``assert expression1, expression2``, is equivalent to ::" msgstr "" -#: ../../reference/simple_stmts.rst:402 +#: ../../reference/simple_stmts.rst:397 msgid "" "if __debug__:\n" " if not expression1: raise AssertionError(expression2)" @@ -454,7 +446,7 @@ msgstr "" "if __debug__:\n" " if not expression1: raise AssertionError(expression2)" -#: ../../reference/simple_stmts.rst:409 +#: ../../reference/simple_stmts.rst:404 msgid "" "These equivalences assume that :const:`__debug__` and :exc:`AssertionError` " "refer to the built-in variables with those names. In the current " @@ -467,24 +459,24 @@ msgid "" "trace." msgstr "" -#: ../../reference/simple_stmts.rst:418 +#: ../../reference/simple_stmts.rst:413 msgid "" "Assignments to :const:`__debug__` are illegal. The value for the built-in " "variable is determined when the interpreter starts." msgstr "" -#: ../../reference/simple_stmts.rst:425 +#: ../../reference/simple_stmts.rst:420 msgid "The :keyword:`!pass` statement" msgstr ":keyword:`!pass` 陳述式" -#: ../../reference/simple_stmts.rst:435 +#: ../../reference/simple_stmts.rst:430 msgid "" ":keyword:`pass` is a null operation --- when it is executed, nothing " "happens. It is useful as a placeholder when a statement is required " "syntactically, but no code needs to be executed, for example::" msgstr "" -#: ../../reference/simple_stmts.rst:439 +#: ../../reference/simple_stmts.rst:434 msgid "" "def f(arg): pass # a function that does nothing (yet)\n" "\n" @@ -494,23 +486,23 @@ msgstr "" "\n" "class C: pass # 一個(還)沒有方法的類別" -#: ../../reference/simple_stmts.rst:447 +#: ../../reference/simple_stmts.rst:442 msgid "The :keyword:`!del` statement" msgstr ":keyword:`!del` 陳述式" -#: ../../reference/simple_stmts.rst:457 +#: ../../reference/simple_stmts.rst:452 msgid "" "Deletion is recursively defined very similar to the way assignment is " "defined. Rather than spelling it out in full details, here are some hints." msgstr "" -#: ../../reference/simple_stmts.rst:460 +#: ../../reference/simple_stmts.rst:455 msgid "" "Deletion of a target list recursively deletes each target, from left to " "right." msgstr "" -#: ../../reference/simple_stmts.rst:466 +#: ../../reference/simple_stmts.rst:461 msgid "" "Deletion of a name removes the binding of that name from the local or global " "namespace, depending on whether the name occurs in a :keyword:`global` " @@ -518,50 +510,50 @@ msgid "" "a :exc:`NameError` exception." msgstr "" -#: ../../reference/simple_stmts.rst:473 +#: ../../reference/simple_stmts.rst:468 msgid "" -"Deletion of attribute references, subscriptions and slicings is passed to " -"the primary object involved; deletion of a slicing is in general equivalent " -"to assignment of an empty slice of the right type (but even this is " -"determined by the sliced object)." +"Deletion of attribute references and subscriptions is passed to the primary " +"object involved; deletion of a slicing is in general equivalent to " +"assignment of an empty slice of the right type (but even this is determined " +"by the sliced object)." msgstr "" -#: ../../reference/simple_stmts.rst:478 +#: ../../reference/simple_stmts.rst:473 msgid "" "Previously it was illegal to delete a name from the local namespace if it " "occurs as a free variable in a nested block." msgstr "" -#: ../../reference/simple_stmts.rst:486 +#: ../../reference/simple_stmts.rst:481 msgid "The :keyword:`!return` statement" msgstr ":keyword:`!return` 陳述式" -#: ../../reference/simple_stmts.rst:496 +#: ../../reference/simple_stmts.rst:491 msgid "" ":keyword:`return` may only occur syntactically nested in a function " "definition, not within a nested class definition." msgstr "" -#: ../../reference/simple_stmts.rst:499 +#: ../../reference/simple_stmts.rst:494 msgid "" "If an expression list is present, it is evaluated, else ``None`` is " "substituted." msgstr "" -#: ../../reference/simple_stmts.rst:501 +#: ../../reference/simple_stmts.rst:496 msgid "" ":keyword:`return` leaves the current function call with the expression list " "(or ``None``) as return value." msgstr "" -#: ../../reference/simple_stmts.rst:506 +#: ../../reference/simple_stmts.rst:501 msgid "" "When :keyword:`return` passes control out of a :keyword:`try` statement with " "a :keyword:`finally` clause, that :keyword:`!finally` clause is executed " "before really leaving the function." msgstr "" -#: ../../reference/simple_stmts.rst:510 +#: ../../reference/simple_stmts.rst:505 msgid "" "In a generator function, the :keyword:`return` statement indicates that the " "generator is done and will cause :exc:`StopIteration` to be raised. The " @@ -569,7 +561,7 @@ msgid "" "`StopIteration` and becomes the :attr:`StopIteration.value` attribute." msgstr "" -#: ../../reference/simple_stmts.rst:515 +#: ../../reference/simple_stmts.rst:510 msgid "" "In an asynchronous generator function, an empty :keyword:`return` statement " "indicates that the asynchronous generator is done and will cause :exc:" @@ -577,11 +569,11 @@ msgid "" "is a syntax error in an asynchronous generator function." msgstr "" -#: ../../reference/simple_stmts.rst:523 +#: ../../reference/simple_stmts.rst:518 msgid "The :keyword:`!yield` statement" msgstr ":keyword:`!yield` 陳述式" -#: ../../reference/simple_stmts.rst:535 +#: ../../reference/simple_stmts.rst:530 msgid "" "A :keyword:`yield` statement is semantically equivalent to a :ref:`yield " "expression `. The ``yield`` statement can be used to omit the " @@ -589,7 +581,7 @@ msgid "" "expression statement. For example, the yield statements ::" msgstr "" -#: ../../reference/simple_stmts.rst:540 +#: ../../reference/simple_stmts.rst:535 msgid "" "yield \n" "yield from " @@ -597,11 +589,11 @@ msgstr "" "yield \n" "yield from " -#: ../../reference/simple_stmts.rst:543 +#: ../../reference/simple_stmts.rst:538 msgid "are equivalent to the yield expression statements ::" msgstr "" -#: ../../reference/simple_stmts.rst:545 +#: ../../reference/simple_stmts.rst:540 msgid "" "(yield )\n" "(yield from )" @@ -609,7 +601,7 @@ msgstr "" "(yield )\n" "(yield from )" -#: ../../reference/simple_stmts.rst:548 +#: ../../reference/simple_stmts.rst:543 msgid "" "Yield expressions and statements are only used when defining a :term:" "`generator` function, and are only used in the body of the generator " @@ -618,17 +610,17 @@ msgid "" "function." msgstr "" -#: ../../reference/simple_stmts.rst:553 +#: ../../reference/simple_stmts.rst:548 msgid "" "For full details of :keyword:`yield` semantics, refer to the :ref:" "`yieldexpr` section." msgstr "" -#: ../../reference/simple_stmts.rst:559 +#: ../../reference/simple_stmts.rst:554 msgid "The :keyword:`!raise` statement" msgstr ":keyword:`!raise` 陳述式" -#: ../../reference/simple_stmts.rst:570 +#: ../../reference/simple_stmts.rst:565 msgid "" "If no expressions are present, :keyword:`raise` re-raises the exception that " "is currently being handled, which is also known as the *active exception*. " @@ -636,7 +628,7 @@ msgid "" "exception is raised indicating that this is an error." msgstr "" -#: ../../reference/simple_stmts.rst:575 +#: ../../reference/simple_stmts.rst:570 msgid "" "Otherwise, :keyword:`raise` evaluates the first expression as the exception " "object. It must be either a subclass or an instance of :class:" @@ -644,13 +636,13 @@ msgid "" "when needed by instantiating the class with no arguments." msgstr "" -#: ../../reference/simple_stmts.rst:580 +#: ../../reference/simple_stmts.rst:575 msgid "" "The :dfn:`type` of the exception is the exception instance's class, the :dfn:" "`value` is the instance itself." msgstr "" -#: ../../reference/simple_stmts.rst:585 +#: ../../reference/simple_stmts.rst:580 msgid "" "A traceback object is normally created automatically when an exception is " "raised and attached to it as the :attr:`~BaseException.__traceback__` " @@ -660,11 +652,11 @@ msgid "" "argument), like so::" msgstr "" -#: ../../reference/simple_stmts.rst:591 +#: ../../reference/simple_stmts.rst:586 msgid "raise Exception(\"foo occurred\").with_traceback(tracebackobj)" msgstr "raise Exception(\"foo occurred\").with_traceback(tracebackobj)" -#: ../../reference/simple_stmts.rst:597 +#: ../../reference/simple_stmts.rst:592 msgid "" "The ``from`` clause is used for exception chaining: if given, the second " "*expression* must be another exception class or instance. If the second " @@ -676,7 +668,7 @@ msgid "" "exception is not handled, both exceptions will be printed:" msgstr "" -#: ../../reference/simple_stmts.rst:606 +#: ../../reference/simple_stmts.rst:601 msgid "" ">>> try:\n" "... print(1 / 0)\n" @@ -714,7 +706,7 @@ msgstr "" " raise RuntimeError(\"Something bad happened\") from exc\n" "RuntimeError: Something bad happened" -#: ../../reference/simple_stmts.rst:626 +#: ../../reference/simple_stmts.rst:621 msgid "" "A similar mechanism works implicitly if a new exception is raised when an " "exception is already being handled. An exception may be handled when an :" @@ -723,7 +715,7 @@ msgid "" "exception's :attr:`~BaseException.__context__` attribute:" msgstr "" -#: ../../reference/simple_stmts.rst:632 +#: ../../reference/simple_stmts.rst:627 msgid "" ">>> try:\n" "... print(1 / 0)\n" @@ -761,13 +753,13 @@ msgstr "" " raise RuntimeError(\"Something bad happened\")\n" "RuntimeError: Something bad happened" -#: ../../reference/simple_stmts.rst:652 +#: ../../reference/simple_stmts.rst:647 msgid "" "Exception chaining can be explicitly suppressed by specifying :const:`None` " "in the ``from`` clause:" msgstr "" -#: ../../reference/simple_stmts.rst:655 +#: ../../reference/simple_stmts.rst:650 msgid "" ">>> try:\n" "... print(1 / 0)\n" @@ -787,24 +779,24 @@ msgstr "" " File \"\", line 4, in \n" "RuntimeError: Something bad happened" -#: ../../reference/simple_stmts.rst:666 +#: ../../reference/simple_stmts.rst:661 msgid "" "Additional information on exceptions can be found in section :ref:" "`exceptions`, and information about handling exceptions is in section :ref:" "`try`." msgstr "" -#: ../../reference/simple_stmts.rst:669 +#: ../../reference/simple_stmts.rst:664 msgid ":const:`None` is now permitted as ``Y`` in ``raise X from Y``." msgstr ":const:`None` 現在允許作為 ``raise X from Y`` 中的 ``Y``。" -#: ../../reference/simple_stmts.rst:672 +#: ../../reference/simple_stmts.rst:667 msgid "" "Added the :attr:`~BaseException.__suppress_context__` attribute to suppress " "automatic display of the exception context." msgstr "" -#: ../../reference/simple_stmts.rst:675 +#: ../../reference/simple_stmts.rst:670 msgid "" "If the traceback of the active exception is modified in an :keyword:`except` " "clause, a subsequent ``raise`` statement re-raises the exception with the " @@ -812,41 +804,41 @@ msgid "" "traceback it had when it was caught." msgstr "" -#: ../../reference/simple_stmts.rst:684 +#: ../../reference/simple_stmts.rst:679 msgid "The :keyword:`!break` statement" msgstr ":keyword:`!break` 陳述式" -#: ../../reference/simple_stmts.rst:695 +#: ../../reference/simple_stmts.rst:690 msgid "" ":keyword:`break` may only occur syntactically nested in a :keyword:`for` or :" "keyword:`while` loop, but not nested in a function or class definition " "within that loop." msgstr "" -#: ../../reference/simple_stmts.rst:702 +#: ../../reference/simple_stmts.rst:697 msgid "" "It terminates the nearest enclosing loop, skipping the optional :keyword:`!" "else` clause if the loop has one." msgstr "" -#: ../../reference/simple_stmts.rst:705 +#: ../../reference/simple_stmts.rst:700 msgid "" "If a :keyword:`for` loop is terminated by :keyword:`break`, the loop control " "target keeps its current value." msgstr "" -#: ../../reference/simple_stmts.rst:710 +#: ../../reference/simple_stmts.rst:705 msgid "" "When :keyword:`break` passes control out of a :keyword:`try` statement with " "a :keyword:`finally` clause, that :keyword:`!finally` clause is executed " "before really leaving the loop." msgstr "" -#: ../../reference/simple_stmts.rst:718 +#: ../../reference/simple_stmts.rst:713 msgid "The :keyword:`!continue` statement" msgstr ":keyword:`!continue` 陳述式" -#: ../../reference/simple_stmts.rst:730 +#: ../../reference/simple_stmts.rst:725 msgid "" ":keyword:`continue` may only occur syntactically nested in a :keyword:`for` " "or :keyword:`while` loop, but not nested in a function or class definition " @@ -854,41 +846,41 @@ msgid "" "loop." msgstr "" -#: ../../reference/simple_stmts.rst:734 +#: ../../reference/simple_stmts.rst:729 msgid "" "When :keyword:`continue` passes control out of a :keyword:`try` statement " "with a :keyword:`finally` clause, that :keyword:`!finally` clause is " "executed before really starting the next loop cycle." msgstr "" -#: ../../reference/simple_stmts.rst:743 +#: ../../reference/simple_stmts.rst:738 msgid "The :keyword:`!import` statement" msgstr ":keyword:`!import` 陳述式" -#: ../../reference/simple_stmts.rst:764 +#: ../../reference/simple_stmts.rst:759 msgid "" "The basic import statement (no :keyword:`from` clause) is executed in two " "steps:" msgstr "" -#: ../../reference/simple_stmts.rst:767 +#: ../../reference/simple_stmts.rst:762 msgid "find a module, loading and initializing it if necessary" msgstr "" -#: ../../reference/simple_stmts.rst:768 +#: ../../reference/simple_stmts.rst:763 msgid "" "define a name or names in the local namespace for the scope where the :" "keyword:`import` statement occurs." msgstr "" -#: ../../reference/simple_stmts.rst:771 +#: ../../reference/simple_stmts.rst:766 msgid "" "When the statement contains multiple clauses (separated by commas) the two " "steps are carried out separately for each clause, just as though the clauses " "had been separated out into individual import statements." msgstr "" -#: ../../reference/simple_stmts.rst:776 +#: ../../reference/simple_stmts.rst:771 msgid "" "The details of the first step, finding and loading modules, are described in " "greater detail in the section on the :ref:`import system `, " @@ -899,26 +891,26 @@ msgid "" "module, which includes execution of the module's code." msgstr "" -#: ../../reference/simple_stmts.rst:784 +#: ../../reference/simple_stmts.rst:779 msgid "" "If the requested module is retrieved successfully, it will be made available " "in the local namespace in one of three ways:" msgstr "" -#: ../../reference/simple_stmts.rst:789 +#: ../../reference/simple_stmts.rst:784 msgid "" "If the module name is followed by :keyword:`!as`, then the name following :" "keyword:`!as` is bound directly to the imported module." msgstr "" -#: ../../reference/simple_stmts.rst:791 +#: ../../reference/simple_stmts.rst:786 msgid "" "If no other name is specified, and the module being imported is a top level " "module, the module's name is bound in the local namespace as a reference to " "the imported module" msgstr "" -#: ../../reference/simple_stmts.rst:794 +#: ../../reference/simple_stmts.rst:789 msgid "" "If the module being imported is *not* a top level module, then the name of " "the top level package that contains the module is bound in the local " @@ -926,46 +918,46 @@ msgid "" "be accessed using its full qualified name rather than directly" msgstr "" -#: ../../reference/simple_stmts.rst:804 +#: ../../reference/simple_stmts.rst:799 msgid "The :keyword:`from` form uses a slightly more complex process:" msgstr "" -#: ../../reference/simple_stmts.rst:806 +#: ../../reference/simple_stmts.rst:801 msgid "" "find the module specified in the :keyword:`from` clause, loading and " "initializing it if necessary;" msgstr "" -#: ../../reference/simple_stmts.rst:808 +#: ../../reference/simple_stmts.rst:803 msgid "for each of the identifiers specified in the :keyword:`import` clauses:" msgstr "" -#: ../../reference/simple_stmts.rst:810 +#: ../../reference/simple_stmts.rst:805 msgid "check if the imported module has an attribute by that name" msgstr "" -#: ../../reference/simple_stmts.rst:811 +#: ../../reference/simple_stmts.rst:806 msgid "" "if not, attempt to import a submodule with that name and then check the " "imported module again for that attribute" msgstr "" -#: ../../reference/simple_stmts.rst:813 +#: ../../reference/simple_stmts.rst:808 msgid "if the attribute is not found, :exc:`ImportError` is raised." msgstr "" -#: ../../reference/simple_stmts.rst:814 +#: ../../reference/simple_stmts.rst:809 msgid "" "otherwise, a reference to that value is stored in the local namespace, using " "the name in the :keyword:`!as` clause if it is present, otherwise using the " "attribute name" msgstr "" -#: ../../reference/simple_stmts.rst:818 +#: ../../reference/simple_stmts.rst:813 msgid "Examples::" msgstr "範例: ::" -#: ../../reference/simple_stmts.rst:820 +#: ../../reference/simple_stmts.rst:815 msgid "" "import foo # foo imported and bound locally\n" "import foo.bar.baz # foo, foo.bar, and foo.bar.baz imported, foo " @@ -977,14 +969,14 @@ msgid "" "from foo import attr # foo imported and foo.attr bound as attr" msgstr "" -#: ../../reference/simple_stmts.rst:828 +#: ../../reference/simple_stmts.rst:823 msgid "" "If the list of identifiers is replaced by a star (``'*'``), all public names " "defined in the module are bound in the local namespace for the scope where " "the :keyword:`import` statement occurs." msgstr "" -#: ../../reference/simple_stmts.rst:837 +#: ../../reference/simple_stmts.rst:832 msgid "" "The *public names* defined by a module are determined by checking the " "module's namespace for a variable named ``__all__``; if defined, it must be " @@ -997,14 +989,14 @@ msgid "" "API (such as library modules which were imported and used within the module)." msgstr "" -#: ../../reference/simple_stmts.rst:847 +#: ../../reference/simple_stmts.rst:842 msgid "" "The wild card form of import --- ``from module import *`` --- is only " "allowed at the module level. Attempting to use it in class or function " "definitions will raise a :exc:`SyntaxError`." msgstr "" -#: ../../reference/simple_stmts.rst:854 +#: ../../reference/simple_stmts.rst:849 msgid "" "When specifying what module to import you do not have to specify the " "absolute name of the module. When a module or package is contained within " @@ -1021,13 +1013,13 @@ msgid "" "the :ref:`relativeimports` section." msgstr "" -#: ../../reference/simple_stmts.rst:868 +#: ../../reference/simple_stmts.rst:863 msgid "" ":func:`importlib.import_module` is provided to support applications that " "determine dynamically the modules to be loaded." msgstr "" -#: ../../reference/simple_stmts.rst:871 +#: ../../reference/simple_stmts.rst:866 msgid "" "Raises an :ref:`auditing event ` ``import`` with arguments " "``module``, ``filename``, ``sys.path``, ``sys.meta_path``, ``sys." @@ -1036,18 +1028,18 @@ msgstr "" "引發一個附帶引數 ``module``、``filename``、``sys.path``、``sys.meta_path``、" "``sys.path_hooks`` 的\\ :ref:`稽核事件 ` ``import``。" -#: ../../reference/simple_stmts.rst:876 +#: ../../reference/simple_stmts.rst:871 msgid "Future statements" msgstr "" -#: ../../reference/simple_stmts.rst:882 +#: ../../reference/simple_stmts.rst:877 msgid "" "A :dfn:`future statement` is a directive to the compiler that a particular " "module should be compiled using syntax or semantics that will be available " "in a specified future release of Python where the feature becomes standard." msgstr "" -#: ../../reference/simple_stmts.rst:886 +#: ../../reference/simple_stmts.rst:881 msgid "" "The future statement is intended to ease migration to future versions of " "Python that introduce incompatible changes to the language. It allows use " @@ -1055,35 +1047,35 @@ msgid "" "feature becomes standard." msgstr "" -#: ../../reference/simple_stmts.rst:898 +#: ../../reference/simple_stmts.rst:893 msgid "" "A future statement must appear near the top of the module. The only lines " "that can appear before a future statement are:" msgstr "" -#: ../../reference/simple_stmts.rst:901 +#: ../../reference/simple_stmts.rst:896 msgid "the module docstring (if any)," msgstr "" -#: ../../reference/simple_stmts.rst:902 +#: ../../reference/simple_stmts.rst:897 msgid "comments," msgstr "" -#: ../../reference/simple_stmts.rst:903 +#: ../../reference/simple_stmts.rst:898 msgid "blank lines, and" msgstr "" -#: ../../reference/simple_stmts.rst:904 +#: ../../reference/simple_stmts.rst:899 msgid "other future statements." msgstr "" -#: ../../reference/simple_stmts.rst:906 +#: ../../reference/simple_stmts.rst:901 msgid "" "The only feature that requires using the future statement is ``annotations`` " "(see :pep:`563`)." msgstr "" -#: ../../reference/simple_stmts.rst:909 +#: ../../reference/simple_stmts.rst:904 msgid "" "All historical features enabled by the future statement are still recognized " "by Python 3. The list includes ``absolute_import``, ``division``, " @@ -1093,7 +1085,7 @@ msgid "" "compatibility." msgstr "" -#: ../../reference/simple_stmts.rst:916 +#: ../../reference/simple_stmts.rst:911 msgid "" "A future statement is recognized and treated specially at compile time: " "Changes to the semantics of core constructs are often implemented by " @@ -1103,41 +1095,41 @@ msgid "" "cannot be pushed off until runtime." msgstr "" -#: ../../reference/simple_stmts.rst:923 +#: ../../reference/simple_stmts.rst:918 msgid "" "For any given release, the compiler knows which feature names have been " "defined, and raises a compile-time error if a future statement contains a " "feature not known to it." msgstr "" -#: ../../reference/simple_stmts.rst:927 +#: ../../reference/simple_stmts.rst:922 msgid "" "The direct runtime semantics are the same as for any import statement: there " "is a standard module :mod:`__future__`, described later, and it will be " "imported in the usual way at the time the future statement is executed." msgstr "" -#: ../../reference/simple_stmts.rst:931 +#: ../../reference/simple_stmts.rst:926 msgid "" "The interesting runtime semantics depend on the specific feature enabled by " "the future statement." msgstr "" -#: ../../reference/simple_stmts.rst:934 +#: ../../reference/simple_stmts.rst:929 msgid "Note that there is nothing special about the statement::" msgstr "" -#: ../../reference/simple_stmts.rst:936 +#: ../../reference/simple_stmts.rst:931 msgid "import __future__ [as name]" msgstr "import __future__ [as name]" -#: ../../reference/simple_stmts.rst:938 +#: ../../reference/simple_stmts.rst:933 msgid "" "That is not a future statement; it's an ordinary import statement with no " "special semantics or syntax restrictions." msgstr "" -#: ../../reference/simple_stmts.rst:941 +#: ../../reference/simple_stmts.rst:936 msgid "" "Code compiled by calls to the built-in functions :func:`exec` and :func:" "`compile` that occur in a module :mod:`!M` containing a future statement " @@ -1146,7 +1138,7 @@ msgid "" "--- see the documentation of that function for details." msgstr "" -#: ../../reference/simple_stmts.rst:947 +#: ../../reference/simple_stmts.rst:942 msgid "" "A future statement typed at an interactive interpreter prompt will take " "effect for the rest of the interpreter session. If an interpreter is " @@ -1155,19 +1147,19 @@ msgid "" "interactive session started after the script is executed." msgstr "" -#: ../../reference/simple_stmts.rst:955 +#: ../../reference/simple_stmts.rst:950 msgid ":pep:`236` - Back to the __future__" msgstr "" -#: ../../reference/simple_stmts.rst:956 +#: ../../reference/simple_stmts.rst:951 msgid "The original proposal for the __future__ mechanism." msgstr "" -#: ../../reference/simple_stmts.rst:962 +#: ../../reference/simple_stmts.rst:957 msgid "The :keyword:`!global` statement" msgstr ":keyword:`!global` 陳述式" -#: ../../reference/simple_stmts.rst:972 +#: ../../reference/simple_stmts.rst:967 msgid "" "The :keyword:`global` statement causes the listed identifiers to be " "interpreted as globals. It would be impossible to assign to a global " @@ -1175,7 +1167,7 @@ msgid "" "globals without being declared global." msgstr "" -#: ../../reference/simple_stmts.rst:977 +#: ../../reference/simple_stmts.rst:972 msgid "" "The :keyword:`!global` statement applies to the entire current scope " "(module, function body or class definition). A :exc:`SyntaxError` is raised " @@ -1183,7 +1175,7 @@ msgid "" "scope." msgstr "" -#: ../../reference/simple_stmts.rst:982 +#: ../../reference/simple_stmts.rst:977 msgid "" "At the module level, all variables are global, so a :keyword:`!global` " "statement has no effect. However, variables must still not be used or " @@ -1191,7 +1183,7 @@ msgid "" "is relaxed in the interactive prompt (:term:`REPL`)." msgstr "" -#: ../../reference/simple_stmts.rst:993 +#: ../../reference/simple_stmts.rst:988 msgid "" "**Programmer's note:** :keyword:`global` is a directive to the parser. It " "applies only to code parsed at the same time as the :keyword:`!global` " @@ -1203,11 +1195,11 @@ msgid "" "func:`compile` functions." msgstr "" -#: ../../reference/simple_stmts.rst:1005 +#: ../../reference/simple_stmts.rst:1000 msgid "The :keyword:`!nonlocal` statement" msgstr ":keyword:`!nonlocal` 陳述式" -#: ../../reference/simple_stmts.rst:1013 +#: ../../reference/simple_stmts.rst:1008 msgid "" "When the definition of a function or class is nested (enclosed) within the " "definitions of other functions, its nonlocal scopes are the local scopes of " @@ -1219,64 +1211,64 @@ msgid "" "`SyntaxError` is raised." msgstr "" -#: ../../reference/simple_stmts.rst:1022 +#: ../../reference/simple_stmts.rst:1017 msgid "" "The :keyword:`nonlocal` statement applies to the entire scope of a function " "or class body. A :exc:`SyntaxError` is raised if a variable is used or " "assigned to prior to its nonlocal declaration in the scope." msgstr "" -#: ../../reference/simple_stmts.rst:1028 +#: ../../reference/simple_stmts.rst:1023 msgid ":pep:`3104` - Access to Names in Outer Scopes" msgstr "" -#: ../../reference/simple_stmts.rst:1029 +#: ../../reference/simple_stmts.rst:1024 msgid "The specification for the :keyword:`nonlocal` statement." msgstr "" -#: ../../reference/simple_stmts.rst:1031 +#: ../../reference/simple_stmts.rst:1026 msgid "" "**Programmer's note:** :keyword:`nonlocal` is a directive to the parser and " "applies only to code parsed along with it. See the note for the :keyword:" "`global` statement." msgstr "" -#: ../../reference/simple_stmts.rst:1039 +#: ../../reference/simple_stmts.rst:1034 msgid "The :keyword:`!type` statement" msgstr ":keyword:`!type` 陳述式" -#: ../../reference/simple_stmts.rst:1046 +#: ../../reference/simple_stmts.rst:1041 msgid "" "The :keyword:`!type` statement declares a type alias, which is an instance " "of :class:`typing.TypeAliasType`." msgstr "" -#: ../../reference/simple_stmts.rst:1049 +#: ../../reference/simple_stmts.rst:1044 msgid "For example, the following statement creates a type alias::" msgstr "" -#: ../../reference/simple_stmts.rst:1051 +#: ../../reference/simple_stmts.rst:1046 msgid "type Point = tuple[float, float]" msgstr "" -#: ../../reference/simple_stmts.rst:1053 +#: ../../reference/simple_stmts.rst:1048 msgid "This code is roughly equivalent to::" msgstr "" -#: ../../reference/simple_stmts.rst:1055 +#: ../../reference/simple_stmts.rst:1050 msgid "" "annotation-def VALUE_OF_Point():\n" " return tuple[float, float]\n" "Point = typing.TypeAliasType(\"Point\", VALUE_OF_Point())" msgstr "" -#: ../../reference/simple_stmts.rst:1059 +#: ../../reference/simple_stmts.rst:1054 msgid "" "``annotation-def`` indicates an :ref:`annotation scope `, " "which behaves mostly like a function, but with several small differences." msgstr "" -#: ../../reference/simple_stmts.rst:1062 +#: ../../reference/simple_stmts.rst:1057 msgid "" "The value of the type alias is evaluated in the annotation scope. It is not " "evaluated when the type alias is created, but only when the value is " @@ -1285,21 +1277,21 @@ msgid "" "not yet defined." msgstr "" -#: ../../reference/simple_stmts.rst:1068 +#: ../../reference/simple_stmts.rst:1063 msgid "" "Type aliases may be made generic by adding a :ref:`type parameter list ` after the name. See :ref:`generic-type-aliases` for more." msgstr "" -#: ../../reference/simple_stmts.rst:1071 +#: ../../reference/simple_stmts.rst:1066 msgid ":keyword:`!type` is a :ref:`soft keyword `." msgstr "" -#: ../../reference/simple_stmts.rst:1077 +#: ../../reference/simple_stmts.rst:1072 msgid ":pep:`695` - Type Parameter Syntax" msgstr "" -#: ../../reference/simple_stmts.rst:1078 +#: ../../reference/simple_stmts.rst:1073 msgid "" "Introduced the :keyword:`!type` statement and syntax for generic classes and " "functions." @@ -1310,15 +1302,15 @@ msgid "simple" msgstr "" #: ../../reference/simple_stmts.rst:8 ../../reference/simple_stmts.rst:39 -#: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:263 -#: ../../reference/simple_stmts.rst:322 ../../reference/simple_stmts.rst:384 -#: ../../reference/simple_stmts.rst:427 ../../reference/simple_stmts.rst:449 -#: ../../reference/simple_stmts.rst:462 ../../reference/simple_stmts.rst:488 -#: ../../reference/simple_stmts.rst:525 ../../reference/simple_stmts.rst:561 -#: ../../reference/simple_stmts.rst:686 ../../reference/simple_stmts.rst:720 -#: ../../reference/simple_stmts.rst:745 ../../reference/simple_stmts.rst:878 -#: ../../reference/simple_stmts.rst:964 ../../reference/simple_stmts.rst:1007 -#: ../../reference/simple_stmts.rst:1041 +#: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:258 +#: ../../reference/simple_stmts.rst:317 ../../reference/simple_stmts.rst:379 +#: ../../reference/simple_stmts.rst:422 ../../reference/simple_stmts.rst:444 +#: ../../reference/simple_stmts.rst:457 ../../reference/simple_stmts.rst:483 +#: ../../reference/simple_stmts.rst:520 ../../reference/simple_stmts.rst:556 +#: ../../reference/simple_stmts.rst:681 ../../reference/simple_stmts.rst:715 +#: ../../reference/simple_stmts.rst:740 ../../reference/simple_stmts.rst:873 +#: ../../reference/simple_stmts.rst:959 ../../reference/simple_stmts.rst:1002 +#: ../../reference/simple_stmts.rst:1036 msgid "statement" msgstr "statement(陳述式)" @@ -1327,12 +1319,12 @@ msgid "expression" msgstr "" #: ../../reference/simple_stmts.rst:39 ../../reference/simple_stmts.rst:42 -#: ../../reference/simple_stmts.rst:105 ../../reference/simple_stmts.rst:116 -#: ../../reference/simple_stmts.rst:196 ../../reference/simple_stmts.rst:449 +#: ../../reference/simple_stmts.rst:104 ../../reference/simple_stmts.rst:115 +#: ../../reference/simple_stmts.rst:200 ../../reference/simple_stmts.rst:444 msgid "list" msgstr "list(串列)" -#: ../../reference/simple_stmts.rst:56 ../../reference/simple_stmts.rst:988 +#: ../../reference/simple_stmts.rst:56 ../../reference/simple_stmts.rst:983 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -1341,8 +1333,8 @@ msgid "repr" msgstr "repr" #: ../../reference/simple_stmts.rst:56 ../../reference/simple_stmts.rst:75 -#: ../../reference/simple_stmts.rst:187 ../../reference/simple_stmts.rst:196 -#: ../../reference/simple_stmts.rst:207 ../../reference/simple_stmts.rst:583 +#: ../../reference/simple_stmts.rst:186 ../../reference/simple_stmts.rst:200 +#: ../../reference/simple_stmts.rst:211 ../../reference/simple_stmts.rst:578 msgid "object" msgstr "object(物件)" @@ -1390,21 +1382,21 @@ msgstr "= (等號)" msgid "assignment statement" msgstr "assignment statement(賦值陳述式)" -#: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:116 -#: ../../reference/simple_stmts.rst:159 ../../reference/simple_stmts.rst:187 -#: ../../reference/simple_stmts.rst:220 ../../reference/simple_stmts.rst:263 -#: ../../reference/simple_stmts.rst:322 +#: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:115 +#: ../../reference/simple_stmts.rst:158 ../../reference/simple_stmts.rst:186 +#: ../../reference/simple_stmts.rst:221 ../../reference/simple_stmts.rst:258 +#: ../../reference/simple_stmts.rst:317 msgid "assignment" msgstr "assignment(賦值)" -#: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:745 -#: ../../reference/simple_stmts.rst:800 ../../reference/simple_stmts.rst:964 +#: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:740 +#: ../../reference/simple_stmts.rst:795 ../../reference/simple_stmts.rst:959 msgid "binding" msgstr "binding(繫結)" -#: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:462 -#: ../../reference/simple_stmts.rst:745 ../../reference/simple_stmts.rst:800 -#: ../../reference/simple_stmts.rst:964 +#: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:457 +#: ../../reference/simple_stmts.rst:740 ../../reference/simple_stmts.rst:795 +#: ../../reference/simple_stmts.rst:959 msgid "name" msgstr "name(名稱)" @@ -1412,372 +1404,372 @@ msgstr "name(名稱)" msgid "rebinding" msgstr "rebinding(重新繫結)" -#: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:187 +#: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:186 msgid "mutable" msgstr "mutable(可變的)" -#: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:159 -#: ../../reference/simple_stmts.rst:471 +#: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:158 +#: ../../reference/simple_stmts.rst:466 msgid "attribute" msgstr "attribute(屬性)" -#: ../../reference/simple_stmts.rst:105 ../../reference/simple_stmts.rst:116 -#: ../../reference/simple_stmts.rst:449 ../../reference/simple_stmts.rst:699 +#: ../../reference/simple_stmts.rst:104 ../../reference/simple_stmts.rst:115 +#: ../../reference/simple_stmts.rst:444 ../../reference/simple_stmts.rst:694 msgid "target" msgstr "target" -#: ../../reference/simple_stmts.rst:116 ../../reference/simple_stmts.rst:384 -#: ../../reference/simple_stmts.rst:745 ../../reference/simple_stmts.rst:964 -#: ../../reference/simple_stmts.rst:1007 +#: ../../reference/simple_stmts.rst:115 ../../reference/simple_stmts.rst:379 +#: ../../reference/simple_stmts.rst:740 ../../reference/simple_stmts.rst:959 +#: ../../reference/simple_stmts.rst:1002 msgid ", (comma)" msgstr ", (逗號)" -#: ../../reference/simple_stmts.rst:116 +#: ../../reference/simple_stmts.rst:115 msgid "in target list" msgstr "於目標列表中" -#: ../../reference/simple_stmts.rst:116 ../../reference/simple_stmts.rst:826 +#: ../../reference/simple_stmts.rst:115 ../../reference/simple_stmts.rst:821 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../reference/simple_stmts.rst:116 +#: ../../reference/simple_stmts.rst:115 msgid "in assignment target list" msgstr "於賦值目標列表中" -#: ../../reference/simple_stmts.rst:116 +#: ../../reference/simple_stmts.rst:115 msgid "[] (square brackets)" msgstr "[] (方括號)" -#: ../../reference/simple_stmts.rst:116 +#: ../../reference/simple_stmts.rst:115 msgid "() (parentheses)" msgstr "() (圓括號)" -#: ../../reference/simple_stmts.rst:153 +#: ../../reference/simple_stmts.rst:152 msgid "destructor" msgstr "destructor(解構函式)" -#: ../../reference/simple_stmts.rst:187 +#: ../../reference/simple_stmts.rst:186 msgid "subscription" msgstr "subscription(下標)" -#: ../../reference/simple_stmts.rst:196 +#: ../../reference/simple_stmts.rst:200 msgid "sequence" msgstr "sequence(序列)" -#: ../../reference/simple_stmts.rst:207 +#: ../../reference/simple_stmts.rst:211 msgid "mapping" msgstr "mapping(對映)" -#: ../../reference/simple_stmts.rst:207 +#: ../../reference/simple_stmts.rst:211 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../reference/simple_stmts.rst:220 +#: ../../reference/simple_stmts.rst:221 msgid "slicing" msgstr "slice(切片)" -#: ../../reference/simple_stmts.rst:263 +#: ../../reference/simple_stmts.rst:258 msgid "augmented" msgstr "augmented(增強)" -#: ../../reference/simple_stmts.rst:263 +#: ../../reference/simple_stmts.rst:258 msgid "assignment, augmented" msgstr "assignment(賦值)、augmented(增強)" -#: ../../reference/simple_stmts.rst:263 +#: ../../reference/simple_stmts.rst:258 msgid "+=" msgstr "+=" -#: ../../reference/simple_stmts.rst:263 +#: ../../reference/simple_stmts.rst:258 msgid "augmented assignment" msgstr "augmented assignment(增強賦值)" -#: ../../reference/simple_stmts.rst:263 +#: ../../reference/simple_stmts.rst:258 msgid "-=" msgstr "-=" -#: ../../reference/simple_stmts.rst:263 +#: ../../reference/simple_stmts.rst:258 msgid "*=" msgstr "*=" -#: ../../reference/simple_stmts.rst:263 +#: ../../reference/simple_stmts.rst:258 msgid "/=" msgstr "/=" -#: ../../reference/simple_stmts.rst:263 +#: ../../reference/simple_stmts.rst:258 msgid "%=" msgstr "%=" -#: ../../reference/simple_stmts.rst:263 +#: ../../reference/simple_stmts.rst:258 msgid "&=" msgstr "&=" -#: ../../reference/simple_stmts.rst:263 +#: ../../reference/simple_stmts.rst:258 msgid "^=" msgstr "^=" -#: ../../reference/simple_stmts.rst:263 +#: ../../reference/simple_stmts.rst:258 msgid "|=" msgstr "|=" -#: ../../reference/simple_stmts.rst:263 +#: ../../reference/simple_stmts.rst:258 msgid "**=" msgstr "**=" -#: ../../reference/simple_stmts.rst:263 +#: ../../reference/simple_stmts.rst:258 msgid "//=" msgstr "//=" -#: ../../reference/simple_stmts.rst:263 +#: ../../reference/simple_stmts.rst:258 msgid ">>=" msgstr ">>=" -#: ../../reference/simple_stmts.rst:263 +#: ../../reference/simple_stmts.rst:258 msgid "<<=" msgstr "<<=" -#: ../../reference/simple_stmts.rst:322 +#: ../../reference/simple_stmts.rst:317 msgid "annotated" msgstr "annotated(註釋)" -#: ../../reference/simple_stmts.rst:322 +#: ../../reference/simple_stmts.rst:317 msgid "assignment, annotated" msgstr "assignment(賦值)、annotated(註釋)" -#: ../../reference/simple_stmts.rst:322 +#: ../../reference/simple_stmts.rst:317 msgid ": (colon)" msgstr ": (冒號)" -#: ../../reference/simple_stmts.rst:322 +#: ../../reference/simple_stmts.rst:317 msgid "annotated variable" msgstr "annotated variable(註釋變數)" -#: ../../reference/simple_stmts.rst:384 +#: ../../reference/simple_stmts.rst:379 msgid "assert" msgstr "assert" -#: ../../reference/simple_stmts.rst:384 +#: ../../reference/simple_stmts.rst:379 msgid "debugging" msgstr "debugging(除錯)" -#: ../../reference/simple_stmts.rst:384 +#: ../../reference/simple_stmts.rst:379 msgid "assertions" msgstr "assertions(斷言)" -#: ../../reference/simple_stmts.rst:384 +#: ../../reference/simple_stmts.rst:379 msgid "expression list" msgstr "expression list(運算式列表)" -#: ../../reference/simple_stmts.rst:405 +#: ../../reference/simple_stmts.rst:400 msgid "__debug__" msgstr "__debug__" -#: ../../reference/simple_stmts.rst:405 ../../reference/simple_stmts.rst:525 -#: ../../reference/simple_stmts.rst:561 ../../reference/simple_stmts.rst:593 -#: ../../reference/simple_stmts.rst:745 +#: ../../reference/simple_stmts.rst:400 ../../reference/simple_stmts.rst:520 +#: ../../reference/simple_stmts.rst:556 ../../reference/simple_stmts.rst:588 +#: ../../reference/simple_stmts.rst:740 msgid "exception" msgstr "exception(例外)" -#: ../../reference/simple_stmts.rst:405 +#: ../../reference/simple_stmts.rst:400 msgid "AssertionError" msgstr "AssertionError" -#: ../../reference/simple_stmts.rst:427 +#: ../../reference/simple_stmts.rst:422 msgid "pass" msgstr "pass" -#: ../../reference/simple_stmts.rst:427 +#: ../../reference/simple_stmts.rst:422 msgid "null" msgstr "null" -#: ../../reference/simple_stmts.rst:427 +#: ../../reference/simple_stmts.rst:422 msgid "operation" msgstr "operation(操作)" -#: ../../reference/simple_stmts.rst:449 +#: ../../reference/simple_stmts.rst:444 msgid "del" msgstr "del" -#: ../../reference/simple_stmts.rst:449 ../../reference/simple_stmts.rst:471 +#: ../../reference/simple_stmts.rst:444 ../../reference/simple_stmts.rst:466 msgid "deletion" msgstr "deletion(刪除)" -#: ../../reference/simple_stmts.rst:462 ../../reference/simple_stmts.rst:964 +#: ../../reference/simple_stmts.rst:457 ../../reference/simple_stmts.rst:959 msgid "global" msgstr "global" -#: ../../reference/simple_stmts.rst:462 +#: ../../reference/simple_stmts.rst:457 msgid "unbinding" msgstr "unbinding(解除繫結)" -#: ../../reference/simple_stmts.rst:488 +#: ../../reference/simple_stmts.rst:483 msgid "return" msgstr "return (回傳)" -#: ../../reference/simple_stmts.rst:488 ../../reference/simple_stmts.rst:525 +#: ../../reference/simple_stmts.rst:483 ../../reference/simple_stmts.rst:520 msgid "function" msgstr "function (函式)" -#: ../../reference/simple_stmts.rst:488 +#: ../../reference/simple_stmts.rst:483 msgid "definition" msgstr "definition(定義)" -#: ../../reference/simple_stmts.rst:488 +#: ../../reference/simple_stmts.rst:483 msgid "class" msgstr "class(類別)" -#: ../../reference/simple_stmts.rst:504 ../../reference/simple_stmts.rst:699 -#: ../../reference/simple_stmts.rst:708 ../../reference/simple_stmts.rst:720 -#: ../../reference/simple_stmts.rst:745 +#: ../../reference/simple_stmts.rst:499 ../../reference/simple_stmts.rst:694 +#: ../../reference/simple_stmts.rst:703 ../../reference/simple_stmts.rst:715 +#: ../../reference/simple_stmts.rst:740 msgid "keyword" msgstr "keyword(關鍵字)" -#: ../../reference/simple_stmts.rst:504 ../../reference/simple_stmts.rst:708 -#: ../../reference/simple_stmts.rst:720 +#: ../../reference/simple_stmts.rst:499 ../../reference/simple_stmts.rst:703 +#: ../../reference/simple_stmts.rst:715 msgid "finally" msgstr "finally" -#: ../../reference/simple_stmts.rst:525 +#: ../../reference/simple_stmts.rst:520 msgid "yield" msgstr "yield" -#: ../../reference/simple_stmts.rst:525 +#: ../../reference/simple_stmts.rst:520 msgid "generator" msgstr "generator(產生器)" -#: ../../reference/simple_stmts.rst:525 +#: ../../reference/simple_stmts.rst:520 msgid "iterator" msgstr "iterator(疊代器)" -#: ../../reference/simple_stmts.rst:525 +#: ../../reference/simple_stmts.rst:520 msgid "StopIteration" msgstr "StopIteration" -#: ../../reference/simple_stmts.rst:561 +#: ../../reference/simple_stmts.rst:556 msgid "raise" msgstr "raise" -#: ../../reference/simple_stmts.rst:561 +#: ../../reference/simple_stmts.rst:556 msgid "raising" msgstr "raiseing" -#: ../../reference/simple_stmts.rst:561 +#: ../../reference/simple_stmts.rst:556 msgid "__traceback__ (exception attribute)" msgstr "__traceback__(例外屬性)" -#: ../../reference/simple_stmts.rst:583 +#: ../../reference/simple_stmts.rst:578 msgid "traceback" msgstr "traceback" -#: ../../reference/simple_stmts.rst:593 +#: ../../reference/simple_stmts.rst:588 msgid "chaining" msgstr "chaining(鏈結)" -#: ../../reference/simple_stmts.rst:593 +#: ../../reference/simple_stmts.rst:588 msgid "__cause__ (exception attribute)" msgstr "__cause__(例外屬性)" -#: ../../reference/simple_stmts.rst:593 +#: ../../reference/simple_stmts.rst:588 msgid "__context__ (exception attribute)" msgstr "__context__(例外屬性)" -#: ../../reference/simple_stmts.rst:686 +#: ../../reference/simple_stmts.rst:681 msgid "break" msgstr "break" -#: ../../reference/simple_stmts.rst:686 ../../reference/simple_stmts.rst:720 +#: ../../reference/simple_stmts.rst:681 ../../reference/simple_stmts.rst:715 msgid "for" msgstr "for" -#: ../../reference/simple_stmts.rst:686 ../../reference/simple_stmts.rst:720 +#: ../../reference/simple_stmts.rst:681 ../../reference/simple_stmts.rst:715 msgid "while" msgstr "while" -#: ../../reference/simple_stmts.rst:686 ../../reference/simple_stmts.rst:720 +#: ../../reference/simple_stmts.rst:681 ../../reference/simple_stmts.rst:715 msgid "loop" msgstr "loop(迴圈)" -#: ../../reference/simple_stmts.rst:699 +#: ../../reference/simple_stmts.rst:694 msgid "else" msgstr "else" -#: ../../reference/simple_stmts.rst:699 +#: ../../reference/simple_stmts.rst:694 msgid "loop control" msgstr "loop control(迴圈控制)" -#: ../../reference/simple_stmts.rst:720 +#: ../../reference/simple_stmts.rst:715 msgid "continue" msgstr "continue" -#: ../../reference/simple_stmts.rst:745 ../../reference/simple_stmts.rst:851 +#: ../../reference/simple_stmts.rst:740 ../../reference/simple_stmts.rst:846 msgid "import" msgstr "import(引入)" -#: ../../reference/simple_stmts.rst:745 +#: ../../reference/simple_stmts.rst:740 msgid "module" msgstr "module(模組)" -#: ../../reference/simple_stmts.rst:745 +#: ../../reference/simple_stmts.rst:740 msgid "importing" msgstr "importing(引入)" -#: ../../reference/simple_stmts.rst:745 ../../reference/simple_stmts.rst:800 +#: ../../reference/simple_stmts.rst:740 ../../reference/simple_stmts.rst:795 msgid "from" msgstr "from" -#: ../../reference/simple_stmts.rst:745 ../../reference/simple_stmts.rst:787 +#: ../../reference/simple_stmts.rst:740 ../../reference/simple_stmts.rst:782 msgid "as" msgstr "as" -#: ../../reference/simple_stmts.rst:745 +#: ../../reference/simple_stmts.rst:740 msgid "ImportError" msgstr "ImportError" -#: ../../reference/simple_stmts.rst:745 ../../reference/simple_stmts.rst:787 -#: ../../reference/simple_stmts.rst:800 ../../reference/simple_stmts.rst:826 +#: ../../reference/simple_stmts.rst:740 ../../reference/simple_stmts.rst:782 +#: ../../reference/simple_stmts.rst:795 ../../reference/simple_stmts.rst:821 msgid "import statement" msgstr "import statement(引入陳述式)" -#: ../../reference/simple_stmts.rst:832 +#: ../../reference/simple_stmts.rst:827 msgid "__all__ (optional module attribute)" msgstr "__all__(可選模組屬性)" -#: ../../reference/simple_stmts.rst:851 +#: ../../reference/simple_stmts.rst:846 msgid "relative" msgstr "relative(相對)" -#: ../../reference/simple_stmts.rst:878 +#: ../../reference/simple_stmts.rst:873 msgid "future" msgstr "future" -#: ../../reference/simple_stmts.rst:878 +#: ../../reference/simple_stmts.rst:873 msgid "__future__" msgstr "__future__" -#: ../../reference/simple_stmts.rst:878 +#: ../../reference/simple_stmts.rst:873 msgid "future statement" msgstr "future statement(future 陳述式)" -#: ../../reference/simple_stmts.rst:964 ../../reference/simple_stmts.rst:1007 +#: ../../reference/simple_stmts.rst:959 ../../reference/simple_stmts.rst:1002 msgid "identifier list" msgstr "identifier list(識別符號清單)" -#: ../../reference/simple_stmts.rst:988 +#: ../../reference/simple_stmts.rst:983 msgid "exec" msgstr "exec" -#: ../../reference/simple_stmts.rst:988 +#: ../../reference/simple_stmts.rst:983 msgid "eval" msgstr "eval" -#: ../../reference/simple_stmts.rst:988 +#: ../../reference/simple_stmts.rst:983 msgid "compile" msgstr "compile(編譯)" -#: ../../reference/simple_stmts.rst:1007 +#: ../../reference/simple_stmts.rst:1002 msgid "nonlocal" msgstr "nonlocal" -#: ../../reference/simple_stmts.rst:1041 +#: ../../reference/simple_stmts.rst:1036 msgid "type" msgstr "" From 3e87fb10eb2266b10e346a72ee272c46aab857f9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 6 Feb 2026 00:19:33 +0000 Subject: [PATCH 10/11] sync with cpython 6614a3c3 --- library/urllib.parse.po | 622 ++++++++++++++++++------------------- library/venv.po | 15 +- library/wsgiref.po | 639 +++++++++++++++++++------------------- reference/simple_stmts.po | 154 ++++----- 4 files changed, 709 insertions(+), 721 deletions(-) diff --git a/library/urllib.parse.po b/library/urllib.parse.po index a40a8c363b..0cab1b4fdc 100644 --- a/library/urllib.parse.po +++ b/library/urllib.parse.po @@ -6,7 +6,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-02-06 00:18+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -79,27 +79,28 @@ msgstr "" #: ../../library/urllib.parse.rst:55 msgid "" -"Parse a URL into six components, returning a 6-item :term:`named tuple`. " -"This corresponds to the general structure of a URL: ``scheme://netloc/" -"path;parameters?query#fragment``. Each tuple item is a string, possibly " -"empty. The components are not broken up into smaller parts (for example, the " -"network location is a single string), and % escapes are not expanded. The " -"delimiters as shown above are not part of the result, except for a leading " -"slash in the *path* component, which is retained if present. For example:" +"Parse a URL into five components, returning a 5-item :term:`named tuple` :" +"class:`SplitResult` or :class:`SplitResultBytes`. This corresponds to the " +"general structure of a URL: ``scheme://netloc/path?query#fragment``. Each " +"tuple item is a string, possibly empty. The components are not broken up " +"into smaller parts (for example, the network location is a single string), " +"and % escapes are not expanded. The delimiters as shown above are not part " +"of the result, except for a leading slash in the *path* component, which is " +"retained if present. For example:" msgstr "" -#: ../../library/urllib.parse.rst:64 +#: ../../library/urllib.parse.rst:65 +#, fuzzy msgid "" -">>> from urllib.parse import urlparse\n" -">>> urlparse(\"scheme://netloc/path;parameters?query#fragment\")\n" -"ParseResult(scheme='scheme', netloc='netloc', path='/path;parameters', " -"params='',\n" +">>> from urllib.parse import urlsplit\n" +">>> urlsplit(\"scheme://netloc/path?query#fragment\")\n" +"SplitResult(scheme='scheme', netloc='netloc', path='/path',\n" " query='query', fragment='fragment')\n" -">>> o = urlparse(\"http://docs.python.org:80/3/library/urllib.parse.html?\"\n" +">>> o = urlsplit(\"http://docs.python.org:80/3/library/urllib.parse.html?\"\n" "... \"highlight=params#url-parsing\")\n" ">>> o\n" -"ParseResult(scheme='http', netloc='docs.python.org:80',\n" -" path='/3/library/urllib.parse.html', params='',\n" +"SplitResult(scheme='http', netloc='docs.python.org:80',\n" +" path='/3/library/urllib.parse.html',\n" " query='highlight=params', fragment='url-parsing')\n" ">>> o.scheme\n" "'http'\n" @@ -134,31 +135,33 @@ msgstr "" ">>> o._replace(fragment=\"\").geturl()\n" "'http://docs.python.org:80/3/library/urllib.parse.html?highlight=params'" -#: ../../library/urllib.parse.rst:88 +#: ../../library/urllib.parse.rst:89 msgid "" -"Following the syntax specifications in :rfc:`1808`, urlparse recognizes a " -"netloc only if it is properly introduced by '//'. Otherwise the input is " -"presumed to be a relative URL and thus to start with a path component." +"Following the syntax specifications in :rfc:`1808`, :func:`!urlsplit` " +"recognizes a netloc only if it is properly introduced by '//'. Otherwise " +"the input is presumed to be a relative URL and thus to start with a path " +"component." msgstr "" -#: ../../library/urllib.parse.rst:93 +#: ../../library/urllib.parse.rst:94 +#, fuzzy msgid "" -">>> from urllib.parse import urlparse\n" -">>> urlparse('//www.cwi.nl:80/%7Eguido/Python.html')\n" -"ParseResult(scheme='', netloc='www.cwi.nl:80', path='/%7Eguido/" -"Python.html',\n" -" params='', query='', fragment='')\n" -">>> urlparse('www.cwi.nl/%7Eguido/Python.html')\n" -"ParseResult(scheme='', netloc='', path='www.cwi.nl/%7Eguido/Python.html',\n" -" params='', query='', fragment='')\n" -">>> urlparse('help/Python.html')\n" -"ParseResult(scheme='', netloc='', path='help/Python.html', params='',\n" +">>> from urllib.parse import urlsplit\n" +">>> urlsplit('//www.cwi.nl:80/%7Eguido/Python.html')\n" +"SplitResult(scheme='', netloc='www.cwi.nl:80', path='/%7Eguido/Python." +"html',\n" +" query='', fragment='')\n" +">>> urlsplit('www.cwi.nl/%7Eguido/Python.html')\n" +"SplitResult(scheme='', netloc='', path='www.cwi.nl/%7Eguido/Python.html',\n" +" query='', fragment='')\n" +">>> urlsplit('help/Python.html')\n" +"SplitResult(scheme='', netloc='', path='help/Python.html',\n" " query='', fragment='')" msgstr "" ">>> from urllib.parse import urlparse\n" ">>> urlparse('//www.cwi.nl:80/%7Eguido/Python.html')\n" -"ParseResult(scheme='', netloc='www.cwi.nl:80', path='/%7Eguido/" -"Python.html',\n" +"ParseResult(scheme='', netloc='www.cwi.nl:80', path='/%7Eguido/Python." +"html',\n" " params='', query='', fragment='')\n" ">>> urlparse('www.cwi.nl/%7Eguido/Python.html')\n" "ParseResult(scheme='', netloc='', path='www.cwi.nl/%7Eguido/Python.html',\n" @@ -167,7 +170,7 @@ msgstr "" "ParseResult(scheme='', netloc='', path='help/Python.html', params='',\n" " query='', fragment='')" -#: ../../library/urllib.parse.rst:107 +#: ../../library/urllib.parse.rst:108 msgid "" "The *scheme* argument gives the default addressing scheme, to be used only " "if the URL does not specify one. It should be the same type (text or bytes) " @@ -175,7 +178,7 @@ msgid "" "is automatically converted to ``b''`` if appropriate." msgstr "" -#: ../../library/urllib.parse.rst:112 +#: ../../library/urllib.parse.rst:113 msgid "" "If the *allow_fragments* argument is false, fragment identifiers are not " "recognized. Instead, they are parsed as part of the path, parameters or " @@ -183,174 +186,149 @@ msgid "" "return value." msgstr "" -#: ../../library/urllib.parse.rst:117 +#: ../../library/urllib.parse.rst:118 msgid "" "The return value is a :term:`named tuple`, which means that its items can be " "accessed by index or as named attributes, which are:" msgstr "" -#: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:314 -#: ../../library/urllib.parse.rst:436 +#: ../../library/urllib.parse.rst:122 ../../library/urllib.parse.rst:388 msgid "Attribute" msgstr "屬性" -#: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:314 -#: ../../library/urllib.parse.rst:436 +#: ../../library/urllib.parse.rst:122 ../../library/urllib.parse.rst:388 msgid "Index" msgstr "" -#: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:314 -#: ../../library/urllib.parse.rst:436 +#: ../../library/urllib.parse.rst:122 ../../library/urllib.parse.rst:388 msgid "Value" msgstr "" -#: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:314 -#: ../../library/urllib.parse.rst:436 +#: ../../library/urllib.parse.rst:122 ../../library/urllib.parse.rst:388 msgid "Value if not present" msgstr "" -#: ../../library/urllib.parse.rst:123 ../../library/urllib.parse.rst:316 +#: ../../library/urllib.parse.rst:124 msgid ":attr:`scheme`" msgstr ":attr:`scheme`" -#: ../../library/urllib.parse.rst:123 ../../library/urllib.parse.rst:316 -#: ../../library/urllib.parse.rst:438 +#: ../../library/urllib.parse.rst:124 ../../library/urllib.parse.rst:390 msgid "0" msgstr "0" -#: ../../library/urllib.parse.rst:123 ../../library/urllib.parse.rst:316 +#: ../../library/urllib.parse.rst:124 msgid "URL scheme specifier" msgstr "" -#: ../../library/urllib.parse.rst:123 ../../library/urllib.parse.rst:316 +#: ../../library/urllib.parse.rst:124 msgid "*scheme* parameter" msgstr "" -#: ../../library/urllib.parse.rst:125 ../../library/urllib.parse.rst:318 +#: ../../library/urllib.parse.rst:126 msgid ":attr:`netloc`" msgstr ":attr:`netloc`" -#: ../../library/urllib.parse.rst:125 ../../library/urllib.parse.rst:318 -#: ../../library/urllib.parse.rst:440 +#: ../../library/urllib.parse.rst:126 ../../library/urllib.parse.rst:392 msgid "1" msgstr "1" -#: ../../library/urllib.parse.rst:125 ../../library/urllib.parse.rst:318 +#: ../../library/urllib.parse.rst:126 msgid "Network location part" msgstr "" -#: ../../library/urllib.parse.rst:125 ../../library/urllib.parse.rst:127 -#: ../../library/urllib.parse.rst:129 ../../library/urllib.parse.rst:132 -#: ../../library/urllib.parse.rst:134 ../../library/urllib.parse.rst:318 -#: ../../library/urllib.parse.rst:320 ../../library/urllib.parse.rst:322 -#: ../../library/urllib.parse.rst:324 ../../library/urllib.parse.rst:438 -#: ../../library/urllib.parse.rst:440 +#: ../../library/urllib.parse.rst:126 ../../library/urllib.parse.rst:128 +#: ../../library/urllib.parse.rst:130 ../../library/urllib.parse.rst:132 +#: ../../library/urllib.parse.rst:390 ../../library/urllib.parse.rst:392 msgid "empty string" msgstr "" -#: ../../library/urllib.parse.rst:127 ../../library/urllib.parse.rst:320 +#: ../../library/urllib.parse.rst:128 msgid ":attr:`path`" msgstr ":attr:`path`" -#: ../../library/urllib.parse.rst:127 ../../library/urllib.parse.rst:320 +#: ../../library/urllib.parse.rst:128 msgid "2" msgstr "2" -#: ../../library/urllib.parse.rst:127 ../../library/urllib.parse.rst:320 +#: ../../library/urllib.parse.rst:128 msgid "Hierarchical path" msgstr "" -#: ../../library/urllib.parse.rst:129 -msgid ":attr:`params`" -msgstr ":attr:`params`" - -#: ../../library/urllib.parse.rst:129 ../../library/urllib.parse.rst:322 -msgid "3" -msgstr "3" - -#: ../../library/urllib.parse.rst:129 -msgid "Parameters for last path element" -msgstr "" - -#: ../../library/urllib.parse.rst:132 ../../library/urllib.parse.rst:322 +#: ../../library/urllib.parse.rst:130 msgid ":attr:`query`" msgstr ":attr:`query`" -#: ../../library/urllib.parse.rst:132 ../../library/urllib.parse.rst:324 -msgid "4" -msgstr "4" +#: ../../library/urllib.parse.rst:130 +msgid "3" +msgstr "3" -#: ../../library/urllib.parse.rst:132 ../../library/urllib.parse.rst:322 +#: ../../library/urllib.parse.rst:130 msgid "Query component" msgstr "" -#: ../../library/urllib.parse.rst:134 ../../library/urllib.parse.rst:324 -#: ../../library/urllib.parse.rst:440 +#: ../../library/urllib.parse.rst:132 ../../library/urllib.parse.rst:392 msgid ":attr:`fragment`" msgstr ":attr:`fragment`" -#: ../../library/urllib.parse.rst:134 -msgid "5" -msgstr "5" +#: ../../library/urllib.parse.rst:132 +msgid "4" +msgstr "4" -#: ../../library/urllib.parse.rst:134 ../../library/urllib.parse.rst:324 -#: ../../library/urllib.parse.rst:440 +#: ../../library/urllib.parse.rst:132 ../../library/urllib.parse.rst:392 msgid "Fragment identifier" msgstr "" -#: ../../library/urllib.parse.rst:136 ../../library/urllib.parse.rst:326 +#: ../../library/urllib.parse.rst:134 msgid ":attr:`username`" msgstr ":attr:`username`" -#: ../../library/urllib.parse.rst:136 ../../library/urllib.parse.rst:326 +#: ../../library/urllib.parse.rst:134 msgid "User name" msgstr "" -#: ../../library/urllib.parse.rst:136 ../../library/urllib.parse.rst:138 -#: ../../library/urllib.parse.rst:140 ../../library/urllib.parse.rst:142 -#: ../../library/urllib.parse.rst:326 ../../library/urllib.parse.rst:328 -#: ../../library/urllib.parse.rst:330 ../../library/urllib.parse.rst:332 +#: ../../library/urllib.parse.rst:134 ../../library/urllib.parse.rst:136 +#: ../../library/urllib.parse.rst:138 ../../library/urllib.parse.rst:140 msgid ":const:`None`" msgstr ":const:`None`" -#: ../../library/urllib.parse.rst:138 ../../library/urllib.parse.rst:328 +#: ../../library/urllib.parse.rst:136 msgid ":attr:`password`" msgstr ":attr:`password`" -#: ../../library/urllib.parse.rst:138 ../../library/urllib.parse.rst:328 +#: ../../library/urllib.parse.rst:136 msgid "Password" msgstr "" -#: ../../library/urllib.parse.rst:140 ../../library/urllib.parse.rst:330 +#: ../../library/urllib.parse.rst:138 msgid ":attr:`hostname`" msgstr ":attr:`hostname`" -#: ../../library/urllib.parse.rst:140 ../../library/urllib.parse.rst:330 +#: ../../library/urllib.parse.rst:138 msgid "Host name (lower case)" msgstr "" -#: ../../library/urllib.parse.rst:142 ../../library/urllib.parse.rst:332 +#: ../../library/urllib.parse.rst:140 msgid ":attr:`port`" msgstr ":attr:`port`" -#: ../../library/urllib.parse.rst:142 ../../library/urllib.parse.rst:332 +#: ../../library/urllib.parse.rst:140 msgid "Port number as integer, if present" msgstr "" -#: ../../library/urllib.parse.rst:146 ../../library/urllib.parse.rst:336 +#: ../../library/urllib.parse.rst:144 msgid "" "Reading the :attr:`port` attribute will raise a :exc:`ValueError` if an " "invalid port is specified in the URL. See section :ref:`urlparse-result-" "object` for more information on the result object." msgstr "" -#: ../../library/urllib.parse.rst:150 ../../library/urllib.parse.rst:340 +#: ../../library/urllib.parse.rst:148 msgid "" -"Unmatched square brackets in the :attr:`netloc` attribute will raise " -"a :exc:`ValueError`." +"Unmatched square brackets in the :attr:`netloc` attribute will raise a :exc:" +"`ValueError`." msgstr "" -#: ../../library/urllib.parse.rst:153 ../../library/urllib.parse.rst:343 +#: ../../library/urllib.parse.rst:151 msgid "" "Characters in the :attr:`netloc` attribute that decompose under NFKC " "normalization (as used by the IDNA encoding) into any of ``/``, ``?``, " @@ -358,76 +336,93 @@ msgid "" "decomposed before parsing, no error will be raised." msgstr "" -#: ../../library/urllib.parse.rst:158 +#: ../../library/urllib.parse.rst:156 +msgid "" +"Following some of the `WHATWG spec`_ that updates :rfc:`3986`, leading C0 " +"control and space characters are stripped from the URL. ``\\n``, ``\\r`` and " +"tab ``\\t`` characters are removed from the URL at any position." +msgstr "" + +#: ../../library/urllib.parse.rst:160 msgid "" "As is the case with all named tuples, the subclass has a few additional " -"methods and attributes that are particularly useful. One such method " -"is :meth:`_replace`. The :meth:`_replace` method will return a new " -"ParseResult object replacing specified fields with new values." +"methods and attributes that are particularly useful. One such method is :" +"meth:`_replace`. The :meth:`_replace` method will return a new :class:" +"`SplitResult` object replacing specified fields with new values." msgstr "" -#: ../../library/urllib.parse.rst:163 +#: ../../library/urllib.parse.rst:165 +#, fuzzy msgid "" -">>> from urllib.parse import urlparse\n" -">>> u = urlparse('//www.cwi.nl:80/%7Eguido/Python.html')\n" +">>> from urllib.parse import urlsplit\n" +">>> u = urlsplit('//www.cwi.nl:80/%7Eguido/Python.html')\n" ">>> u\n" -"ParseResult(scheme='', netloc='www.cwi.nl:80', path='/%7Eguido/" -"Python.html',\n" -" params='', query='', fragment='')\n" +"SplitResult(scheme='', netloc='www.cwi.nl:80', path='/%7Eguido/Python." +"html',\n" +" query='', fragment='')\n" ">>> u._replace(scheme='http')\n" -"ParseResult(scheme='http', netloc='www.cwi.nl:80', path='/%7Eguido/" -"Python.html',\n" -" params='', query='', fragment='')" +"SplitResult(scheme='http', netloc='www.cwi.nl:80', path='/%7Eguido/Python." +"html',\n" +" query='', fragment='')" msgstr "" ">>> from urllib.parse import urlparse\n" ">>> u = urlparse('//www.cwi.nl:80/%7Eguido/Python.html')\n" ">>> u\n" -"ParseResult(scheme='', netloc='www.cwi.nl:80', path='/%7Eguido/" -"Python.html',\n" +"ParseResult(scheme='', netloc='www.cwi.nl:80', path='/%7Eguido/Python." +"html',\n" " params='', query='', fragment='')\n" ">>> u._replace(scheme='http')\n" -"ParseResult(scheme='http', netloc='www.cwi.nl:80', path='/%7Eguido/" -"Python.html',\n" +"ParseResult(scheme='http', netloc='www.cwi.nl:80', path='/%7Eguido/Python." +"html',\n" " params='', query='', fragment='')" -#: ../../library/urllib.parse.rst:177 +#: ../../library/urllib.parse.rst:179 msgid "" -":func:`urlparse` does not perform validation. See :ref:`URL parsing " +":func:`urlsplit` does not perform validation. See :ref:`URL parsing " "security ` for details." msgstr "" -#: ../../library/urllib.parse.rst:180 +#: ../../library/urllib.parse.rst:182 msgid "Added IPv6 URL parsing capabilities." msgstr "新增剖析 IPv6 URL 的能力。" -#: ../../library/urllib.parse.rst:183 +#: ../../library/urllib.parse.rst:185 msgid "" "The fragment is now parsed for all URL schemes (unless *allow_fragments* is " "false), in accordance with :rfc:`3986`. Previously, an allowlist of schemes " "that support fragments existed." msgstr "" -#: ../../library/urllib.parse.rst:188 ../../library/urllib.parse.rst:357 +#: ../../library/urllib.parse.rst:190 msgid "" -"Out-of-range port numbers now raise :exc:`ValueError`, instead of " -"returning :const:`None`." +"Out-of-range port numbers now raise :exc:`ValueError`, instead of returning :" +"const:`None`." msgstr "" -#: ../../library/urllib.parse.rst:192 ../../library/urllib.parse.rst:361 +#: ../../library/urllib.parse.rst:194 msgid "" "Characters that affect netloc parsing under NFKC normalization will now " "raise :exc:`ValueError`." msgstr "" -#: ../../library/urllib.parse.rst:199 +#: ../../library/urllib.parse.rst:198 +msgid "ASCII newline and tab characters are stripped from the URL." +msgstr "" + +#: ../../library/urllib.parse.rst:201 +msgid "" +"Leading WHATWG C0 control and space characters are stripped from the URL." +msgstr "" + +#: ../../library/urllib.parse.rst:209 msgid "" -"Parse a query string given as a string argument (data of " -"type :mimetype:`application/x-www-form-urlencoded`). Data are returned as a " -"dictionary. The dictionary keys are the unique query variable names and the " -"values are lists of values for each name." +"Parse a query string given as a string argument (data of type :mimetype:" +"`application/x-www-form-urlencoded`). Data are returned as a dictionary. " +"The dictionary keys are the unique query variable names and the values are " +"lists of values for each name." msgstr "" -#: ../../library/urllib.parse.rst:204 ../../library/urllib.parse.rst:253 +#: ../../library/urllib.parse.rst:214 ../../library/urllib.parse.rst:263 msgid "" "The optional argument *keep_blank_values* is a flag indicating whether blank " "values in percent-encoded queries should be treated as blank strings. A true " @@ -436,48 +431,48 @@ msgid "" "treated as if they were not included." msgstr "" -#: ../../library/urllib.parse.rst:210 ../../library/urllib.parse.rst:259 +#: ../../library/urllib.parse.rst:220 ../../library/urllib.parse.rst:269 msgid "" "The optional argument *strict_parsing* is a flag indicating what to do with " "parsing errors. If false (the default), errors are silently ignored. If " "true, errors raise a :exc:`ValueError` exception." msgstr "" -#: ../../library/urllib.parse.rst:214 ../../library/urllib.parse.rst:263 +#: ../../library/urllib.parse.rst:224 ../../library/urllib.parse.rst:273 msgid "" "The optional *encoding* and *errors* parameters specify how to decode " -"percent-encoded sequences into Unicode characters, as accepted by " -"the :meth:`bytes.decode` method." +"percent-encoded sequences into Unicode characters, as accepted by the :meth:" +"`bytes.decode` method." msgstr "" -#: ../../library/urllib.parse.rst:218 ../../library/urllib.parse.rst:267 +#: ../../library/urllib.parse.rst:228 ../../library/urllib.parse.rst:277 msgid "" "The optional argument *max_num_fields* is the maximum number of fields to " "read. If set, then throws a :exc:`ValueError` if there are more than " "*max_num_fields* fields read." msgstr "" -#: ../../library/urllib.parse.rst:222 ../../library/urllib.parse.rst:271 +#: ../../library/urllib.parse.rst:232 ../../library/urllib.parse.rst:281 msgid "" "The optional argument *separator* is the symbol to use for separating the " "query arguments. It defaults to ``&``." msgstr "" -#: ../../library/urllib.parse.rst:225 +#: ../../library/urllib.parse.rst:235 msgid "" "Use the :func:`urllib.parse.urlencode` function (with the ``doseq`` " "parameter set to ``True``) to convert such dictionaries into query strings." msgstr "" -#: ../../library/urllib.parse.rst:230 ../../library/urllib.parse.rst:277 +#: ../../library/urllib.parse.rst:240 ../../library/urllib.parse.rst:287 msgid "Add *encoding* and *errors* parameters." msgstr "新增 *encoding* 和 *errors* 參數。" -#: ../../library/urllib.parse.rst:233 ../../library/urllib.parse.rst:280 +#: ../../library/urllib.parse.rst:243 ../../library/urllib.parse.rst:290 msgid "Added *max_num_fields* parameter." msgstr "新增 *max_num_fields* 參數。" -#: ../../library/urllib.parse.rst:236 ../../library/urllib.parse.rst:283 +#: ../../library/urllib.parse.rst:246 ../../library/urllib.parse.rst:293 msgid "" "Added *separator* parameter with the default value of ``&``. Python versions " "earlier than Python 3.10 allowed using both ``;`` and ``&`` as query " @@ -485,88 +480,63 @@ msgid "" "key, with ``&`` as the default separator." msgstr "" -#: ../../library/urllib.parse.rst:242 ../../library/urllib.parse.rst:761 +#: ../../library/urllib.parse.rst:252 ../../library/urllib.parse.rst:713 msgid "" "Accepting objects with false values (like ``0`` and ``[]``) except empty " "strings and byte-like objects and ``None`` is now deprecated." msgstr "" -#: ../../library/urllib.parse.rst:249 +#: ../../library/urllib.parse.rst:259 msgid "" -"Parse a query string given as a string argument (data of " -"type :mimetype:`application/x-www-form-urlencoded`). Data are returned as a " -"list of name, value pairs." +"Parse a query string given as a string argument (data of type :mimetype:" +"`application/x-www-form-urlencoded`). Data are returned as a list of name, " +"value pairs." msgstr "" -#: ../../library/urllib.parse.rst:274 +#: ../../library/urllib.parse.rst:284 msgid "" "Use the :func:`urllib.parse.urlencode` function to convert such lists of " "pairs into query strings." msgstr "" -#: ../../library/urllib.parse.rst:292 +#: ../../library/urllib.parse.rst:302 msgid "" -"Construct a URL from a tuple as returned by ``urlparse()``. The *parts* " -"argument can be any six-item iterable. This may result in a slightly " +"Construct a URL from a tuple as returned by ``urlsplit()``. The *parts* " +"argument can be any five-item iterable. This may result in a slightly " "different, but equivalent URL, if the URL that was parsed originally had " "unnecessary delimiters (for example, a ``?`` with an empty query; the RFC " "states that these are equivalent)." msgstr "" -#: ../../library/urllib.parse.rst:301 +#: ../../library/urllib.parse.rst:311 msgid "" -"This is similar to :func:`urlparse`, but does not split the params from the " -"URL. This should generally be used instead of :func:`urlparse` if the more " -"recent URL syntax allowing parameters to be applied to each segment of the " -"*path* portion of the URL (see :rfc:`2396`) is wanted. A separate function " -"is needed to separate the path segments and parameters. This function " -"returns a 5-item :term:`named tuple`::" +"This is similar to :func:`urlsplit`, but additionally splits the *path* " +"component on *path* and *params*. This function returns a 6-item :term:" +"`named tuple` :class:`ParseResult` or :class:`ParseResultBytes`. Its items " +"are the same as for the :func:`!urlsplit` result, except that *params* is " +"inserted at index 3, between *path* and *query*." msgstr "" -#: ../../library/urllib.parse.rst:308 +#: ../../library/urllib.parse.rst:318 msgid "" -"(addressing scheme, network location, path, query, fragment identifier)." +"This function is based on obsoleted :rfc:`1738` and :rfc:`1808`, which " +"listed *params* as the main URL component. The more recent URL syntax allows " +"parameters to be applied to each segment of the *path* portion of the URL " +"(see :rfc:`3986`). :func:`urlsplit` should generally be used instead of :" +"func:`urlparse`. A separate function is needed to separate the path segments " +"and parameters." msgstr "" -"(addressing scheme, network location, path, query, fragment identifier)." -#: ../../library/urllib.parse.rst:310 ../../library/urllib.parse.rst:432 +#: ../../library/urllib.parse.rst:327 msgid "" -"The return value is a :term:`named tuple`, its items can be accessed by " -"index or as named attributes:" +"Combine the elements of a tuple as returned by :func:`urlparse` into a " +"complete URL as a string. The *parts* argument can be any six-item iterable. " +"This may result in a slightly different, but equivalent URL, if the URL that " +"was parsed originally had unnecessary delimiters (for example, a ? with an " +"empty query; the RFC states that these are equivalent)." msgstr "" -#: ../../library/urllib.parse.rst:348 -msgid "" -"Following some of the `WHATWG spec`_ that updates RFC 3986, leading C0 " -"control and space characters are stripped from the URL. ``\\n``, ``\\r`` and " -"tab ``\\t`` characters are removed from the URL at any position." -msgstr "" - -#: ../../library/urllib.parse.rst:354 -msgid "" -":func:`urlsplit` does not perform validation. See :ref:`URL parsing " -"security ` for details." -msgstr "" - -#: ../../library/urllib.parse.rst:365 -msgid "ASCII newline and tab characters are stripped from the URL." -msgstr "" - -#: ../../library/urllib.parse.rst:368 -msgid "" -"Leading WHATWG C0 control and space characters are stripped from the URL." -msgstr "" - -#: ../../library/urllib.parse.rst:375 -msgid "" -"Combine the elements of a tuple as returned by :func:`urlsplit` into a " -"complete URL as a string. The *parts* argument can be any five-item " -"iterable. This may result in a slightly different, but equivalent URL, if " -"the URL that was parsed originally had unnecessary delimiters (for example, " -"a ? with an empty query; the RFC states that these are equivalent)." -msgstr "" - -#: ../../library/urllib.parse.rst:384 +#: ../../library/urllib.parse.rst:336 msgid "" "Construct a full (\"absolute\") URL by combining a \"base URL\" (*base*) " "with another URL (*url*). Informally, this uses components of the base URL, " @@ -574,20 +544,20 @@ msgid "" "path, to provide missing components in the relative URL. For example:" msgstr "" -#: ../../library/urllib.parse.rst:393 +#: ../../library/urllib.parse.rst:345 msgid "" -"The *allow_fragments* argument has the same meaning and default as " -"for :func:`urlparse`." +"The *allow_fragments* argument has the same meaning and default as for :func:" +"`urlsplit`." msgstr "" -#: ../../library/urllib.parse.rst:398 +#: ../../library/urllib.parse.rst:350 msgid "" "If *url* is an absolute URL (that is, it starts with ``//`` or ``scheme://" "``), the *url*'s hostname and/or scheme will be present in the result. For " "example:" msgstr "" -#: ../../library/urllib.parse.rst:401 +#: ../../library/urllib.parse.rst:353 msgid "" ">>> urljoin('http://www.cwi.nl/%7Eguido/Python.html',\n" "... '//www.python.org/%7Eguido')\n" @@ -597,13 +567,13 @@ msgstr "" "... '//www.python.org/%7Eguido')\n" "'http://www.python.org/%7Eguido'" -#: ../../library/urllib.parse.rst:407 +#: ../../library/urllib.parse.rst:359 msgid "" "If you do not want that behavior, preprocess the *url* with :func:`urlsplit` " "and :func:`urlunsplit`, removing possible *scheme* and *netloc* parts." msgstr "" -#: ../../library/urllib.parse.rst:412 +#: ../../library/urllib.parse.rst:364 msgid "" "Because an absolute URL may be passed as the ``url`` parameter, it is " "generally **not secure** to use ``urljoin`` with an attacker-controlled " @@ -612,11 +582,11 @@ msgid "" "``urljoin`` will be the absolute URL." msgstr "" -#: ../../library/urllib.parse.rst:422 +#: ../../library/urllib.parse.rst:374 msgid "Behavior updated to match the semantics defined in :rfc:`3986`." msgstr "" -#: ../../library/urllib.parse.rst:427 +#: ../../library/urllib.parse.rst:379 msgid "" "If *url* contains a fragment identifier, return a modified version of *url* " "with no fragment identifier, and the fragment identifier as a separate " @@ -624,37 +594,43 @@ msgid "" "unmodified and an empty string." msgstr "" -#: ../../library/urllib.parse.rst:438 +#: ../../library/urllib.parse.rst:384 +msgid "" +"The return value is a :term:`named tuple`, its items can be accessed by " +"index or as named attributes:" +msgstr "" + +#: ../../library/urllib.parse.rst:390 msgid ":attr:`url`" msgstr ":attr:`url`" -#: ../../library/urllib.parse.rst:438 +#: ../../library/urllib.parse.rst:390 msgid "URL with no fragment" msgstr "" -#: ../../library/urllib.parse.rst:443 +#: ../../library/urllib.parse.rst:395 msgid "" "See section :ref:`urlparse-result-object` for more information on the result " "object." msgstr "" -#: ../../library/urllib.parse.rst:446 +#: ../../library/urllib.parse.rst:398 msgid "Result is a structured object rather than a simple 2-tuple." msgstr "" -#: ../../library/urllib.parse.rst:451 +#: ../../library/urllib.parse.rst:403 msgid "" -"Extract the url from a wrapped URL (that is, a string formatted as " -"````, ````, ``URL:scheme://host/" -"path`` or ``scheme://host/path``). If *url* is not a wrapped URL, it is " -"returned without changes." +"Extract the url from a wrapped URL (that is, a string formatted as ````, ````, ``URL:scheme://host/path`` " +"or ``scheme://host/path``). If *url* is not a wrapped URL, it is returned " +"without changes." msgstr "" -#: ../../library/urllib.parse.rst:459 +#: ../../library/urllib.parse.rst:411 msgid "URL parsing security" msgstr "" -#: ../../library/urllib.parse.rst:461 +#: ../../library/urllib.parse.rst:413 msgid "" "The :func:`urlsplit` and :func:`urlparse` APIs do not perform **validation** " "of inputs. They may not raise errors on inputs that other applications " @@ -663,14 +639,14 @@ msgid "" "rather than purity." msgstr "" -#: ../../library/urllib.parse.rst:467 +#: ../../library/urllib.parse.rst:419 msgid "" "Instead of raising an exception on unusual input, they may instead return " "some component parts as empty strings. Or components may contain more than " "perhaps they should." msgstr "" -#: ../../library/urllib.parse.rst:471 +#: ../../library/urllib.parse.rst:423 msgid "" "We recommend that users of these APIs where the values may be used anywhere " "with security implications code defensively. Do some verification within " @@ -679,7 +655,7 @@ msgid "" "that ``hostname``? etc." msgstr "" -#: ../../library/urllib.parse.rst:477 +#: ../../library/urllib.parse.rst:429 msgid "" "What constitutes a URL is not universally well defined. Different " "applications have different needs and desired constraints. For instance the " @@ -691,56 +667,55 @@ msgid "" "API behavior changes." msgstr "" -#: ../../library/urllib.parse.rst:488 +#: ../../library/urllib.parse.rst:440 msgid "Parsing ASCII Encoded Bytes" msgstr "" -#: ../../library/urllib.parse.rst:490 +#: ../../library/urllib.parse.rst:442 msgid "" "The URL parsing functions were originally designed to operate on character " "strings only. In practice, it is useful to be able to manipulate properly " "quoted and encoded URLs as sequences of ASCII bytes. Accordingly, the URL " -"parsing functions in this module all operate on :class:`bytes` " -"and :class:`bytearray` objects in addition to :class:`str` objects." +"parsing functions in this module all operate on :class:`bytes` and :class:" +"`bytearray` objects in addition to :class:`str` objects." msgstr "" -#: ../../library/urllib.parse.rst:496 +#: ../../library/urllib.parse.rst:448 msgid "" -"If :class:`str` data is passed in, the result will also contain " -"only :class:`str` data. If :class:`bytes` or :class:`bytearray` data is " -"passed in, the result will contain only :class:`bytes` data." +"If :class:`str` data is passed in, the result will also contain only :class:" +"`str` data. If :class:`bytes` or :class:`bytearray` data is passed in, the " +"result will contain only :class:`bytes` data." msgstr "" -#: ../../library/urllib.parse.rst:500 +#: ../../library/urllib.parse.rst:452 msgid "" -"Attempting to mix :class:`str` data with :class:`bytes` " -"or :class:`bytearray` in a single function call will result in " -"a :exc:`TypeError` being raised, while attempting to pass in non-ASCII byte " -"values will trigger :exc:`UnicodeDecodeError`." +"Attempting to mix :class:`str` data with :class:`bytes` or :class:" +"`bytearray` in a single function call will result in a :exc:`TypeError` " +"being raised, while attempting to pass in non-ASCII byte values will " +"trigger :exc:`UnicodeDecodeError`." msgstr "" -#: ../../library/urllib.parse.rst:505 +#: ../../library/urllib.parse.rst:457 msgid "" -"To support easier conversion of result objects between :class:`str` " -"and :class:`bytes`, all return values from URL parsing functions provide " -"either an :meth:`encode` method (when the result contains :class:`str` data) " -"or a :meth:`decode` method (when the result contains :class:`bytes` data). " -"The signatures of these methods match those of the " -"corresponding :class:`str` and :class:`bytes` methods (except that the " -"default encoding is ``'ascii'`` rather than ``'utf-8'``). Each produces a " -"value of a corresponding type that contains either :class:`bytes` data " -"(for :meth:`encode` methods) or :class:`str` data (for :meth:`decode` " -"methods)." +"To support easier conversion of result objects between :class:`str` and :" +"class:`bytes`, all return values from URL parsing functions provide either " +"an :meth:`encode` method (when the result contains :class:`str` data) or a :" +"meth:`decode` method (when the result contains :class:`bytes` data). The " +"signatures of these methods match those of the corresponding :class:`str` " +"and :class:`bytes` methods (except that the default encoding is ``'ascii'`` " +"rather than ``'utf-8'``). Each produces a value of a corresponding type that " +"contains either :class:`bytes` data (for :meth:`encode` methods) or :class:" +"`str` data (for :meth:`decode` methods)." msgstr "" -#: ../../library/urllib.parse.rst:516 +#: ../../library/urllib.parse.rst:468 msgid "" "Applications that need to operate on potentially improperly quoted URLs that " "may contain non-ASCII data will need to do their own decoding from bytes to " "characters before invoking the URL parsing methods." msgstr "" -#: ../../library/urllib.parse.rst:520 +#: ../../library/urllib.parse.rst:472 msgid "" "The behaviour described in this section applies only to the URL parsing " "functions. The URL quoting functions use their own rules when producing or " @@ -748,24 +723,24 @@ msgid "" "URL quoting functions." msgstr "" -#: ../../library/urllib.parse.rst:525 +#: ../../library/urllib.parse.rst:477 msgid "URL parsing functions now accept ASCII encoded byte sequences" msgstr "" -#: ../../library/urllib.parse.rst:532 +#: ../../library/urllib.parse.rst:484 msgid "Structured Parse Results" msgstr "" -#: ../../library/urllib.parse.rst:534 +#: ../../library/urllib.parse.rst:486 msgid "" -"The result objects from the :func:`urlparse`, :func:`urlsplit` " -"and :func:`urldefrag` functions are subclasses of the :class:`tuple` type. " -"These subclasses add the attributes listed in the documentation for those " +"The result objects from the :func:`urlsplit`, :func:`urlparse` and :func:" +"`urldefrag` functions are subclasses of the :class:`tuple` type. These " +"subclasses add the attributes listed in the documentation for those " "functions, the encoding and decoding support described in the previous " "section, as well as an additional method:" msgstr "" -#: ../../library/urllib.parse.rst:542 +#: ../../library/urllib.parse.rst:494 msgid "" "Return the re-combined version of the original URL as a string. This may " "differ from the original URL in that the scheme may be normalized to lower " @@ -773,72 +748,72 @@ msgid "" "queries, and fragment identifiers will be removed." msgstr "" -#: ../../library/urllib.parse.rst:547 +#: ../../library/urllib.parse.rst:499 msgid "" "For :func:`urldefrag` results, only empty fragment identifiers will be " "removed. For :func:`urlsplit` and :func:`urlparse` results, all noted " "changes will be made to the URL returned by this method." msgstr "" -#: ../../library/urllib.parse.rst:551 +#: ../../library/urllib.parse.rst:503 msgid "" "The result of this method remains unchanged if passed back through the " "original parsing function:" msgstr "" -#: ../../library/urllib.parse.rst:564 +#: ../../library/urllib.parse.rst:516 msgid "" "The following classes provide the implementations of the structured parse " "results when operating on :class:`str` objects:" msgstr "" -#: ../../library/urllib.parse.rst:569 +#: ../../library/urllib.parse.rst:521 msgid "" "Concrete class for :func:`urldefrag` results containing :class:`str` data. " "The :meth:`encode` method returns a :class:`DefragResultBytes` instance." msgstr "" -#: ../../library/urllib.parse.rst:577 +#: ../../library/urllib.parse.rst:529 msgid "" "Concrete class for :func:`urlparse` results containing :class:`str` data. " "The :meth:`encode` method returns a :class:`ParseResultBytes` instance." msgstr "" -#: ../../library/urllib.parse.rst:583 +#: ../../library/urllib.parse.rst:535 msgid "" "Concrete class for :func:`urlsplit` results containing :class:`str` data. " "The :meth:`encode` method returns a :class:`SplitResultBytes` instance." msgstr "" -#: ../../library/urllib.parse.rst:588 +#: ../../library/urllib.parse.rst:540 msgid "" "The following classes provide the implementations of the parse results when " "operating on :class:`bytes` or :class:`bytearray` objects:" msgstr "" -#: ../../library/urllib.parse.rst:593 +#: ../../library/urllib.parse.rst:545 msgid "" "Concrete class for :func:`urldefrag` results containing :class:`bytes` data. " "The :meth:`decode` method returns a :class:`DefragResult` instance." msgstr "" -#: ../../library/urllib.parse.rst:601 +#: ../../library/urllib.parse.rst:553 msgid "" "Concrete class for :func:`urlparse` results containing :class:`bytes` data. " "The :meth:`decode` method returns a :class:`ParseResult` instance." msgstr "" -#: ../../library/urllib.parse.rst:609 +#: ../../library/urllib.parse.rst:561 msgid "" "Concrete class for :func:`urlsplit` results containing :class:`bytes` data. " "The :meth:`decode` method returns a :class:`SplitResult` instance." msgstr "" -#: ../../library/urllib.parse.rst:617 +#: ../../library/urllib.parse.rst:569 msgid "URL Quoting" msgstr "" -#: ../../library/urllib.parse.rst:619 +#: ../../library/urllib.parse.rst:571 msgid "" "The URL quoting functions focus on taking program data and making it safe " "for use as URL components by quoting special characters and appropriately " @@ -847,7 +822,7 @@ msgid "" "isn't already covered by the URL parsing functions above." msgstr "" -#: ../../library/urllib.parse.rst:627 +#: ../../library/urllib.parse.rst:579 msgid "" "Replace special characters in *string* using the :samp:`%{xx}` escape. " "Letters, digits, and the characters ``'_.-~'`` are never quoted. By default, " @@ -856,38 +831,38 @@ msgid "" "not be quoted --- its default value is ``'/'``." msgstr "" -#: ../../library/urllib.parse.rst:633 ../../library/urllib.parse.rst:679 -#: ../../library/urllib.parse.rst:708 +#: ../../library/urllib.parse.rst:585 ../../library/urllib.parse.rst:631 +#: ../../library/urllib.parse.rst:660 msgid "*string* may be either a :class:`str` or a :class:`bytes` object." msgstr "" -#: ../../library/urllib.parse.rst:635 +#: ../../library/urllib.parse.rst:587 msgid "" "Moved from :rfc:`2396` to :rfc:`3986` for quoting URL strings. \"~\" is now " "included in the set of unreserved characters." msgstr "" -#: ../../library/urllib.parse.rst:639 +#: ../../library/urllib.parse.rst:591 msgid "" "The optional *encoding* and *errors* parameters specify how to deal with non-" "ASCII characters, as accepted by the :meth:`str.encode` method. *encoding* " "defaults to ``'utf-8'``. *errors* defaults to ``'strict'``, meaning " "unsupported characters raise a :class:`UnicodeEncodeError`. *encoding* and " -"*errors* must not be supplied if *string* is a :class:`bytes`, or " -"a :class:`TypeError` is raised." +"*errors* must not be supplied if *string* is a :class:`bytes`, or a :class:" +"`TypeError` is raised." msgstr "" -#: ../../library/urllib.parse.rst:647 +#: ../../library/urllib.parse.rst:599 msgid "" "Note that ``quote(string, safe, encoding, errors)`` is equivalent to " "``quote_from_bytes(string.encode(encoding, errors), safe)``." msgstr "" -#: ../../library/urllib.parse.rst:650 +#: ../../library/urllib.parse.rst:602 msgid "Example: ``quote('/El Niño/')`` yields ``'/El%20Ni%C3%B1o/'``." msgstr "" -#: ../../library/urllib.parse.rst:655 +#: ../../library/urllib.parse.rst:607 msgid "" "Like :func:`quote`, but also replace spaces with plus signs, as required for " "quoting HTML form values when building up a query string to go into a URL. " @@ -895,74 +870,74 @@ msgid "" "*safe*. It also does not have *safe* default to ``'/'``." msgstr "" -#: ../../library/urllib.parse.rst:660 +#: ../../library/urllib.parse.rst:612 msgid "Example: ``quote_plus('/El Niño/')`` yields ``'%2FEl+Ni%C3%B1o%2F'``." msgstr "" -#: ../../library/urllib.parse.rst:665 +#: ../../library/urllib.parse.rst:617 msgid "" -"Like :func:`quote`, but accepts a :class:`bytes` object rather than " -"a :class:`str`, and does not perform string-to-bytes encoding." +"Like :func:`quote`, but accepts a :class:`bytes` object rather than a :class:" +"`str`, and does not perform string-to-bytes encoding." msgstr "" -#: ../../library/urllib.parse.rst:668 +#: ../../library/urllib.parse.rst:620 msgid "Example: ``quote_from_bytes(b'a&\\xef')`` yields ``'a%26%EF'``." msgstr "" -#: ../../library/urllib.parse.rst:674 +#: ../../library/urllib.parse.rst:626 msgid "" "Replace :samp:`%{xx}` escapes with their single-character equivalent. The " "optional *encoding* and *errors* parameters specify how to decode percent-" -"encoded sequences into Unicode characters, as accepted by " -"the :meth:`bytes.decode` method." +"encoded sequences into Unicode characters, as accepted by the :meth:`bytes." +"decode` method." msgstr "" -#: ../../library/urllib.parse.rst:681 +#: ../../library/urllib.parse.rst:633 msgid "" "*encoding* defaults to ``'utf-8'``. *errors* defaults to ``'replace'``, " "meaning invalid sequences are replaced by a placeholder character." msgstr "" -#: ../../library/urllib.parse.rst:685 +#: ../../library/urllib.parse.rst:637 msgid "Example: ``unquote('/El%20Ni%C3%B1o/')`` yields ``'/El Niño/'``." msgstr "" -#: ../../library/urllib.parse.rst:687 +#: ../../library/urllib.parse.rst:639 msgid "" "*string* parameter supports bytes and str objects (previously only str)." msgstr "" -#: ../../library/urllib.parse.rst:695 +#: ../../library/urllib.parse.rst:647 msgid "" "Like :func:`unquote`, but also replace plus signs with spaces, as required " "for unquoting HTML form values." msgstr "" -#: ../../library/urllib.parse.rst:698 +#: ../../library/urllib.parse.rst:650 msgid "*string* must be a :class:`str`." msgstr "" -#: ../../library/urllib.parse.rst:700 +#: ../../library/urllib.parse.rst:652 msgid "Example: ``unquote_plus('/El+Ni%C3%B1o/')`` yields ``'/El Niño/'``." msgstr "" -#: ../../library/urllib.parse.rst:705 +#: ../../library/urllib.parse.rst:657 msgid "" "Replace :samp:`%{xx}` escapes with their single-octet equivalent, and return " "a :class:`bytes` object." msgstr "" -#: ../../library/urllib.parse.rst:710 +#: ../../library/urllib.parse.rst:662 msgid "" "If it is a :class:`str`, unescaped non-ASCII characters in *string* are " "encoded into UTF-8 bytes." msgstr "" -#: ../../library/urllib.parse.rst:713 +#: ../../library/urllib.parse.rst:665 msgid "Example: ``unquote_to_bytes('a%26%EF')`` yields ``b'a&\\xef'``." msgstr "" -#: ../../library/urllib.parse.rst:719 +#: ../../library/urllib.parse.rst:671 msgid "" "Convert a mapping object or a sequence of two-element tuples, which may " "contain :class:`str` or :class:`bytes` objects, to a percent-encoded ASCII " @@ -971,7 +946,7 @@ msgid "" "be encoded to bytes, otherwise it would result in a :exc:`TypeError`." msgstr "" -#: ../../library/urllib.parse.rst:726 +#: ../../library/urllib.parse.rst:678 msgid "" "The resulting string is a series of ``key=value`` pairs separated by ``'&'`` " "characters, where both *key* and *value* are quoted using the *quote_via* " @@ -984,7 +959,7 @@ msgid "" "``quote`` and specify a value for *safe*." msgstr "" -#: ../../library/urllib.parse.rst:736 +#: ../../library/urllib.parse.rst:688 msgid "" "When a sequence of two-element tuples is used as the *query* argument, the " "first element of each tuple is a key and the second is a value. The value " @@ -995,49 +970,49 @@ msgid "" "order of parameter tuples in the sequence." msgstr "" -#: ../../library/urllib.parse.rst:744 +#: ../../library/urllib.parse.rst:696 msgid "" "The *safe*, *encoding*, and *errors* parameters are passed down to " "*quote_via* (the *encoding* and *errors* parameters are only passed when a " "query element is a :class:`str`)." msgstr "" -#: ../../library/urllib.parse.rst:748 +#: ../../library/urllib.parse.rst:700 msgid "" "To reverse this encoding process, :func:`parse_qs` and :func:`parse_qsl` are " "provided in this module to parse query strings into Python data structures." msgstr "" -#: ../../library/urllib.parse.rst:751 +#: ../../library/urllib.parse.rst:703 msgid "" -"Refer to :ref:`urllib examples ` to find out how " -"the :func:`urllib.parse.urlencode` method can be used for generating the " -"query string of a URL or data for a POST request." +"Refer to :ref:`urllib examples ` to find out how the :func:" +"`urllib.parse.urlencode` method can be used for generating the query string " +"of a URL or data for a POST request." msgstr "" -#: ../../library/urllib.parse.rst:755 +#: ../../library/urllib.parse.rst:707 msgid "*query* supports bytes and string objects." msgstr "" -#: ../../library/urllib.parse.rst:758 +#: ../../library/urllib.parse.rst:710 msgid "Added the *quote_via* parameter." msgstr "新增 *quote_via* 參數。" -#: ../../library/urllib.parse.rst:768 +#: ../../library/urllib.parse.rst:720 msgid "`WHATWG`_ - URL Living standard" msgstr "" -#: ../../library/urllib.parse.rst:769 +#: ../../library/urllib.parse.rst:721 msgid "" "Working Group for the URL Standard that defines URLs, domains, IP addresses, " "the application/x-www-form-urlencoded format, and their API." msgstr "" -#: ../../library/urllib.parse.rst:772 +#: ../../library/urllib.parse.rst:724 msgid ":rfc:`3986` - Uniform Resource Identifiers" msgstr ":rfc:`3986` - 統一資源識別碼" -#: ../../library/urllib.parse.rst:773 +#: ../../library/urllib.parse.rst:725 msgid "" "This is the current standard (STD66). Any changes to urllib.parse module " "should conform to this. Certain deviations could be observed, which are " @@ -1045,49 +1020,49 @@ msgid "" "requirements as commonly observed in major browsers." msgstr "" -#: ../../library/urllib.parse.rst:778 +#: ../../library/urllib.parse.rst:730 msgid ":rfc:`2732` - Format for Literal IPv6 Addresses in URL's." msgstr "" -#: ../../library/urllib.parse.rst:779 +#: ../../library/urllib.parse.rst:731 msgid "This specifies the parsing requirements of IPv6 URLs." msgstr "" -#: ../../library/urllib.parse.rst:781 +#: ../../library/urllib.parse.rst:733 msgid ":rfc:`2396` - Uniform Resource Identifiers (URI): Generic Syntax" msgstr ":rfc:`2396` - 統一資源識別碼 (URI):通用語法" -#: ../../library/urllib.parse.rst:782 +#: ../../library/urllib.parse.rst:734 msgid "" "Document describing the generic syntactic requirements for both Uniform " "Resource Names (URNs) and Uniform Resource Locators (URLs)." msgstr "" -#: ../../library/urllib.parse.rst:785 +#: ../../library/urllib.parse.rst:737 msgid ":rfc:`2368` - The mailto URL scheme." msgstr "" -#: ../../library/urllib.parse.rst:786 +#: ../../library/urllib.parse.rst:738 msgid "Parsing requirements for mailto URL schemes." msgstr "" -#: ../../library/urllib.parse.rst:788 +#: ../../library/urllib.parse.rst:740 msgid ":rfc:`1808` - Relative Uniform Resource Locators" msgstr "" ":rfc:`1808` - 相對的統一資源定位器 (Relative Uniform Resource Locators)" -#: ../../library/urllib.parse.rst:789 +#: ../../library/urllib.parse.rst:741 msgid "" "This Request For Comments includes the rules for joining an absolute and a " "relative URL, including a fair number of \"Abnormal Examples\" which govern " "the treatment of border cases." msgstr "" -#: ../../library/urllib.parse.rst:793 +#: ../../library/urllib.parse.rst:745 msgid ":rfc:`1738` - Uniform Resource Locators (URL)" msgstr ":rfc:`1738` - 統一資源定位器 (URL, Uniform Resource Locators)" -#: ../../library/urllib.parse.rst:794 +#: ../../library/urllib.parse.rst:746 msgid "This specifies the formal syntax and semantics of absolute URLs." msgstr "" @@ -1110,3 +1085,14 @@ msgstr "parsing(剖析)" #: ../../library/urllib.parse.rst:9 msgid "relative" msgstr "relative(相對)" + +#~ msgid ":attr:`params`" +#~ msgstr ":attr:`params`" + +#~ msgid "5" +#~ msgstr "5" + +#~ msgid "" +#~ "(addressing scheme, network location, path, query, fragment identifier)." +#~ msgstr "" +#~ "(addressing scheme, network location, path, query, fragment identifier)." diff --git a/library/venv.po b/library/venv.po index 9b5d3e1f91..9168cb77fc 100644 --- a/library/venv.po +++ b/library/venv.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-12 00:14+0000\n" +"POT-Creation-Date: 2026-02-06 00:18+0000\n" "PO-Revision-Date: 2025-05-23 10:20+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -121,8 +121,8 @@ msgid "" "This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." msgstr "" -"此模組在\\ :ref:`行動平台 `\\ 或 :ref:`WebAssembly 平" -"台 `\\ 上不支援。" +"此模組在\\ :ref:`行動平台 `\\ 或 :ref:`WebAssembly 平台 " +"`\\ 上不支援。" #: ../../library/venv.rst:65 msgid "Creating virtual environments" @@ -154,8 +154,8 @@ msgstr "" "徑的 ``home`` 鍵。它同時會建立一個 :file:`bin` (在 Windows 上為 :file:" "`Scripts`)子目錄,其中包含一個 Python 二進位檔案的副本/符號連結(根據建立環" "境時使用的平台或引數而定)。此外,它還會建立一個 :file:`lib/pythonX.Y/site-" -"packages` 子目錄(在 Windows 上為 :file:`Lib\\\\site-packages`)。如果指定的目" -"錄已存在,則將重新使用該目錄。" +"packages` 子目錄(在 Windows 上為 :file:`Lib\\\\site-packages`)。如果指定的" +"目錄已存在,則將重新使用該目錄。" #: ../../library/venv.rst:84 msgid "" @@ -969,13 +969,14 @@ msgstr "" "環境中安裝 setuptools 與 pip: ::" #: ../../library/venv.rst:543 +#, fuzzy msgid "" "import os\n" "import os.path\n" "from subprocess import Popen, PIPE\n" "import sys\n" "from threading import Thread\n" -"from urllib.parse import urlparse\n" +"from urllib.parse import urlsplit\n" "from urllib.request import urlretrieve\n" "import venv\n" "\n" @@ -1050,7 +1051,7 @@ msgid "" " stream.close()\n" "\n" " def install_script(self, context, name, url):\n" -" _, _, path, _, _, _ = urlparse(url)\n" +" _, _, path, _, _ = urlsplit(url)\n" " fn = os.path.split(path)[-1]\n" " binpath = context.bin_path\n" " distpath = os.path.join(binpath, fn)\n" diff --git a/library/wsgiref.po b/library/wsgiref.po index a8da940263..e10942f56a 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-25 00:14+0000\n" +"POT-Creation-Date: 2026-02-06 00:18+0000\n" "PO-Revision-Date: 2023-12-09 21:29+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,7 +26,13 @@ msgstr ":mod:`!wsgiref` --- WSGI 工具與參考實作" msgid "**Source code:** :source:`Lib/wsgiref`" msgstr "**原始碼:**\\ :source:`Lib/wsgiref`" -#: ../../library/wsgiref.rst:14 +#: ../../library/wsgiref.rst:16 +msgid "" +":mod:`wsgiref` is a reference implementation and is not recommended for " +"production. The module only implements basic security checks." +msgstr "" + +#: ../../library/wsgiref.rst:19 msgid "" "The Web Server Gateway Interface (WSGI) is a standard interface between web " "server software and web applications written in Python. Having a standard " @@ -37,7 +43,7 @@ msgstr "" "Python 撰寫的網頁應用程式,擁有一個標準介面使得支援 WSGI 的應用程式可以與多個" "不同的網頁伺服器運行。" -#: ../../library/wsgiref.rst:19 +#: ../../library/wsgiref.rst:24 msgid "" "Only authors of web servers and programming frameworks need to know every " "detail and corner case of the WSGI design. You don't need to understand " @@ -48,7 +54,7 @@ msgstr "" "需要為了安裝 WSGI 應用程式或是使用現有框架撰寫網頁應用程式而必須理解每個細" "節。" -#: ../../library/wsgiref.rst:24 +#: ../../library/wsgiref.rst:29 msgid "" ":mod:`wsgiref` is a reference implementation of the WSGI specification that " "can be used to add WSGI support to a web server or framework. It provides " @@ -63,7 +69,7 @@ msgstr "" "別,提供用於示範 HTTP 伺服器的 WSGI 應用程式、靜態型別檢查、以及驗證 WSGI 伺" "服器與應用程式是否符合 WSGI 規格的驗證工具 (:pep:`3333`)。" -#: ../../library/wsgiref.rst:32 +#: ../../library/wsgiref.rst:37 msgid "" "See `wsgi.readthedocs.io `_ for more " "information about WSGI, and links to tutorials and other resources." @@ -71,26 +77,25 @@ msgstr "" "參閱 `wsgi.readthedocs.io `_ 更多 WSGI 相關資" "訊,以及教學連結與其他資源。" -#: ../../library/wsgiref.rst:39 +#: ../../library/wsgiref.rst:44 msgid ":mod:`wsgiref.util` -- WSGI environment utilities" msgstr ":mod:`wsgiref.util` -- WSGI 環境工具" -#: ../../library/wsgiref.rst:45 +#: ../../library/wsgiref.rst:50 msgid "" "This module provides a variety of utility functions for working with WSGI " "environments. A WSGI environment is a dictionary containing HTTP request " "variables as described in :pep:`3333`. All of the functions taking an " "*environ* parameter expect a WSGI-compliant dictionary to be supplied; " -"please see :pep:`3333` for a detailed specification " -"and :data:`~wsgiref.types.WSGIEnvironment` for a type alias that can be used " -"in type annotations." +"please see :pep:`3333` for a detailed specification and :data:`~wsgiref." +"types.WSGIEnvironment` for a type alias that can be used in type annotations." msgstr "" "這個模組提供許多用於處理 WSGI 環境運作的功能。WSGI 環境是一個包含 HTTP 請求變" "數的字典,如 :pep:`3333` 所述。所有接受 *environ* 的參數的函式都需要提供符合 " -"WSGI 標準的字典;請參閱 :pep:`3333` 取得詳細規格,以" -"及 :data:`~wsgiref.types.WSGIEnvironment` 取得可用於使用型別註釋的型別別名。" +"WSGI 標準的字典;請參閱 :pep:`3333` 取得詳細規格,以及 :data:`~wsgiref.types." +"WSGIEnvironment` 取得可用於使用型別註釋的型別別名。" -#: ../../library/wsgiref.rst:56 +#: ../../library/wsgiref.rst:61 msgid "" "Return a guess for whether ``wsgi.url_scheme`` should be \"http\" or " "\"https\", by checking for a ``HTTPS`` environment variable in the *environ* " @@ -99,7 +104,7 @@ msgstr "" "透過檢查 *environ* 字典中的 ``HTTPS`` 環境變數,回傳 ``wsgi.url_scheme`` 應該" "是 \"http\" 或 \"https\" 的猜測。回傳值為一個字串。" -#: ../../library/wsgiref.rst:60 +#: ../../library/wsgiref.rst:65 msgid "" "This function is useful when creating a gateway that wraps CGI or a CGI-like " "protocol such as FastCGI. Typically, servers providing such protocols will " @@ -108,11 +113,11 @@ msgid "" "a value is found, and \"http\" otherwise." msgstr "" "當建立一個包裝 CGI 或類似 FastCGI 的 CGI-like 協定閘道時,此函式非常有用。例" -"如 FastCGI,通常提供這類協定的伺服器在透過 SSL 接收到請求時會包含 \"1\"," -"\"yes\",或 \"on\" 的 ``HTTPS`` 變數,因此,如果找到這樣的值,此函式回傳 " -"\"https\",否則回傳 \"http\"。" +"如 FastCGI,通常提供這類協定的伺服器在透過 SSL 接收到請求時會包含 " +"\"1\",\"yes\",或 \"on\" 的 ``HTTPS`` 變數,因此,如果找到這樣的值,此函式回" +"傳 \"https\",否則回傳 \"http\"。" -#: ../../library/wsgiref.rst:69 +#: ../../library/wsgiref.rst:74 msgid "" "Return the full request URI, optionally including the query string, using " "the algorithm found in the \"URL Reconstruction\" section of :pep:`3333`. " @@ -123,7 +128,7 @@ msgstr "" "求 URI,可選擇性的包含查詢字串,如果 *include_query* 設為 false,查詢字串不會" "被包含在結果的 URI 中。" -#: ../../library/wsgiref.rst:76 +#: ../../library/wsgiref.rst:81 msgid "" "Similar to :func:`request_uri`, except that the ``PATH_INFO`` and " "``QUERY_STRING`` variables are ignored. The result is the base URI of the " @@ -132,7 +137,7 @@ msgstr "" "類似於 :func:`request_uri`,但忽略 ``PATH_INFO`` 和 ``QUERY_STRING`` 變數。結" "果是請求地址的應用程式物件的的基本 URI。" -#: ../../library/wsgiref.rst:83 +#: ../../library/wsgiref.rst:88 msgid "" "Shift a single name from ``PATH_INFO`` to ``SCRIPT_NAME`` and return the " "name. The *environ* dictionary is *modified* in-place; use a copy if you " @@ -142,24 +147,24 @@ msgstr "" "會在適當時機被 *modified*;如果你需要保留原始完好無損的 ``PATH_INFO`` 或 " "``SCRIPT_NAME`` 請使用副本。" -#: ../../library/wsgiref.rst:87 +#: ../../library/wsgiref.rst:92 msgid "" "If there are no remaining path segments in ``PATH_INFO``, ``None`` is " "returned." msgstr "如果在 ``PATH_INFO`` 中沒有剩餘的路徑片段,則回傳 ``None``。" -#: ../../library/wsgiref.rst:89 +#: ../../library/wsgiref.rst:94 msgid "" "Typically, this routine is used to process each portion of a request URI " "path, for example to treat the path as a series of dictionary keys. This " "routine modifies the passed-in environment to make it suitable for invoking " "another WSGI application that is located at the target URI. For example, if " "there is a WSGI application at ``/foo``, and the request URI path is ``/foo/" -"bar/baz``, and the WSGI application at ``/foo`` " -"calls :func:`shift_path_info`, it will receive the string \"bar\", and the " -"environment will be updated to be suitable for passing to a WSGI application " -"at ``/foo/bar``. That is, ``SCRIPT_NAME`` will change from ``/foo`` to ``/" -"foo/bar``, and ``PATH_INFO`` will change from ``/bar/baz`` to ``/baz``." +"bar/baz``, and the WSGI application at ``/foo`` calls :func:" +"`shift_path_info`, it will receive the string \"bar\", and the environment " +"will be updated to be suitable for passing to a WSGI application at ``/foo/" +"bar``. That is, ``SCRIPT_NAME`` will change from ``/foo`` to ``/foo/bar``, " +"and ``PATH_INFO`` will change from ``/bar/baz`` to ``/baz``." msgstr "" "通常,此程式用於處理請求 URI 的每一部分路徑,例如將路徑視為一系列的字典鍵此程" "式會修改傳入的環境,使其適用於呼叫位於目標 URI 的 WSGI 應用程式。例如,如果" @@ -169,7 +174,7 @@ msgstr "" "話說,``SCRIPT_NAME`` 將從 ``/foo`` 變更為 ``/foo/bar``,而 ``PATH_INFO`` 將" "從 ``/bar/baz`` 變更為 ``/baz``。" -#: ../../library/wsgiref.rst:100 +#: ../../library/wsgiref.rst:105 msgid "" "When ``PATH_INFO`` is just a \"/\", this routine returns an empty string and " "appends a trailing slash to ``SCRIPT_NAME``, even though empty path segments " @@ -183,24 +188,24 @@ msgstr "" "``SCRIPT_NAME`` 通常不會以斜號結尾。這是刻意行為,以確保應用程式在使用這個程" "式進行物件遍歷時可以區分結尾為 ``/x`` 和結尾為 ``/x/`` 的 URIs。" -#: ../../library/wsgiref.rst:110 +#: ../../library/wsgiref.rst:115 msgid "Update *environ* with trivial defaults for testing purposes." msgstr "為測試目的,以簡單的預設值更新 *environ* 。" -#: ../../library/wsgiref.rst:112 +#: ../../library/wsgiref.rst:117 msgid "" "This routine adds various parameters required for WSGI, including " "``HTTP_HOST``, ``SERVER_NAME``, ``SERVER_PORT``, ``REQUEST_METHOD``, " -"``SCRIPT_NAME``, ``PATH_INFO``, and all of the :pep:`3333`\\ -defined " -"``wsgi.*`` variables. It only supplies default values, and does not replace " -"any existing settings for these variables." +"``SCRIPT_NAME``, ``PATH_INFO``, and all of the :pep:`3333`\\ -defined ``wsgi." +"*`` variables. It only supplies default values, and does not replace any " +"existing settings for these variables." msgstr "" "這個程式新增 WSGI 所需的各種參數,包括 ``HTTP_HOST``、``SERVER_NAME``、" "``SERVER_PORT``、``REQUEST_METHOD``、``SCRIPT_NAME``、``PATH_INFO``,以及所" "有 :pep:`3333` 定義的 ``wsgi.*`` 變數,它只提供預設值,並且不會取代現有的這些" "變數設定。" -#: ../../library/wsgiref.rst:118 +#: ../../library/wsgiref.rst:123 msgid "" "This routine is intended to make it easier for unit tests of WSGI servers " "and applications to set up dummy environments. It should NOT be used by " @@ -209,13 +214,13 @@ msgstr "" "這個程式目的為了讓 WSGI 伺服器和應用程式的單元測試更容易建置虛擬環境。實際的 " "WSGI 伺服器或應用程式不應該使用它,因為所產生的數據是假的!" -#: ../../library/wsgiref.rst:122 +#: ../../library/wsgiref.rst:127 msgid "" "Example usage (see also :func:`~wsgiref.simple_server.demo_app` for another " "example)::" msgstr "" -#: ../../library/wsgiref.rst:125 +#: ../../library/wsgiref.rst:130 msgid "" "from wsgiref.util import setup_testing_defaults\n" "from wsgiref.simple_server import make_server\n" @@ -239,13 +244,13 @@ msgid "" " httpd.serve_forever()" msgstr "" -#: ../../library/wsgiref.rst:147 +#: ../../library/wsgiref.rst:152 msgid "" "In addition to the environment functions above, the :mod:`wsgiref.util` " "module also provides these miscellaneous utilities:" msgstr "除了上述的環境功能外,:mod:`wsgiref.util` 模組還提供以下各類工具:" -#: ../../library/wsgiref.rst:153 +#: ../../library/wsgiref.rst:158 msgid "" "Return ``True`` if 'header_name' is an HTTP/1.1 \"Hop-by-Hop\" header, as " "defined by :rfc:`2616`." @@ -253,37 +258,36 @@ msgstr "" "如果 'header_name' 是根據 :rfc:`2616` 所定義的 HTTP/1.1 \"Hop-by-Hop\" 標頭," "則回傳 ``True``。" -#: ../../library/wsgiref.rst:159 +#: ../../library/wsgiref.rst:164 msgid "" "A concrete implementation of the :class:`wsgiref.types.FileWrapper` protocol " "used to convert a file-like object to an :term:`iterator`. The resulting " "objects are :term:`iterable`\\ s. As the object is iterated over, the " "optional *blksize* parameter will be repeatedly passed to the *filelike* " -"object's :meth:`read` method to obtain bytestrings to yield. " -"When :meth:`read` returns an empty bytestring, iteration is ended and is not " -"resumable." +"object's :meth:`read` method to obtain bytestrings to yield. When :meth:" +"`read` returns an empty bytestring, iteration is ended and is not resumable." msgstr "" -":class:`wsgiref.types.FileWrapper` 協定的具體實作,用於將類檔案物件轉換" -"為 :term:`iterator`。產生的物件是 :term:`iterable`。當物件進行疊代時,將可選" -"的 *blksize* 引數重複傳遞給 *filelike* 物件的 :meth:`read` 方法來獲得將產生" +":class:`wsgiref.types.FileWrapper` 協定的具體實作,用於將類檔案物件轉換為 :" +"term:`iterator`。產生的物件是 :term:`iterable`。當物件進行疊代時,將可選的 " +"*blksize* 引數重複傳遞給 *filelike* 物件的 :meth:`read` 方法來獲得將產生" "(yield)的位元組字串。當 :meth:`read` 回傳一個空位元組字串,代表疊代已結束且" "無法回復。" -#: ../../library/wsgiref.rst:167 +#: ../../library/wsgiref.rst:172 msgid "" "If *filelike* has a :meth:`close` method, the returned object will also have " -"a :meth:`close` method, and it will invoke the *filelike* " -"object's :meth:`close` method when called." +"a :meth:`close` method, and it will invoke the *filelike* object's :meth:" +"`close` method when called." msgstr "" "如果 *filelike* 有 :meth:`close` 方法,則回傳的物件也會具有 :meth:`close` 方" "法,並在呼叫時叫用 *filelike* 物件的 :meth:`close` 方法。" -#: ../../library/wsgiref.rst:171 ../../library/wsgiref.rst:294 -#: ../../library/wsgiref.rst:429 +#: ../../library/wsgiref.rst:176 ../../library/wsgiref.rst:299 +#: ../../library/wsgiref.rst:434 msgid "Example usage::" msgstr "用法範例: ::" -#: ../../library/wsgiref.rst:173 +#: ../../library/wsgiref.rst:178 msgid "" "from io import StringIO\n" "from wsgiref.util import FileWrapper\n" @@ -296,15 +300,15 @@ msgid "" " print(chunk)" msgstr "" -#: ../../library/wsgiref.rst:183 +#: ../../library/wsgiref.rst:188 msgid "Support for :meth:`~object.__getitem__` method has been removed." msgstr "已移除對 :meth:`~object.__getitem__` 方法的支援。" -#: ../../library/wsgiref.rst:188 +#: ../../library/wsgiref.rst:193 msgid ":mod:`wsgiref.headers` -- WSGI response header tools" msgstr ":mod:`wsgiref.headers` -- WSGI 回應標頭工具" -#: ../../library/wsgiref.rst:194 +#: ../../library/wsgiref.rst:199 msgid "" "This module provides a single class, :class:`Headers`, for convenient " "manipulation of WSGI response headers using a mapping-like interface." @@ -312,7 +316,7 @@ msgstr "" "這個模組提供單一類別 :class:`Headers`,用於使用類似對映的介面方便地操作 WSGI " "回應標頭。" -#: ../../library/wsgiref.rst:200 +#: ../../library/wsgiref.rst:205 msgid "" "Create a mapping-like object wrapping *headers*, which must be a list of " "header name/value tuples as described in :pep:`3333`. The default value of " @@ -321,25 +325,26 @@ msgstr "" "建立一個類似對映物件並包裝 *headers*,並且必須是符合 :pep:`3333` 描述的 name/" "value 元組的標頭串列。*headers* 的預設值是一個空串列。" -#: ../../library/wsgiref.rst:204 -msgid "" -":class:`Headers` objects support typical mapping operations " -"including :meth:`~object.__getitem__`, :meth:`~dict.get`, :meth:`~object.__setitem__`, :meth:`~dict.setdefault`, :meth:`~object.__delitem__` " -"and :meth:`~object.__contains__`. For each of these methods, the key is the " -"header name (treated case-insensitively), and the value is the first value " -"associated with that header name. Setting a header deletes any existing " -"values for that header, then adds a new value at the end of the wrapped " -"header list. Headers' existing order is generally maintained, with new " -"headers added to the end of the wrapped list." -msgstr "" -":class:`Headers` 物件支援典型對映操作包" -"括 :meth:`~object.__getitem__`、:meth:`~dict.get`、:meth:`~object.__setitem__`、:meth:`~dict.setdefault`、:meth:`~object.__delitem__` " -"以及 :meth:`~object.__contains__`。對於這些方法中的每一個,鍵是標頭名稱(以不" -"區分大小寫方式處理),而值則是與該標頭名稱關聯的第一個值。設定標頭會刪除該標" -"頭的所有現有值,然後將新值添加到包裝的標頭串列末尾。標頭的現有順序通常保持不" -"變,新標頭會添加到包裝串列的末尾。" +#: ../../library/wsgiref.rst:209 +msgid "" +":class:`Headers` objects support typical mapping operations including :meth:" +"`~object.__getitem__`, :meth:`~dict.get`, :meth:`~object.__setitem__`, :meth:" +"`~dict.setdefault`, :meth:`~object.__delitem__` and :meth:`~object." +"__contains__`. For each of these methods, the key is the header name " +"(treated case-insensitively), and the value is the first value associated " +"with that header name. Setting a header deletes any existing values for " +"that header, then adds a new value at the end of the wrapped header list. " +"Headers' existing order is generally maintained, with new headers added to " +"the end of the wrapped list." +msgstr "" +":class:`Headers` 物件支援典型對映操作包括 :meth:`~object.__getitem__`、:meth:" +"`~dict.get`、:meth:`~object.__setitem__`、:meth:`~dict.setdefault`、:meth:" +"`~object.__delitem__` 以及 :meth:`~object.__contains__`。對於這些方法中的每一" +"個,鍵是標頭名稱(以不區分大小寫方式處理),而值則是與該標頭名稱關聯的第一個" +"值。設定標頭會刪除該標頭的所有現有值,然後將新值添加到包裝的標頭串列末尾。標" +"頭的現有順序通常保持不變,新標頭會添加到包裝串列的末尾。" -#: ../../library/wsgiref.rst:214 +#: ../../library/wsgiref.rst:219 msgid "" "Unlike a dictionary, :class:`Headers` objects do not raise an error when you " "try to get or delete a key that isn't in the wrapped header list. Getting a " @@ -350,22 +355,22 @@ msgstr "" "不會引發例外錯誤。取得不存在的標頭只會回傳 ``None``,而刪除不存在的標頭則不會" "有任何效果。" -#: ../../library/wsgiref.rst:219 +#: ../../library/wsgiref.rst:224 msgid "" -":class:`Headers` objects also support :meth:`keys`, :meth:`values`, " -"and :meth:`items` methods. The lists returned by :meth:`keys` " -"and :meth:`items` can include the same key more than once if there is a " -"multi-valued header. The ``len()`` of a :class:`Headers` object is the same " -"as the length of its :meth:`items`, which is the same as the length of the " -"wrapped header list. In fact, the :meth:`items` method just returns a copy " -"of the wrapped header list." +":class:`Headers` objects also support :meth:`keys`, :meth:`values`, and :" +"meth:`items` methods. The lists returned by :meth:`keys` and :meth:`items` " +"can include the same key more than once if there is a multi-valued header. " +"The ``len()`` of a :class:`Headers` object is the same as the length of its :" +"meth:`items`, which is the same as the length of the wrapped header list. " +"In fact, the :meth:`items` method just returns a copy of the wrapped header " +"list." msgstr "" ":class:`Headers` 物件還支援 :meth:`keys`、:meth:`values`、和 :meth:`items` 方" "法。由 :meth:`keys` 和 :meth:`items` 回傳的串列在存在多值標頭時可能會包含相同" "的鍵。:class:`Headers` 物件的 ``len()`` 與 :meth:`items` 的長度相同,也與包裝" "標頭串列的長度相同。實際上,:meth:`items` 方法只是回傳包裝的標頭串列的副本。" -#: ../../library/wsgiref.rst:226 +#: ../../library/wsgiref.rst:231 msgid "" "Calling ``bytes()`` on a :class:`Headers` object returns a formatted " "bytestring suitable for transmission as HTTP response headers. Each header " @@ -377,21 +382,20 @@ msgstr "" "式化的位元組字串。每個標頭都與其值一起置於一行上,由冒號與空格分隔。每行以回" "車(carriage return)和換行(line feed)結束,而該位元組字串則以空行結束。" -#: ../../library/wsgiref.rst:232 +#: ../../library/wsgiref.rst:237 msgid "" -"In addition to their mapping interface and formatting " -"features, :class:`Headers` objects also have the following methods for " -"querying and adding multi-valued headers, and for adding headers with MIME " -"parameters:" +"In addition to their mapping interface and formatting features, :class:" +"`Headers` objects also have the following methods for querying and adding " +"multi-valued headers, and for adding headers with MIME parameters:" msgstr "" "除了對映介面和格式化功能外,:class:`Headers` 物件還具有以下查詢及附加多值標頭" "的以及附加 MIME 參數標頭的方法:" -#: ../../library/wsgiref.rst:239 +#: ../../library/wsgiref.rst:244 msgid "Return a list of all the values for the named header." msgstr "回傳指定標頭的所有值的串列。" -#: ../../library/wsgiref.rst:241 +#: ../../library/wsgiref.rst:246 msgid "" "The returned list will be sorted in the order they appeared in the original " "header list or were added to this instance, and may contain duplicates. Any " @@ -402,14 +406,14 @@ msgstr "" "序,並且可能包含重複的內容。任何被刪除並重新插入的欄位都會被添加到標頭串列的" "末尾。如果不存在指定名稱的欄位,則回傳空串列。" -#: ../../library/wsgiref.rst:249 +#: ../../library/wsgiref.rst:254 msgid "" "Add a (possibly multi-valued) header, with optional MIME parameters " "specified via keyword arguments." msgstr "" "添加一個(可能是多值的)標頭,可透過關鍵字引數來指定選擇性的 MIME 參數。" -#: ../../library/wsgiref.rst:252 +#: ../../library/wsgiref.rst:257 msgid "" "*name* is the header field to add. Keyword arguments can be used to set " "MIME parameters for the header field. Each parameter must be a string or " @@ -426,55 +430,55 @@ msgstr "" "則以 ``name=\"value\"`` 的形式添加到標頭值參數中。如果它是 ``None``,則僅添加" "參數名稱。(這使用於沒有值的 MIME 參數)使用範例: ::" -#: ../../library/wsgiref.rst:260 +#: ../../library/wsgiref.rst:265 msgid "h.add_header('content-disposition', 'attachment', filename='bud.gif')" msgstr "h.add_header('content-disposition', 'attachment', filename='bud.gif')" -#: ../../library/wsgiref.rst:262 +#: ../../library/wsgiref.rst:267 msgid "The above will add a header that looks like this::" msgstr "上述操作將添加看起來像這樣的標頭: ::" -#: ../../library/wsgiref.rst:264 +#: ../../library/wsgiref.rst:269 msgid "Content-Disposition: attachment; filename=\"bud.gif\"" msgstr "Content-Disposition: attachment; filename=\"bud.gif\"" -#: ../../library/wsgiref.rst:267 +#: ../../library/wsgiref.rst:272 msgid "*headers* parameter is optional." msgstr "*headers* 參數是可選的。" -#: ../../library/wsgiref.rst:272 +#: ../../library/wsgiref.rst:277 msgid ":mod:`wsgiref.simple_server` -- a simple WSGI HTTP server" msgstr ":mod:`wsgiref.simple_server` -- 一個簡單的 WSGI HTTP 伺服器" -#: ../../library/wsgiref.rst:278 +#: ../../library/wsgiref.rst:283 msgid "" "This module implements a simple HTTP server (based on :mod:`http.server`) " "that serves WSGI applications. Each server instance serves a single WSGI " "application on a given host and port. If you want to serve multiple " "applications on a single host and port, you should create a WSGI application " "that parses ``PATH_INFO`` to select which application to invoke for each " -"request. (E.g., using the :func:`shift_path_info` function " -"from :mod:`wsgiref.util`.)" +"request. (E.g., using the :func:`shift_path_info` function from :mod:" +"`wsgiref.util`.)" msgstr "" "這個模組實作一個簡單的的 HTTP 伺服器(基於 :mod:`http.server`)用於提供 WSGI " "應用程式。每個伺服器執行個體在特定的主機與埠提供單一的 WSGI 應用程式。如果你" "想要在單一主機與埠上提供多個應用程式,你應該建立一個 WSGI 應用程式以剖析 " -"``PATH_INFO`` 去選擇為每個請求叫用哪個應用程式。(例如,使用來" -"自 :mod:`wsgiref.util` 的 :func:`shift_path_info` 函式。)" +"``PATH_INFO`` 去選擇為每個請求叫用哪個應用程式。(例如,使用來自 :mod:" +"`wsgiref.util` 的 :func:`shift_path_info` 函式。)" -#: ../../library/wsgiref.rst:289 +#: ../../library/wsgiref.rst:294 msgid "" "Create a new WSGI server listening on *host* and *port*, accepting " "connections for *app*. The return value is an instance of the supplied " "*server_class*, and will process requests using the specified " -"*handler_class*. *app* must be a WSGI application object, as defined " -"by :pep:`3333`." +"*handler_class*. *app* must be a WSGI application object, as defined by :" +"pep:`3333`." msgstr "" "建立一個新的 WSGI 伺服器監聽 *host* 和 *port*,接受 *app* 的連線。回傳值是提" "供 *server_class* 的實例,並將使用指定的 *handler_class* 處理請求。*app* 必須" "是一個 WSGI 應用程式物件,如 :pep:`3333` 所定義。" -#: ../../library/wsgiref.rst:296 +#: ../../library/wsgiref.rst:301 msgid "" "from wsgiref.simple_server import make_server, demo_app\n" "\n" @@ -488,7 +492,7 @@ msgid "" " httpd.handle_request()" msgstr "" -#: ../../library/wsgiref.rst:310 +#: ../../library/wsgiref.rst:315 msgid "" "This function is a small but complete WSGI application that returns a text " "page containing the message \"Hello world!\" and a list of the key/value " @@ -501,85 +505,83 @@ msgstr "" "(例如 :mod:`wsgiref.simple_server`)是否能正確執行簡單的 WSGI 應用程式非常有" "用。" -#: ../../library/wsgiref.rst:316 +#: ../../library/wsgiref.rst:321 msgid "" "The *start_response* callable should follow the :class:`.StartResponse` " "protocol." msgstr "" -#: ../../library/wsgiref.rst:321 +#: ../../library/wsgiref.rst:326 msgid "" -"Create a :class:`WSGIServer` instance. *server_address* should be a " -"``(host,port)`` tuple, and *RequestHandlerClass* should be the subclass " -"of :class:`http.server.BaseHTTPRequestHandler` that will be used to process " -"requests." +"Create a :class:`WSGIServer` instance. *server_address* should be a ``(host," +"port)`` tuple, and *RequestHandlerClass* should be the subclass of :class:" +"`http.server.BaseHTTPRequestHandler` that will be used to process requests." msgstr "" "建立一個 :class:`WSGIServer` 實例。*server_address* 應該是一個 ``(host, " -"port)`` 元組,而 *RequestHandlerClass* 應該" -"是 :class:`http.server.BaseHTTPRequestHandler` 的子類別,將用於處理請求。" +"port)`` 元組,而 *RequestHandlerClass* 應該是 :class:`http.server." +"BaseHTTPRequestHandler` 的子類別,將用於處理請求。" -#: ../../library/wsgiref.rst:326 +#: ../../library/wsgiref.rst:331 msgid "" -"You do not normally need to call this constructor, as " -"the :func:`make_server` function can handle all the details for you." +"You do not normally need to call this constructor, as the :func:" +"`make_server` function can handle all the details for you." msgstr "" "通常你不需要呼叫這個建構函式(constructor),因為 :func:`make_server` 函式可" "以為你處理所有細節。" -#: ../../library/wsgiref.rst:329 +#: ../../library/wsgiref.rst:334 msgid "" ":class:`WSGIServer` is a subclass of :class:`http.server.HTTPServer`, so all " "of its methods (such as :meth:`serve_forever` and :meth:`handle_request`) " "are available. :class:`WSGIServer` also provides these WSGI-specific methods:" msgstr "" ":class:`WSGIServer` 是 :class:`http.server.HTTPServer` 的子類別,因此它的所有" -"方法(例如 :meth:`serve_forever` 和 :meth:`handle_request`)都可" -"用。:class:`WSGIServer` 也提供這些特定於 WSGI 的方法:" +"方法(例如 :meth:`serve_forever` 和 :meth:`handle_request`)都可用。:class:" +"`WSGIServer` 也提供這些特定於 WSGI 的方法:" -#: ../../library/wsgiref.rst:336 +#: ../../library/wsgiref.rst:341 msgid "" "Sets the callable *application* as the WSGI application that will receive " "requests." msgstr "將可呼叫的 *application* 設定為接收請求的 WSGI 應用程式。" -#: ../../library/wsgiref.rst:342 +#: ../../library/wsgiref.rst:347 msgid "Returns the currently set application callable." msgstr "回傳目前設定應用程式的可呼叫物件。" -#: ../../library/wsgiref.rst:344 +#: ../../library/wsgiref.rst:349 msgid "" -"Normally, however, you do not need to use these additional methods, " -"as :meth:`set_app` is normally called by :func:`make_server`, and " -"the :meth:`get_app` exists mainly for the benefit of request handler " -"instances." +"Normally, however, you do not need to use these additional methods, as :meth:" +"`set_app` is normally called by :func:`make_server`, and the :meth:`get_app` " +"exists mainly for the benefit of request handler instances." msgstr "" -"然而,通常情況下你不需要去使用這些額外方法,因為 :meth:`set_app` 通常會" -"被 :func:`make_server` 呼叫而 :meth:`get_app` 主要存在於請求處理程式" -"(handler)實例的好處上。" +"然而,通常情況下你不需要去使用這些額外方法,因為 :meth:`set_app` 通常會被 :" +"func:`make_server` 呼叫而 :meth:`get_app` 主要存在於請求處理程式(handler)實" +"例的好處上。" -#: ../../library/wsgiref.rst:351 +#: ../../library/wsgiref.rst:356 msgid "" "Create an HTTP handler for the given *request* (i.e. a socket), " -"*client_address* (a ``(host,port)`` tuple), and *server* " -"(:class:`WSGIServer` instance)." +"*client_address* (a ``(host,port)`` tuple), and *server* (:class:" +"`WSGIServer` instance)." msgstr "" -"為給定的 *request*\\ (即一個 socket)、*client_address*\\ (一個 ``(host,port)`` " -"位元組)、*server* (:class:`WSGIServer` 實例) 建立一個 HTTP 處理程式" +"為給定的 *request*\\ (即一個 socket)、*client_address*\\ (一個 ``(host," +"port)`` 位元組)、*server* (:class:`WSGIServer` 實例) 建立一個 HTTP 處理程式" "(handler)。" -#: ../../library/wsgiref.rst:354 +#: ../../library/wsgiref.rst:359 msgid "" "You do not need to create instances of this class directly; they are " "automatically created as needed by :class:`WSGIServer` objects. You can, " -"however, subclass this class and supply it as a *handler_class* to " -"the :func:`make_server` function. Some possibly relevant methods for " -"overriding in subclasses:" +"however, subclass this class and supply it as a *handler_class* to the :func:" +"`make_server` function. Some possibly relevant methods for overriding in " +"subclasses:" msgstr "" "你不需要直接建立這個類別的實例;它們會在需要時由 :class:`WSGIServer` 物件自動" -"建立。不過,你可以建立這個類別的子類別並將其作為 *handler_class* 提供" -"給 :func:`make_server` 函式。一些可能相關的方法可以在子類別中進行覆寫:" +"建立。不過,你可以建立這個類別的子類別並將其作為 *handler_class* 提供給 :" +"func:`make_server` 函式。一些可能相關的方法可以在子類別中進行覆寫:" -#: ../../library/wsgiref.rst:363 +#: ../../library/wsgiref.rst:368 msgid "" "Return a :data:`~wsgiref.types.WSGIEnvironment` dictionary for a request. " "The default implementation copies the contents of the :class:`WSGIServer` " @@ -590,17 +592,17 @@ msgid "" msgstr "" "唯一個請求回傳一個 :data:`~wsgiref.types.WSGIEnvironment` 字典。預設的實作會" "複製 :class:`WSGIServer` 物件的 :attr:`base_environ` 字典屬性的內容以及添加" -"從 HTTP 請求中衍生的各種標頭。每次呼叫這個方法都應該回傳一個包含所有" -"如 :pep:`3333` 所指定的相關 CGI 環境變數的新字典。" +"從 HTTP 請求中衍生的各種標頭。每次呼叫這個方法都應該回傳一個包含所有如 :pep:" +"`3333` 所指定的相關 CGI 環境變數的新字典。" -#: ../../library/wsgiref.rst:374 +#: ../../library/wsgiref.rst:379 msgid "" "Return the object that should be used as the ``wsgi.errors`` stream. The " "default implementation just returns ``sys.stderr``." msgstr "" "回傳的物件應該被用作 ``wsgi.errors`` 串流。預設實作只會回傳 ``sys.stderr``。" -#: ../../library/wsgiref.rst:380 +#: ../../library/wsgiref.rst:385 msgid "" "Process the HTTP request. The default implementation creates a handler " "instance using a :mod:`wsgiref.handlers` class to implement the actual WSGI " @@ -609,17 +611,17 @@ msgstr "" "處理 HTTP 請求。預設實作會使用 :mod:`wsgiref.handlers` 類別來建立處置程式" "(handler)實例來實作實際 WSGI 應用程式介面。" -#: ../../library/wsgiref.rst:386 +#: ../../library/wsgiref.rst:391 msgid ":mod:`wsgiref.validate` --- WSGI conformance checker" msgstr ":mod:`wsgiref.validate` --- WSGI 符合性檢查" -#: ../../library/wsgiref.rst:392 +#: ../../library/wsgiref.rst:397 msgid "" "When creating new WSGI application objects, frameworks, servers, or " -"middleware, it can be useful to validate the new code's conformance " -"using :mod:`wsgiref.validate`. This module provides a function that creates " -"WSGI application objects that validate communications between a WSGI server " -"or gateway and a WSGI application object, to check both sides for protocol " +"middleware, it can be useful to validate the new code's conformance using :" +"mod:`wsgiref.validate`. This module provides a function that creates WSGI " +"application objects that validate communications between a WSGI server or " +"gateway and a WSGI application object, to check both sides for protocol " "conformance." msgstr "" "當建立新的 WSGI 應用程式物件、框架、伺服器、或是中介軟體(middleware)時,使" @@ -627,7 +629,7 @@ msgstr "" "個函式用於建立 WSGI 應用程式物件,並用於驗證 WSGI 伺服器或是閘道與 WSGI 應用" "程式物件之間的通訊,以檢查雙方協定的符合性。" -#: ../../library/wsgiref.rst:399 +#: ../../library/wsgiref.rst:404 msgid "" "Note that this utility does not guarantee complete :pep:`3333` compliance; " "an absence of errors from this module does not necessarily mean that errors " @@ -639,7 +641,7 @@ msgstr "" "錯誤。但是,如果如果這個模組產生錯誤,那麼幾乎可以確定伺服器或應用程式不是 " "100% 符合標準。" -#: ../../library/wsgiref.rst:404 +#: ../../library/wsgiref.rst:409 msgid "" "This module is based on the :mod:`paste.lint` module from Ian Bicking's " "\"Python Paste\" library." @@ -647,7 +649,7 @@ msgstr "" "這個模組基於 Ian Bicking 的 \"Python Paste\" 函式庫的 :mod:`paste.lint` 模" "組。" -#: ../../library/wsgiref.rst:410 +#: ../../library/wsgiref.rst:415 msgid "" "Wrap *application* and return a new WSGI application object. The returned " "application will forward all requests to the original *application*, and " @@ -658,7 +660,7 @@ msgstr "" "請求給原始的 *application*,並檢查 *application* 和呼叫它的伺服器是否符合 " "WSGI 規範和 :rfc:`2616`。" -#: ../../library/wsgiref.rst:415 +#: ../../library/wsgiref.rst:420 msgid "" "Any detected nonconformance results in an :exc:`AssertionError` being " "raised; note, however, that how these errors are handled is server-" @@ -669,12 +671,12 @@ msgid "" "stream." msgstr "" "任何在 :exc:`AssertionError` 中偵測不符合結果都會發起例外;但請注意,如何處理" -"這些錯誤取決於伺服器。例如,基於 :mod:`wsgiref.handlers` " -"的 :mod:`wsgiref.simple_server` 以及其他伺服器(未覆蓋錯誤處理方法以執行其他" -"操作的伺服器)將僅輸出一條錯誤訊息,指示發生錯誤,並將回溯訊息輸出到 " -"``sys.stderr`` 或是其他錯誤串流。" +"這些錯誤取決於伺服器。例如,基於 :mod:`wsgiref.handlers` 的 :mod:`wsgiref." +"simple_server` 以及其他伺服器(未覆蓋錯誤處理方法以執行其他操作的伺服器)將僅" +"輸出一條錯誤訊息,指示發生錯誤,並將回溯訊息輸出到 ``sys.stderr`` 或是其他錯" +"誤串流。" -#: ../../library/wsgiref.rst:422 +#: ../../library/wsgiref.rst:427 msgid "" "This wrapper may also generate output using the :mod:`warnings` module to " "indicate behaviors that are questionable but which may not actually be " @@ -684,11 +686,11 @@ msgid "" "object)." msgstr "" "這個包裝器也可以使用 :mod:`warnings` 模組生成輸出去指示一些可能有疑慮但實際上" -"可能不會被 :pep:`3333` 禁止的行為。除非使用 Python 命令列選項" -"或 :mod:`warnings` API,抑制了這些警告,否則這類警告將被寫入到 " -"``sys.stderr``\\ (*not* ``wsgi.errors``,除非它們碰巧是相同的物件)。" +"可能不會被 :pep:`3333` 禁止的行為。除非使用 Python 命令列選項或 :mod:" +"`warnings` API,抑制了這些警告,否則這類警告將被寫入到 ``sys.stderr``\\ " +"(*not* ``wsgi.errors``,除非它們碰巧是相同的物件)。" -#: ../../library/wsgiref.rst:431 +#: ../../library/wsgiref.rst:436 msgid "" "from wsgiref.validate import validator\n" "from wsgiref.simple_server import make_server\n" @@ -712,11 +714,11 @@ msgid "" " httpd.serve_forever()" msgstr "" -#: ../../library/wsgiref.rst:454 +#: ../../library/wsgiref.rst:459 msgid ":mod:`wsgiref.handlers` -- server/gateway base classes" msgstr ":mod:`wsgiref.handlers` -- 伺服器 / 閘道基本類別" -#: ../../library/wsgiref.rst:460 +#: ../../library/wsgiref.rst:465 msgid "" "This module provides base handler classes for implementing WSGI servers and " "gateways. These base classes handle most of the work of communicating with " @@ -727,7 +729,7 @@ msgstr "" "處理程式大部分與 WSGI 應用程式通訊的工作,只要它們被提供 CGI-like 環境,以及" "輸入、輸出和錯誤串流。" -#: ../../library/wsgiref.rst:468 +#: ../../library/wsgiref.rst:473 msgid "" "CGI-based invocation via ``sys.stdin``, ``sys.stdout``, ``sys.stderr`` and " "``os.environ``. This is useful when you have a WSGI application and want to " @@ -739,18 +741,18 @@ msgstr "" "很有用的。只需叫用 ``CGIHandler().run(app)``,其中 ``app`` 是你希望叫用的 " "WSGI 應用程式物件。" -#: ../../library/wsgiref.rst:473 +#: ../../library/wsgiref.rst:478 msgid "" -"This class is a subclass of :class:`BaseCGIHandler` that sets " -"``wsgi.run_once`` to true, ``wsgi.multithread`` to false, and " -"``wsgi.multiprocess`` to true, and always uses :mod:`sys` and :mod:`os` to " -"obtain the necessary CGI streams and environment." +"This class is a subclass of :class:`BaseCGIHandler` that sets ``wsgi." +"run_once`` to true, ``wsgi.multithread`` to false, and ``wsgi.multiprocess`` " +"to true, and always uses :mod:`sys` and :mod:`os` to obtain the necessary " +"CGI streams and environment." msgstr "" "這個類別是 :class:`BaseCGIHandler` 的子類別將 ``wsgi.run_once`` 設置為 true," "``wsgi.multithread`` 設置為 false,並將 ``wsgi.multiprocess`` 設置為 true,並" "且始終使用 :mod:`sys` 和 :mod:`os` 來取得所需的 CGI 串流以及環境。" -#: ../../library/wsgiref.rst:481 +#: ../../library/wsgiref.rst:486 msgid "" "A specialized alternative to :class:`CGIHandler`, for use when deploying on " "Microsoft's IIS web server, without having set the config allowPathInfo " @@ -760,7 +762,7 @@ msgstr "" "個專門替代選擇,無需設置 config 的 allowPathInfo 選項(IIS>=7),或 metabase " "的 allowPathInfoForScriptMappings 選項(IIS<7)。" -#: ../../library/wsgiref.rst:485 +#: ../../library/wsgiref.rst:490 msgid "" "By default, IIS gives a ``PATH_INFO`` that duplicates the ``SCRIPT_NAME`` at " "the front, causing problems for WSGI applications that wish to implement " @@ -770,7 +772,7 @@ msgstr "" "作路由的 WSGI 應用程式造成問題。這個處理程式(handler)會移除任何這樣的重複路" "徑。" -#: ../../library/wsgiref.rst:489 +#: ../../library/wsgiref.rst:494 msgid "" "IIS can be configured to pass the correct ``PATH_INFO``, but this causes " "another bug where ``PATH_TRANSLATED`` is wrong. Luckily this variable is " @@ -786,31 +788,30 @@ msgstr "" "``PATH_TRANSLATED`` 問題時會中斷。由於這個原因幾乎從不會使用修復的 IIS<7(即" "使是 IIS7 也很少使用它,因為它仍然沒有相應的 UI)。" -#: ../../library/wsgiref.rst:497 +#: ../../library/wsgiref.rst:502 msgid "" "There is no way for CGI code to tell whether the option was set, so a " -"separate handler class is provided. It is used in the same way " -"as :class:`CGIHandler`, i.e., by calling ``IISCGIHandler().run(app)``, where " -"``app`` is the WSGI application object you wish to invoke." +"separate handler class is provided. It is used in the same way as :class:" +"`CGIHandler`, i.e., by calling ``IISCGIHandler().run(app)``, where ``app`` " +"is the WSGI application object you wish to invoke." msgstr "" "CGI 程式碼無法知道是否已設置該選項,因此提供了一個獨立的處理程式(handler)類" -"別。它的使用方式與 :class:`CGIHandler` 相同,即透過呼叫 " -"``IISCGIHandler().run(app)`` 來使用,其中 ``app`` 是你希望叫用的 WSGI 應用程" -"式物件。" +"別。它的使用方式與 :class:`CGIHandler` 相同,即透過呼叫 ``IISCGIHandler()." +"run(app)`` 來使用,其中 ``app`` 是你希望叫用的 WSGI 應用程式物件。" -#: ../../library/wsgiref.rst:507 +#: ../../library/wsgiref.rst:512 msgid "" -"Similar to :class:`CGIHandler`, but instead of using the :mod:`sys` " -"and :mod:`os` modules, the CGI environment and I/O streams are specified " -"explicitly. The *multithread* and *multiprocess* values are used to set the " -"``wsgi.multithread`` and ``wsgi.multiprocess`` flags for any applications " -"run by the handler instance." +"Similar to :class:`CGIHandler`, but instead of using the :mod:`sys` and :mod:" +"`os` modules, the CGI environment and I/O streams are specified explicitly. " +"The *multithread* and *multiprocess* values are used to set the ``wsgi." +"multithread`` and ``wsgi.multiprocess`` flags for any applications run by " +"the handler instance." msgstr "" "類似於 :class:`CGIHandler`,但不是使用 :mod:`sys` 和 :mod:`os` 模組,而是明確" "指定 CGI 環境與 I/O 串流。*multithread* 和 *multiprocess* 值用於設置由處理程" "式(handler)實例運行的任何應用程式的旗標。" -#: ../../library/wsgiref.rst:513 +#: ../../library/wsgiref.rst:518 msgid "" "This class is a subclass of :class:`SimpleHandler` intended for use with " "software other than HTTP \"origin servers\". If you are writing a gateway " @@ -818,37 +819,38 @@ msgid "" "``Status:`` header to send an HTTP status, you probably want to subclass " "this instead of :class:`SimpleHandler`." msgstr "" -"這個類別是專門為除了 HTTP \"origin servers\" 以外的軟體一起使用" -"的 :class:`SimpleHandler` 的子類別。如果你正在撰寫一個使用 ``Status:`` 標頭來" -"發送 HTTP 狀態的閘道協定實作(例如 CGI、FastCGI、SCGI 等),你可能會想要子類" -"化這個類別來替代 :class:`SimpleHandler`。" +"這個類別是專門為除了 HTTP \"origin servers\" 以外的軟體一起使用的 :class:" +"`SimpleHandler` 的子類別。如果你正在撰寫一個使用 ``Status:`` 標頭來發送 HTTP " +"狀態的閘道協定實作(例如 CGI、FastCGI、SCGI 等),你可能會想要子類化這個類別" +"來替代 :class:`SimpleHandler`。" -#: ../../library/wsgiref.rst:522 +#: ../../library/wsgiref.rst:527 msgid "" "Similar to :class:`BaseCGIHandler`, but designed for use with HTTP origin " "servers. If you are writing an HTTP server implementation, you will " "probably want to subclass this instead of :class:`BaseCGIHandler`." msgstr "" "類似於 :class:`BaseCGIHandler`,但是被設計使用在 HTTP origin 伺服器。如果你正" -"在撰寫 HTTP 伺服器的實作,你可能會想要子類別化這個類別來替" -"代 :class:`BaseCGIHandler`。" +"在撰寫 HTTP 伺服器的實作,你可能會想要子類別化這個類別來替代 :class:" +"`BaseCGIHandler`。" -#: ../../library/wsgiref.rst:526 +#: ../../library/wsgiref.rst:531 msgid "" "This class is a subclass of :class:`BaseHandler`. It overrides the :meth:`!" -"__init__`, :meth:`~BaseHandler.get_stdin`, :meth:`~BaseHandler.get_stderr`, :meth:`~BaseHandler.add_cgi_vars`, :meth:`~BaseHandler._write`, " -"and :meth:`~BaseHandler._flush` methods to support explicitly setting the " -"environment and streams via the constructor. The supplied environment and " -"streams are stored in the :attr:`stdin`, :attr:`stdout`, :attr:`stderr`, " -"and :attr:`environ` attributes." +"__init__`, :meth:`~BaseHandler.get_stdin`, :meth:`~BaseHandler.get_stderr`, :" +"meth:`~BaseHandler.add_cgi_vars`, :meth:`~BaseHandler._write`, and :meth:" +"`~BaseHandler._flush` methods to support explicitly setting the environment " +"and streams via the constructor. The supplied environment and streams are " +"stored in the :attr:`stdin`, :attr:`stdout`, :attr:`stderr`, and :attr:" +"`environ` attributes." msgstr "" "這個類別是 :class:`BaseHandler` 的子類別。它透過建構函式去覆寫 :meth:`!" -"__init__`、:meth:`~BaseHandler.get_stdin`、:meth:`~BaseHandler.get_stderr`、:meth:`~BaseHandler.add_cgi_vars`、:meth:`~BaseHandler._write`、" -"和 :meth:`~BaseHandler._flush` 方法來明確提供設置環境與串流。提供的環境與串流" -"被儲存在 :attr:`stdin`、:attr:`stdout`、:attr:`stderr`、和 :attr:`environ` 環" -"境中。" +"__init__`、:meth:`~BaseHandler.get_stdin`、:meth:`~BaseHandler.get_stderr`、:" +"meth:`~BaseHandler.add_cgi_vars`、:meth:`~BaseHandler._write`、和 :meth:" +"`~BaseHandler._flush` 方法來明確提供設置環境與串流。提供的環境與串流被儲存" +"在 :attr:`stdin`、:attr:`stdout`、:attr:`stderr`、和 :attr:`environ` 環境中。" -#: ../../library/wsgiref.rst:535 +#: ../../library/wsgiref.rst:540 msgid "" "The :meth:`~io.BufferedIOBase.write` method of *stdout* should write each " "chunk in full, like :class:`io.BufferedIOBase`." @@ -856,7 +858,7 @@ msgstr "" "*stdout* 的 :meth:`~io.BufferedIOBase.write` 方法應該完整地寫入每個塊" "(chunk),像是 :class:`io.BufferedIOBase`。" -#: ../../library/wsgiref.rst:541 +#: ../../library/wsgiref.rst:546 msgid "" "This is an abstract base class for running WSGI applications. Each instance " "will handle a single HTTP request, although in principle you could create a " @@ -865,17 +867,17 @@ msgstr "" "這是一個運行 WSGI 應用程式的抽象基底類別。每個實例將處理單個 HTTP 請求,儘管" "原則上你可以建立一個可重用於多個請求的子類別。" -#: ../../library/wsgiref.rst:545 +#: ../../library/wsgiref.rst:550 msgid "" ":class:`BaseHandler` instances have only one method intended for external " "use:" msgstr ":class:`BaseHandler` 實例只有一個供外部使用的方法:" -#: ../../library/wsgiref.rst:550 +#: ../../library/wsgiref.rst:555 msgid "Run the specified WSGI application, *app*." msgstr "運行指定 WSGI 應用程式,*app*。" -#: ../../library/wsgiref.rst:552 +#: ../../library/wsgiref.rst:557 msgid "" "All of the other :class:`BaseHandler` methods are invoked by this method in " "the process of running the application, and thus exist primarily to allow " @@ -884,11 +886,11 @@ msgstr "" "此方法在運行應用程式的過程中叫用了所有其他 :class:`BaseHandler` 的方法,因此" "這些方法主要存在是為了允許自訂整個過程。" -#: ../../library/wsgiref.rst:556 +#: ../../library/wsgiref.rst:561 msgid "The following methods MUST be overridden in a subclass:" msgstr "以下方法必須在子類別中覆寫:" -#: ../../library/wsgiref.rst:561 +#: ../../library/wsgiref.rst:566 msgid "" "Buffer the bytes *data* for transmission to the client. It's okay if this " "method actually transmits the data; :class:`BaseHandler` just separates " @@ -899,15 +901,15 @@ msgstr "" "底層系統實際具有這種區分時,:class:`BaseHandler` 為了更好的效能進而分離寫入和" "刷新操作。" -#: ../../library/wsgiref.rst:569 +#: ../../library/wsgiref.rst:574 msgid "" "Force buffered data to be transmitted to the client. It's okay if this " "method is a no-op (i.e., if :meth:`_write` actually sends the data)." msgstr "" -"強制將緩衝數據傳送到用戶端。如果這是一個無操作(no-op)的方法(即,如" -"果 :meth:`_write` 實際上發送了數據),那麼是可以的。" +"強制將緩衝數據傳送到用戶端。如果這是一個無操作(no-op)的方法(即,如果 :" +"meth:`_write` 實際上發送了數據),那麼是可以的。" -#: ../../library/wsgiref.rst:575 +#: ../../library/wsgiref.rst:580 msgid "" "Return an object compatible with :class:`~wsgiref.types.InputStream` " "suitable for use as the ``wsgi.input`` of the request currently being " @@ -916,7 +918,7 @@ msgstr "" "回傳一個與 :class:`~wsgiref.types.InputStream` 相容的物件並適用於用作目前正在" "處理請求的 ``wsgi.input``。" -#: ../../library/wsgiref.rst:582 +#: ../../library/wsgiref.rst:587 msgid "" "Return an object compatible with :class:`~wsgiref.types.ErrorStream` " "suitable for use as the ``wsgi.errors`` of the request currently being " @@ -925,29 +927,29 @@ msgstr "" "回傳一個與 :class:`~wsgiref.types.ErrorStream` 相容的物件並適用於用作目前正在" "處理請求的 ``wsgi.errors``。" -#: ../../library/wsgiref.rst:589 +#: ../../library/wsgiref.rst:594 msgid "" "Insert CGI variables for the current request into the :attr:`environ` " "attribute." msgstr "將目前請求的 CGI 變數插入到 :attr:`environ` 屬性中。" -#: ../../library/wsgiref.rst:591 +#: ../../library/wsgiref.rst:596 msgid "" "Here are some other methods and attributes you may wish to override. This " "list is only a summary, however, and does not include every method that can " "be overridden. You should consult the docstrings and source code for " -"additional information before attempting to create a " -"customized :class:`BaseHandler` subclass." +"additional information before attempting to create a customized :class:" +"`BaseHandler` subclass." msgstr "" "以下是你可能希望覆寫的其他方法和屬性。這個列表只是一個摘要,然而,不包括可以" -"被覆寫的每個方法。在嘗試建立自訂的 :class:`BaseHandler` 子類別之前,你應該" -"參考文件說明和原始碼以獲得更多資訊。" +"被覆寫的每個方法。在嘗試建立自訂的 :class:`BaseHandler` 子類別之前,你應該參" +"考文件說明和原始碼以獲得更多資訊。" -#: ../../library/wsgiref.rst:597 +#: ../../library/wsgiref.rst:602 msgid "Attributes and methods for customizing the WSGI environment:" msgstr "用於自訂 WSGI 環境的屬性和方法:" -#: ../../library/wsgiref.rst:602 +#: ../../library/wsgiref.rst:607 msgid "" "The value to be used for the ``wsgi.multithread`` environment variable. It " "defaults to true in :class:`BaseHandler`, but may have a different default " @@ -956,7 +958,7 @@ msgstr "" "用於 ``wsgi.multithread`` 環境變數的值。在 :class:`BaseHandler` 中預設為 " "true,但在其他子類別中可能有不同的預設值(或由建構函式設置)。" -#: ../../library/wsgiref.rst:609 +#: ../../library/wsgiref.rst:614 msgid "" "The value to be used for the ``wsgi.multiprocess`` environment variable. It " "defaults to true in :class:`BaseHandler`, but may have a different default " @@ -965,7 +967,7 @@ msgstr "" "用於 ``wsgi.multiprocess`` 環境變數的值。在 :class:`BaseHandler` 中預設為 " "true,但在其他子類別中可能有不同的預設值(或由建構函式設置)。" -#: ../../library/wsgiref.rst:616 +#: ../../library/wsgiref.rst:621 msgid "" "The value to be used for the ``wsgi.run_once`` environment variable. It " "defaults to false in :class:`BaseHandler`, but :class:`CGIHandler` sets it " @@ -974,21 +976,20 @@ msgstr "" "用於 ``wsgi.run_once`` 環境變數的值。在 :class:`BaseHandler` 中預設為 false," "但 :class:`CGIHandler` 預設將其設置為 true。" -#: ../../library/wsgiref.rst:623 +#: ../../library/wsgiref.rst:628 msgid "" "The default environment variables to be included in every request's WSGI " -"environment. By default, this is a copy of ``os.environ`` at the time " -"that :mod:`wsgiref.handlers` was imported, but subclasses can either create " -"their own at the class or instance level. Note that the dictionary should " -"be considered read-only, since the default value is shared between multiple " +"environment. By default, this is a copy of ``os.environ`` at the time that :" +"mod:`wsgiref.handlers` was imported, but subclasses can either create their " +"own at the class or instance level. Note that the dictionary should be " +"considered read-only, since the default value is shared between multiple " "classes and instances." msgstr "" -"預設環境變數包含在每一個請求的 WSGI 環境中。預設情況下,這是在載" -"入 :mod:`wsgiref.handlers` 時的 ``os.environ`` 副本,但子類別可以在類別或實例" -"層級建立自己的副本。注意字典應該被視為唯讀,因為預設值在多個類別與實例中共" -"享。" +"預設環境變數包含在每一個請求的 WSGI 環境中。預設情況下,這是在載入 :mod:" +"`wsgiref.handlers` 時的 ``os.environ`` 副本,但子類別可以在類別或實例層級建立" +"自己的副本。注意字典應該被視為唯讀,因為預設值在多個類別與實例中共享。" -#: ../../library/wsgiref.rst:633 +#: ../../library/wsgiref.rst:638 msgid "" "If the :attr:`origin_server` attribute is set, this attribute's value is " "used to set the default ``SERVER_SOFTWARE`` WSGI environment variable, and " @@ -998,28 +999,28 @@ msgid "" msgstr "" "如果設置 :attr:`origin_server` 屬性,則此屬性的值將用於設置預設的 " "``SERVER_SOFTWARE`` WSGI 環境變數,並且還將用於設置 HTTP 回應中的預設 " -"``Server:`` 標頭。對於不是 HTTP origin 伺服器的處置程式(例" -"如 :class:`BaseCGIHandler` 和 :class:`CGIHandler`),此屬性將被忽略。" +"``Server:`` 標頭。對於不是 HTTP origin 伺服器的處置程式(例如 :class:" +"`BaseCGIHandler` 和 :class:`CGIHandler`),此屬性將被忽略。" -#: ../../library/wsgiref.rst:639 +#: ../../library/wsgiref.rst:644 msgid "" "The term \"Python\" is replaced with implementation specific term like " "\"CPython\", \"Jython\" etc." msgstr "" "將術語 \"Python\" 替換為特定實作的術語,如 \"CPython\"、\"Jython\" 等。" -#: ../../library/wsgiref.rst:645 +#: ../../library/wsgiref.rst:650 msgid "" "Return the URL scheme being used for the current request. The default " -"implementation uses the :func:`guess_scheme` function " -"from :mod:`wsgiref.util` to guess whether the scheme should be \"http\" or " -"\"https\", based on the current request's :attr:`environ` variables." +"implementation uses the :func:`guess_scheme` function from :mod:`wsgiref." +"util` to guess whether the scheme should be \"http\" or \"https\", based on " +"the current request's :attr:`environ` variables." msgstr "" -"回傳用於目前請求的 URL scheme。預設的實作使用 :mod:`wsgiref.util` 中" -"的 :func:`guess_scheme` 函式去猜測 scheme 是 \"http\" 或是 \"https\",基於目" -"前請求的 :attr:`environ` 變數。" +"回傳用於目前請求的 URL scheme。預設的實作使用 :mod:`wsgiref.util` 中的 :func:" +"`guess_scheme` 函式去猜測 scheme 是 \"http\" 或是 \"https\",基於目前請求的 :" +"attr:`environ` 變數。" -#: ../../library/wsgiref.rst:653 +#: ../../library/wsgiref.rst:658 msgid "" "Set the :attr:`environ` attribute to a fully populated WSGI environment. " "The default implementation uses all of the above methods and attributes, " @@ -1034,11 +1035,11 @@ msgstr "" "``SERVER_SOFTWARE`` 關鍵字,只要 :attr:`origin_server` 屬性是一個 true 值並" "且 :attr:`server_software` 屬性被設置。" -#: ../../library/wsgiref.rst:660 +#: ../../library/wsgiref.rst:665 msgid "Methods and attributes for customizing exception handling:" msgstr "用於自訂例外處理的屬性和方法:" -#: ../../library/wsgiref.rst:665 +#: ../../library/wsgiref.rst:670 msgid "" "Log the *exc_info* tuple in the server log. *exc_info* is a ``(type, value, " "traceback)`` tuple. The default implementation simply writes the traceback " @@ -1052,15 +1053,15 @@ msgstr "" "並刷新它。子類別可以覆蓋此方法以更改格式或重新定向輸出,將追蹤資訊發送給管理" "員,或執行其他被認為合適的操作。" -#: ../../library/wsgiref.rst:674 +#: ../../library/wsgiref.rst:679 msgid "" -"The maximum number of frames to include in tracebacks output by the " -"default :meth:`log_exception` method. If ``None``, all frames are included." +"The maximum number of frames to include in tracebacks output by the default :" +"meth:`log_exception` method. If ``None``, all frames are included." msgstr "" "預設的 :meth:`log_exception` 方法追蹤輸出中包含的最大幀數 。如果為 ``None``," "則包含所有幀。" -#: ../../library/wsgiref.rst:680 +#: ../../library/wsgiref.rst:685 msgid "" "This method is a WSGI application to generate an error page for the user. " "It is only invoked if an error occurs before headers are sent to the client." @@ -1068,7 +1069,7 @@ msgstr "" "這個方法是一個為使用者去產生錯誤頁面的 WSGI 應用程式。只有在標頭傳送給用戶端" "前如果發生錯誤才會被叫用。" -#: ../../library/wsgiref.rst:683 +#: ../../library/wsgiref.rst:688 msgid "" "This method can access the current error using ``sys.exception()``, and " "should pass that information to *start_response* when calling it (as " @@ -1080,18 +1081,16 @@ msgstr "" "\"Error Handling\" 部分所描述)時應該傳遞資訊給 *start_response*。特別是 " "*start_response* 可呼叫物件應該遵循 :class:`.StartResponse` 協定。" -#: ../../library/wsgiref.rst:689 +#: ../../library/wsgiref.rst:694 msgid "" -"The default implementation just uses " -"the :attr:`error_status`, :attr:`error_headers`, and :attr:`error_body` " -"attributes to generate an output page. Subclasses can override this to " -"produce more dynamic error output." +"The default implementation just uses the :attr:`error_status`, :attr:" +"`error_headers`, and :attr:`error_body` attributes to generate an output " +"page. Subclasses can override this to produce more dynamic error output." msgstr "" -"預設的實作只是使用 :attr:`error_status`、:attr:`error_headers` " -"和 :attr:`error_body` 屬性產生輸出頁面。子類別可以覆蓋此方法以生成更動態的錯" -"誤輸出。" +"預設的實作只是使用 :attr:`error_status`、:attr:`error_headers` 和 :attr:" +"`error_body` 屬性產生輸出頁面。子類別可以覆蓋此方法以生成更動態的錯誤輸出。" -#: ../../library/wsgiref.rst:693 +#: ../../library/wsgiref.rst:698 msgid "" "Note, however, that it's not recommended from a security perspective to spit " "out diagnostics to any old user; ideally, you should have to do something " @@ -1101,7 +1100,7 @@ msgstr "" "然而,從安全的角度並不建議向任何普通使用者顯示診斷資訊;理想情況下,你應該需" "要採取特殊措施才能啟用診斷輸出,這就是預設實作不包括任何診斷資訊的原因。" -#: ../../library/wsgiref.rst:701 +#: ../../library/wsgiref.rst:706 msgid "" "The HTTP status used for error responses. This should be a status string as " "defined in :pep:`3333`; it defaults to a 500 code and message." @@ -1109,7 +1108,7 @@ msgstr "" "用於錯誤回應的 HTTP 狀態。這應該是一個按照 :pep:`3333` 定義的狀態字串;預設" "為 500 狀態碼和訊息。" -#: ../../library/wsgiref.rst:707 +#: ../../library/wsgiref.rst:712 msgid "" "The HTTP headers used for error responses. This should be a list of WSGI " "response headers (``(name, value)`` tuples), as described in :pep:`3333`. " @@ -1119,7 +1118,7 @@ msgstr "" "value)`` 元組),如 :pep:`3333` 中所描述。預設串列只設置內容種類為 ``text/" "plain``。" -#: ../../library/wsgiref.rst:714 +#: ../../library/wsgiref.rst:719 msgid "" "The error response body. This should be an HTTP response body bytestring. " "It defaults to the plain text, \"A server error occurred. Please contact " @@ -1128,7 +1127,7 @@ msgstr "" "錯誤回應的主體。這應該是一個 HTTP 回應內容的位元組字串。預設為純文字 \"A " "server error occurred. Please contact the administrator.\"" -#: ../../library/wsgiref.rst:718 +#: ../../library/wsgiref.rst:723 msgid "" "Methods and attributes for :pep:`3333`'s \"Optional Platform-Specific File " "Handling\" feature:" @@ -1136,17 +1135,17 @@ msgstr "" "用於 :pep:`3333` 中的 \"Optional Platform-Specific File Handling\" 功能的方法" "和屬性:" -#: ../../library/wsgiref.rst:724 +#: ../../library/wsgiref.rst:729 msgid "" -"A ``wsgi.file_wrapper`` factory, compatible " -"with :class:`wsgiref.types.FileWrapper`, or ``None``. The default value of " -"this attribute is the :class:`wsgiref.util.FileWrapper` class." +"A ``wsgi.file_wrapper`` factory, compatible with :class:`wsgiref.types." +"FileWrapper`, or ``None``. The default value of this attribute is the :" +"class:`wsgiref.util.FileWrapper` class." msgstr "" -"一個 ``wsgi.file_wrapper`` 工廠函式(factory)," -"與 :class:`wsgiref.types.FileWrapper` 相容,或者為 ``None``。這個屬性的預設值" -"是 :class:`wsgiref.util.FileWrapper` 類別。" +"一個 ``wsgi.file_wrapper`` 工廠函式(factory),與 :class:`wsgiref.types." +"FileWrapper` 相容,或者為 ``None``。這個屬性的預設值是 :class:`wsgiref.util." +"FileWrapper` 類別。" -#: ../../library/wsgiref.rst:731 +#: ../../library/wsgiref.rst:736 msgid "" "Override to implement platform-specific file transmission. This method is " "called only if the application's return value is an instance of the class " @@ -1155,35 +1154,35 @@ msgid "" "default transmission code will not be executed. The default implementation " "of this method just returns a false value." msgstr "" -"覆蓋以實作特定平台的檔案傳輸。只有當應用程式的回傳值是" -"由 :attr:`wsgi_file_wrapper` 屬性指定的類別實例時才會呼叫此方法。如果它能夠成" -"功傳輸檔案應該回傳一個 true 值,以便不執行預設的傳輸程式碼。該方法的預設實作" -"只回傳一個 false 值。" +"覆蓋以實作特定平台的檔案傳輸。只有當應用程式的回傳值是由 :attr:" +"`wsgi_file_wrapper` 屬性指定的類別實例時才會呼叫此方法。如果它能夠成功傳輸檔" +"案應該回傳一個 true 值,以便不執行預設的傳輸程式碼。該方法的預設實作只回傳一" +"個 false 值。" -#: ../../library/wsgiref.rst:738 +#: ../../library/wsgiref.rst:743 msgid "Miscellaneous methods and attributes:" msgstr "其他方法和屬性:" -#: ../../library/wsgiref.rst:743 +#: ../../library/wsgiref.rst:748 msgid "" "This attribute should be set to a true value if the handler's :meth:`_write` " "and :meth:`_flush` are being used to communicate directly to the client, " "rather than via a CGI-like gateway protocol that wants the HTTP status in a " "special ``Status:`` header." msgstr "" -"這個屬性應該被設置為 true 值,如果處理程式(handler)的 :meth:`_write` " -"和 :meth:`_flush` 被用於直接與用戶端通訊,而不是透過 CGI-like 的閘道協定希望 " +"這個屬性應該被設置為 true 值,如果處理程式(handler)的 :meth:`_write` 和 :" +"meth:`_flush` 被用於直接與用戶端通訊,而不是透過 CGI-like 的閘道協定希望 " "HTTP 狀態在特殊的 ``Status:`` 標頭中。" -#: ../../library/wsgiref.rst:748 +#: ../../library/wsgiref.rst:753 msgid "" "This attribute's default value is true in :class:`BaseHandler`, but false " "in :class:`BaseCGIHandler` and :class:`CGIHandler`." msgstr "" -"這個屬性在 :class:`BaseHandler` 預設值為 true,但是" -"在 :class:`BaseCGIHandler` 和 :class:`CGIHandler` 為 false。" +"這個屬性在 :class:`BaseHandler` 預設值為 true,但是在 :class:" +"`BaseCGIHandler` 和 :class:`CGIHandler` 為 false。" -#: ../../library/wsgiref.rst:754 +#: ../../library/wsgiref.rst:759 msgid "" "If :attr:`origin_server` is true, this string attribute is used to set the " "HTTP version of the response set to the client. It defaults to ``\"1.0\"``." @@ -1191,11 +1190,11 @@ msgstr "" "如果 :attr:`origin_server` 為 true,則此字串屬性用於設定傳送給用戶端的回應的 " "HTTP 版本。預設為 ``\"1.0\"``。" -#: ../../library/wsgiref.rst:760 +#: ../../library/wsgiref.rst:765 msgid "" "Transcode CGI variables from ``os.environ`` to :pep:`3333` \"bytes in " -"unicode\" strings, returning a new dictionary. This function is used " -"by :class:`CGIHandler` and :class:`IISCGIHandler` in place of directly using " +"unicode\" strings, returning a new dictionary. This function is used by :" +"class:`CGIHandler` and :class:`IISCGIHandler` in place of directly using " "``os.environ``, which is not necessarily WSGI-compliant on all platforms and " "web servers using Python 3 -- specifically, ones where the OS's actual " "environment is Unicode (i.e. Windows), or ones where the environment is " @@ -1203,13 +1202,13 @@ msgid "" "than ISO-8859-1 (e.g. Unix systems using UTF-8)." msgstr "" "從 ``os.environ`` 轉碼 CGI 變數到 :pep:`3333` 中的 \"bytes in unicode\" 字" -"串,並回傳一個新字典。這個函式被 :class:`CGIHandler` " -"和 :class:`IISCGIHandler` 使用來直接替代 ``os.environ``,在所有平台和使用 " -"Python 3 的網頁伺服器上不一定符合 WSGI 標準,具體來說,在 OS 的實際環境是 " -"Unicode(例如 Windows)的情況下,或者在環境是位元組的情況下,但 Python 用於解" -"碼它的系統編碼不是 ISO-8859-1 (例如使用 UTF-8 的 Unix 系統)。" +"串,並回傳一個新字典。這個函式被 :class:`CGIHandler` 和 :class:" +"`IISCGIHandler` 使用來直接替代 ``os.environ``,在所有平台和使用 Python 3 的網" +"頁伺服器上不一定符合 WSGI 標準,具體來說,在 OS 的實際環境是 Unicode(例如 " +"Windows)的情況下,或者在環境是位元組的情況下,但 Python 用於解碼它的系統編碼" +"不是 ISO-8859-1 (例如使用 UTF-8 的 Unix 系統)。" -#: ../../library/wsgiref.rst:769 +#: ../../library/wsgiref.rst:774 msgid "" "If you are implementing a CGI-based handler of your own, you probably want " "to use this routine instead of just copying values out of ``os.environ`` " @@ -1218,17 +1217,17 @@ msgstr "" "如果你自己正在實作 CGI-based 處理程式(handler),你可能想要使用這個函式來替" "換單純直接從 ``os.environ`` 中複製值。" -#: ../../library/wsgiref.rst:777 +#: ../../library/wsgiref.rst:782 msgid ":mod:`wsgiref.types` -- WSGI types for static type checking" msgstr ":mod:`wsgiref.types` -- 用於靜態型別檢查的 WSGI 型別" -#: ../../library/wsgiref.rst:783 +#: ../../library/wsgiref.rst:788 msgid "" -"This module provides various types for static type checking as described " -"in :pep:`3333`." +"This module provides various types for static type checking as described in :" +"pep:`3333`." msgstr "這個模組提供在 :pep:`3333` 中所描述的各種用於靜態型別檢查的型別。" -#: ../../library/wsgiref.rst:791 +#: ../../library/wsgiref.rst:796 msgid "" "A :class:`typing.Protocol` describing :pep:`start_response() <3333#the-start-" "response-callable>` callables (:pep:`3333`)." @@ -1236,52 +1235,52 @@ msgstr "" "一個描述 :pep:`start_response() <3333#the-start-response-callable>` 可呼叫物" "件的 :class:`typing.Protocol` (:pep:`3333`)。" -#: ../../library/wsgiref.rst:797 +#: ../../library/wsgiref.rst:802 msgid "A type alias describing a WSGI environment dictionary." msgstr "一個描述 WSGI 環境字典的型別別名。" -#: ../../library/wsgiref.rst:801 +#: ../../library/wsgiref.rst:806 msgid "A type alias describing a WSGI application callable." msgstr "一個描述 WSGI 應用程式可呼叫物件的型別別名。" -#: ../../library/wsgiref.rst:805 +#: ../../library/wsgiref.rst:810 msgid "" "A :class:`typing.Protocol` describing a :pep:`WSGI Input Stream <3333#input-" "and-error-streams>`." msgstr "" -"一個描述 :pep:`WSGI 輸入串流 <3333#input-and-error-streams>`\\ " -"的 :class:`typing.Protocol`。" +"一個描述 :pep:`WSGI 輸入串流 <3333#input-and-error-streams>`\\ 的 :class:" +"`typing.Protocol`。" -#: ../../library/wsgiref.rst:810 +#: ../../library/wsgiref.rst:815 msgid "" "A :class:`typing.Protocol` describing a :pep:`WSGI Error Stream <3333#input-" "and-error-streams>`." msgstr "" -"一個描述 :pep:`WSGI 錯誤串流 <3333#input-and-error-streams>`\\ " -"的 :class:`typing.Protocol`。" +"一個描述 :pep:`WSGI 錯誤串流 <3333#input-and-error-streams>`\\ 的 :class:" +"`typing.Protocol`。" -#: ../../library/wsgiref.rst:815 +#: ../../library/wsgiref.rst:820 msgid "" "A :class:`typing.Protocol` describing a :pep:`file wrapper <3333#optional-" "platform-specific-file-handling>`. See :class:`wsgiref.util.FileWrapper` for " "a concrete implementation of this protocol." msgstr "" "一個描述\\ :pep:`檔案包裝器 <3333#optional-platform-specific-file-" -"handling>`\\ 的 :class:`typing.Protocol`。請參" -"閱 :class:`wsgiref.util.FileWrapper` 來瞭解此協定的具體實作。" +"handling>`\\ 的 :class:`typing.Protocol`。請參閱 :class:`wsgiref.util." +"FileWrapper` 來瞭解此協定的具體實作。" -#: ../../library/wsgiref.rst:822 +#: ../../library/wsgiref.rst:827 msgid "Examples" msgstr "範例" -#: ../../library/wsgiref.rst:824 +#: ../../library/wsgiref.rst:829 msgid "" "This is a working \"Hello World\" WSGI application, where the " "*start_response* callable should follow the :class:`.StartResponse` " "protocol::" msgstr "" -#: ../../library/wsgiref.rst:827 +#: ../../library/wsgiref.rst:832 msgid "" "\"\"\"\n" "Every WSGI application must have an application object - a callable\n" @@ -1310,7 +1309,7 @@ msgid "" " httpd.serve_forever()" msgstr "" -#: ../../library/wsgiref.rst:854 +#: ../../library/wsgiref.rst:859 msgid "" "Example of a WSGI application serving the current directory, accept optional " "directory and port number (default: 8000) on the command line::" @@ -1318,7 +1317,7 @@ msgstr "" "提供目前目錄的 WSGI 應用程式範例,並接受命令列上的可選目錄和埠號(預設:" "8000): ::" -#: ../../library/wsgiref.rst:857 +#: ../../library/wsgiref.rst:862 msgid "" "\"\"\"\n" "Small wsgiref based web server. Takes a path to serve from and an\n" diff --git a/reference/simple_stmts.po b/reference/simple_stmts.po index b862503a3b..c3d85c07db 100644 --- a/reference/simple_stmts.po +++ b/reference/simple_stmts.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-05 14:10+0000\n" +"POT-Creation-Date: 2026-02-06 00:18+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -980,23 +980,25 @@ msgstr "" msgid "" "The *public names* defined by a module are determined by checking the " "module's namespace for a variable named ``__all__``; if defined, it must be " -"a sequence of strings which are names defined or imported by that module. " -"The names given in ``__all__`` are all considered public and are required to " -"exist. If ``__all__`` is not defined, the set of public names includes all " -"names found in the module's namespace which do not begin with an underscore " -"character (``'_'``). ``__all__`` should contain the entire public API. It " -"is intended to avoid accidentally exporting items that are not part of the " -"API (such as library modules which were imported and used within the module)." +"a sequence of strings which are names defined or imported by that module. " +"Names containing non-ASCII characters must be in the `normalization form`_ " +"NFKC; see :ref:`lexical-names-nonascii` for details. The names given in " +"``__all__`` are all considered public and are required to exist. If " +"``__all__`` is not defined, the set of public names includes all names found " +"in the module's namespace which do not begin with an underscore character " +"(``'_'``). ``__all__`` should contain the entire public API. It is intended " +"to avoid accidentally exporting items that are not part of the API (such as " +"library modules which were imported and used within the module)." msgstr "" -#: ../../reference/simple_stmts.rst:842 +#: ../../reference/simple_stmts.rst:844 msgid "" "The wild card form of import --- ``from module import *`` --- is only " "allowed at the module level. Attempting to use it in class or function " "definitions will raise a :exc:`SyntaxError`." msgstr "" -#: ../../reference/simple_stmts.rst:849 +#: ../../reference/simple_stmts.rst:851 msgid "" "When specifying what module to import you do not have to specify the " "absolute name of the module. When a module or package is contained within " @@ -1013,13 +1015,13 @@ msgid "" "the :ref:`relativeimports` section." msgstr "" -#: ../../reference/simple_stmts.rst:863 +#: ../../reference/simple_stmts.rst:865 msgid "" ":func:`importlib.import_module` is provided to support applications that " "determine dynamically the modules to be loaded." msgstr "" -#: ../../reference/simple_stmts.rst:866 +#: ../../reference/simple_stmts.rst:868 msgid "" "Raises an :ref:`auditing event ` ``import`` with arguments " "``module``, ``filename``, ``sys.path``, ``sys.meta_path``, ``sys." @@ -1028,18 +1030,18 @@ msgstr "" "引發一個附帶引數 ``module``、``filename``、``sys.path``、``sys.meta_path``、" "``sys.path_hooks`` 的\\ :ref:`稽核事件 ` ``import``。" -#: ../../reference/simple_stmts.rst:871 +#: ../../reference/simple_stmts.rst:875 msgid "Future statements" msgstr "" -#: ../../reference/simple_stmts.rst:877 +#: ../../reference/simple_stmts.rst:881 msgid "" "A :dfn:`future statement` is a directive to the compiler that a particular " "module should be compiled using syntax or semantics that will be available " "in a specified future release of Python where the feature becomes standard." msgstr "" -#: ../../reference/simple_stmts.rst:881 +#: ../../reference/simple_stmts.rst:885 msgid "" "The future statement is intended to ease migration to future versions of " "Python that introduce incompatible changes to the language. It allows use " @@ -1047,35 +1049,35 @@ msgid "" "feature becomes standard." msgstr "" -#: ../../reference/simple_stmts.rst:893 +#: ../../reference/simple_stmts.rst:897 msgid "" "A future statement must appear near the top of the module. The only lines " "that can appear before a future statement are:" msgstr "" -#: ../../reference/simple_stmts.rst:896 +#: ../../reference/simple_stmts.rst:900 msgid "the module docstring (if any)," msgstr "" -#: ../../reference/simple_stmts.rst:897 +#: ../../reference/simple_stmts.rst:901 msgid "comments," msgstr "" -#: ../../reference/simple_stmts.rst:898 +#: ../../reference/simple_stmts.rst:902 msgid "blank lines, and" msgstr "" -#: ../../reference/simple_stmts.rst:899 +#: ../../reference/simple_stmts.rst:903 msgid "other future statements." msgstr "" -#: ../../reference/simple_stmts.rst:901 +#: ../../reference/simple_stmts.rst:905 msgid "" "The only feature that requires using the future statement is ``annotations`` " "(see :pep:`563`)." msgstr "" -#: ../../reference/simple_stmts.rst:904 +#: ../../reference/simple_stmts.rst:908 msgid "" "All historical features enabled by the future statement are still recognized " "by Python 3. The list includes ``absolute_import``, ``division``, " @@ -1085,7 +1087,7 @@ msgid "" "compatibility." msgstr "" -#: ../../reference/simple_stmts.rst:911 +#: ../../reference/simple_stmts.rst:915 msgid "" "A future statement is recognized and treated specially at compile time: " "Changes to the semantics of core constructs are often implemented by " @@ -1095,41 +1097,41 @@ msgid "" "cannot be pushed off until runtime." msgstr "" -#: ../../reference/simple_stmts.rst:918 +#: ../../reference/simple_stmts.rst:922 msgid "" "For any given release, the compiler knows which feature names have been " "defined, and raises a compile-time error if a future statement contains a " "feature not known to it." msgstr "" -#: ../../reference/simple_stmts.rst:922 +#: ../../reference/simple_stmts.rst:926 msgid "" "The direct runtime semantics are the same as for any import statement: there " "is a standard module :mod:`__future__`, described later, and it will be " "imported in the usual way at the time the future statement is executed." msgstr "" -#: ../../reference/simple_stmts.rst:926 +#: ../../reference/simple_stmts.rst:930 msgid "" "The interesting runtime semantics depend on the specific feature enabled by " "the future statement." msgstr "" -#: ../../reference/simple_stmts.rst:929 +#: ../../reference/simple_stmts.rst:933 msgid "Note that there is nothing special about the statement::" msgstr "" -#: ../../reference/simple_stmts.rst:931 +#: ../../reference/simple_stmts.rst:935 msgid "import __future__ [as name]" msgstr "import __future__ [as name]" -#: ../../reference/simple_stmts.rst:933 +#: ../../reference/simple_stmts.rst:937 msgid "" "That is not a future statement; it's an ordinary import statement with no " "special semantics or syntax restrictions." msgstr "" -#: ../../reference/simple_stmts.rst:936 +#: ../../reference/simple_stmts.rst:940 msgid "" "Code compiled by calls to the built-in functions :func:`exec` and :func:" "`compile` that occur in a module :mod:`!M` containing a future statement " @@ -1138,7 +1140,7 @@ msgid "" "--- see the documentation of that function for details." msgstr "" -#: ../../reference/simple_stmts.rst:942 +#: ../../reference/simple_stmts.rst:946 msgid "" "A future statement typed at an interactive interpreter prompt will take " "effect for the rest of the interpreter session. If an interpreter is " @@ -1147,19 +1149,19 @@ msgid "" "interactive session started after the script is executed." msgstr "" -#: ../../reference/simple_stmts.rst:950 +#: ../../reference/simple_stmts.rst:954 msgid ":pep:`236` - Back to the __future__" msgstr "" -#: ../../reference/simple_stmts.rst:951 +#: ../../reference/simple_stmts.rst:955 msgid "The original proposal for the __future__ mechanism." msgstr "" -#: ../../reference/simple_stmts.rst:957 +#: ../../reference/simple_stmts.rst:961 msgid "The :keyword:`!global` statement" msgstr ":keyword:`!global` 陳述式" -#: ../../reference/simple_stmts.rst:967 +#: ../../reference/simple_stmts.rst:971 msgid "" "The :keyword:`global` statement causes the listed identifiers to be " "interpreted as globals. It would be impossible to assign to a global " @@ -1167,7 +1169,7 @@ msgid "" "globals without being declared global." msgstr "" -#: ../../reference/simple_stmts.rst:972 +#: ../../reference/simple_stmts.rst:976 msgid "" "The :keyword:`!global` statement applies to the entire current scope " "(module, function body or class definition). A :exc:`SyntaxError` is raised " @@ -1175,7 +1177,7 @@ msgid "" "scope." msgstr "" -#: ../../reference/simple_stmts.rst:977 +#: ../../reference/simple_stmts.rst:981 msgid "" "At the module level, all variables are global, so a :keyword:`!global` " "statement has no effect. However, variables must still not be used or " @@ -1183,7 +1185,7 @@ msgid "" "is relaxed in the interactive prompt (:term:`REPL`)." msgstr "" -#: ../../reference/simple_stmts.rst:988 +#: ../../reference/simple_stmts.rst:992 msgid "" "**Programmer's note:** :keyword:`global` is a directive to the parser. It " "applies only to code parsed at the same time as the :keyword:`!global` " @@ -1195,11 +1197,11 @@ msgid "" "func:`compile` functions." msgstr "" -#: ../../reference/simple_stmts.rst:1000 +#: ../../reference/simple_stmts.rst:1004 msgid "The :keyword:`!nonlocal` statement" msgstr ":keyword:`!nonlocal` 陳述式" -#: ../../reference/simple_stmts.rst:1008 +#: ../../reference/simple_stmts.rst:1012 msgid "" "When the definition of a function or class is nested (enclosed) within the " "definitions of other functions, its nonlocal scopes are the local scopes of " @@ -1211,64 +1213,64 @@ msgid "" "`SyntaxError` is raised." msgstr "" -#: ../../reference/simple_stmts.rst:1017 +#: ../../reference/simple_stmts.rst:1021 msgid "" "The :keyword:`nonlocal` statement applies to the entire scope of a function " "or class body. A :exc:`SyntaxError` is raised if a variable is used or " "assigned to prior to its nonlocal declaration in the scope." msgstr "" -#: ../../reference/simple_stmts.rst:1023 +#: ../../reference/simple_stmts.rst:1027 msgid ":pep:`3104` - Access to Names in Outer Scopes" msgstr "" -#: ../../reference/simple_stmts.rst:1024 +#: ../../reference/simple_stmts.rst:1028 msgid "The specification for the :keyword:`nonlocal` statement." msgstr "" -#: ../../reference/simple_stmts.rst:1026 +#: ../../reference/simple_stmts.rst:1030 msgid "" "**Programmer's note:** :keyword:`nonlocal` is a directive to the parser and " "applies only to code parsed along with it. See the note for the :keyword:" "`global` statement." msgstr "" -#: ../../reference/simple_stmts.rst:1034 +#: ../../reference/simple_stmts.rst:1038 msgid "The :keyword:`!type` statement" msgstr ":keyword:`!type` 陳述式" -#: ../../reference/simple_stmts.rst:1041 +#: ../../reference/simple_stmts.rst:1045 msgid "" "The :keyword:`!type` statement declares a type alias, which is an instance " "of :class:`typing.TypeAliasType`." msgstr "" -#: ../../reference/simple_stmts.rst:1044 +#: ../../reference/simple_stmts.rst:1048 msgid "For example, the following statement creates a type alias::" msgstr "" -#: ../../reference/simple_stmts.rst:1046 +#: ../../reference/simple_stmts.rst:1050 msgid "type Point = tuple[float, float]" msgstr "" -#: ../../reference/simple_stmts.rst:1048 +#: ../../reference/simple_stmts.rst:1052 msgid "This code is roughly equivalent to::" msgstr "" -#: ../../reference/simple_stmts.rst:1050 +#: ../../reference/simple_stmts.rst:1054 msgid "" "annotation-def VALUE_OF_Point():\n" " return tuple[float, float]\n" "Point = typing.TypeAliasType(\"Point\", VALUE_OF_Point())" msgstr "" -#: ../../reference/simple_stmts.rst:1054 +#: ../../reference/simple_stmts.rst:1058 msgid "" "``annotation-def`` indicates an :ref:`annotation scope `, " "which behaves mostly like a function, but with several small differences." msgstr "" -#: ../../reference/simple_stmts.rst:1057 +#: ../../reference/simple_stmts.rst:1061 msgid "" "The value of the type alias is evaluated in the annotation scope. It is not " "evaluated when the type alias is created, but only when the value is " @@ -1277,21 +1279,21 @@ msgid "" "not yet defined." msgstr "" -#: ../../reference/simple_stmts.rst:1063 +#: ../../reference/simple_stmts.rst:1067 msgid "" "Type aliases may be made generic by adding a :ref:`type parameter list ` after the name. See :ref:`generic-type-aliases` for more." msgstr "" -#: ../../reference/simple_stmts.rst:1066 +#: ../../reference/simple_stmts.rst:1070 msgid ":keyword:`!type` is a :ref:`soft keyword `." msgstr "" -#: ../../reference/simple_stmts.rst:1072 +#: ../../reference/simple_stmts.rst:1076 msgid ":pep:`695` - Type Parameter Syntax" msgstr "" -#: ../../reference/simple_stmts.rst:1073 +#: ../../reference/simple_stmts.rst:1077 msgid "" "Introduced the :keyword:`!type` statement and syntax for generic classes and " "functions." @@ -1308,9 +1310,9 @@ msgstr "" #: ../../reference/simple_stmts.rst:457 ../../reference/simple_stmts.rst:483 #: ../../reference/simple_stmts.rst:520 ../../reference/simple_stmts.rst:556 #: ../../reference/simple_stmts.rst:681 ../../reference/simple_stmts.rst:715 -#: ../../reference/simple_stmts.rst:740 ../../reference/simple_stmts.rst:873 -#: ../../reference/simple_stmts.rst:959 ../../reference/simple_stmts.rst:1002 -#: ../../reference/simple_stmts.rst:1036 +#: ../../reference/simple_stmts.rst:740 ../../reference/simple_stmts.rst:877 +#: ../../reference/simple_stmts.rst:963 ../../reference/simple_stmts.rst:1006 +#: ../../reference/simple_stmts.rst:1040 msgid "statement" msgstr "statement(陳述式)" @@ -1324,7 +1326,7 @@ msgstr "" msgid "list" msgstr "list(串列)" -#: ../../reference/simple_stmts.rst:56 ../../reference/simple_stmts.rst:983 +#: ../../reference/simple_stmts.rst:56 ../../reference/simple_stmts.rst:987 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -1390,13 +1392,13 @@ msgid "assignment" msgstr "assignment(賦值)" #: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:740 -#: ../../reference/simple_stmts.rst:795 ../../reference/simple_stmts.rst:959 +#: ../../reference/simple_stmts.rst:795 ../../reference/simple_stmts.rst:963 msgid "binding" msgstr "binding(繫結)" #: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:457 #: ../../reference/simple_stmts.rst:740 ../../reference/simple_stmts.rst:795 -#: ../../reference/simple_stmts.rst:959 +#: ../../reference/simple_stmts.rst:963 msgid "name" msgstr "name(名稱)" @@ -1419,8 +1421,8 @@ msgid "target" msgstr "target" #: ../../reference/simple_stmts.rst:115 ../../reference/simple_stmts.rst:379 -#: ../../reference/simple_stmts.rst:740 ../../reference/simple_stmts.rst:959 -#: ../../reference/simple_stmts.rst:1002 +#: ../../reference/simple_stmts.rst:740 ../../reference/simple_stmts.rst:963 +#: ../../reference/simple_stmts.rst:1006 msgid ", (comma)" msgstr ", (逗號)" @@ -1594,7 +1596,7 @@ msgstr "del" msgid "deletion" msgstr "deletion(刪除)" -#: ../../reference/simple_stmts.rst:457 ../../reference/simple_stmts.rst:959 +#: ../../reference/simple_stmts.rst:457 ../../reference/simple_stmts.rst:963 msgid "global" msgstr "global" @@ -1701,7 +1703,7 @@ msgstr "loop control(迴圈控制)" msgid "continue" msgstr "continue" -#: ../../reference/simple_stmts.rst:740 ../../reference/simple_stmts.rst:846 +#: ../../reference/simple_stmts.rst:740 ../../reference/simple_stmts.rst:848 msgid "import" msgstr "import(引入)" @@ -1734,42 +1736,42 @@ msgstr "import statement(引入陳述式)" msgid "__all__ (optional module attribute)" msgstr "__all__(可選模組屬性)" -#: ../../reference/simple_stmts.rst:846 +#: ../../reference/simple_stmts.rst:848 msgid "relative" msgstr "relative(相對)" -#: ../../reference/simple_stmts.rst:873 +#: ../../reference/simple_stmts.rst:877 msgid "future" msgstr "future" -#: ../../reference/simple_stmts.rst:873 +#: ../../reference/simple_stmts.rst:877 msgid "__future__" msgstr "__future__" -#: ../../reference/simple_stmts.rst:873 +#: ../../reference/simple_stmts.rst:877 msgid "future statement" msgstr "future statement(future 陳述式)" -#: ../../reference/simple_stmts.rst:959 ../../reference/simple_stmts.rst:1002 +#: ../../reference/simple_stmts.rst:963 ../../reference/simple_stmts.rst:1006 msgid "identifier list" msgstr "identifier list(識別符號清單)" -#: ../../reference/simple_stmts.rst:983 +#: ../../reference/simple_stmts.rst:987 msgid "exec" msgstr "exec" -#: ../../reference/simple_stmts.rst:983 +#: ../../reference/simple_stmts.rst:987 msgid "eval" msgstr "eval" -#: ../../reference/simple_stmts.rst:983 +#: ../../reference/simple_stmts.rst:987 msgid "compile" msgstr "compile(編譯)" -#: ../../reference/simple_stmts.rst:1002 +#: ../../reference/simple_stmts.rst:1006 msgid "nonlocal" msgstr "nonlocal" -#: ../../reference/simple_stmts.rst:1036 +#: ../../reference/simple_stmts.rst:1040 msgid "type" msgstr "" From 5fc224e97152a952da784e9a8c646b669743367c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 7 Feb 2026 00:20:50 +0000 Subject: [PATCH 11/11] sync with cpython bdba86ea --- c-api/intro.po | 888 +++++++++++++++++-------------- library/__future__.po | 47 +- library/argparse.po | 326 ++++++------ library/ast.po | 39 +- library/atexit.po | 16 +- library/bdb.po | 137 +++-- library/binascii.po | 9 +- library/bisect.po | 42 +- library/bz2.po | 7 +- library/calendar.po | 153 +++--- library/cmath.po | 15 +- library/cmd.po | 11 +- library/codecs.po | 4 +- library/codeop.po | 10 +- library/colorsys.po | 12 +- library/concurrent.futures.po | 5 +- library/configparser.po | 181 ++++--- library/contextlib.po | 172 +++--- library/copy.po | 9 +- library/copyreg.po | 5 +- library/csv.po | 22 +- library/ctypes.po | 102 ++-- library/curses.ascii.po | 4 +- library/curses.panel.po | 5 +- library/curses.po | 27 +- library/dbm.po | 25 +- library/decimal.po | 10 +- library/dis.po | 17 +- library/doctest.po | 359 ++++++------- library/email.charset.po | 26 +- library/email.errors.po | 4 +- library/email.generator.po | 4 +- library/email.header.po | 10 +- library/email.iterators.po | 4 +- library/email.message.po | 4 +- library/email.parser.po | 6 +- library/email.po | 10 +- library/email.utils.po | 84 +-- library/ensurepip.po | 16 +- library/fcntl.po | 56 +- library/filecmp.po | 17 +- library/fractions.po | 4 +- library/ftplib.po | 5 +- library/functools.po | 8 +- library/gc.po | 29 +- library/getpass.po | 5 +- library/gettext.po | 19 +- library/graphlib.po | 123 +++-- library/gzip.po | 16 +- library/hashlib.po | 10 +- library/http.cookiejar.po | 33 +- library/http.cookies.po | 12 +- library/http.po | 7 +- library/http.server.po | 8 +- library/imaplib.po | 81 ++- library/importlib.po | 5 +- library/inspect.po | 8 +- library/io.po | 461 ++++++++-------- library/ipaddress.po | 106 ++-- library/json.po | 19 +- library/linecache.po | 8 +- library/locale.po | 17 +- library/logging.config.po | 6 +- library/logging.handlers.po | 34 +- library/logging.po | 10 +- library/marshal.po | 93 ++-- library/math.po | 276 +++++----- library/mimetypes.po | 55 +- library/multiprocessing.po | 76 +-- library/operator.po | 63 +-- library/optparse.po | 336 ++++++------ library/os.path.po | 11 +- library/os.po | 20 +- library/pathlib.po | 5 +- library/pickle.po | 77 ++- library/pickletools.po | 9 +- library/platform.po | 4 +- library/poplib.po | 6 +- library/posix.po | 23 +- library/pprint.po | 6 +- library/pty.po | 7 +- library/py_compile.po | 4 +- library/pyclbr.po | 54 +- library/pyexpat.po | 9 +- library/queue.po | 10 +- library/random.po | 12 +- library/re.po | 540 ++++++++++--------- library/readline.po | 12 +- library/runpy.po | 8 +- library/sched.po | 9 +- library/secrets.po | 30 +- library/select.po | 4 +- library/shelve.po | 9 +- library/shlex.po | 10 +- library/shutil.po | 11 +- library/signal.po | 22 +- library/site.po | 8 +- library/smtplib.po | 8 +- library/socket.po | 18 +- library/socketserver.po | 7 +- library/ssl.po | 7 +- library/stat.po | 7 +- library/string.po | 9 +- library/stringprep.po | 19 +- library/struct.po | 75 +-- library/subprocess.po | 26 +- library/symtable.po | 29 +- library/sys.monitoring.po | 25 +- library/sys.po | 4 +- library/sysconfig.po | 26 +- library/tarfile.po | 522 ++++++++++-------- library/tempfile.po | 6 +- library/termios.po | 4 +- library/test.po | 37 +- library/textwrap.po | 4 +- library/timeit.po | 56 +- library/tkinter.colorchooser.po | 5 +- library/tkinter.dnd.po | 13 +- library/tkinter.font.po | 7 +- library/tkinter.messagebox.po | 5 +- library/tkinter.po | 110 ++-- library/tkinter.scrolledtext.po | 4 +- library/tkinter.ttk.po | 82 +-- library/tokenize.po | 42 +- library/trace.po | 13 +- library/tracemalloc.po | 39 +- library/tty.po | 8 +- library/unittest.mock.po | 22 +- library/unittest.po | 62 ++- library/urllib.error.po | 8 +- library/urllib.parse.po | 4 +- library/urllib.request.po | 427 +++++++-------- library/uuid.po | 88 +-- library/warnings.po | 27 +- library/wave.po | 67 +-- library/webbrowser.po | 8 +- library/winreg.po | 4 +- library/winsound.po | 5 +- library/wsgiref.po | 7 +- library/xml.dom.minidom.po | 31 +- library/xml.dom.po | 6 +- library/xml.dom.pulldom.po | 8 +- library/xml.etree.elementtree.po | 11 +- library/xml.sax.handler.po | 6 +- library/xml.sax.po | 8 +- library/xml.sax.utils.po | 5 +- library/xmlrpc.client.po | 6 +- library/xmlrpc.server.po | 96 ++-- library/zipapp.po | 24 +- library/zipfile.po | 21 +- library/zipimport.po | 8 +- library/zoneinfo.po | 7 +- 152 files changed, 4163 insertions(+), 3773 deletions(-) diff --git a/c-api/intro.po b/c-api/intro.po index d53f508f9c..3f7203ee80 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-05 00:20+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2023-04-25 18:01+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -221,290 +221,225 @@ msgstr "" "macro:`Py_RETURN_NONE`、:c:macro:`PyMODINIT_FUNC`),其他是更通用的工具程式。" "以下並不一定是完整的列表。" -#: ../../c-api/intro.rst:122 -msgid "Return the absolute value of ``x``." -msgstr "回傳 ``x`` 的絕對值。" - -#: ../../c-api/intro.rst:124 +#: ../../c-api/intro.rst:121 msgid "" -"If the result cannot be represented (for example, if ``x`` has :c:macro:`!" -"INT_MIN` value for :c:expr:`int` type), the behavior is undefined." -msgstr "" - -#: ../../c-api/intro.rst:132 -msgid "Specify alignment to *num* bytes on compilers that support it." -msgstr "" - -#: ../../c-api/intro.rst:134 -msgid "Consider using the C11 standard ``_Alignas`` specifier over this macro." +"If this macro is defined, then the current system is able to start threads." msgstr "" -#: ../../c-api/intro.rst:138 +#: ../../c-api/intro.rst:123 msgid "" -"Similar to ``integer >> positions``, but forces sign extension, as the C " -"standard does not define whether a right-shift of a signed integer will " -"perform sign extension or a zero-fill." +"Currently, all systems supported by CPython (per :pep:`11`), with the " +"exception of some WebAssembly platforms, support starting threads." msgstr "" -#: ../../c-api/intro.rst:142 +#: ../../c-api/intro.rst:130 +#, fuzzy msgid "" -"*integer* should be any signed integer type. *positions* is the number of " -"positions to shift to the right." +"Like :samp:`getenv({s})`, but returns ``NULL`` if :option:`-E` was passed on " +"the command line (see :c:member:`PyConfig.use_environment`)." msgstr "" +"類似於 ``getenv(s)``,但如果在命令列上傳遞了 :option:`-E` 則回傳 ``NULL`` " +"(請見 :c:member:`PyConfig.use_environment`)。" -#: ../../c-api/intro.rst:145 -msgid "" -"Both *integer* and *positions* can be evaluated more than once; " -"consequently, avoid directly passing a function call or some other operation " -"with side-effects to this macro. Instead, store the result as a variable and " -"then pass it." +#: ../../c-api/intro.rst:135 +msgid "Docstring macros" msgstr "" -#: ../../c-api/intro.rst:150 +#: ../../c-api/intro.rst:139 +#, fuzzy msgid "" -"*type* is unused and only kept for backwards compatibility. Historically, " -"*type* was used to cast *integer*." +"Creates a variable with name *name* that can be used in docstrings. If " +"Python is built without docstrings (:option:`--without-doc-strings`), the " +"value will be an empty string." msgstr "" +"建立一個名為 *name* 的變數,可以在文件字串中使用。如果 Python 是在沒有文件字" +"串的情況下建置,則該值將為空。" + +#: ../../c-api/intro.rst:143 ../../c-api/intro.rst:160 +#: ../../c-api/intro.rst:428 +msgid "Example::" +msgstr "範例: ::" -#: ../../c-api/intro.rst:155 +#: ../../c-api/intro.rst:145 msgid "" -"This macro is now valid for all signed integer types, not just those for " -"which ``unsigned type`` is legal. As a result, *type* is no longer used." +"PyDoc_STRVAR(pop_doc, \"Remove and return the rightmost element.\");\n" +"\n" +"static PyMethodDef deque_methods[] = {\n" +" // ...\n" +" {\"pop\", (PyCFunction)deque_pop, METH_NOARGS, pop_doc},\n" +" // ...\n" +"}" msgstr "" +"PyDoc_STRVAR(pop_doc, \"Remove and return the rightmost element.\");\n" +"\n" +"static PyMethodDef deque_methods[] = {\n" +" // ...\n" +" {\"pop\", (PyCFunction)deque_pop, METH_NOARGS, pop_doc},\n" +" // ...\n" +"}" -#: ../../c-api/intro.rst:161 -msgid "" -"Ask the compiler to always inline a static inline function. The compiler can " -"ignore it and decide to not inline the function." +#: ../../c-api/intro.rst:153 +msgid "Expands to :samp:`PyDoc_VAR({name}) = PyDoc_STR({str})`." msgstr "" -"要求編譯器總是嵌入靜態行內函式 (static inline function),編譯器可以忽略它並決" -"定不嵌入該函式。" -#: ../../c-api/intro.rst:164 +#: ../../c-api/intro.rst:157 +#, fuzzy msgid "" -"It can be used to inline performance critical static inline functions when " -"building Python in debug mode with function inlining disabled. For example, " -"MSC disables function inlining when building in debug mode." -msgstr "" -"在禁用函式嵌入的除錯模式下建置 Python 時,它可用於嵌入有性能要求的靜態行內函" -"式。例如,MSC 在除錯模式下建置時禁用函式嵌入。" +"Expands to the given input string, or an empty string if docstrings are " +"disabled (:option:`--without-doc-strings`)." +msgstr "為給定的輸入字串建立一個文件字串,如果文件字串被禁用則建立空字串。" -#: ../../c-api/intro.rst:168 +#: ../../c-api/intro.rst:162 msgid "" -"Marking blindly a static inline function with Py_ALWAYS_INLINE can result in " -"worse performances (due to increased code size for example). The compiler is " -"usually smarter than the developer for the cost/benefit analysis." +"static PyMethodDef pysqlite_row_methods[] = {\n" +" {\"keys\", (PyCFunction)pysqlite_row_keys, METH_NOARGS,\n" +" PyDoc_STR(\"Returns the keys of the row.\")},\n" +" {NULL, NULL}\n" +"};" msgstr "" -"盲目地使用 Py_ALWAYS_INLINE 標記靜態行內函式可能會導致更差的性能(例如程式碼" -"大小增加)。在成本/收益分析方面,編譯器通常比開發人員更聰明。" +"static PyMethodDef pysqlite_row_methods[] = {\n" +" {\"keys\", (PyCFunction)pysqlite_row_keys, METH_NOARGS,\n" +" PyDoc_STR(\"Returns the keys of the row.\")},\n" +" {NULL, NULL}\n" +"};" -#: ../../c-api/intro.rst:172 +#: ../../c-api/intro.rst:170 msgid "" -"If Python is :ref:`built in debug mode ` (if the :c:macro:" -"`Py_DEBUG` macro is defined), the :c:macro:`Py_ALWAYS_INLINE` macro does " -"nothing." +"Declares a static character array variable with the given *name*. Expands " +"to :samp:`static const char {name}[]`" msgstr "" -"如果 Python 是\\ :ref:`在除錯模式下建置 `\\ (如果 :c:macro:" -"`Py_DEBUG` 巨集有被定義),:c:macro:`Py_ALWAYS_INLINE` 巨集就什麼都不會做。" -#: ../../c-api/intro.rst:175 -msgid "It must be specified before the function return type. Usage::" -msgstr "它必須在函式回傳型別之前被指定。用法: ::" - -#: ../../c-api/intro.rst:177 -msgid "static inline Py_ALWAYS_INLINE int random(void) { return 4; }" -msgstr "static inline Py_ALWAYS_INLINE int random(void) { return 4; }" +#: ../../c-api/intro.rst:173 ../../c-api/intro.rst:314 +#: ../../c-api/intro.rst:325 +msgid "For example::" +msgstr "範例: ::" -#: ../../c-api/intro.rst:183 +#: ../../c-api/intro.rst:175 +#, fuzzy msgid "" -"If this macro is defined, then the current system is able to start threads." +"PyDoc_VAR(python_doc) = PyDoc_STR(\n" +" \"A genus of constricting snakes in the Pythonidae family native \"\n" +" \"to the tropics and subtropics of the Eastern Hemisphere.\");" msgstr "" +"PyDoc_VAR(python_doc) = PyDoc_STR(\"A genus of constricting snakes in the " +"Pythonidae family native \"\n" +" \"to the tropics and subtropics of the " +"Eastern Hemisphere.\");" -#: ../../c-api/intro.rst:185 -msgid "" -"Currently, all systems supported by CPython (per :pep:`11`), with the " -"exception of some WebAssembly platforms, support starting threads." +#: ../../c-api/intro.rst:181 +msgid "General utility macros" msgstr "" -#: ../../c-api/intro.rst:192 -msgid "" -"Argument must be a character or an integer in the range [-128, 127] or [0, " -"255]. This macro returns ``c`` cast to an ``unsigned char``." +#: ../../c-api/intro.rst:183 +msgid "The following macros common tasks not specific to Python." msgstr "" -"引數必須是 [-128, 127] 或 [0, 255] 範圍內的字元或整數。這個巨集會將 ``c`` 轉" -"換為 ``unsigned char`` 並回傳。" - -#: ../../c-api/intro.rst:197 -msgid "" -"Use this for deprecated declarations. The macro must be placed before the " -"symbol name." -msgstr "將其用於已棄用的聲明。巨集必須放在符號名稱之前。" - -#: ../../c-api/intro.rst:200 ../../c-api/intro.rst:384 -#: ../../c-api/intro.rst:402 -msgid "Example::" -msgstr "範例: ::" - -#: ../../c-api/intro.rst:202 -msgid "Py_DEPRECATED(3.8) PyAPI_FUNC(int) Py_OldFunction(void);" -msgstr "Py_DEPRECATED(3.8) PyAPI_FUNC(int) Py_OldFunction(void);" -#: ../../c-api/intro.rst:204 -msgid "MSVC support was added." -msgstr "新增了 MSVC 支援。" - -#: ../../c-api/intro.rst:209 +#: ../../c-api/intro.rst:187 msgid "" -"This is equivalent to ``X``, which is useful for token-pasting in macros, as " -"macro expansions in *X* are forcefully evaluated by the preprocessor." +"Use this for unused arguments in a function definition to silence compiler " +"warnings. Example: ``int func(int a, int Py_UNUSED(b)) { return a; }``." msgstr "" +"將此用於函式定義中未使用的參數以消除編譯器警告。例如:``int func(int a, int " +"Py_UNUSED(b)) { return a; }``。" -#: ../../c-api/intro.rst:215 +#: ../../c-api/intro.rst:194 msgid "" "Use a GCC attribute *name*, hiding it from compilers that don't support GCC " "attributes (such as MSVC)." msgstr "" -#: ../../c-api/intro.rst:218 -msgid "" -"This expands to ``__attribute__((name))`` on a GCC compiler, and expands to " -"nothing on compilers that don't support GCC attributes." -msgstr "" - -#: ../../c-api/intro.rst:223 +#: ../../c-api/intro.rst:197 msgid "" -"Like ``getenv(s)``, but returns ``NULL`` if :option:`-E` was passed on the " -"command line (see :c:member:`PyConfig.use_environment`)." -msgstr "" -"類似於 ``getenv(s)``,但如果在命令列上傳遞了 :option:`-E` 則回傳 ``NULL`` " -"(請見 :c:member:`PyConfig.use_environment`)。" - -#: ../../c-api/intro.rst:228 -msgid "Use *number* as a ``long long`` integer literal." +"This expands to :samp:`__attribute__(({name)})` on a GCC compiler, and " +"expands to nothing on compilers that don't support GCC attributes." msgstr "" -#: ../../c-api/intro.rst:230 -msgid "" -"This usally expands to *number* followed by ``LL``, but will expand to some " -"compiler-specific suffixes (such as ``I64``) on older compilers." +#: ../../c-api/intro.rst:202 +msgid "Numeric utilities" msgstr "" -#: ../../c-api/intro.rst:233 -msgid "" -"In modern versions of Python, this macro is not very useful, as C99 and " -"later require the ``LL`` suffix to be valid for an integer." -msgstr "" +#: ../../c-api/intro.rst:206 +msgid "Return the absolute value of ``x``." +msgstr "回傳 ``x`` 的絕對值。" -#: ../../c-api/intro.rst:238 +#: ../../c-api/intro.rst:208 msgid "" -"Declare a function returning the specified *type* using a fast-calling " -"qualifier for functions that are local to the current file. Semantically, " -"this is equivalent to ``static type``." +"The argument may be evaluated more than once. Consequently, do not pass an " +"expression with side-effects directly to this macro." msgstr "" -#: ../../c-api/intro.rst:244 +#: ../../c-api/intro.rst:212 msgid "" -"Equivalent to :c:macro:`Py_LOCAL` but additionally requests the function be " -"inlined." +"If the result cannot be represented (for example, if ``x`` has :c:macro:`!" +"INT_MIN` value for :c:expr:`int` type), the behavior is undefined." msgstr "" -#: ../../c-api/intro.rst:249 -msgid "" -"Macro used to declare a symbol as local to the shared library (hidden). On " -"supported platforms, it ensures the symbol is not exported." +#: ../../c-api/intro.rst:216 +msgid "Corresponds roughly to :samp:`(({x}) < 0 ? -({x}) : ({x}))`" msgstr "" -#: ../../c-api/intro.rst:252 -msgid "" -"On compatible versions of GCC/Clang, it expands to " -"``__attribute__((visibility(\"hidden\")))``." +#: ../../c-api/intro.rst:223 +msgid "Return the larger or smaller of the arguments, respectively." msgstr "" -#: ../../c-api/intro.rst:257 -msgid "Return the maximum value between ``x`` and ``y``." -msgstr "回傳 ``x`` 和 ``y`` 之間的最大值。" - -#: ../../c-api/intro.rst:263 -msgid "Return the size of a structure (``type``) ``member`` in bytes." -msgstr "以位元組為單位回傳結構 (``type``) ``member`` 的大小。" - -#: ../../c-api/intro.rst:269 +#: ../../c-api/intro.rst:225 msgid "" -"This is a :term:`soft deprecated` alias to :c:func:`!memcpy`. Use :c:func:`!" -"memcpy` directly instead." +"Any arguments may be evaluated more than once. Consequently, do not pass an " +"expression with side-effects directly to this macro." msgstr "" -"這是 :c:func:`!memcpy` 的已\\ :term:`軟性棄用 `\\ 別名。請直" -"接使用 :c:func:`!memcpy`。" - -#: ../../c-api/intro.rst:272 -msgid "The macro is :term:`soft deprecated`." -msgstr "這個巨集已被\\ :term:`軟性棄用 `。" - -#: ../../c-api/intro.rst:277 -msgid "Return the minimum value between ``x`` and ``y``." -msgstr "回傳 ``x`` 和 ``y`` 之間的最小值。" -#: ../../c-api/intro.rst:283 +#: ../../c-api/intro.rst:229 msgid "" -"Disable inlining on a function. For example, it reduces the C stack " -"consumption: useful on LTO+PGO builds which heavily inline code (see :issue:" -"`33720`)." +":c:macro:`!Py_MAX` corresponds roughly to :samp:`((({x}) > ({y})) ? ({x}) : " +"({y}))`." msgstr "" -"禁用函式的嵌入。例如,它減少了 C 堆疊的消耗:對大量嵌入程式碼的 LTO+PGO 建置" -"很有用(請參閱 :issue:`33720`)。" - -#: ../../c-api/intro.rst:287 -msgid "Usage::" -msgstr "用法: ::" -#: ../../c-api/intro.rst:289 -msgid "Py_NO_INLINE static int random(void) { return 4; }" -msgstr "Py_NO_INLINE static int random(void) { return 4; }" - -#: ../../c-api/intro.rst:295 +#: ../../c-api/intro.rst:236 msgid "" -"Cast *value* to type *smaller* from type *larger*, validating that no " -"information was lost." +"Similar to :samp:`{integer} >> {positions}`, but forces sign extension, as " +"the C standard does not define whether a right-shift of a signed integer " +"will perform sign extension or a zero-fill." msgstr "" -#: ../../c-api/intro.rst:298 +#: ../../c-api/intro.rst:240 msgid "" -"On release builds of Python, this is roughly equivalent to ``(smaller) " -"value`` (in C++, ``static_cast(value)`` will be used instead)." +"*integer* should be any signed integer type. *positions* is the number of " +"positions to shift to the right." msgstr "" -#: ../../c-api/intro.rst:302 +#: ../../c-api/intro.rst:243 msgid "" -"On debug builds (implying that :c:macro:`Py_DEBUG` is defined), this asserts " -"that no information was lost with the cast from *larger* to *smaller*." +"Both *integer* and *positions* can be evaluated more than once; " +"consequently, avoid directly passing a function call or some other operation " +"with side-effects to this macro. Instead, store the result as a variable and " +"then pass it." msgstr "" -#: ../../c-api/intro.rst:305 +#: ../../c-api/intro.rst:248 msgid "" -"*value*, *larger*, and *smaller* may all be evaluated more than once in the " -"expression; consequently, do not pass an expression with side-effects " -"directly to this macro." +"*type* is unused and only kept for backwards compatibility. Historically, " +"*type* was used to cast *integer*." msgstr "" -#: ../../c-api/intro.rst:311 +#: ../../c-api/intro.rst:253 msgid "" -"Convert ``x`` to a C string. E.g. ``Py_STRINGIFY(123)`` returns ``\"123\"``." +"This macro is now valid for all signed integer types, not just those for " +"which ``unsigned type`` is legal. As a result, *type* is no longer used." msgstr "" -"將 ``x`` 轉換為 C 字串。例如 ``Py_STRINGIFY(123)`` 會回傳 ``\"123\"``。" -#: ../../c-api/intro.rst:318 +#: ../../c-api/intro.rst:259 msgid "" -"Similar to :c:macro:`Py_LL`, but *number* will be an ``unsigned long long`` " -"literal instead. This is done by appending ``U`` to the result of ``Py_LL``." +"Argument must be a character or an integer in the range [-128, 127] or [0, " +"255]. This macro returns ``c`` cast to an ``unsigned char``." msgstr "" +"引數必須是 [-128, 127] 或 [0, 255] 範圍內的字元或整數。這個巨集會將 ``c`` 轉" +"換為 ``unsigned char`` 並回傳。" -#: ../../c-api/intro.rst:321 -msgid "" -"In modern versions of Python, this macro is not very useful, as C99 and " -"later require the ``ULL``/``LLU`` suffixes to be valid for an integer." +#: ../../c-api/intro.rst:264 +msgid "Assertion utilities" msgstr "" -#: ../../c-api/intro.rst:326 +#: ../../c-api/intro.rst:268 msgid "" "Use this when you have a code path that cannot be reached by design. For " "example, in the ``default:`` clause in a ``switch`` statement for which all " @@ -515,7 +450,7 @@ msgstr "" "蓋了所有可能值的 ``switch`` 陳述式中的 ``default:`` 子句。在你可能想要呼叫 " "``assert(0)`` 或 ``abort()`` 的地方使用它。" -#: ../../c-api/intro.rst:331 +#: ../../c-api/intro.rst:273 msgid "" "In release mode, the macro helps the compiler to optimize the code, and " "avoids a warning about unreachable code. For example, the macro is " @@ -525,15 +460,22 @@ msgstr "" "程式碼的警告。例如該巨集是在發布模式下於 GCC 使用 " "``__builtin_unreachable()`` 來實作。" -#: ../../c-api/intro.rst:335 +#: ../../c-api/intro.rst:277 +msgid "" +"In debug mode, and on unsupported compilers, the macro expands to a call to :" +"c:func:`Py_FatalError`." +msgstr "" + +#: ../../c-api/intro.rst:280 +#, fuzzy msgid "" "A use for ``Py_UNREACHABLE()`` is following a call a function that never " -"returns but that is not declared :c:macro:`_Py_NO_RETURN`." +"returns but that is not declared ``_Noreturn``." msgstr "" "``Py_UNREACHABLE()`` 的一個用途是,在對一個永不回傳但並未聲明為 :c:macro:" "`_Py_NO_RETURN` 的函式之呼叫後使用。" -#: ../../c-api/intro.rst:338 +#: ../../c-api/intro.rst:283 msgid "" "If a code path is very unlikely code but can be reached under exceptional " "case, this macro must not be used. For example, under low memory condition " @@ -545,37 +487,54 @@ msgstr "" "憶體條件下或系統呼叫回傳了超出預期範圍的值。在這種情況下,最好將錯誤回報給呼" "叫者。如果無法回報錯誤則可以使用 :c:func:`Py_FatalError`。" -#: ../../c-api/intro.rst:348 +#: ../../c-api/intro.rst:293 msgid "" -"Use this for unused arguments in a function definition to silence compiler " -"warnings. Example: ``int func(int a, int Py_UNUSED(b)) { return a; }``." +"Cast *value* to type *smaller* from type *larger*, validating that no " +"information was lost." +msgstr "" + +#: ../../c-api/intro.rst:296 +msgid "" +"On release builds of Python, this is roughly equivalent to :samp:" +"`(({smaller}) {value})` (in C++, :samp:`static_cast<{smaller}>({value})` " +"will be used instead)." +msgstr "" + +#: ../../c-api/intro.rst:300 +msgid "" +"On debug builds (implying that :c:macro:`Py_DEBUG` is defined), this asserts " +"that no information was lost with the cast from *larger* to *smaller*." msgstr "" -"將此用於函式定義中未使用的參數以消除編譯器警告。例如:``int func(int a, int " -"Py_UNUSED(b)) { return a; }``。" -#: ../../c-api/intro.rst:355 +#: ../../c-api/intro.rst:303 +msgid "" +"*value*, *larger*, and *smaller* may all be evaluated more than once in the " +"expression; consequently, do not pass an expression with side-effects " +"directly to this macro." +msgstr "" + +#: ../../c-api/intro.rst:309 msgid "" "Asserts a compile-time condition *cond*, as a statement. The build will fail " "if the condition is false or cannot be evaluated at compile time." msgstr "" -#: ../../c-api/intro.rst:358 ../../c-api/intro.rst:369 -#: ../../c-api/intro.rst:414 -msgid "For example::" -msgstr "範例: ::" +#: ../../c-api/intro.rst:312 +msgid "Corresponds roughly to :samp:`static_assert({cond})` on C23 and above." +msgstr "" -#: ../../c-api/intro.rst:360 +#: ../../c-api/intro.rst:316 msgid "Py_BUILD_ASSERT(sizeof(PyTime_t) == sizeof(int64_t));" msgstr "Py_BUILD_ASSERT(sizeof(PyTime_t) == sizeof(int64_t));" -#: ../../c-api/intro.rst:366 +#: ../../c-api/intro.rst:322 msgid "" "Asserts a compile-time condition *cond*, as an expression that evaluates to " "``0``. The build will fail if the condition is false or cannot be evaluated " "at compile time." msgstr "" -#: ../../c-api/intro.rst:371 +#: ../../c-api/intro.rst:327 msgid "" "#define foo_to_char(foo) \\\n" " ((char *)(foo) + Py_BUILD_ASSERT_EXPR(offsetof(struct foo, string) == 0))" @@ -583,105 +542,182 @@ msgstr "" "#define foo_to_char(foo) \\\n" " ((char *)(foo) + Py_BUILD_ASSERT_EXPR(offsetof(struct foo, string) == 0))" -#: ../../c-api/intro.rst:378 +#: ../../c-api/intro.rst:334 +msgid "Type size utilities" +msgstr "" + +#: ../../c-api/intro.rst:338 +msgid "Compute the length of a statically allocated C array at compile time." +msgstr "" + +#: ../../c-api/intro.rst:340 msgid "" -"Creates a variable with name *name* that can be used in docstrings. If " -"Python is built without docstrings, the value will be empty." +"The *array* argument must be a C array with a size known at compile time. " +"Passing an array with an unknown size, such as a heap-allocated array, will " +"result in a compilation error on some compilers, or otherwise produce " +"incorrect results." +msgstr "" + +#: ../../c-api/intro.rst:345 +msgid "This is roughly equivalent to::" +msgstr "這大致上相當於: ::" + +#: ../../c-api/intro.rst:347 +msgid "sizeof(array) / sizeof((array)[0])" +msgstr "sizeof(array) / sizeof((array)[0])" + +#: ../../c-api/intro.rst:351 +#, fuzzy +msgid "Return the size of a structure (*type*) *member* in bytes." +msgstr "以位元組為單位回傳結構 (``type``) ``member`` 的大小。" + +#: ../../c-api/intro.rst:353 +msgid "Corresponds roughly to :samp:`sizeof((({type} *)NULL)->{member})`." +msgstr "" + +#: ../../c-api/intro.rst:359 +msgid "Macro definition utilities" msgstr "" -"建立一個名為 *name* 的變數,可以在文件字串中使用。如果 Python 是在沒有文件字" -"串的情況下建置,則該值將為空。" -#: ../../c-api/intro.rst:381 +#: ../../c-api/intro.rst:363 msgid "" -"Use :c:macro:`PyDoc_STRVAR` for docstrings to support building Python " -"without docstrings, as specified in :pep:`7`." +"This is equivalent to :samp:`{X}`, which is useful for token-pasting in " +"macros, as macro expansions in *X* are forcefully evaluated by the " +"preprocessor." msgstr "" -"如 :pep:`7` 中所指明,使用 :c:macro:`PyDoc_STRVAR` 作為文件字串可以支援在沒有" -"文件字串的情況下建置 Python。" -#: ../../c-api/intro.rst:386 +#: ../../c-api/intro.rst:369 +#, fuzzy msgid "" -"PyDoc_STRVAR(pop_doc, \"Remove and return the rightmost element.\");\n" -"\n" -"static PyMethodDef deque_methods[] = {\n" -" // ...\n" -" {\"pop\", (PyCFunction)deque_pop, METH_NOARGS, pop_doc},\n" -" // ...\n" -"}" +"Convert ``x`` to a C string. For example, ``Py_STRINGIFY(123)`` returns " +"``\"123\"``." msgstr "" -"PyDoc_STRVAR(pop_doc, \"Remove and return the rightmost element.\");\n" -"\n" -"static PyMethodDef deque_methods[] = {\n" -" // ...\n" -" {\"pop\", (PyCFunction)deque_pop, METH_NOARGS, pop_doc},\n" -" // ...\n" -"}" +"將 ``x`` 轉換為 C 字串。例如 ``Py_STRINGIFY(123)`` 會回傳 ``\"123\"``。" -#: ../../c-api/intro.rst:396 +#: ../../c-api/intro.rst:376 +msgid "Declaration utilities" +msgstr "" + +#: ../../c-api/intro.rst:378 msgid "" -"Creates a docstring for the given input string or an empty string if " -"docstrings are disabled." -msgstr "為給定的輸入字串建立一個文件字串,如果文件字串被禁用則建立空字串。" +"The following macros can be used in declarations. They are most useful for " +"defining the C API itself, and have limited use for extension authors. Most " +"of them expand to compiler-specific spellings of common extensions to the C " +"language." +msgstr "" -#: ../../c-api/intro.rst:399 +#: ../../c-api/intro.rst:386 msgid "" -"Use :c:macro:`PyDoc_STR` in specifying docstrings to support building Python " -"without docstrings, as specified in :pep:`7`." +"Ask the compiler to always inline a static inline function. The compiler can " +"ignore it and decide to not inline the function." msgstr "" -"如 :pep:`7` 中所指明,使用 :c:macro:`PyDoc_STR` 指定文件字串以支援在沒有文件" -"字串下建置 Python。" +"要求編譯器總是嵌入靜態行內函式 (static inline function),編譯器可以忽略它並決" +"定不嵌入該函式。" -#: ../../c-api/intro.rst:404 +#: ../../c-api/intro.rst:389 msgid "" -"static PyMethodDef pysqlite_row_methods[] = {\n" -" {\"keys\", (PyCFunction)pysqlite_row_keys, METH_NOARGS,\n" -" PyDoc_STR(\"Returns the keys of the row.\")},\n" -" {NULL, NULL}\n" -"};" +"Corresponds to ``always_inline`` attribute in GCC and ``__forceinline`` in " +"MSVC." msgstr "" -"static PyMethodDef pysqlite_row_methods[] = {\n" -" {\"keys\", (PyCFunction)pysqlite_row_keys, METH_NOARGS,\n" -" PyDoc_STR(\"Returns the keys of the row.\")},\n" -" {NULL, NULL}\n" -"};" -#: ../../c-api/intro.rst:412 -msgid "Declares a static character array variable with the given name *name*." +#: ../../c-api/intro.rst:392 +msgid "" +"It can be used to inline performance critical static inline functions when " +"building Python in debug mode with function inlining disabled. For example, " +"MSC disables function inlining when building in debug mode." msgstr "" +"在禁用函式嵌入的除錯模式下建置 Python 時,它可用於嵌入有性能要求的靜態行內函" +"式。例如,MSC 在除錯模式下建置時禁用函式嵌入。" -#: ../../c-api/intro.rst:416 +#: ../../c-api/intro.rst:396 msgid "" -"PyDoc_VAR(python_doc) = PyDoc_STR(\"A genus of constricting snakes in the " -"Pythonidae family native \"\n" -" \"to the tropics and subtropics of the " -"Eastern Hemisphere.\");" +"Marking blindly a static inline function with Py_ALWAYS_INLINE can result in " +"worse performances (due to increased code size for example). The compiler is " +"usually smarter than the developer for the cost/benefit analysis." msgstr "" -"PyDoc_VAR(python_doc) = PyDoc_STR(\"A genus of constricting snakes in the " -"Pythonidae family native \"\n" -" \"to the tropics and subtropics of the " -"Eastern Hemisphere.\");" +"盲目地使用 Py_ALWAYS_INLINE 標記靜態行內函式可能會導致更差的性能(例如程式碼" +"大小增加)。在成本/收益分析方面,編譯器通常比開發人員更聰明。" -#: ../../c-api/intro.rst:421 -msgid "Compute the length of a statically allocated C array at compile time." +#: ../../c-api/intro.rst:400 +msgid "" +"If Python is :ref:`built in debug mode ` (if the :c:macro:" +"`Py_DEBUG` macro is defined), the :c:macro:`Py_ALWAYS_INLINE` macro does " +"nothing." msgstr "" +"如果 Python 是\\ :ref:`在除錯模式下建置 `\\ (如果 :c:macro:" +"`Py_DEBUG` 巨集有被定義),:c:macro:`Py_ALWAYS_INLINE` 巨集就什麼都不會做。" + +#: ../../c-api/intro.rst:403 +msgid "It must be specified before the function return type. Usage::" +msgstr "它必須在函式回傳型別之前被指定。用法: ::" + +#: ../../c-api/intro.rst:405 +msgid "static inline Py_ALWAYS_INLINE int random(void) { return 4; }" +msgstr "static inline Py_ALWAYS_INLINE int random(void) { return 4; }" -#: ../../c-api/intro.rst:423 +#: ../../c-api/intro.rst:411 msgid "" -"The *array* argument must be a C array with a size known at compile time. " -"Passing an array with an unknown size, such as a heap-allocated array, will " -"result in a compilation error on some compilers, or otherwise produce " -"incorrect results." +"Disable inlining on a function. For example, it reduces the C stack " +"consumption: useful on LTO+PGO builds which heavily inline code (see :issue:" +"`33720`)." msgstr "" +"禁用函式的嵌入。例如,它減少了 C 堆疊的消耗:對大量嵌入程式碼的 LTO+PGO 建置" +"很有用(請參閱 :issue:`33720`)。" -#: ../../c-api/intro.rst:428 -msgid "This is roughly equivalent to::" -msgstr "這大致上相當於: ::" +#: ../../c-api/intro.rst:415 +msgid "" +"Corresponds to the ``noinline`` attribute/specification on GCC and MSVC." +msgstr "" + +#: ../../c-api/intro.rst:417 +msgid "Usage::" +msgstr "用法: ::" + +#: ../../c-api/intro.rst:419 +msgid "Py_NO_INLINE static int random(void) { return 4; }" +msgstr "Py_NO_INLINE static int random(void) { return 4; }" + +#: ../../c-api/intro.rst:425 +#, fuzzy +msgid "" +"Use this to declare APIs that were deprecated in a specific CPython version. " +"The macro must be placed before the symbol name." +msgstr "將其用於已棄用的聲明。巨集必須放在符號名稱之前。" #: ../../c-api/intro.rst:430 -msgid "sizeof(array) / sizeof((array)[0])" -msgstr "sizeof(array) / sizeof((array)[0])" +msgid "Py_DEPRECATED(3.8) PyAPI_FUNC(int) Py_OldFunction(void);" +msgstr "Py_DEPRECATED(3.8) PyAPI_FUNC(int) Py_OldFunction(void);" + +#: ../../c-api/intro.rst:432 +msgid "MSVC support was added." +msgstr "新增了 MSVC 支援。" + +#: ../../c-api/intro.rst:437 +msgid "" +"Declare a function returning the specified *type* using a fast-calling " +"qualifier for functions that are local to the current file. Semantically, " +"this is equivalent to :samp:`static {type}`." +msgstr "" + +#: ../../c-api/intro.rst:443 +msgid "" +"Equivalent to :c:macro:`Py_LOCAL` but additionally requests the function be " +"inlined." +msgstr "" + +#: ../../c-api/intro.rst:448 +msgid "" +"Macro used to declare a symbol as local to the shared library (hidden). On " +"supported platforms, it ensures the symbol is not exported." +msgstr "" + +#: ../../c-api/intro.rst:451 +msgid "" +"On compatible versions of GCC/Clang, it expands to " +"``__attribute__((visibility(\"hidden\")))``." +msgstr "" -#: ../../c-api/intro.rst:435 +#: ../../c-api/intro.rst:456 msgid "" "Macro used to declare a symbol (function or data) as exported. On Windows, " "this expands to ``__declspec(dllexport)``. On compatible versions of GCC/" @@ -689,14 +725,14 @@ msgid "" "macro is for defining the C API itself; extension modules should not use it." msgstr "" -#: ../../c-api/intro.rst:444 +#: ../../c-api/intro.rst:465 msgid "" "Macro used to declare a symbol as imported. On Windows, this expands to " "``__declspec(dllimport)``. This macro is for defining the C API itself; " "extension modules should not use it." msgstr "" -#: ../../c-api/intro.rst:451 +#: ../../c-api/intro.rst:472 msgid "" "Macro used by CPython to declare a function as part of the C API. Its " "expansion depends on the platform and build configuration. This macro is " @@ -704,7 +740,7 @@ msgid "" "use it for their own symbols." msgstr "" -#: ../../c-api/intro.rst:459 +#: ../../c-api/intro.rst:480 msgid "" "Macro used by CPython to declare a public global variable as part of the C " "API. Its expansion depends on the platform and build configuration. This " @@ -712,7 +748,53 @@ msgid "" "should not use it for their own symbols." msgstr "" -#: ../../c-api/intro.rst:466 +#: ../../c-api/intro.rst:487 +msgid "Outdated macros" +msgstr "" + +#: ../../c-api/intro.rst:489 +msgid "" +"The following macros have been used to features that have been standardized " +"in C11." +msgstr "" + +#: ../../c-api/intro.rst:494 +msgid "Specify alignment to *num* bytes on compilers that support it." +msgstr "" + +#: ../../c-api/intro.rst:496 +msgid "Consider using the C11 standard ``_Alignas`` specifier over this macro." +msgstr "" + +#: ../../c-api/intro.rst:501 +msgid "" +"Use *number* as a ``long long`` or ``unsigned long long`` integer literal, " +"respectively." +msgstr "" + +#: ../../c-api/intro.rst:504 +msgid "" +"Expands to *number* followed by ``LL`` or ``LLU``, respectively, but will " +"expand to some compiler-specific suffixes on some older compilers." +msgstr "" + +#: ../../c-api/intro.rst:507 +msgid "Consider using the C99 standard suffixes ``LL`` and ``LLU`` directly." +msgstr "" + +#: ../../c-api/intro.rst:511 +msgid "" +"This is a :term:`soft deprecated` alias to :c:func:`!memcpy`. Use :c:func:`!" +"memcpy` directly instead." +msgstr "" +"這是 :c:func:`!memcpy` 的已\\ :term:`軟性棄用 `\\ 別名。請直" +"接使用 :c:func:`!memcpy`。" + +#: ../../c-api/intro.rst:514 +msgid "The macro is :term:`soft deprecated`." +msgstr "這個巨集已被\\ :term:`軟性棄用 `。" + +#: ../../c-api/intro.rst:519 #, fuzzy msgid "" "This is a :term:`soft deprecated` alias to the C99-standard ``va_copy`` " @@ -721,21 +803,21 @@ msgstr "" "這是 :c:func:`!memcpy` 的已\\ :term:`軟性棄用 `\\ 別名。請直" "接使用 :c:func:`!memcpy`。" -#: ../../c-api/intro.rst:469 +#: ../../c-api/intro.rst:522 msgid "" "Historically, this would use a compiler-specific method to copy a " "``va_list``." msgstr "" -#: ../../c-api/intro.rst:471 +#: ../../c-api/intro.rst:524 msgid "This is now an alias to ``va_copy``." msgstr "" -#: ../../c-api/intro.rst:478 +#: ../../c-api/intro.rst:531 msgid "Objects, Types and Reference Counts" msgstr "物件、型別和參照計數" -#: ../../c-api/intro.rst:482 +#: ../../c-api/intro.rst:535 msgid "" "Most Python/C API functions have one or more arguments as well as a return " "value of type :c:expr:`PyObject*`. This type is a pointer to an opaque data " @@ -758,7 +840,7 @@ msgstr "" "別物件;由於它們絕不能被釋放,因此它們通常是靜態 :c:type:`PyTypeObject` 物" "件。" -#: ../../c-api/intro.rst:493 +#: ../../c-api/intro.rst:546 msgid "" "All Python objects (even Python integers) have a :dfn:`type` and a :dfn:" "`reference count`. An object's type determines what kind of object it is (e." @@ -774,11 +856,11 @@ msgstr "" "`types`\\ )。對於每個眾所周知的型別,都有一個巨集來檢查物件是否屬於該型別;" "例如,若(且唯若)*a* 指向的物件是 Python list 時,``PyList_Check(a)`` 為真。" -#: ../../c-api/intro.rst:504 +#: ../../c-api/intro.rst:557 msgid "Reference Counts" msgstr "參照計數" -#: ../../c-api/intro.rst:506 +#: ../../c-api/intro.rst:559 msgid "" "The reference count is important because today's computers have a finite " "(and often severely limited) memory size; it counts how many different " @@ -801,7 +883,7 @@ msgstr "" "則可以依次為那些其他物件解除配置,依此類推。(此處相互參照物件的存在是個明顯" "的問題;目前,解決方案是「就不要那樣做」。)" -#: ../../c-api/intro.rst:523 +#: ../../c-api/intro.rst:576 msgid "" "Reference counts are always manipulated explicitly. The normal way is to " "use the macro :c:func:`Py_INCREF` to take a new reference to an object (i.e. " @@ -829,7 +911,7 @@ msgstr "" "元會被使用(假設 ``sizeof(Py_ssize_t) >= sizeof(void*)``)。因此參照計數增加" "是一個簡單的操作。" -#: ../../c-api/intro.rst:539 +#: ../../c-api/intro.rst:592 msgid "" "It is not necessary to hold a :term:`strong reference` (i.e. increment the " "reference count) for every local variable that contains a pointer to an " @@ -855,7 +937,7 @@ msgstr "" "種情況的一個重要情況是在從 Python 呼叫的擴充模組中作為引數傳遞給 C 函式的物" "件;呼叫機制保證在呼叫期間保持對每個參數的參照。" -#: ../../c-api/intro.rst:555 +#: ../../c-api/intro.rst:608 msgid "" "However, a common pitfall is to extract an object from a list and hold on to " "it for a while without taking a new reference. Some other operation might " @@ -871,7 +953,7 @@ msgstr "" "程式碼路徑允許控制權從 :c:func:`Py_DECREF` 回歸使用者,因此幾乎任何操作都有潛" "在危險。" -#: ../../c-api/intro.rst:563 +#: ../../c-api/intro.rst:616 msgid "" "A safe approach is to always use the generic operations (functions whose " "name begins with ``PyObject_``, ``PyNumber_``, ``PySequence_`` or " @@ -886,11 +968,11 @@ msgstr "" "計數)。這讓呼叫者有責任在處理完結果後呼叫 :c:func:`Py_DECREF`;這就成為第二" "本質。" -#: ../../c-api/intro.rst:574 +#: ../../c-api/intro.rst:627 msgid "Reference Count Details" msgstr "參照計數詳細資訊" -#: ../../c-api/intro.rst:576 +#: ../../c-api/intro.rst:629 msgid "" "The reference count behavior of functions in the Python/C API is best " "explained in terms of *ownership of references*. Ownership pertains to " @@ -915,7 +997,7 @@ msgstr "" "照。當沒有所有權轉移時,呼叫者被稱為\\ *借用*\\ 參照。如果是\\ :term:`借用參" "照 `\\ 就不需要做任何事情。" -#: ../../c-api/intro.rst:589 +#: ../../c-api/intro.rst:642 msgid "" "Conversely, when a calling function passes in a reference to an object, " "there are two possibilities: the function *steals* a reference to the " @@ -927,7 +1009,7 @@ msgstr "" "物件的參照,或者沒有。 *竊取參照*\\ 意味著當你將參照傳遞給函式時,該函式假定" "它現在擁有該參照,並且你不再對它負責。" -#: ../../c-api/intro.rst:599 +#: ../../c-api/intro.rst:652 msgid "" "Few functions steal references; the two notable exceptions are :c:func:" "`PyList_SetItem` and :c:func:`PyTuple_SetItem`, which steal a reference to " @@ -944,7 +1026,7 @@ msgstr "" "慣,這些函式旨在竊取參照;例如,建立 tuple ``(1, 2, \"three\")`` 的程式碼可以" "如下所示(先暫時忘記錯誤處理;更好的編寫方式如下所示):" -#: ../../c-api/intro.rst:607 +#: ../../c-api/intro.rst:660 msgid "" "PyObject *t;\n" "\n" @@ -960,7 +1042,7 @@ msgstr "" "PyTuple_SetItem(t, 1, PyLong_FromLong(2L));\n" "PyTuple_SetItem(t, 2, PyUnicode_FromString(\"three\"));" -#: ../../c-api/intro.rst:614 +#: ../../c-api/intro.rst:667 msgid "" "Here, :c:func:`PyLong_FromLong` returns a new reference which is immediately " "stolen by :c:func:`PyTuple_SetItem`. When you want to keep using an object " @@ -971,7 +1053,7 @@ msgstr "" "`PyTuple_SetItem` 竊取。如果你想繼續使用一個物件,儘管對它的參照將被竊取,請" "在呼叫參照竊取函式之前使用 :c:func:`Py_INCREF` 來取得另一個參照。" -#: ../../c-api/intro.rst:619 +#: ../../c-api/intro.rst:672 msgid "" "Incidentally, :c:func:`PyTuple_SetItem` is the *only* way to set tuple " "items; :c:func:`PySequence_SetItem` and :c:func:`PyObject_SetItem` refuse to " @@ -983,7 +1065,7 @@ msgstr "" "tuple 是一種不可變 (immutable) 的資料型別。你應該只對你自己建立的 tuple 使" "用 :c:func:`PyTuple_SetItem`。" -#: ../../c-api/intro.rst:624 +#: ../../c-api/intro.rst:677 msgid "" "Equivalent code for populating a list can be written using :c:func:" "`PyList_New` and :c:func:`PyList_SetItem`." @@ -991,7 +1073,7 @@ msgstr "" "可以使用 :c:func:`PyList_New` 和 :c:func:`PyList_SetItem` 編寫用於填充列表的" "等效程式碼。" -#: ../../c-api/intro.rst:627 +#: ../../c-api/intro.rst:680 msgid "" "However, in practice, you will rarely use these ways of creating and " "populating a tuple or list. There's a generic function, :c:func:" @@ -1004,7 +1086,7 @@ msgstr "" "string` 引導。例如上面的兩個程式碼可以用以下程式碼替換(它還負責了錯誤檢" "查): ::" -#: ../../c-api/intro.rst:633 +#: ../../c-api/intro.rst:686 msgid "" "PyObject *tuple, *list;\n" "\n" @@ -1016,7 +1098,7 @@ msgstr "" "tuple = Py_BuildValue(\"(iis)\", 1, 2, \"three\");\n" "list = Py_BuildValue(\"[iis]\", 1, 2, \"three\");" -#: ../../c-api/intro.rst:638 +#: ../../c-api/intro.rst:691 msgid "" "It is much more common to use :c:func:`PyObject_SetItem` and friends with " "items whose references you are only borrowing, like arguments that were " @@ -1031,7 +1113,7 @@ msgstr "" "穩健,因為你不取得新的一個參照就可以放棄參照(「讓它被竊取」)。例如,此函式" "將 list(實際上是任何可變序列)的所有項目設定於給定項目:" -#: ../../c-api/intro.rst:645 +#: ../../c-api/intro.rst:698 msgid "" "int\n" "set_all(PyObject *target, PyObject *item)\n" @@ -1075,7 +1157,7 @@ msgstr "" " return 0;\n" "}" -#: ../../c-api/intro.rst:668 +#: ../../c-api/intro.rst:721 msgid "" "The situation is slightly different for function return values. While " "passing a reference to most functions does not change your ownership " @@ -1093,7 +1175,7 @@ msgstr "" "照的通用函式,如 :c:func:`PyObject_GetItem` 和 :c:func:`PySequence_GetItem`," "總是回傳一個新的參照(呼叫者成為參照的所有者)。" -#: ../../c-api/intro.rst:677 +#: ../../c-api/intro.rst:730 msgid "" "It is important to realize that whether you own a reference returned by a " "function depends on which function you call only --- *the plumage* (the type " @@ -1109,7 +1191,7 @@ msgstr "" "但如果你使用 :c:func:`PySequence_GetItem` 從同一 list 中取得相同的項目(且恰" "好使用完全相同的引數),你確實會擁有對回傳物件的參照。" -#: ../../c-api/intro.rst:689 +#: ../../c-api/intro.rst:742 msgid "" "Here is an example of how you could write a function that computes the sum " "of the items in a list of integers; once using :c:func:`PyList_GetItem`, " @@ -1118,7 +1200,7 @@ msgstr "" "以下是一個範例,說明如何編寫函式來計算一個整數 list 中項目的總和;一次使用 :" "c:func:`PyList_GetItem`,一次使用 :c:func:`PySequence_GetItem`: ::" -#: ../../c-api/intro.rst:693 +#: ../../c-api/intro.rst:746 msgid "" "long\n" "sum_list(PyObject *list)\n" @@ -1164,7 +1246,7 @@ msgstr "" " return total;\n" "}" -#: ../../c-api/intro.rst:719 +#: ../../c-api/intro.rst:772 msgid "" "long\n" "sum_sequence(PyObject *sequence)\n" @@ -1222,11 +1304,11 @@ msgstr "" " return total;\n" "}" -#: ../../c-api/intro.rst:753 +#: ../../c-api/intro.rst:806 msgid "Types" msgstr "型別" -#: ../../c-api/intro.rst:755 +#: ../../c-api/intro.rst:808 msgid "" "There are few other data types that play a significant role in the Python/C " "API; most are simple C types such as :c:expr:`int`, :c:expr:`long`, :c:expr:" @@ -1241,7 +1323,7 @@ msgstr "" "一些結構型別被用於描述用於列出模組所匯出的函式或新物件型別的資料屬性的靜態" "表,其他則用於描述複數的值。這些將與使用它們的函式一起討論。" -#: ../../c-api/intro.rst:765 +#: ../../c-api/intro.rst:818 msgid "" "A signed integral type such that ``sizeof(Py_ssize_t) == sizeof(size_t)``. " "C99 doesn't define such a thing directly (size_t is an unsigned integral " @@ -1252,11 +1334,11 @@ msgstr "" "有直接定義這樣的東西(size_t 是無符號整數型別)。有關詳細資訊,請參閱 :pep:" "`353`。 ``PY_SSIZE_T_MAX`` 是 :c:type:`Py_ssize_t` 型別的最大正值。" -#: ../../c-api/intro.rst:774 +#: ../../c-api/intro.rst:827 msgid "Exceptions" msgstr "例外" -#: ../../c-api/intro.rst:776 +#: ../../c-api/intro.rst:829 msgid "" "The Python programmer only needs to deal with exceptions if specific error " "handling is required; unhandled exceptions are automatically propagated to " @@ -1268,7 +1350,7 @@ msgstr "" "給呼叫者,然後傳遞給呼叫者的呼叫者,依此類推,直到它們到達頂層直譯器,在那裡" "它們透過堆疊回溯 (stack trace) 回報給使用者。" -#: ../../c-api/intro.rst:784 +#: ../../c-api/intro.rst:837 msgid "" "For C programmers, however, error checking always has to be explicit. All " "functions in the Python/C API can raise exceptions, unless an explicit claim " @@ -1290,7 +1372,7 @@ msgstr "" "確的錯誤指示器或者有不明確的回傳值,而需要使用 :c:func:`PyErr_Occurred` 明確" "測試錯誤。這些例外都會被明確地記錄於文件。" -#: ../../c-api/intro.rst:799 +#: ../../c-api/intro.rst:852 msgid "" "Exception state is maintained in per-thread storage (this is equivalent to " "using global storage in an unthreaded application). A thread can be in one " @@ -1309,7 +1391,7 @@ msgstr "" "func:`PyErr_SetString` 是最常見的(儘管不是最通用的)設定例外狀態的函式,而 :" "c:func:`PyErr_Clear` 是用來清除例外狀態。" -#: ../../c-api/intro.rst:809 +#: ../../c-api/intro.rst:862 msgid "" "The full exception state consists of three objects (all of which can be " "``NULL``): the exception type, the corresponding exception value, and the " @@ -1328,7 +1410,7 @@ msgstr "" "達 Python 位元組碼直譯器的主迴圈,該迴圈負責將它傳遞給 ``sys.exc_info()`` 和" "其系列函式。" -#: ../../c-api/intro.rst:821 +#: ../../c-api/intro.rst:874 msgid "" "Note that starting with Python 1.5, the preferred, thread-safe way to access " "the exception state from Python code is to call the function :func:`sys." @@ -1348,7 +1430,7 @@ msgstr "" "式碼中的常見錯誤,這些錯誤是由看似無辜的函式覆蓋了正在處理的例外而引起的;它" "還替回溯中被堆疊框 (stack frame) 參照的物件減少了通常不需要的生命週期延長。" -#: ../../c-api/intro.rst:832 +#: ../../c-api/intro.rst:885 msgid "" "As a general principle, a function that calls another function to perform " "some task should check whether the called function raised an exception, and " @@ -1363,7 +1445,7 @@ msgstr "" "並回傳一個錯誤指示符,但它\\ *不應該*\\ 設定另一個例外 --- 這將覆蓋剛剛引發的" "例外,並丟失關於錯誤確切原因的重要資訊。" -#: ../../c-api/intro.rst:841 +#: ../../c-api/intro.rst:894 msgid "" "A simple example of detecting exceptions and passing them on is shown in " "the :c:func:`!sum_sequence` example above. It so happens that this example " @@ -1375,7 +1457,7 @@ msgstr "" "巧這個例子在檢測到錯誤時不需要清理任何擁有的參照。以下範例函式展示了一些錯誤" "清理。首先,為了提醒你為什麼喜歡 Python,我們展示了等效的 Python 程式碼: ::" -#: ../../c-api/intro.rst:847 +#: ../../c-api/intro.rst:900 msgid "" "def incr_item(dict, key):\n" " try:\n" @@ -1391,11 +1473,11 @@ msgstr "" " item = 0\n" " dict[key] = item + 1" -#: ../../c-api/intro.rst:856 +#: ../../c-api/intro.rst:909 msgid "Here is the corresponding C code, in all its glory::" msgstr "這是相應的 C 程式碼:" -#: ../../c-api/intro.rst:858 +#: ../../c-api/intro.rst:911 msgid "" "int\n" "incr_item(PyObject *dict, PyObject *key)\n" @@ -1441,7 +1523,7 @@ msgid "" "}" msgstr "" -#: ../../c-api/intro.rst:908 +#: ../../c-api/intro.rst:961 msgid "" "This example represents an endorsed use of the ``goto`` statement in C! It " "illustrates the use of :c:func:`PyErr_ExceptionMatches` and :c:func:" @@ -1460,11 +1542,11 @@ msgstr "" "於保存擁有的參照的變數被初始化為 ``NULL`` 以使其能夠順利作用;同樣地,回傳值" "被初始化為 ``-1``\\ (失敗),並且僅在最後一次呼叫成功後才設定為成功。" -#: ../../c-api/intro.rst:922 +#: ../../c-api/intro.rst:975 msgid "Embedding Python" msgstr "嵌入式Python" -#: ../../c-api/intro.rst:924 +#: ../../c-api/intro.rst:977 msgid "" "The one important task that only embedders (as opposed to extension writers) " "of the Python interpreter have to worry about is the initialization, and " @@ -1474,7 +1556,7 @@ msgstr "" "只有 Python 直譯器的嵌入者(而不是擴充編寫者)需要擔心的一項重要任務是 " "Python 直譯器的初始化與完成階段。直譯器的大部分功能只能在直譯器初始化後使用。" -#: ../../c-api/intro.rst:937 +#: ../../c-api/intro.rst:990 msgid "" "The basic initialization function is :c:func:`Py_Initialize`. This " "initializes the table of loaded modules, and creates the fundamental " @@ -1485,7 +1567,7 @@ msgstr "" "立基礎模組 :mod:`builtins`、:mod:`__main__` 和 :mod:`sys`。它還會初始化模組搜" "索路徑 (``sys.path``)。" -#: ../../c-api/intro.rst:942 +#: ../../c-api/intro.rst:995 msgid "" ":c:func:`Py_Initialize` does not set the \"script argument list\" (``sys." "argv``). If this variable is needed by Python code that will be executed " @@ -1497,7 +1579,7 @@ msgstr "" "`PyConfig.argv` 和 :c:member:`PyConfig.parse_argv`,請見 :ref:`Python 初始化" "配置 `。" -#: ../../c-api/intro.rst:947 +#: ../../c-api/intro.rst:1000 msgid "" "On most systems (in particular, on Unix and Windows, although the details " "are slightly different), :c:func:`Py_Initialize` calculates the module " @@ -1515,7 +1597,7 @@ msgstr "" "file:`python` 的可執行檔案,並在其父目錄中查找一個名為 :file:`lib/python{X.Y}" "` 的目錄的相對位置。" -#: ../../c-api/intro.rst:956 +#: ../../c-api/intro.rst:1009 msgid "" "For instance, if the Python executable is found in :file:`/usr/local/bin/" "python`, it will assume that the libraries are in :file:`/usr/local/lib/" @@ -1532,7 +1614,7 @@ msgstr "" "`PYTHONHOME`,或者透過設定 :envvar:`PYTHONPATH` 在標準路徑前面插入額外的目" "錄。" -#: ../../c-api/intro.rst:970 +#: ../../c-api/intro.rst:1023 msgid "" "The embedding application can steer the search by setting :c:member:" "`PyConfig.program_name` *before* calling :c:func:`Py_InitializeFromConfig`. " @@ -1549,7 +1631,7 @@ msgstr "" "func:`Py_GetExecPrefix` 和 :c:func:`Py_GetProgramFullPath`\\(全部定義在 :" "file:`Modules/getpath.c`)。" -#: ../../c-api/intro.rst:981 +#: ../../c-api/intro.rst:1034 msgid "" "Sometimes, it is desirable to \"uninitialize\" Python. For instance, the " "application may want to start over (make another call to :c:func:" @@ -1570,11 +1652,11 @@ msgstr "" "`Py_FinalizeEx` *不會*\\ 釋放由 Python 直譯器分配的所有記憶體,例如目前無法釋" "放被擴充模組所分配的記憶體。" -#: ../../c-api/intro.rst:995 +#: ../../c-api/intro.rst:1048 msgid "Debugging Builds" msgstr "除錯建置" -#: ../../c-api/intro.rst:997 +#: ../../c-api/intro.rst:1050 msgid "" "Python can be built with several macros to enable extra checks of the " "interpreter and extension modules. These checks tend to add a large amount " @@ -1583,7 +1665,7 @@ msgstr "" "Python 可以在建置時使用多個巨集來啟用對直譯器和擴充模組的額外檢查,這些檢查往" "往會在執行環境 (runtime) 增加大量開銷 (overhead),因此預設情況下不啟用它們。" -#: ../../c-api/intro.rst:1001 +#: ../../c-api/intro.rst:1054 msgid "" "A full list of the various types of debugging builds is in the file :file:" "`Misc/SpecialBuilds.txt` in the Python source distribution. Builds are " @@ -1596,7 +1678,7 @@ msgstr "" "錯構置的完整列表,為支援追蹤參照計數、為記憶體分配器除錯或對主直譯器迴圈進行" "低階分析的建置。本節的其餘部分將僅描述最常用的建置。" -#: ../../c-api/intro.rst:1009 +#: ../../c-api/intro.rst:1062 msgid "" "Compiling the interpreter with the :c:macro:`!Py_DEBUG` macro defined " "produces what is generally meant by :ref:`a debug build of Python `." @@ -1620,7 +1702,7 @@ msgstr "" "除了下面描述的參照計數除錯之外,還會執行額外的檢查,請參閱 :ref:`Python 除錯" "建置 `。" -#: ../../c-api/intro.rst:1020 +#: ../../c-api/intro.rst:1073 msgid "" "Defining :c:macro:`Py_TRACE_REFS` enables reference tracing (see the :option:" "`configure --with-trace-refs option <--with-trace-refs>`). When defined, a " @@ -1635,7 +1717,7 @@ msgstr "" "linked list)。全體分配也有被追蹤。退出時將印出所有現行參照。(在交互模式下," "這發生在直譯器運行的每個陳述句之後。)" -#: ../../c-api/intro.rst:1027 +#: ../../c-api/intro.rst:1080 msgid "" "Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution for more detailed information." @@ -1643,11 +1725,11 @@ msgstr "" "有關更多詳細資訊,請參閱 Python 原始碼發布版中的 :file:`Misc/SpecialBuilds." "txt`。" -#: ../../c-api/intro.rst:1034 +#: ../../c-api/intro.rst:1087 msgid "Recommended third party tools" msgstr "建議的第三方工具" -#: ../../c-api/intro.rst:1036 +#: ../../c-api/intro.rst:1089 msgid "" "The following third party tools offer both simpler and more sophisticated " "approaches to creating C, C++ and Rust extensions for Python:" @@ -1655,39 +1737,39 @@ msgstr "" "以下第三方工具提供了更簡單且更細緻的方法來為 Python 建立 C、C++ 和 Rust 擴充" "模組:" -#: ../../c-api/intro.rst:1039 +#: ../../c-api/intro.rst:1092 msgid "`Cython `_" msgstr "`Cython `_" -#: ../../c-api/intro.rst:1040 +#: ../../c-api/intro.rst:1093 msgid "`cffi `_" msgstr "`cffi `_" -#: ../../c-api/intro.rst:1041 +#: ../../c-api/intro.rst:1094 msgid "`HPy `_" msgstr "`HPy `_" -#: ../../c-api/intro.rst:1042 +#: ../../c-api/intro.rst:1095 msgid "`nanobind `_ (C++)" msgstr "`nanobind `_ (C++)" -#: ../../c-api/intro.rst:1043 +#: ../../c-api/intro.rst:1096 msgid "`Numba `_" msgstr "`Numba `_" -#: ../../c-api/intro.rst:1044 +#: ../../c-api/intro.rst:1097 msgid "`pybind11 `_ (C++)" msgstr "`pybind11 `_ (C++)" -#: ../../c-api/intro.rst:1045 +#: ../../c-api/intro.rst:1098 msgid "`PyO3 `_ (Rust)" msgstr "`PyO3 `_ (Rust)" -#: ../../c-api/intro.rst:1046 +#: ../../c-api/intro.rst:1099 msgid "`SWIG `_" msgstr "`SWIG `_" -#: ../../c-api/intro.rst:1048 +#: ../../c-api/intro.rst:1101 msgid "" "Using tools such as these can help avoid writing code that is tightly bound " "to a particular version of CPython, avoid reference counting errors, and " @@ -1698,7 +1780,7 @@ msgid "" "sources." msgstr "" -#: ../../c-api/intro.rst:1055 +#: ../../c-api/intro.rst:1108 msgid "" "These projects are not supported by the same people who maintain Python, and " "issues need to be raised with the projects directly. Remember to check that " @@ -1706,139 +1788,159 @@ msgid "" "outdated." msgstr "" -#: ../../c-api/intro.rst:1062 +#: ../../c-api/intro.rst:1115 msgid "" "`Python Packaging User Guide: Binary Extensions `_" msgstr "" -#: ../../c-api/intro.rst:1063 +#: ../../c-api/intro.rst:1116 msgid "" "The Python Packaging User Guide not only covers several available tools that " "simplify the creation of binary extensions, but also discusses the various " "reasons why creating an extension module may be desirable in the first place." msgstr "" -#: ../../c-api/intro.rst:480 +#: ../../c-api/intro.rst:533 msgid "object" msgstr "object(物件)" -#: ../../c-api/intro.rst:480 +#: ../../c-api/intro.rst:533 msgid "type" msgstr "type(型別)" -#: ../../c-api/intro.rst:519 +#: ../../c-api/intro.rst:572 msgid "Py_INCREF (C function)" msgstr "Py_INCREF(C 函式)" -#: ../../c-api/intro.rst:519 +#: ../../c-api/intro.rst:572 msgid "Py_DECREF (C function)" msgstr "Py_DECREF(C 函式)" -#: ../../c-api/intro.rst:595 +#: ../../c-api/intro.rst:648 msgid "PyList_SetItem (C function)" msgstr "PyList_SetItem(C 函式)" -#: ../../c-api/intro.rst:595 +#: ../../c-api/intro.rst:648 msgid "PyTuple_SetItem (C function)" msgstr "PyTuple_SetItem(C 函式)" -#: ../../c-api/intro.rst:666 +#: ../../c-api/intro.rst:719 msgid "set_all()" msgstr "set_all()" -#: ../../c-api/intro.rst:685 +#: ../../c-api/intro.rst:738 msgid "PyList_GetItem (C function)" msgstr "PyList_GetItem(C 函式)" -#: ../../c-api/intro.rst:685 +#: ../../c-api/intro.rst:738 msgid "PySequence_GetItem (C function)" msgstr "PySequence_GetItem(C 函式)" -#: ../../c-api/intro.rst:715 +#: ../../c-api/intro.rst:768 msgid "sum_list()" msgstr "sum_list()" -#: ../../c-api/intro.rst:747 ../../c-api/intro.rst:839 +#: ../../c-api/intro.rst:800 ../../c-api/intro.rst:892 msgid "sum_sequence()" msgstr "sum_sequence()" -#: ../../c-api/intro.rst:782 +#: ../../c-api/intro.rst:835 msgid "PyErr_Occurred (C function)" msgstr "PyErr_Occurred(C 函式)" -#: ../../c-api/intro.rst:795 +#: ../../c-api/intro.rst:848 msgid "PyErr_SetString (C function)" msgstr "PyErr_SetString(C 函式)" -#: ../../c-api/intro.rst:795 ../../c-api/intro.rst:903 +#: ../../c-api/intro.rst:848 ../../c-api/intro.rst:956 msgid "PyErr_Clear (C function)" msgstr "PyErr_Clear(C 函式)" -#: ../../c-api/intro.rst:819 +#: ../../c-api/intro.rst:872 msgid "exc_info (in module sys)" msgstr "exc_info (sys 模組中)" -#: ../../c-api/intro.rst:854 ../../c-api/intro.rst:901 +#: ../../c-api/intro.rst:907 ../../c-api/intro.rst:954 msgid "incr_item()" msgstr "incr_item()" -#: ../../c-api/intro.rst:903 +#: ../../c-api/intro.rst:956 msgid "PyErr_ExceptionMatches (C function)" msgstr "PyErr_ExceptionMatches(C 函式)" -#: ../../c-api/intro.rst:903 +#: ../../c-api/intro.rst:956 msgid "Py_XDECREF (C function)" msgstr "Py_XDECREF(C 函式)" -#: ../../c-api/intro.rst:929 +#: ../../c-api/intro.rst:982 msgid "Py_Initialize (C function)" msgstr "Py_Initialize(C 函式)" -#: ../../c-api/intro.rst:929 +#: ../../c-api/intro.rst:982 msgid "module" msgstr "module(模組)" -#: ../../c-api/intro.rst:929 +#: ../../c-api/intro.rst:982 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/intro.rst:929 +#: ../../c-api/intro.rst:982 msgid "__main__" msgstr "__main__" -#: ../../c-api/intro.rst:929 +#: ../../c-api/intro.rst:982 msgid "sys" msgstr "sys" -#: ../../c-api/intro.rst:929 +#: ../../c-api/intro.rst:982 msgid "search" msgstr "search(搜尋)" -#: ../../c-api/intro.rst:929 +#: ../../c-api/intro.rst:982 msgid "path" msgstr "path(路徑)" -#: ../../c-api/intro.rst:929 +#: ../../c-api/intro.rst:982 msgid "path (in module sys)" msgstr "path(sys 模組中)" -#: ../../c-api/intro.rst:964 +#: ../../c-api/intro.rst:1017 msgid "Py_GetPath (C function)" msgstr "Py_GetPath(C 函式)" -#: ../../c-api/intro.rst:964 +#: ../../c-api/intro.rst:1017 msgid "Py_GetPrefix (C function)" msgstr "Py_GetPrefix(C 函式)" -#: ../../c-api/intro.rst:964 +#: ../../c-api/intro.rst:1017 msgid "Py_GetExecPrefix (C function)" msgstr "Py_GetExecPrefix(C 函式)" -#: ../../c-api/intro.rst:964 +#: ../../c-api/intro.rst:1017 msgid "Py_GetProgramFullPath (C function)" msgstr "Py_GetProgramFullPath(C 函式)" -#: ../../c-api/intro.rst:979 +#: ../../c-api/intro.rst:1032 msgid "Py_IsInitialized (C function)" msgstr "Py_IsInitialized(C 函式)" + +#~ msgid "Return the maximum value between ``x`` and ``y``." +#~ msgstr "回傳 ``x`` 和 ``y`` 之間的最大值。" + +#~ msgid "Return the minimum value between ``x`` and ``y``." +#~ msgstr "回傳 ``x`` 和 ``y`` 之間的最小值。" + +#~ msgid "" +#~ "Use :c:macro:`PyDoc_STRVAR` for docstrings to support building Python " +#~ "without docstrings, as specified in :pep:`7`." +#~ msgstr "" +#~ "如 :pep:`7` 中所指明,使用 :c:macro:`PyDoc_STRVAR` 作為文件字串可以支援在" +#~ "沒有文件字串的情況下建置 Python。" + +#~ msgid "" +#~ "Use :c:macro:`PyDoc_STR` in specifying docstrings to support building " +#~ "Python without docstrings, as specified in :pep:`7`." +#~ msgstr "" +#~ "如 :pep:`7` 中所指明,使用 :c:macro:`PyDoc_STR` 指定文件字串以支援在沒有文" +#~ "件字串下建置 Python。" diff --git a/library/__future__.po b/library/__future__.po index 02cef9a695..e07516434d 100644 --- a/library/__future__.po +++ b/library/__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-02-07 00:19+0000\n" "PO-Revision-Date: 2024-02-06 02:12+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,21 +28,21 @@ msgstr "**原始碼:**\\ :source:`Lib/__future__.py`" #: ../../library/__future__.rst:11 msgid "" -"Imports of the form ``from __future__ import feature`` are " -"called :ref:`future statements `. These are special-cased by the " -"Python compiler to allow the use of new Python features in modules " -"containing the future statement before the release in which the feature " -"becomes standard." +"Imports of the form ``from __future__ import feature`` are called :ref:" +"`future statements `. These are special-cased by the Python compiler " +"to allow the use of new Python features in modules containing the future " +"statement before the release in which the feature becomes standard." msgstr "" "``from __future__ import feature`` 形式的引入被稱為 :ref:`future 陳述式 " "`。這些是 Python 編譯器的特殊情況,允許在該功能成為標準版本之前在包" "含 future 陳述式的模組中使用新的 Python 功能。" #: ../../library/__future__.rst:16 +#, fuzzy msgid "" "While these future statements are given additional special meaning by the " "Python compiler, they are still executed like any other import statement and " -"the :mod:`__future__` exists and is handled by the import system the same " +"the :mod:`!__future__` exists and is handled by the import system the same " "way any other Python module would be. This design serves three purposes:" msgstr "" "雖然這些 future 陳述式被 Python 編譯器賦予了額外的特殊意義,但它們仍然像任何" @@ -56,21 +56,23 @@ msgid "" msgstr "為了避免混淆分析引入陳述式並預期要找到它們正在引入之模組的現有工具。" #: ../../library/__future__.rst:24 +#, fuzzy msgid "" "To document when incompatible changes were introduced, and when they will be " "--- or were --- made mandatory. This is a form of executable documentation, " -"and can be inspected programmatically via importing :mod:`__future__` and " +"and can be inspected programmatically via importing :mod:`!__future__` and " "examining its contents." msgstr "" "記錄何時出現不相容的變更,以及何時開始強制執行這些變更。這是一種可執行文件的" "形式,可以透過引入 :mod:`__future__` 並檢查其內容以程式化的方式進行檢查。" #: ../../library/__future__.rst:29 +#, fuzzy msgid "" "To ensure that :ref:`future statements ` run under releases prior to " -"Python 2.1 at least yield runtime exceptions (the import " -"of :mod:`__future__` will fail, because there was no module of that name " -"prior to 2.1)." +"Python 2.1 at least yield runtime exceptions (the import of :mod:`!" +"__future__` will fail, because there was no module of that name prior to " +"2.1)." msgstr "" "確保 :ref:`future 陳述式 `\\ 在 Python 2.1 之前的版本中運行至少會產" "生 runtime 例外(\\ :mod:`__future__` 的引入將會失敗,因為 2.1 之前沒有該名稱" @@ -81,8 +83,9 @@ msgid "Module Contents" msgstr "模組內容" #: ../../library/__future__.rst:36 +#, fuzzy msgid "" -"No feature description will ever be deleted from :mod:`__future__`. Since " +"No feature description will ever be deleted from :mod:`!__future__`. Since " "its introduction in Python 2.1 the following features have found their way " "into the language using this mechanism:" msgstr "" @@ -221,8 +224,8 @@ msgid "" "where, normally, *OptionalRelease* is less than *MandatoryRelease*, and both " "are 5-tuples of the same form as :data:`sys.version_info`::" msgstr "" -"通常,*OptionalRelease* 會小於 *MandatoryRelease*,且兩者都是" -"與 :data:`sys.version_info` 形式相同的 5 元組 (5-tuple): ::" +"通常,*OptionalRelease* 會小於 *MandatoryRelease*,且兩者都是與 :data:`sys." +"version_info` 形式相同的 5 元組 (5-tuple): ::" #: ../../library/__future__.rst:101 msgid "" @@ -279,19 +282,19 @@ msgstr "" msgid "" "*CompilerFlag* is the (bitfield) flag that should be passed in the fourth " "argument to the built-in function :func:`compile` to enable the feature in " -"dynamically compiled code. This flag is stored in " -"the :attr:`_Feature.compiler_flag` attribute on :class:`_Feature` instances." +"dynamically compiled code. This flag is stored in the :attr:`_Feature." +"compiler_flag` attribute on :class:`_Feature` instances." msgstr "" "*CompilerFlag* 是(位元欄位 (bitfield))旗標,應在第四個引數中傳遞給內建函" -"式 :func:`compile` 以在動態編譯的程式碼中啟用該功能。此旗標儲存" -"在 :class:`_Feature` 實例上的 :attr:`_Feature.compiler_flag` 屬性中。" +"式 :func:`compile` 以在動態編譯的程式碼中啟用該功能。此旗標儲存在 :class:" +"`_Feature` 實例上的 :attr:`_Feature.compiler_flag` 屬性中。" #: ../../library/__future__.rst:133 msgid "" "``from __future__ import annotations`` was previously scheduled to become " "mandatory in Python 3.10, but the change was delayed and ultimately " -"canceled. This feature will eventually be deprecated and removed. " -"See :pep:`649` and :pep:`749`." +"canceled. This feature will eventually be deprecated and removed. See :pep:" +"`649` and :pep:`749`." msgstr "" "``from __future__ import annotations`` 原本預定在 Python 3.10 中成為強制性功" "能,但該變更被延後並最終取消。此功能最終將被棄用並移除。請參閱 :pep:`649` " @@ -320,8 +323,8 @@ msgstr "__future__ 機制的原始提案。" #~ msgid "" #~ "``from __future__ import annotations`` was previously scheduled to become " #~ "mandatory in Python 3.10, but the Python Steering Council twice decided " -#~ "to delay the change (`announcement for Python 3.10 `__; `announcement for Python 3.11 " #~ "`__). No final decision has been made " diff --git a/library/argparse.po b/library/argparse.po index ecd33ee32f..91aa9bd793 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-02 02:24+0700\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,9 +28,10 @@ msgid "**Source code:** :source:`Lib/argparse.py`" msgstr "**原始碼:**\\ :source:`Lib/argparse.py`" #: ../../library/argparse.rst:16 +#, fuzzy msgid "" -"While :mod:`argparse` is the default recommended standard library module for " -"implementing basic command line applications, authors with more exacting " +"While :mod:`!argparse` is the default recommended standard library module " +"for implementing basic command line applications, authors with more exacting " "requirements for exactly how their command line applications behave may find " "it doesn't provide the necessary level of control. Refer to :ref:`choosing-" "an-argument-parser` for alternatives to consider when ``argparse`` doesn't " @@ -55,8 +56,8 @@ msgid "" "introduction to Python command-line parsing, have a look at the :ref:" "`argparse tutorial `." msgstr "" -"本頁包含 API 參考資訊。如需更淺顯的 Python 命令列剖析介紹,請參" -"閱 :ref:`argparse 教學 `。" +"本頁包含 API 參考資訊。如需更淺顯的 Python 命令列剖析介紹,請參閱 :ref:" +"`argparse 教學 `。" #: ../../library/argparse.rst:34 msgid "" @@ -68,9 +69,9 @@ msgid "" "invalid arguments." msgstr "" ":mod:`!argparse` 模組使得撰寫使用者友善的命令列介面變得容易。程式定義它需要什" -"麼引數,而 :mod:`!argparse` 會找出如何從 :data:`sys.argv` 中剖析這些引" -"數。:mod:`!argparse` 模組也會自動產生說明和用法訊息。當使用者向程式提供無效引" -"數時,此模組也會發出錯誤。" +"麼引數,而 :mod:`!argparse` 會找出如何從 :data:`sys.argv` 中剖析這些引數。:" +"mod:`!argparse` 模組也會自動產生說明和用法訊息。當使用者向程式提供無效引數" +"時,此模組也會發出錯誤。" #: ../../library/argparse.rst:40 msgid "" @@ -79,9 +80,9 @@ msgid "" "for argument specifications and has options that apply to the parser as " "whole::" msgstr "" -":mod:`!argparse` 模組對命令列介面的支援是圍" -"繞 :class:`argparse.ArgumentParser` 的實例建構的。它是引數規格的容器,並具有" -"適用於整個剖析器的選項: ::" +":mod:`!argparse` 模組對命令列介面的支援是圍繞 :class:`argparse." +"ArgumentParser` 的實例建構的。它是引數規格的容器,並具有適用於整個剖析器的選" +"項: ::" #: ../../library/argparse.rst:44 msgid "" @@ -121,8 +122,8 @@ msgid "" "The :meth:`ArgumentParser.parse_args` method runs the parser and places the " "extracted data in a :class:`argparse.Namespace` object::" msgstr "" -":meth:`ArgumentParser.parse_args` 方法會執行剖析器,並將擷取的資料放入一" -"個 :class:`argparse.Namespace` 物件中:::" +":meth:`ArgumentParser.parse_args` 方法會執行剖析器,並將擷取的資料放入一個 :" +"class:`argparse.Namespace` 物件中:::" #: ../../library/argparse.rst:61 msgid "" @@ -285,16 +286,16 @@ msgid "" "The :func:`base name ` of ``sys.argv[0]`` if a file was " "passed as argument." msgstr "" -"如果傳入的引數是一個檔案,則使用 ``sys.argv[0]`` 的\\ :func:`基底名稱 " -"`。" +"如果傳入的引數是一個檔案,則使用 ``sys.argv[0]`` 的\\ :func:`基底名稱 `。" #: ../../library/argparse.rst:151 msgid "" "The Python interpreter name followed by ``sys.argv[0]`` if a directory or a " "zipfile was passed as argument." msgstr "" -"如果傳入的引數是一個目錄或 zip 檔案,則使用 Python 直譯器名稱加上 " -"``sys.argv[0]``。" +"如果傳入的引數是一個目錄或 zip 檔案,則使用 Python 直譯器名稱加上 ``sys." +"argv[0]``。" #: ../../library/argparse.rst:153 msgid "" @@ -365,8 +366,8 @@ msgid "" "The default ``prog`` value now reflects how ``__main__`` was actually " "executed, rather than always being ``os.path.basename(sys.argv[0])``." msgstr "" -"預設的 ``prog`` 值現在會反映 ``__main__`` 實際的執行方式,而非總是使用 " -"``os.path.basename(sys.argv[0])``。" +"預設的 ``prog`` 值現在會反映 ``__main__`` 實際的執行方式,而非總是使用 ``os." +"path.basename(sys.argv[0])``。" #: ../../library/argparse.rst:189 msgid "usage" @@ -425,10 +426,10 @@ msgid "" "`~_SubParsersAction.add_parser`, to ensure consistent command prefixes and " "usage information across subparsers." msgstr "" -"當為主剖析器指定了自訂用法訊息時,你可能也會想考慮將 ``prog`` 引數傳" -"給 :meth:`~ArgumentParser.add_subparsers`,或是將 ``prog`` 和 ``usage`` 引數" -"傳給 :meth:`~_SubParsersAction.add_parser` 以確保子剖析器之間的命令前綴和用法" -"資訊一致。" +"當為主剖析器指定了自訂用法訊息時,你可能也會想考慮將 ``prog`` 引數傳給 :meth:" +"`~ArgumentParser.add_subparsers`,或是將 ``prog`` 和 ``usage`` 引數傳給 :" +"meth:`~_SubParsersAction.add_parser` 以確保子剖析器之間的命令前綴和用法資訊一" +"致。" #: ../../library/argparse.rst:221 msgid "description" @@ -464,8 +465,8 @@ msgid "" "the description of the arguments. Such text can be specified using the " "``epilog=`` argument to :class:`ArgumentParser`::" msgstr "" -"有些程式喜歡在引數描述之後顯示程式的額外說明。可以使" -"用 :class:`ArgumentParser` 的 ``epilog=`` 引數來指定這類文字: ::" +"有些程式喜歡在引數描述之後顯示程式的額外說明。可以使用 :class:" +"`ArgumentParser` 的 ``epilog=`` 引數來指定這類文字: ::" #: ../../library/argparse.rst:240 msgid "" @@ -501,8 +502,8 @@ msgid "" "wrapped, but this behavior can be adjusted with the formatter_class_ " "argument to :class:`ArgumentParser`." msgstr "" -"與 description_ 引數一樣,``epilog=`` 文字預設會被自動斷行,但可以透" -"過 :class:`ArgumentParser` 的 formatter_class_ 引數調整此行為。" +"與 description_ 引數一樣,``epilog=`` 文字預設會被自動斷行,但可以透過 :" +"class:`ArgumentParser` 的 formatter_class_ 引數調整此行為。" #: ../../library/argparse.rst:259 msgid "parents" @@ -521,8 +522,8 @@ msgstr "" "有時候多個剖析器會共用一組共同的引數。與其重複定義這些引數,不如使用一個包含" "所有共用引數的剖析器,並將其傳給 :class:`ArgumentParser` 的 ``parents=`` 引" "數。``parents=`` 引數接受一個 :class:`ArgumentParser` 物件的串列,收集它們的" -"所有位置 action 和可選 action,並將這些 action 加入正在建構" -"的 :class:`ArgumentParser` 物件中: ::" +"所有位置 action 和可選 action,並將這些 action 加入正在建構的 :class:" +"`ArgumentParser` 物件中: ::" #: ../../library/argparse.rst:268 msgid "" @@ -558,9 +559,9 @@ msgid "" "the :class:`ArgumentParser` will see two ``-h/--help`` options (one in the " "parent and one in the child) and raise an error." msgstr "" -"請注意,大多數父剖析器會指定 ``add_help=False``。否" -"則 :class:`ArgumentParser` 會看到兩個 ``-h/--help`` 選項(一個在父剖析器中," -"一個在子剖析器中)並引發錯誤。" +"請注意,大多數父剖析器會指定 ``add_help=False``。否則 :class:" +"`ArgumentParser` 會看到兩個 ``-h/--help`` 選項(一個在父剖析器中,一個在子剖" +"析器中)並引發錯誤。" #: ../../library/argparse.rst:286 msgid "" @@ -798,8 +799,8 @@ msgid "" "``prefix_chars=`` argument to the :class:`ArgumentParser` constructor::" msgstr "" "大多數命令列選項會使用 ``-`` 作為前綴,例如 ``-f/--foo``。需要支援不同或額外" -"前綴字元的剖析器,例如 ``+f`` 或 ``/foo`` 之類的選項,可以使" -"用 :class:`ArgumentParser` 建構函式的 ``prefix_chars=`` 引數來指定: ::" +"前綴字元的剖析器,例如 ``+f`` 或 ``/foo`` 之類的選項,可以使用 :class:" +"`ArgumentParser` 建構函式的 ``prefix_chars=`` 引數來指定: ::" #: ../../library/argparse.rst:408 msgid "" @@ -869,10 +870,10 @@ msgid "" "'@args.txt']`` is considered equivalent to the expression ``['-f', 'foo', '-" "f', 'bar']``." msgstr "" -"從檔案讀取的引數預設必須每行一個(但也請參" -"閱 :meth:`~ArgumentParser.convert_arg_line_to_args`),且剖析器會將其視為與命" -"令列上引用檔案的原始引數位於相同位置。因此在上面的範例中,運算式 ``['-f', " -"'foo', '@args.txt']`` 等同於運算式 ``['-f', 'foo', '-f', 'bar']``。" +"從檔案讀取的引數預設必須每行一個(但也請參閱 :meth:`~ArgumentParser." +"convert_arg_line_to_args`),且剖析器會將其視為與命令列上引用檔案的原始引數位" +"於相同位置。因此在上面的範例中,運算式 ``['-f', 'foo', '@args.txt']`` 等同於" +"運算式 ``['-f', 'foo', '-f', 'bar']``。" #: ../../library/argparse.rst:445 msgid "" @@ -907,9 +908,9 @@ msgid "" "and error handler`. Arguments file should be encoded in UTF-8 instead of " "ANSI Codepage on Windows." msgstr "" -":class:`ArgumentParser` 將讀取引數檔案的編碼和錯誤處理從預設值(例" -"如 :func:`locale.getpreferredencoding(False) ` " -"和 ``\"strict\"``)改為\\ :term:`檔案系統編碼和錯誤處理函式 ` 和 " +"``\"strict\"``)改為\\ :term:`檔案系統編碼和錯誤處理函式 `。在 Windows 上引數檔案應使用 UTF-8 而非 ANSI 字" "碼頁編碼。" @@ -928,13 +929,12 @@ msgid "" "suppress attribute creation on :meth:`~ArgumentParser.parse_args` calls, we " "supply ``argument_default=SUPPRESS``::" msgstr "" -"一般而言,引數預設值可以透過將預設值傳" -"給 :meth:`~ArgumentParser.add_argument` 或是透過呼" -"叫 :meth:`~ArgumentParser.set_defaults` 方法並指定一組名稱—值對 (name-value " -"pair) 來設定。然而有時候為引數指定一個剖析器層級的單一預設值可能很有用。這可" -"以透過將 ``argument_default=`` 關鍵字引數傳給 :class:`ArgumentParser` 來完" -"成。例如若要全域地抑制 :meth:`~ArgumentParser.parse_args` 呼叫時的屬性建立," -"我們可以提供 ``argument_default=SUPPRESS``: ::" +"一般而言,引數預設值可以透過將預設值傳給 :meth:`~ArgumentParser." +"add_argument` 或是透過呼叫 :meth:`~ArgumentParser.set_defaults` 方法並指定一" +"組名稱—值對 (name-value pair) 來設定。然而有時候為引數指定一個剖析器層級的單" +"一預設值可能很有用。這可以透過將 ``argument_default=`` 關鍵字引數傳給 :class:" +"`ArgumentParser` 來完成。例如若要全域地抑制 :meth:`~ArgumentParser." +"parse_args` 呼叫時的屬性建立,我們可以提供 ``argument_default=SUPPRESS``: ::" #: ../../library/argparse.rst:474 msgid "" @@ -964,9 +964,9 @@ msgid "" "parse_args` method of an :class:`ArgumentParser`, it :ref:`recognizes " "abbreviations ` of long options." msgstr "" -"當你將引數串列傳給 :class:`ArgumentParser` " -"的 :meth:`~ArgumentParser.parse_args` 方法時,它會通常會\\ :ref:`辨識為長選項" -"的縮寫 `。" +"當你將引數串列傳給 :class:`ArgumentParser` 的 :meth:`~ArgumentParser." +"parse_args` 方法時,它會通常會\\ :ref:`辨識為長選項的縮寫 `。" #: ../../library/argparse.rst:491 msgid "This feature can be disabled by setting ``allow_abbrev`` to ``False``::" @@ -1145,9 +1145,9 @@ msgid "" "`~ArgumentParser.parse_args` method of an :class:`ArgumentParser`, it will " "print a *message* to :data:`sys.stderr` and exit with a status code of 2." msgstr "" -"當你將無效的引數串列傳給 :class:`ArgumentParser` " -"的 :meth:`~ArgumentParser.parse_args` 方法時,它通常會向 :data:`sys.stderr` " -"印出一個\\ *訊息*\\ 並以狀態碼 2 退出。" +"當你將無效的引數串列傳給 :class:`ArgumentParser` 的 :meth:`~ArgumentParser." +"parse_args` 方法時,它通常會向 :data:`sys.stderr` 印出一個\\ *訊息*\\ 並以狀" +"態碼 2 退出。" #: ../../library/argparse.rst:580 msgid "" @@ -1194,9 +1194,9 @@ msgid "" "permissible argument choices (if specified) or subparser names as part of " "the error message." msgstr "" -"預設情況下,當使用者傳入無效的引數選擇或子剖析器名稱" -"時,:class:`ArgumentParser` 會帶著錯誤資訊退出,並將允許的引數選擇(如果有指" -"定的話)或子剖析器名稱列為錯誤訊息的一部分。" +"預設情況下,當使用者傳入無效的引數選擇或子剖析器名稱時,:class:" +"`ArgumentParser` 會帶著錯誤資訊退出,並將允許的引數選擇(如果有指定的話)或子" +"剖析器名稱列為錯誤訊息的一部分。" #: ../../library/argparse.rst:602 msgid "" @@ -1368,8 +1368,8 @@ msgstr "metavar_ - 引數在用法訊息中的名稱。" #: ../../library/argparse.rst:691 msgid "" -"dest_ - The name of the attribute to be added to the object returned " -"by :meth:`parse_args`." +"dest_ - The name of the attribute to be added to the object returned by :" +"meth:`parse_args`." msgstr "dest_ - 要加入到 :meth:`parse_args` 回傳物件中的屬性名稱。" #: ../../library/argparse.rst:694 @@ -1389,9 +1389,9 @@ msgid "" "or a simple argument name." msgstr "" ":meth:`~ArgumentParser.add_argument` 方法必須知道預期的是可選引數(如 ``-f`` " -"或 ``--foo``)還是位置引數(如檔案名稱的串列)。因此,傳" -"給 :meth:`~ArgumentParser.add_argument` 的第一個引數必須是一系列旗標或一個簡" -"單的引數名稱。" +"或 ``--foo``)還是位置引數(如檔案名稱的串列)。因此,傳給 :meth:" +"`~ArgumentParser.add_argument` 的第一個引數必須是一系列旗標或一個簡單的引數名" +"稱。" #: ../../library/argparse.rst:710 msgid "For example, an optional argument could be created like::" @@ -1493,9 +1493,9 @@ msgid "" "be handled. The supplied actions are:" msgstr "" ":class:`ArgumentParser` 物件會將命令列引數與 action 關聯起來。這些 action 幾" -"乎可以對與其關聯的命令列引數做任何事情,但大多數 action 只是將屬性加入" -"到 :meth:`~ArgumentParser.parse_args` 回傳的物件中。``action`` 關鍵字引數指定" -"命令列引數應如何被處理。提供的 action 有:" +"乎可以對與其關聯的命令列引數做任何事情,但大多數 action 只是將屬性加入到 :" +"meth:`~ArgumentParser.parse_args` 回傳的物件中。``action`` 關鍵字引數指定命令" +"列引數應如何被處理。提供的 action 有:" #: ../../library/argparse.rst:764 msgid "" @@ -1664,8 +1664,8 @@ msgid "" "output is created." msgstr "" "``'help'`` - 這會印出目前剖析器中所有選項的完整說明訊息,然後退出。預設情況" -"下,help action 會自動加入到剖析器。有關輸出如何建立的詳情,請參" -"閱 :class:`ArgumentParser`。" +"下,help action 會自動加入到剖析器。有關輸出如何建立的詳情,請參閱 :class:" +"`ArgumentParser`。" #: ../../library/argparse.rst:842 msgid "" @@ -1700,10 +1700,10 @@ msgid "" "arguments (e.g. ``'store'``, ``'append'``, ``'extend'``, or custom actions " "with non-zero ``nargs``) can be used with positional arguments." msgstr "" -"你也可以傳遞一個 :class:`Action` 子類別(例" -"如 :class:`BooleanOptionalAction`)或實作相同介面的其他物件。只有會消耗命令列" -"引數的 action(例如 ``'store'``、``'append'``、``'extend'`` 或 ``nargs`` 不為" -"零的自訂 action)可用於位置引數。" +"你也可以傳遞一個 :class:`Action` 子類別(例如 :class:" +"`BooleanOptionalAction`)或實作相同介面的其他物件。只有會消耗命令列引數的 " +"action(例如 ``'store'``、``'append'``、``'extend'`` 或 ``nargs`` 不為零的自" +"訂 action)可用於位置引數。" #: ../../library/argparse.rst:858 msgid "" @@ -1963,10 +1963,10 @@ msgid "" "receive a default value of ``None``." msgstr "" "當 :meth:`~ArgumentParser.add_argument` 以 ``action='store_const'`` 或 " -"``action='append_const'`` 呼叫時。這些 action 會將 ``const`` 值加入" -"到 :meth:`~ArgumentParser.parse_args` 回傳物件的其中一個屬性中。範例請參閱 " -"action_ 描述。如果未向 :meth:`~ArgumentParser.add_argument` 提供 ``const``," -"它會接收預設值 ``None``。" +"``action='append_const'`` 呼叫時。這些 action 會將 ``const`` 值加入到 :meth:" +"`~ArgumentParser.parse_args` 回傳物件的其中一個屬性中。範例請參閱 action_ 描" +"述。如果未向 :meth:`~ArgumentParser.add_argument` 提供 ``const``,它會接收預" +"設值 ``None``。" #: ../../library/argparse.rst:992 msgid "" @@ -2003,10 +2003,10 @@ msgid "" "the ``default`` value is used when the option string was not present at the " "command line::" msgstr "" -"所有可選引數和部分位置引數都可以在命令列上被省" -"略。:meth:`~ArgumentParser.add_argument` 的 ``default`` 關鍵字引數(其值預設" -"為 ``None``)指定在命令列引數不存在時應使用的值。對於可選引數,當選項字串不在" -"命令列上時會使用 ``default`` 值: ::" +"所有可選引數和部分位置引數都可以在命令列上被省略。:meth:`~ArgumentParser." +"add_argument` 的 ``default`` 關鍵字引數(其值預設為 ``None``)指定在命令列引" +"數不存在時應使用的值。對於可選引數,當選項字串不在命令列上時會使用 " +"``default`` 值: ::" #: ../../library/argparse.rst:1015 msgid "" @@ -2138,9 +2138,8 @@ msgid "" "checking and type conversions to be performed." msgstr "" "預設情況下,剖析器將命令列引數作為簡單字串讀取。然而命令列字串往往應直譯為另" -"一種型別,例如 :class:`float` " -"或 :class:`int`。:meth:`~ArgumentParser.add_argument` 的 ``type`` 關鍵字允許" -"執行任何必要的型別檢查和型別轉換。" +"一種型別,例如 :class:`float` 或 :class:`int`。:meth:`~ArgumentParser." +"add_argument` 的 ``type`` 關鍵字允許執行任何必要的型別檢查和型別轉換。" #: ../../library/argparse.rst:1077 msgid "" @@ -2159,9 +2158,9 @@ msgid "" "is displayed. Other exception types are not handled." msgstr "" "``type`` 的引數可以是一個接受單個字串的可呼叫物件,或是已註冊型別的名稱(請參" -"閱 :meth:`~ArgumentParser.register`)。如果函式引" -"發 :exc:`ArgumentTypeError`、:exc:`TypeError` 或 :exc:`ValueError`,剖析器會" -"捕捉例外並顯示格式良好的錯誤訊息。其他例外型別則不處理。" +"閱 :meth:`~ArgumentParser.register`)。如果函式引發 :exc:" +"`ArgumentTypeError`、:exc:`TypeError` 或 :exc:`ValueError`,剖析器會捕捉例外" +"並顯示格式良好的錯誤訊息。其他例外型別則不處理。" #: ../../library/argparse.rst:1086 msgid "Common built-in types and functions can be used as type converters:" @@ -2238,8 +2237,8 @@ msgid "" "exception would not be handled at all." msgstr "" "例如,JSON 或 YAML 轉換具有複雜的錯誤情況,需要比 ``type`` 關鍵字所能提供的更" -"好的報告。:exc:`~json.JSONDecodeError` 無法得到良好的格式化," -"而 :exc:`FileNotFoundError` 例外則完全不會處理。" +"好的報告。:exc:`~json.JSONDecodeError` 無法得到良好的格式化,而 :exc:" +"`FileNotFoundError` 例外則完全不會處理。" #: ../../library/argparse.rst:1126 msgid "" @@ -2252,8 +2251,8 @@ msgid "" msgstr "" "即使是 :class:`~argparse.FileType` 在與 ``type`` 關鍵字一起使用時也有其限制。" "如果一個引數使用了 :class:`~argparse.FileType`,然後後續的引數失敗了,雖然會" -"報告錯誤但檔案不會自動關閉。在這種情況下,最好等到剖析器執行完畢後,再使" -"用 :keyword:`with` 陳述式來管理檔案。" +"報告錯誤但檔案不會自動關閉。在這種情況下,最好等到剖析器執行完畢後,再使用 :" +"keyword:`with` 陳述式來管理檔案。" #: ../../library/argparse.rst:1133 msgid "" @@ -2382,9 +2381,8 @@ msgid "" "`~ArgumentParser.parse_args` will report an error if that option is not " "present at the command line." msgstr "" -"如範例所示,如果一個選項被標記為 " -"``required``,:meth:`~ArgumentParser.parse_args` 會在該選項不在命令列上時報告" -"錯誤。" +"如範例所示,如果一個選項被標記為 ``required``,:meth:`~ArgumentParser." +"parse_args` 會在該選項不在命令列上時報告錯誤。" #: ../../library/argparse.rst:1202 msgid "" @@ -2417,9 +2415,8 @@ msgid "" "``%(type)s``, etc.::" msgstr "" "``help`` 字串可以包含各種格式說明符號以避免重複程式名稱或引數 default_ 之類的" -"內容。可用的說明符號包括程式名稱 ``%(prog)s`` 以" -"及 :meth:`~ArgumentParser.add_argument` 的大多數關鍵字引數,例如 ``%" -"(default)s``、``%(type)s`` 等: ::" +"內容。可用的說明符號包括程式名稱 ``%(prog)s`` 以及 :meth:`~ArgumentParser." +"add_argument` 的大多數關鍵字引數,例如 ``%(default)s``、``%(type)s`` 等: ::" #: ../../library/argparse.rst:1221 msgid "" @@ -2576,8 +2573,8 @@ msgid "" "attribute on the :meth:`~ArgumentParser.parse_args` object is still " "determined by the dest_ value." msgstr "" -"請注意 ``metavar`` 只會更改\\ *顯示*\\ 的名稱" -"——:meth:`~ArgumentParser.parse_args` 物件上的屬性名稱仍由 dest_ 值決定。" +"請注意 ``metavar`` 只會更改\\ *顯示*\\ 的名稱——:meth:`~ArgumentParser." +"parse_args` 物件上的屬性名稱仍由 dest_ 值決定。" #: ../../library/argparse.rst:1298 msgid "" @@ -2625,11 +2622,10 @@ msgid "" "is normally supplied as the first argument to :meth:`~ArgumentParser." "add_argument`::" msgstr "" -"大多數 :class:`ArgumentParser` action 會將某個值作" -"為 :meth:`~ArgumentParser.parse_args` 回傳物件的屬性加入。此屬性的名稱" -"由 :meth:`~ArgumentParser.add_argument` 的 ``dest`` 關鍵字引數決定。對於位置" -"引數 action,``dest`` 通常作為 :meth:`~ArgumentParser.add_argument` 的第一個" -"引數提供: ::" +"大多數 :class:`ArgumentParser` action 會將某個值作為 :meth:`~ArgumentParser." +"parse_args` 回傳物件的屬性加入。此屬性的名稱由 :meth:`~ArgumentParser." +"add_argument` 的 ``dest`` 關鍵字引數決定。對於位置引數 action,``dest`` 通常" +"作為 :meth:`~ArgumentParser.add_argument` 的第一個引數提供: ::" #: ../../library/argparse.rst:1326 msgid "" @@ -2654,11 +2650,11 @@ msgid "" "characters to make sure the string is a valid attribute name. The examples " "below illustrate this behavior::" msgstr "" -"對於可選引數 action,``dest`` 的值通常從選項字串推" -"斷。:class:`ArgumentParser` 透過取第一個長選項字串並去除開頭的 ``--`` 字串來" -"產生 ``dest`` 的值。如果沒有提供長選項字串,``dest`` 會從第一個短選項字串去除" -"開頭的 ``-`` 字元來衍生。任何內部的 ``-`` 字元都會轉為 ``_`` 字元,以確保該字" -"串是有效的屬性名稱。以下範例說明了此行為: ::" +"對於可選引數 action,``dest`` 的值通常從選項字串推斷。:class:" +"`ArgumentParser` 透過取第一個長選項字串並去除開頭的 ``--`` 字串來產生 " +"``dest`` 的值。如果沒有提供長選項字串,``dest`` 會從第一個短選項字串去除開頭" +"的 ``-`` 字元來衍生。任何內部的 ``-`` 字元都會轉為 ``_`` 字元,以確保該字串是" +"有效的屬性名稱。以下範例說明了此行為: ::" #: ../../library/argparse.rst:1340 msgid "" @@ -2711,8 +2707,8 @@ msgstr "" "在專案的生命週期中,某些引數可能需要從命令列移除。在移除它們之前,你應告知使" "用者這些引數已棄用且即將移除。:meth:`~ArgumentParser.add_argument` 的 " "``deprecated`` 關鍵字引數(預設為 ``False``)指定引數是否已棄用並將在未來移" -"除。對於引數,如果 ``deprecated`` 為 ``True``,那麼使用該引數時會" -"向 :data:`sys.stderr` 印出警告: ::" +"除。對於引數,如果 ``deprecated`` 為 ``True``,那麼使用該引數時會向 :data:" +"`sys.stderr` 印出警告: ::" #: ../../library/argparse.rst:1371 msgid "" @@ -2746,8 +2742,8 @@ msgid "" "`~ArgumentParser.add_argument`." msgstr "" ":class:`!Action` 類別實作了 Action API,為一個可呼叫物件,會回傳能夠處理來自" -"命令列引數的可呼叫物件。任何遵循此 API 的物件都可以作為 ``action`` 參數傳" -"給 :meth:`~ArgumentParser.add_argument`。" +"命令列引數的可呼叫物件。任何遵循此 API 的物件都可以作為 ``action`` 參數傳給 :" +"meth:`~ArgumentParser.add_argument`。" #: ../../library/argparse.rst:1395 msgid "" @@ -2771,9 +2767,9 @@ msgid "" "is to call :meth:`!Action.__init__`." msgstr "" ":class:`!Action` 的實例(或任何傳給 ``action`` 參數的可呼叫物件的回傳值)應定" -"義 :attr:`!dest`、:attr:`!option_strings`、:attr:`!default`、:attr:`!" -"type`、:attr:`!required`、:attr:`!help` 等屬性。確保這些屬性被定義的最簡單方" -"式是呼叫 :meth:`!Action.__init__`。" +"義 :attr:`!dest`、:attr:`!option_strings`、:attr:`!default`、:attr:`!type`、:" +"attr:`!required`、:attr:`!help` 等屬性。確保這些屬性被定義的最簡單方式是呼" +"叫 :meth:`!Action.__init__`。" #: ../../library/argparse.rst:1409 msgid "" @@ -2794,9 +2790,8 @@ msgid "" "`~ArgumentParser.parse_args`. Most actions add an attribute to this object " "using :func:`setattr`." msgstr "" -"*namespace* - 將由 :meth:`~ArgumentParser.parse_args` 回傳" -"的 :class:`Namespace` 物件。大多數 action 使用 :func:`setattr` 將屬性加入此物" -"件。" +"*namespace* - 將由 :meth:`~ArgumentParser.parse_args` 回傳的 :class:" +"`Namespace` 物件。大多數 action 使用 :func:`setattr` 將屬性加入此物件。" #: ../../library/argparse.rst:1418 msgid "" @@ -2804,8 +2799,8 @@ msgid "" "applied. Type conversions are specified with the type_ keyword argument to :" "meth:`~ArgumentParser.add_argument`." msgstr "" -"*values* - 相關聯的命令列引數,已套用任何型別轉換。型別轉換透" -"過 :meth:`~ArgumentParser.add_argument` 的 type_ 關鍵字引數指定。" +"*values* - 相關聯的命令列引數,已套用任何型別轉換。型別轉換透過 :meth:" +"`~ArgumentParser.add_argument` 的 type_ 關鍵字引數指定。" #: ../../library/argparse.rst:1422 msgid "" @@ -3271,9 +3266,9 @@ msgid "" "to an already existing object, rather than a new :class:`Namespace` object. " "This can be achieved by specifying the ``namespace=`` keyword argument::" msgstr "" -"讓 :class:`ArgumentParser` 將屬性指定給已存在的物件而非新" -"的 :class:`Namespace` 物件也可能很有用。這可以透過指定 ``namespace=`` 關鍵字" -"引數來達成: ::" +"讓 :class:`ArgumentParser` 將屬性指定給已存在的物件而非新的 :class:" +"`Namespace` 物件也可能很有用。這可以透過指定 ``namespace=`` 關鍵字引數來達" +"成: ::" #: ../../library/argparse.rst:1658 msgid "" @@ -3321,12 +3316,12 @@ msgid "" msgstr "" "許多程式將其功能分割為數個子命令,例如 ``svn`` 程式可以呼叫 ``svn " "checkout``、``svn update`` 和 ``svn commit`` 等子命令。當程式執行多個需要不同" -"種類命令列引數的不同功能時,以這種方式分割功能是特別好的做" -"法。:class:`ArgumentParser` 透過 :meth:`!add_subparsers` 方法支援建立這類子命" -"令。:meth:`!add_subparsers` 方法通常不帶引數呼叫,並回傳一個特殊的 action 物" -"件。此物件有一個方法 :meth:`~_SubParsersAction.add_parser`,它接受命令名稱和" -"任何 :class:`!ArgumentParser` 建構函式引數,並回傳一個可以像往常一樣修改" -"的 :class:`!ArgumentParser` 物件。" +"種類命令列引數的不同功能時,以這種方式分割功能是特別好的做法。:class:" +"`ArgumentParser` 透過 :meth:`!add_subparsers` 方法支援建立這類子命令。:meth:" +"`!add_subparsers` 方法通常不帶引數呼叫,並回傳一個特殊的 action 物件。此物件" +"有一個方法 :meth:`~_SubParsersAction.add_parser`,它接受命令名稱和任何 :" +"class:`!ArgumentParser` 建構函式引數,並回傳一個可以像往常一樣修改的 :class:" +"`!ArgumentParser` 物件。" #: ../../library/argparse.rst:1692 msgid "Description of parameters:" @@ -3361,8 +3356,8 @@ msgid "" "*parser_class* - class which will be used to create sub-parser instances, by " "default the class of the current parser (e.g. :class:`ArgumentParser`)" msgstr "" -"*parser_class* - 將用來建立子剖析器實例的類別,預設為目前剖析器的類別(例" -"如 :class:`ArgumentParser`)" +"*parser_class* - 將用來建立子剖析器實例的類別,預設為目前剖析器的類別(例如 :" +"class:`ArgumentParser`)" #: ../../library/argparse.rst:1708 msgid "" @@ -3611,9 +3606,9 @@ msgid "" "that each subparser knows which Python function it should execute. For " "example::" msgstr "" -"處理子命令的一個特別有效的方式是將 :meth:`add_subparsers` 方法的使用" -"與 :meth:`set_defaults` 的呼叫結合,使每個子剖析器知道它應該執行哪個 Python " -"函式。例如: ::" +"處理子命令的一個特別有效的方式是將 :meth:`add_subparsers` 方法的使用與 :meth:" +"`set_defaults` 的呼叫結合,使每個子剖析器知道它應該執行哪個 Python 函式。例" +"如: ::" #: ../../library/argparse.rst:1838 msgid "" @@ -3767,8 +3762,8 @@ msgid "" "and :data:`sys.stdout` for writable :class:`FileType` objects::" msgstr "" "FileType 物件能理解偽引數 ``'-'``,並自動將其轉換為可讀 :class:`FileType` 物" -"件的 :data:`sys.stdin` 和可寫 :class:`FileType` 物件" -"的 :data:`sys.stdout`: ::" +"件的 :data:`sys.stdin` 和可寫 :class:`FileType` 物件的 :data:`sys." +"stdout`: ::" #: ../../library/argparse.rst:1915 msgid "" @@ -3811,8 +3806,8 @@ msgid "" "method::" msgstr "" "預設情況下,:class:`ArgumentParser` 在顯示說明訊息時會將命令列引數分成「位置" -"引數」和「選項」兩組。當引數有比此預設分組更好的概念性分組時,可以使" -"用 :meth:`!add_argument_group` 方法建立適當的群組: ::" +"引數」和「選項」兩組。當引數有比此預設分組更好的概念性分組時,可以使用 :meth:" +"`!add_argument_group` 方法建立適當的群組: ::" #: ../../library/argparse.rst:1946 msgid "" @@ -3848,11 +3843,11 @@ msgid "" "accepts *title* and *description* arguments which can be used to customize " "this display::" msgstr "" -":meth:`add_argument_group` 方法回傳一個引數群組物件,它具有與一" -"般 :class:`ArgumentParser` 相同的 :meth:`~ArgumentParser.add_argument` 方法。" -"當引數被加入群組時,剖析器會像處理正常引數一樣處理它,但在說明訊息中以獨立的" -"群組顯示該引數。:meth:`!add_argument_group` 方法接受 *title* 和 " -"*description* 引數,可以用來自訂此顯示: ::" +":meth:`add_argument_group` 方法回傳一個引數群組物件,它具有與一般 :class:" +"`ArgumentParser` 相同的 :meth:`~ArgumentParser.add_argument` 方法。當引數被加" +"入群組時,剖析器會像處理正常引數一樣處理它,但在說明訊息中以獨立的群組顯示該" +"引數。:meth:`!add_argument_group` 方法接受 *title* 和 *description* 引數,可" +"以用來自訂此顯示: ::" #: ../../library/argparse.rst:1965 msgid "" @@ -4045,9 +4040,9 @@ msgid "" "never supported, often failed to work correctly, and was unintentionally " "exposed through inheritance." msgstr "" -"在互斥群組上呼叫 :meth:`add_argument_group` " -"或 :meth:`add_mutually_exclusive_group` 現在會引發例外。這種巢狀用法從未支" -"援,通常無法正確運作,且是因為繼承而無意間被公開出來的。" +"在互斥群組上呼叫 :meth:`add_argument_group` 或 :meth:" +"`add_mutually_exclusive_group` 現在會引發例外。這種巢狀用法從未支援,通常無法" +"正確運作,且是因為繼承而無意間被公開出來的。" #: ../../library/argparse.rst:2065 msgid "Parser defaults" @@ -4110,16 +4105,16 @@ msgid "" "parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an " "example of this type." msgstr "" -"在使用多個剖析器時,剖析器層級的預設值可能特別有用。請參" -"閱 :meth:`~ArgumentParser.add_subparsers` 方法以了解這類範例。" +"在使用多個剖析器時,剖析器層級的預設值可能特別有用。請參閱 :meth:" +"`~ArgumentParser.add_subparsers` 方法以了解這類範例。" #: ../../library/argparse.rst:2097 msgid "" "Get the default value for a namespace attribute, as set by either :meth:" "`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" msgstr "" -"取得命名空間屬性的預設值,由 :meth:`~ArgumentParser.add_argument` " -"或 :meth:`~ArgumentParser.set_defaults` 設定: ::" +"取得命名空間屬性的預設值,由 :meth:`~ArgumentParser.add_argument` 或 :meth:" +"`~ArgumentParser.set_defaults` 設定: ::" #: ../../library/argparse.rst:2101 msgid "" @@ -4232,9 +4227,9 @@ msgid "" "it's just a prefix of one of its known options, instead of leaving it in the " "remaining arguments list." msgstr "" -":ref:`前綴匹配 `\\ 規則適用" -"於 :meth:`~ArgumentParser.parse_known_args`。即使選項只是其已知選項之一的前" -"綴,剖析器也可能消耗它,而非將其留在剩餘引數串列中。" +":ref:`前綴匹配 `\\ 規則適用於 :meth:`~ArgumentParser." +"parse_known_args`。即使選項只是其已知選項之一的前綴,剖析器也可能消耗它,而非" +"將其留在剩餘引數串列中。" #: ../../library/argparse.rst:2171 msgid "Customizing file parsing" @@ -4248,8 +4243,8 @@ msgid "" "reading." msgstr "" "從檔案讀取的引數(請參閱 :class:`ArgumentParser` 建構函式的 " -"*fromfile_prefix_chars* 關鍵字引數)每行讀取一個引數。可以覆" -"寫 :meth:`convert_arg_line_to_args` 以進行更精細的讀取。" +"*fromfile_prefix_chars* 關鍵字引數)每行讀取一個引數。可以覆寫 :meth:" +"`convert_arg_line_to_args` 以進行更精細的讀取。" #: ../../library/argparse.rst:2180 msgid "" @@ -4288,9 +4283,9 @@ msgid "" "if given, it prints a *message* to :data:`sys.stderr` before that. The user " "can override this method to handle these steps differently::" msgstr "" -"此方法終止程式,以指定的 *status* 退出,並在退出前(如果有提供的話)" -"向 :data:`sys.stderr` 印出一個 *message*。使用者可以覆寫此方法來以不同方式處" -"理這些步驟: ::" +"此方法終止程式,以指定的 *status* 退出,並在退出前(如果有提供的話)向 :data:" +"`sys.stderr` 印出一個 *message*。使用者可以覆寫此方法來以不同方式處理這些步" +"驟: ::" #: ../../library/argparse.rst:2201 msgid "" @@ -4325,9 +4320,9 @@ msgid "" "and :meth:`~ArgumentParser.parse_known_intermixed_args` methods support this " "parsing style." msgstr "" -"許多 Unix 命令允許使用者將可選引數與位置引數交錯使" -"用。:meth:`~ArgumentParser.parse_intermixed_args` " -"和 :meth:`~ArgumentParser.parse_known_intermixed_args` 方法支援此剖析風格。" +"許多 Unix 命令允許使用者將可選引數與位置引數交錯使用。:meth:`~ArgumentParser." +"parse_intermixed_args` 和 :meth:`~ArgumentParser." +"parse_known_intermixed_args` 方法支援此剖析風格。" #: ../../library/argparse.rst:2224 msgid "" @@ -4346,9 +4341,9 @@ msgid "" "former returns ``['2', '3']`` as unparsed arguments, while the latter " "collects all the positionals into ``rest``. ::" msgstr "" -"以下範例展示了 :meth:`~ArgumentParser.parse_known_args` " -"和 :meth:`~ArgumentParser.parse_intermixed_args` 之間的差異:前者回傳 " -"``['2', '3']`` 作為未剖析的引數,而後者將所有位置引數收集到 ``rest`` 中。 ::" +"以下範例展示了 :meth:`~ArgumentParser.parse_known_args` 和 :meth:" +"`~ArgumentParser.parse_intermixed_args` 之間的差異:前者回傳 ``['2', '3']`` " +"作為未剖析的引數,而後者將所有位置引數收集到 ``rest`` 中。 ::" #: ../../library/argparse.rst:2235 msgid "" @@ -4378,9 +4373,8 @@ msgid "" "there are any remaining unparsed argument strings." msgstr "" ":meth:`~ArgumentParser.parse_known_intermixed_args` 回傳一個二元素元組,包含" -"填充後的命名空間和剩餘引數字串的串" -"列。:meth:`~ArgumentParser.parse_intermixed_args` 在有任何剩餘未剖析的引數字" -"串時會引發錯誤。" +"填充後的命名空間和剩餘引數字串的串列。:meth:`~ArgumentParser." +"parse_intermixed_args` 在有任何剩餘未剖析的引數字串時會引發錯誤。" #: ../../library/argparse.rst:2253 msgid "Registering custom types or actions" diff --git a/library/ast.po b/library/ast.po index 7e4692bb7c..31ca867dea 100644 --- a/library/ast.po +++ b/library/ast.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-30 00:15+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,8 +26,9 @@ msgid "**Source code:** :source:`Lib/ast.py`" msgstr "**原始碼:**\\ :source:`Lib/ast.py`" #: ../../library/ast.rst:18 +#, fuzzy msgid "" -"The :mod:`ast` module helps Python applications to process trees of the " +"The :mod:`!ast` module helps Python applications to process trees of the " "Python abstract syntax grammar. The abstract syntax itself might change " "with each Python release; this module helps to find out programmatically " "what the current grammar looks like." @@ -240,11 +241,12 @@ msgid "Node classes" msgstr "節點 (Node) 類別" #: ../../library/ast.rst:46 +#, fuzzy msgid "" "This is the base of all AST node classes. The actual node classes are " "derived from the :file:`Parser/Python.asdl` file, which is reproduced :ref:" "`above `. They are defined in the :mod:`!_ast` C module " -"and re-exported in :mod:`ast`." +"and re-exported in :mod:`!ast`." msgstr "" "這是所有 AST 節點類別的基礎。實際的節點類別是衍生自 :file:`Parser/Python." "asdl` 檔案,該檔案在\\ :ref:`上方 ` 重現。它們被定義於 :" @@ -403,7 +405,8 @@ msgstr "以它們的值表示簡單索引,擴充切片 (slice) 則以元組 (t msgid "" "The :meth:`~object.__repr__` output of :class:`~ast.AST` nodes includes the " "values of the node fields." -msgstr ":class:`~ast.AST` 節點的 :meth:`~object.__repr__` 輸出包含節點欄位的值。" +msgstr "" +":class:`~ast.AST` 節點的 :meth:`~object.__repr__` 輸出包含節點欄位的值。" #: ../../library/ast.rst:144 msgid "" @@ -796,8 +799,8 @@ msgid "" "code is identical to the original and is intended for code generation." msgstr "" "如果 ``str`` 被設為 ``None``,則在呼叫 :func:`ast.unparse` 時會使用 " -"``value`` 來產生程式碼。這不再保證產生的程式碼與原始程式碼相同,且適用於程式碼" -"產生。" +"``value`` 來產生程式碼。這不再保證產生的程式碼與原始程式碼相同,且適用於程式" +"碼產生。" #: ../../library/ast.rst:375 msgid "-1: no conversion" @@ -3248,8 +3251,8 @@ msgid "" "A ``# type: ignore`` comment located at *lineno*. *tag* is the optional tag " "specified by the form ``# type: ignore ``." msgstr "" -"位於 *lineno* 的 ``# type: ignore`` 註解。*tag* 是以 " -"``# type: ignore `` 形式指定的可選標籤。" +"位於 *lineno* 的 ``# type: ignore`` 註解。*tag* 是以 ``# type: ignore " +"`` 形式指定的可選標籤。" #: ../../library/ast.rst:1831 msgid "" @@ -3303,8 +3306,8 @@ msgid "" "parameter is set to ``False`` (default). See :func:`ast.parse` for more " "details." msgstr "" -"當 *type_comments* 參數設為 ``False``\\ (預設值)時,不會產生 " -":class:`!TypeIgnore` 節點。更多細節請參閱 :func:`ast.parse`。" +"當 *type_comments* 參數設為 ``False``\\ (預設值)時,不會產生 :class:`!" +"TypeIgnore` 節點。更多細節請參閱 :func:`ast.parse`。" #: ../../library/ast.rst:1862 msgid "Type parameters" @@ -3924,12 +3927,14 @@ msgstr "" "出現的相同值中(例如 :class:`ast.Add`)。" #: ../../library/ast.rst:2221 -msgid ":mod:`ast` helpers" +#, fuzzy +msgid ":mod:`!ast` helpers" msgstr ":mod:`ast` 輔助程式" #: ../../library/ast.rst:2223 +#, fuzzy msgid "" -"Apart from the node classes, the :mod:`ast` module defines these utility " +"Apart from the node classes, the :mod:`!ast` module defines these utility " "functions and classes for traversing abstract syntax trees:" msgstr "" "除了節點類別之外,:mod:`ast` 模組還定義了這些用於遍歷 (traverse) 抽象語法樹的" @@ -4524,17 +4529,19 @@ msgid "" "check whether the ASTs are structurally equal but differ in whitespace or " "similar details. Attributes include line numbers and column offsets." msgstr "" -"*compare_attributes* 會影響比較時是否考慮 AST 屬性。如果 *compare_attributes* " -"為 ``False``\\ (預設值),則忽略屬性。否則所有屬性都必須相等。此選項用於檢查 " -"AST 在結構上是否相等,但在空白或類似細節上有所不同。屬性包括列號和行偏移量。" +"*compare_attributes* 會影響比較時是否考慮 AST 屬性。如果 " +"*compare_attributes* 為 ``False``\\ (預設值),則忽略屬性。否則所有屬性都必" +"須相等。此選項用於檢查 AST 在結構上是否相等,但在空白或類似細節上有所不同。屬" +"性包括列號和行偏移量。" #: ../../library/ast.rst:2596 msgid "Command-line usage" msgstr "命令列用法" #: ../../library/ast.rst:2600 +#, fuzzy msgid "" -"The :mod:`ast` module can be executed as a script from the command line. It " +"The :mod:`!ast` module can be executed as a script from the command line. It " "is as simple as:" msgstr ":mod:`ast` 模組可以作為腳本從命令列執行,可以像這樣簡單地做到:" diff --git a/library/atexit.po b/library/atexit.po index 2ad3f8cf56..761e3a3b12 100644 --- a/library/atexit.po +++ b/library/atexit.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2016-01-31 07:13+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -23,10 +23,11 @@ msgid ":mod:`!atexit` --- Exit handlers" msgstr ":mod:`!atexit` --- 退出處理函式" #: ../../library/atexit.rst:12 +#, fuzzy msgid "" -"The :mod:`atexit` module defines functions to register and unregister " +"The :mod:`!atexit` module defines functions to register and unregister " "cleanup functions. Functions thus registered are automatically executed " -"upon normal interpreter termination. :mod:`atexit` runs these functions in " +"upon normal interpreter termination. :mod:`!atexit` runs these functions in " "the *reverse* order in which they were registered; if you register ``A``, " "``B``, and ``C``, at interpreter termination time they will be run in the " "order ``C``, ``B``, ``A``." @@ -119,11 +120,12 @@ msgstr "" "`RuntimeError`。" #: ../../library/atexit.rst:64 +#, fuzzy msgid "" "Remove *func* from the list of functions to be run at interpreter shutdown. :" "func:`unregister` silently does nothing if *func* was not previously " "registered. If *func* has been registered more than once, every occurrence " -"of that function in the :mod:`atexit` call stack will be removed. Equality " +"of that function in the :mod:`!atexit` call stack will be removed. Equality " "comparisons (``==``) are used internally during unregistration, so function " "references do not need to have matching identities." msgstr "" @@ -137,14 +139,16 @@ msgid "Module :mod:`readline`" msgstr ":mod:`readline` 模組" #: ../../library/atexit.rst:75 +#, fuzzy msgid "" -"Useful example of :mod:`atexit` to read and write :mod:`readline` history " +"Useful example of :mod:`!atexit` to read and write :mod:`readline` history " "files." msgstr "" ":mod:`atexit` 用於讀取和寫入 :mod:`readline` 歷史檔案的一個不錯的範例。" #: ../../library/atexit.rst:82 -msgid ":mod:`atexit` Example" +#, fuzzy +msgid ":mod:`!atexit` Example" msgstr ":mod:`atexit` 範例" #: ../../library/atexit.rst:84 diff --git a/library/bdb.po b/library/bdb.po index 37f55c0b11..1e2376acf5 100644 --- a/library/bdb.po +++ b/library/bdb.po @@ -6,7 +6,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-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/bdb.py`" #: ../../library/bdb.rst:11 msgid "" -"The :mod:`bdb` module handles basic debugger functions, like setting " +"The :mod:`!bdb` module handles basic debugger functions, like setting " "breakpoints or managing execution via the debugger." msgstr "" @@ -40,7 +40,8 @@ msgid "Exception raised by the :class:`Bdb` class for quitting the debugger." msgstr "由 :class:`Bdb` 類別所引發的例外,用來退出偵錯器。" #: ../../library/bdb.rst:21 -msgid "The :mod:`bdb` module also defines two classes:" +#, fuzzy +msgid "The :mod:`!bdb` module also defines two classes:" msgstr ":mod:`bdb` 模組也定義了兩個類別:" #: ../../library/bdb.rst:25 @@ -60,10 +61,10 @@ msgstr "" #: ../../library/bdb.rst:33 msgid "" "When creating a breakpoint, its associated :attr:`file name ` should " -"be in canonical form. If a :attr:`funcname` is defined, a " -"breakpoint :attr:`hit ` will be counted when the first line of that " -"function is executed. A :attr:`conditional ` breakpoint always counts " -"a :attr:`hit `." +"be in canonical form. If a :attr:`funcname` is defined, a breakpoint :attr:" +"`hit ` will be counted when the first line of that function is " +"executed. A :attr:`conditional ` breakpoint always counts a :attr:" +"`hit `." msgstr "" #: ../../library/bdb.rst:39 @@ -157,8 +158,8 @@ msgstr "" #: ../../library/bdb.rst:110 msgid "" -"Dictionary of :class:`Breakpoint` instances indexed by " -"(:attr:`file`, :attr:`line`) tuples." +"Dictionary of :class:`Breakpoint` instances indexed by (:attr:`file`, :attr:" +"`line`) tuples." msgstr "" #: ../../library/bdb.rst:115 @@ -176,8 +177,8 @@ msgstr "" #: ../../library/bdb.rst:125 msgid "" "This class takes care of the details of the trace facility; a derived class " -"should implement user interaction. The standard debugger class " -"(:class:`pdb.Pdb`) is an example." +"should implement user interaction. The standard debugger class (:class:`pdb." +"Pdb`) is an example." msgstr "" #: ../../library/bdb.rst:129 @@ -192,13 +193,13 @@ msgstr "" #: ../../library/bdb.rst:135 msgid "" "The *backend* argument specifies the backend to use for :class:`Bdb`. It can " -"be either ``'settrace'`` or ``'monitoring'``. ``'settrace'`` " -"uses :func:`sys.settrace` which has the best backward compatibility. The " -"``'monitoring'`` backend uses the new :mod:`sys.monitoring` that was " -"introduced in Python 3.12, which can be much more efficient because it can " -"disable unused events. We are trying to keep the exact interfaces for both " -"backends, but there are some differences. The debugger developers are " -"encouraged to use the ``'monitoring'`` backend to achieve better performance." +"be either ``'settrace'`` or ``'monitoring'``. ``'settrace'`` uses :func:`sys." +"settrace` which has the best backward compatibility. The ``'monitoring'`` " +"backend uses the new :mod:`sys.monitoring` that was introduced in Python " +"3.12, which can be much more efficient because it can disable unused events. " +"We are trying to keep the exact interfaces for both backends, but there are " +"some differences. The debugger developers are encouraged to use the " +"``'monitoring'`` backend to achieve better performance." msgstr "" #: ../../library/bdb.rst:145 @@ -220,10 +221,10 @@ msgstr "" #: ../../library/bdb.rst:157 msgid "" -"For real file names, the canonical form is an operating-system-" -"dependent, :func:`case-normalized ` :func:`absolute path " -"`. A *filename* with angle brackets, such as " -"``\"\"`` generated in interactive mode, is returned unchanged." +"For real file names, the canonical form is an operating-system-dependent, :" +"func:`case-normalized ` :func:`absolute path `. A *filename* with angle brackets, such as ``\"\"`` " +"generated in interactive mode, is returned unchanged." msgstr "" #: ../../library/bdb.rst:164 @@ -234,14 +235,14 @@ msgstr "" #: ../../library/bdb.rst:171 msgid "" -"Stop tracing. For ``'settrace'`` backend, this method is equivalent to " -"``sys.settrace(None)``" +"Stop tracing. For ``'settrace'`` backend, this method is equivalent to ``sys." +"settrace(None)``" msgstr "" #: ../../library/bdb.rst:178 msgid "" -"Set the :attr:`!botframe`, :attr:`!stopframe`, :attr:`!returnframe` " -"and :attr:`quitting ` attributes with values ready to start " +"Set the :attr:`!botframe`, :attr:`!stopframe`, :attr:`!returnframe` and :" +"attr:`quitting ` attributes with values ready to start " "debugging." msgstr "" @@ -301,45 +302,44 @@ msgstr "" #: ../../library/bdb.rst:204 msgid "" "See the documentation for :func:`sys.settrace` for more information on the " -"trace function. For more information on code and frame objects, refer " -"to :ref:`types`." +"trace function. For more information on code and frame objects, refer to :" +"ref:`types`." msgstr "" #: ../../library/bdb.rst:210 msgid "" -"If the debugger should stop on the current line, invoke " -"the :meth:`user_line` method (which should be overridden in subclasses). " -"Raise a :exc:`BdbQuit` exception if the :attr:`quitting ` " -"flag is set (which can be set from :meth:`user_line`). Return a reference " -"to the :meth:`trace_dispatch` method for further tracing in that scope." +"If the debugger should stop on the current line, invoke the :meth:" +"`user_line` method (which should be overridden in subclasses). Raise a :exc:" +"`BdbQuit` exception if the :attr:`quitting ` flag is set " +"(which can be set from :meth:`user_line`). Return a reference to the :meth:" +"`trace_dispatch` method for further tracing in that scope." msgstr "" #: ../../library/bdb.rst:218 msgid "" -"If the debugger should stop on this function call, invoke " -"the :meth:`user_call` method (which should be overridden in subclasses). " -"Raise a :exc:`BdbQuit` exception if the :attr:`quitting ` " -"flag is set (which can be set from :meth:`user_call`). Return a reference " -"to the :meth:`trace_dispatch` method for further tracing in that scope." +"If the debugger should stop on this function call, invoke the :meth:" +"`user_call` method (which should be overridden in subclasses). Raise a :exc:" +"`BdbQuit` exception if the :attr:`quitting ` flag is set " +"(which can be set from :meth:`user_call`). Return a reference to the :meth:" +"`trace_dispatch` method for further tracing in that scope." msgstr "" #: ../../library/bdb.rst:226 msgid "" -"If the debugger should stop on this function return, invoke " -"the :meth:`user_return` method (which should be overridden in subclasses). " -"Raise a :exc:`BdbQuit` exception if the :attr:`quitting ` " -"flag is set (which can be set from :meth:`user_return`). Return a reference " -"to the :meth:`trace_dispatch` method for further tracing in that scope." +"If the debugger should stop on this function return, invoke the :meth:" +"`user_return` method (which should be overridden in subclasses). Raise a :" +"exc:`BdbQuit` exception if the :attr:`quitting ` flag is set " +"(which can be set from :meth:`user_return`). Return a reference to the :" +"meth:`trace_dispatch` method for further tracing in that scope." msgstr "" #: ../../library/bdb.rst:234 msgid "" -"If the debugger should stop at this exception, invokes " -"the :meth:`user_exception` method (which should be overridden in " -"subclasses). Raise a :exc:`BdbQuit` exception if the :attr:`quitting " -"` flag is set (which can be set from :meth:`user_exception`). " -"Return a reference to the :meth:`trace_dispatch` method for further tracing " -"in that scope." +"If the debugger should stop at this exception, invokes the :meth:" +"`user_exception` method (which should be overridden in subclasses). Raise a :" +"exc:`BdbQuit` exception if the :attr:`quitting ` flag is set " +"(which can be set from :meth:`user_exception`). Return a reference to the :" +"meth:`trace_dispatch` method for further tracing in that scope." msgstr "" #: ../../library/bdb.rst:240 @@ -390,8 +390,8 @@ msgstr "" #: ../../library/bdb.rst:275 msgid "" -"Called from :meth:`dispatch_line` when either :meth:`stop_here` " -"or :meth:`break_here` returns ``True``." +"Called from :meth:`dispatch_line` when either :meth:`stop_here` or :meth:" +"`break_here` returns ``True``." msgstr "" #: ../../library/bdb.rst:280 @@ -483,9 +483,9 @@ msgstr "" #: ../../library/bdb.rst:353 msgid "" -"Delete the breakpoint which has the index *arg* in " -"the :attr:`Breakpoint.bpbynumber`. If *arg* is not numeric or out of range, " -"return an error message." +"Delete the breakpoint which has the index *arg* in the :attr:`Breakpoint." +"bpbynumber`. If *arg* is not numeric or out of range, return an error " +"message." msgstr "" #: ../../library/bdb.rst:359 @@ -621,17 +621,17 @@ msgstr "最後,這個模組定義了以下函式:" #: ../../library/bdb.rst:464 msgid "" -"Return ``True`` if we should break here, depending on the way " -"the :class:`Breakpoint` *b* was set." +"Return ``True`` if we should break here, depending on the way the :class:" +"`Breakpoint` *b* was set." msgstr "" #: ../../library/bdb.rst:467 msgid "" -"If it was set via line number, it checks if :attr:`b.line " -"` is the same as the one in *frame*. If the breakpoint " -"was set via :attr:`function name `, we have to " -"check we are in the right *frame* (the right function) and if we are on its " -"first executable line." +"If it was set via line number, it checks if :attr:`b.line ` is the same as the one in *frame*. If the breakpoint was set via :" +"attr:`function name `, we have to check we are in " +"the right *frame* (the right function) and if we are on its first executable " +"line." msgstr "" #: ../../library/bdb.rst:476 @@ -642,16 +642,15 @@ msgstr "" #: ../../library/bdb.rst:479 msgid "" -"The *active breakpoint* is the first entry in :attr:`bplist " -"` for the (:attr:`file " -"`, :attr:`line `) (which must " -"exist) that is :attr:`enabled `, for " -"which :func:`checkfuncname` is true, and that has neither a " +"The *active breakpoint* is the first entry in :attr:`bplist ` for the (:attr:`file `, :attr:`line `) (which must exist) that is :attr:`enabled `, for which :func:`checkfuncname` is true, and that has neither a " "false :attr:`condition ` nor positive :attr:`ignore " "` count. The *flag*, meaning that a temporary " -"breakpoint should be deleted, is ``False`` only when the :attr:`cond " -"` cannot be evaluated (in which case, :attr:`ignore " -"` count is ignored)." +"breakpoint should be deleted, is ``False`` only when the :attr:`cond ` cannot be evaluated (in which case, :attr:`ignore ` count is ignored)." msgstr "" #: ../../library/bdb.rst:490 diff --git a/library/binascii.po b/library/binascii.po index 4cae1df2e3..830fa06d03 100644 --- a/library/binascii.po +++ b/library/binascii.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -23,10 +23,10 @@ msgstr ":mod:`!binascii` --- 在二進位制和 ASCII 之間轉換" #: ../../library/binascii.rst:13 msgid "" -"The :mod:`binascii` module contains a number of methods to convert between " +"The :mod:`!binascii` module contains a number of methods to convert between " "binary and various ASCII-encoded binary representations. Normally, you will " "not use these functions directly but use wrapper modules like :mod:`base64` " -"instead. The :mod:`binascii` module contains low-level functions written in " +"instead. The :mod:`!binascii` module contains low-level functions written in " "C for greater speed that are used by the higher-level modules." msgstr "" @@ -43,7 +43,8 @@ msgid "ASCII-only unicode strings are now accepted by the ``a2b_*`` functions." msgstr "" #: ../../library/binascii.rst:31 -msgid "The :mod:`binascii` module defines the following functions:" +#, fuzzy +msgid "The :mod:`!binascii` module defines the following functions:" msgstr ":mod:`binascii` 模組定義了以下函式:" #: ../../library/binascii.rst:36 diff --git a/library/bisect.po b/library/bisect.po index e18d196ae0..c3a9ea5452 100644 --- a/library/bisect.po +++ b/library/bisect.po @@ -10,7 +10,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-02-07 00:19+0000\n" "PO-Revision-Date: 2023-08-01 12:53+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -42,14 +42,15 @@ msgstr "" "善。" #: ../../library/bisect.rst:19 +#, fuzzy msgid "" -"The module is called :mod:`bisect` because it uses a basic bisection " +"The module is called :mod:`!bisect` because it uses a basic bisection " "algorithm to do its work. Unlike other bisection tools that search for a " "specific value, the functions in this module are designed to locate an " -"insertion point. Accordingly, the functions never call " -"an :meth:`~object.__eq__` method to determine whether a value has been " -"found. Instead, the functions only call the :meth:`~object.__lt__` method " -"and will return an insertion point between values in an array." +"insertion point. Accordingly, the functions never call an :meth:`~object." +"__eq__` method to determine whether a value has been found. Instead, the " +"functions only call the :meth:`~object.__lt__` method and will return an " +"insertion point between values in an array." msgstr "" "這個模組被稱為 :mod:`bisect` 是因為它使用基本二分演算法來完成其工作。不像其它" "搜尋特定值的二分法工具,本模組中的函式旨在定位插入點。因此,這些函式永遠不會" @@ -59,11 +60,12 @@ msgstr "" #: ../../library/bisect.rst:29 msgid "" "The functions in this module are not thread-safe. If multiple threads " -"concurrently use :mod:`bisect` functions on the same sequence, this may " +"concurrently use :mod:`!bisect` functions on the same sequence, this may " "result in undefined behaviour. Likewise, if the provided sequence is mutated " -"by a different thread while a :mod:`bisect` function is operating on it, the " -"result is undefined. For example, using :py:func:`~bisect.insort_left` on " -"the same list from multiple threads may result in the list becoming unsorted." +"by a different thread while a :mod:`!bisect` function is operating on it, " +"the result is undefined. For example, using :py:func:`~bisect.insort_left` " +"on the same list from multiple threads may result in the list becoming " +"unsorted." msgstr "" #: ../../library/bisect.rst:39 @@ -81,8 +83,8 @@ msgid "" msgstr "" "在 *a* 當中找到一個位置,讓 *x* 插入後 *a* 仍然是排序好的。參數 *lo* 和 *hi* " "用來指定 list 中應該被考慮的子區間,預設是考慮整個 list 。如果 *a* 裡面已經" -"有 *x* 出現,插入的位置會在所有 *x* 的前面(左邊)。回傳值可以被當作 " -"``list.insert()`` 的第一個參數,但列表 *a* 必須先排序過。" +"有 *x* 出現,插入的位置會在所有 *x* 的前面(左邊)。回傳值可以被當作 ``list." +"insert()`` 的第一個參數,但列表 *a* 必須先排序過。" #: ../../library/bisect.rst:51 msgid "" @@ -145,8 +147,8 @@ msgid "" "insertion point. Next, it runs the :meth:`~sequence.insert` method on *a* to " "insert *x* at the appropriate position to maintain sort order." msgstr "" -"此函式先使用 :py:func:`~bisect.bisect_left` 搜尋插入位置,接著用 :meth:`~sequence." -"insert` 於 *a* 以將 *x* 插入,並維持添加元素後的順序。" +"此函式先使用 :py:func:`~bisect.bisect_left` 搜尋插入位置,接著用 :meth:" +"`~sequence.insert` 於 *a* 以將 *x* 插入,並維持添加元素後的順序。" #: ../../library/bisect.rst:89 ../../library/bisect.rst:109 msgid "" @@ -176,8 +178,8 @@ msgid "" "insertion point. Next, it runs the :meth:`~sequence.insert` method on *a* to " "insert *x* at the appropriate position to maintain sort order." msgstr "" -"此函式先使用 :py:func:`~bisect.bisect_right` 搜尋插入位置,接著用 :meth:`~sequence." -"insert` 於 *a* 以將 *x* 插入,並維持添加元素後的順序。" +"此函式先使用 :py:func:`~bisect.bisect_right` 搜尋插入位置,接著用 :meth:" +"`~sequence.insert` 於 *a* 以將 *x* 插入,並維持添加元素後的順序。" #: ../../library/bisect.rst:120 msgid "Performance Notes" @@ -212,10 +214,10 @@ msgid "" "The search functions are stateless and discard key function results after " "they are used. Consequently, if the search functions are used in a loop, " "the key function may be called again and again on the same array elements. " -"If the key function isn't fast, consider wrapping it " -"with :py:func:`functools.cache` to avoid duplicate computations. " -"Alternatively, consider searching an array of precomputed keys to locate the " -"insertion point (as shown in the examples section below)." +"If the key function isn't fast, consider wrapping it with :py:func:" +"`functools.cache` to avoid duplicate computations. Alternatively, consider " +"searching an array of precomputed keys to locate the insertion point (as " +"shown in the examples section below)." msgstr "" "搜尋函式為無狀態的 (stateless),且鍵函式會在使用過後被丟棄。因此,如果搜尋函" "式被使用於迴圈當中,鍵函式會不斷被重複呼叫於相同的 list 元素。如果鍵函式執行" diff --git a/library/bz2.po b/library/bz2.po index 206e116b50..68e3cc20b9 100644 --- a/library/bz2.po +++ b/library/bz2.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-10 16:45+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,7 +32,8 @@ msgid "" msgstr "" #: ../../library/bz2.rst:19 -msgid "The :mod:`bz2` module contains:" +#, fuzzy +msgid "The :mod:`!bz2` module contains:" msgstr ":mod:`bz2` 模組包含:" #: ../../library/bz2.rst:21 @@ -407,7 +408,7 @@ msgid "Examples of usage" msgstr "用法範例" #: ../../library/bz2.rst:320 -msgid "Below are some examples of typical usage of the :mod:`bz2` module." +msgid "Below are some examples of typical usage of the :mod:`!bz2` module." msgstr "" #: ../../library/bz2.rst:322 diff --git a/library/calendar.po b/library/calendar.po index 1a974b314f..788c95db6d 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -6,7 +6,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-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -38,8 +38,8 @@ msgstr "" "這個模組讓你可以像 Unix 的 :program:`cal` 程式一樣輸出日曆,並額外提供有用的" "日曆相關函式。這些日曆預設把週一當作一週的第一天,而週日當作最後一天(歐洲的" "慣例)。可以使用 :func:`setfirstweekday` 設定一週的第一天為週日 (6) 或一週的" -"其它任一天,其中指定日期的參數是整數。相關功能參考 :mod:`datetime` " -"和 :mod:`time` 模組。" +"其它任一天,其中指定日期的參數是整數。相關功能參考 :mod:`datetime` 和 :mod:" +"`time` 模組。" #: ../../library/calendar.rst:22 msgid "" @@ -60,11 +60,11 @@ msgstr "" #: ../../library/calendar.rst:33 msgid "" "Creates a :class:`Calendar` object. *firstweekday* is an integer specifying " -"the first day of the week. :const:`MONDAY` is ``0`` (the " -"default), :const:`SUNDAY` is ``6``." +"the first day of the week. :const:`MONDAY` is ``0`` (the default), :const:" +"`SUNDAY` is ``6``." msgstr "" -"建立 :class:`Calendar` 物件。*firstweekday* 是一個指定一週第一天的整" -"數,:const:`MONDAY` 是 ``0``\\ (預設值),:const:`SUNDAY` 是 ``6``。" +"建立 :class:`Calendar` 物件。*firstweekday* 是一個指定一週第一天的整數,:" +"const:`MONDAY` 是 ``0``\\ (預設值),:const:`SUNDAY` 是 ``6``。" #: ../../library/calendar.rst:36 msgid "" @@ -85,9 +85,8 @@ msgstr "" #: ../../library/calendar.rst:47 msgid "" -"This property can also be set and read " -"using :meth:`~Calendar.setfirstweekday` " -"and :meth:`~Calendar.getfirstweekday` respectively." +"This property can also be set and read using :meth:`~Calendar." +"setfirstweekday` and :meth:`~Calendar.getfirstweekday` respectively." msgstr "" #: ../../library/calendar.rst:53 @@ -110,11 +109,11 @@ msgstr "" #: ../../library/calendar.rst:65 msgid "" "Return an iterator for the week day numbers that will be used for one week. " -"The first value from the iterator will be the same as the value of " -"the :attr:`~Calendar.firstweekday` property." +"The first value from the iterator will be the same as the value of the :attr:" +"`~Calendar.firstweekday` property." msgstr "" -"回傳一個以數字代表一週的每一天的疊代器 (iterator)。疊代器的第一個值" -"和 :attr:`~Calendar.firstweekday` 屬性的值一樣。" +"回傳一個以數字代表一週的每一天的疊代器 (iterator)。疊代器的第一個值和 :attr:" +"`~Calendar.firstweekday` 屬性的值一樣。" #: ../../library/calendar.rst:72 msgid "" @@ -128,10 +127,10 @@ msgstr "" #: ../../library/calendar.rst:80 msgid "" -"Return an iterator for the month *month* in the year *year* similar " -"to :meth:`itermonthdates`, but not restricted by the :class:`datetime.date` " -"range. Days returned will simply be day of the month numbers. For the days " -"outside of the specified month, the day number is ``0``." +"Return an iterator for the month *month* in the year *year* similar to :meth:" +"`itermonthdates`, but not restricted by the :class:`datetime.date` range. " +"Days returned will simply be day of the month numbers. For the days outside " +"of the specified month, the day number is ``0``." msgstr "" "類似 :meth:`itermonthdates`,回傳一個在 *year* 年 *month* 月的疊代器,但不受" "限於 :class:`datetime.date` 的範圍。回傳的日期單純是該月當日的數字,對於該月" @@ -139,10 +138,10 @@ msgstr "" #: ../../library/calendar.rst:88 msgid "" -"Return an iterator for the month *month* in the year *year* similar " -"to :meth:`itermonthdates`, but not restricted by the :class:`datetime.date` " -"range. Days returned will be tuples consisting of a day of the month number " -"and a week day number." +"Return an iterator for the month *month* in the year *year* similar to :meth:" +"`itermonthdates`, but not restricted by the :class:`datetime.date` range. " +"Days returned will be tuples consisting of a day of the month number and a " +"week day number." msgstr "" "類似 :meth:`itermonthdates`,回傳一個在 *year* 年 *month* 月的疊代器,但不受" "限於 :class:`datetime.date` 的範圍。回傳的日期是一個由該月當日的數字及代表週" @@ -150,10 +149,10 @@ msgstr "" #: ../../library/calendar.rst:96 msgid "" -"Return an iterator for the month *month* in the year *year* similar " -"to :meth:`itermonthdates`, but not restricted by the :class:`datetime.date` " -"range. Days returned will be tuples consisting of a year, a month and a day " -"of the month numbers." +"Return an iterator for the month *month* in the year *year* similar to :meth:" +"`itermonthdates`, but not restricted by the :class:`datetime.date` range. " +"Days returned will be tuples consisting of a year, a month and a day of the " +"month numbers." msgstr "" "類似 :meth:`itermonthdates`,回傳一個在 *year* 年 *month* 月的疊代器,但不受" "限於 :class:`datetime.date` 的範圍。回傳的日期是一個由年、月、日的數字組成的" @@ -161,10 +160,10 @@ msgstr "" #: ../../library/calendar.rst:106 msgid "" -"Return an iterator for the month *month* in the year *year* similar " -"to :meth:`itermonthdates`, but not restricted by the :class:`datetime.date` " -"range. Days returned will be tuples consisting of a year, a month, a day of " -"the month, and a day of the week numbers." +"Return an iterator for the month *month* in the year *year* similar to :meth:" +"`itermonthdates`, but not restricted by the :class:`datetime.date` range. " +"Days returned will be tuples consisting of a year, a month, a day of the " +"month, and a day of the week numbers." msgstr "" "類似 :meth:`itermonthdates`,回傳一個在 *year* 年 *month* 月的疊代器,但不受" "限於 :class:`datetime.date` 的範圍。回傳的日期是一個由年、月、日及代表週幾的" @@ -175,8 +174,8 @@ msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven :class:`datetime.date` objects." msgstr "" -"回傳一個在 *year* 年 *month* 月每一週組成的串列。每一週是一個串列,包含七" -"個 :class:`datetime.date` 物件。" +"回傳一個在 *year* 年 *month* 月每一週組成的串列。每一週是一個串列,包含七個 :" +"class:`datetime.date` 物件。" #: ../../library/calendar.rst:122 msgid "" @@ -207,8 +206,8 @@ msgstr "" #: ../../library/calendar.rst:143 msgid "" -"Return the data for the specified year ready for formatting (similar " -"to :meth:`yeardatescalendar`). Entries in the week lists are tuples of day " +"Return the data for the specified year ready for formatting (similar to :" +"meth:`yeardatescalendar`). Entries in the week lists are tuples of day " "numbers and weekday numbers. Day numbers outside this month are zero." msgstr "" "回傳用來格式化的指定年份的資料(類似 :meth:`yeardatescalendar`)。每一天是一" @@ -216,9 +215,9 @@ msgstr "" #: ../../library/calendar.rst:150 msgid "" -"Return the data for the specified year ready for formatting (similar " -"to :meth:`yeardatescalendar`). Entries in the week lists are day numbers. " -"Day numbers outside this month are zero." +"Return the data for the specified year ready for formatting (similar to :" +"meth:`yeardatescalendar`). Entries in the week lists are day numbers. Day " +"numbers outside this month are zero." msgstr "" "回傳用來格式化的指定年份的資料(類似 :meth:`yeardatescalendar`)。每一天是一" "個該月當日的數字,該月外的日期的該月當日數字為 0。" @@ -242,8 +241,8 @@ msgstr "" msgid "" "Return a single week in a string with no newline. If *w* is provided, it " "specifies the width of the date columns, which are centered. Depends on the " -"first weekday as specified in the constructor or set by " -"the :meth:`setfirstweekday` method." +"first weekday as specified in the constructor or set by the :meth:" +"`setfirstweekday` method." msgstr "" #: ../../library/calendar.rst:179 @@ -265,8 +264,8 @@ msgid "" "Return a month's calendar in a multi-line string. If *w* is provided, it " "specifies the width of the date columns, which are centered. If *l* is " "given, it specifies the number of lines that each week will use. Depends on " -"the first weekday as specified in the constructor or set by " -"the :meth:`setfirstweekday` method." +"the first weekday as specified in the constructor or set by the :meth:" +"`setfirstweekday` method." msgstr "" "以多行字串的形式回傳一個月份的日曆。如果給定 *w*,它會指定置中的日期欄的寬" "度。如果給定 *l*,它會指定每一週使用的行數。這個日曆會依據在建構函式中指定或" @@ -289,9 +288,9 @@ msgid "" "Return a *m*-column calendar for an entire year as a multi-line string. " "Optional parameters *w*, *l*, and *c* are for date column width, lines per " "week, and number of spaces between month columns, respectively. Depends on " -"the first weekday as specified in the constructor or set by " -"the :meth:`setfirstweekday` method. The earliest year for which a calendar " -"can be generated is platform-dependent." +"the first weekday as specified in the constructor or set by the :meth:" +"`setfirstweekday` method. The earliest year for which a calendar can be " +"generated is platform-dependent." msgstr "" "以多行字串的形式回傳有 *m* 欄的一整年的日曆。可選的參數 *w*、*l* 及 *c* 分別" "是日期欄寬度、每週行數及月份欄中間的空白數。這個日曆會依據在建構函式中指定或" @@ -409,15 +408,15 @@ msgstr "" #: ../../library/calendar.rst:313 msgid "" -"The CSS class for the whole year's table of tables (used " -"by :meth:`formatyear`). The default value is ``\"year\"``." +"The CSS class for the whole year's table of tables (used by :meth:" +"`formatyear`). The default value is ``\"year\"``." msgstr "" "整年表格的 CSS 類別(由 :meth:`formatyear` 所使用),預設值是 ``\"year\"``。" #: ../../library/calendar.rst:321 msgid "" -"The CSS class for the table head for the whole year (used " -"by :meth:`formatyear`). The default value is ``\"year\"``." +"The CSS class for the table head for the whole year (used by :meth:" +"`formatyear`). The default value is ``\"year\"``." msgstr "" "整年表格標題的 CSS 類別(由 :meth:`formatyear` 所使用),預設值是 " "``\"year\"``。" @@ -490,13 +489,13 @@ msgstr "這個模組提供以下函式給單純的文字日曆使用。" #: ../../library/calendar.rst:367 msgid "" "Sets the weekday (``0`` is Monday, ``6`` is Sunday) to start each week. The " -"values :const:`MONDAY`, :const:`TUESDAY`, :const:`WEDNESDAY`, :const:`THURSDAY`, :const:`FRIDAY`, :const:`SATURDAY`, " -"and :const:`SUNDAY` are provided for convenience. For example, to set the " -"first weekday to Sunday::" +"values :const:`MONDAY`, :const:`TUESDAY`, :const:`WEDNESDAY`, :const:" +"`THURSDAY`, :const:`FRIDAY`, :const:`SATURDAY`, and :const:`SUNDAY` are " +"provided for convenience. For example, to set the first weekday to Sunday::" msgstr "" -"設定一週的第一天(``0`` 是週一、``6`` 是週日)。提" -"供 :const:`MONDAY`、:const:`TUESDAY`、:const:`WEDNESDAY`、:const:`THURSDAY`、:const:`FRIDAY`、:const:`SATURDAY` " -"及 :const:`SUNDAY` 可以方便設定。例如設定一週的第一天為週日: ::" +"設定一週的第一天(``0`` 是週一、``6`` 是週日)。提供 :const:`MONDAY`、:const:" +"`TUESDAY`、:const:`WEDNESDAY`、:const:`THURSDAY`、:const:`FRIDAY`、:const:" +"`SATURDAY` 及 :const:`SUNDAY` 可以方便設定。例如設定一週的第一天為週日: ::" #: ../../library/calendar.rst:372 msgid "" @@ -561,11 +560,11 @@ msgstr "印出一個月份的日曆,跟 :func:`month` 回傳的內容一樣。 #: ../../library/calendar.rst:426 msgid "" -"Returns a month's calendar in a multi-line string using " -"the :meth:`~TextCalendar.formatmonth` of the :class:`TextCalendar` class." +"Returns a month's calendar in a multi-line string using the :meth:" +"`~TextCalendar.formatmonth` of the :class:`TextCalendar` class." msgstr "" -"以多行字串的形式回傳一個月的日曆,使用 :class:`TextCalendar` 類別" -"的 :meth:`~TextCalendar.formatmonth`。" +"以多行字串的形式回傳一個月的日曆,使用 :class:`TextCalendar` 類別的 :meth:" +"`~TextCalendar.formatmonth`。" #: ../../library/calendar.rst:432 msgid "" @@ -577,8 +576,8 @@ msgid "" "Returns a 3-column calendar for an entire year as a multi-line string using " "the :meth:`~TextCalendar.formatyear` of the :class:`TextCalendar` class." msgstr "" -"以多行字串回傳三欄形式的一整年日曆,使用 :class:`TextCalendar` 類別" -"的 :meth:`~TextCalendar.formatyear`。" +"以多行字串回傳三欄形式的一整年日曆,使用 :class:`TextCalendar` 類別的 :meth:" +"`~TextCalendar.formatyear`。" #: ../../library/calendar.rst:443 msgid "" @@ -588,13 +587,13 @@ msgid "" "encoding. In fact, :func:`time.gmtime` and :func:`timegm` are each others' " "inverse." msgstr "" -"一個跟日曆無關但方便的函式,它接受一個像 :mod:`time` 模組裡" -"的 :func:`~time.gmtime` 函式回傳的元組,並回傳對應的 Unix 時間戳,假設從 " -"1970 開始及 POSIX 編碼。事實上,:func:`time.gmtime` 和 :func:`timegm` 是彼此" -"相反的。" +"一個跟日曆無關但方便的函式,它接受一個像 :mod:`time` 模組裡的 :func:`~time." +"gmtime` 函式回傳的元組,並回傳對應的 Unix 時間戳,假設從 1970 開始及 POSIX 編" +"碼。事實上,:func:`time.gmtime` 和 :func:`timegm` 是彼此相反的。" #: ../../library/calendar.rst:450 -msgid "The :mod:`calendar` module exports the following data attributes:" +#, fuzzy +msgid "The :mod:`!calendar` module exports the following data attributes:" msgstr ":mod:`calendar` 模組匯出以下資料屬性:" #: ../../library/calendar.rst:454 @@ -618,11 +617,11 @@ msgstr "一週每一天的別名,其中 ``MONDAY`` 是 ``0`` 而 ``SUNDAY`` #: ../../library/calendar.rst:487 msgid "" "Enumeration defining days of the week as integer constants. The members of " -"this enumeration are exported to the module scope as :data:`MONDAY` " -"through :data:`SUNDAY`." +"this enumeration are exported to the module scope as :data:`MONDAY` through :" +"data:`SUNDAY`." msgstr "" -"將一週中的幾天定義為整數常數的列舉。此列舉的成員將作為 :data:`MONDAY` " -"到 :data:`SUNDAY` 匯出到模組作用域。" +"將一週中的幾天定義為整數常數的列舉。此列舉的成員將作為 :data:`MONDAY` 到 :" +"data:`SUNDAY` 匯出到模組作用域。" #: ../../library/calendar.rst:496 msgid "" @@ -655,11 +654,12 @@ msgid "" "this enumeration are exported to the module scope as :data:`JANUARY` " "through :data:`DECEMBER`." msgstr "" -"將一年中的月份定義為整數常數的列舉。此列舉的成員將作為 :data:`JANUARY` " -"到 :data:`DECEMBER` 匯出到模組作用域。" +"將一年中的月份定義為整數常數的列舉。此列舉的成員將作為 :data:`JANUARY` 到 :" +"data:`DECEMBER` 匯出到模組作用域。" #: ../../library/calendar.rst:543 -msgid "The :mod:`calendar` module defines the following exceptions:" +#, fuzzy +msgid "The :mod:`!calendar` module defines the following exceptions:" msgstr ":mod:`calendar` 模組定義了以下例外:" #: ../../library/calendar.rst:547 @@ -707,9 +707,10 @@ msgid "Command-line usage" msgstr "命令列用法" #: ../../library/calendar.rst:582 +#, fuzzy msgid "" -"The :mod:`calendar` module can be executed as a script from the command line " -"to interactively print a calendar." +"The :mod:`!calendar` module can be executed as a script from the command " +"line to interactively print a calendar." msgstr ":mod:`calendar` 模組可以作為腳本從命令列執行,並以互動方式列印日曆。" #: ../../library/calendar.rst:585 @@ -818,8 +819,8 @@ msgstr "用於月份和週幾名稱的語系。預設為英語。" #: ../../library/calendar.rst:653 msgid "" -"The encoding to use for output. :option:`--encoding` is required " -"if :option:`--locale` is set." +"The encoding to use for output. :option:`--encoding` is required if :option:" +"`--locale` is set." msgstr "" "用於輸出的編碼。如有設定 :option:`--locale` 則必須給定 :option:`--encoding`。" diff --git a/library/cmath.po b/library/cmath.po index 1106996067..238de7efec 100644 --- a/library/cmath.po +++ b/library/cmath.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-15 00:16+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2024-03-14 09:26+0800\n" "Last-Translator: Enkai Huang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -407,10 +407,11 @@ msgstr "" "-3.141592653589793" #: ../../library/cmath.rst:125 +#, fuzzy msgid "" "The modulus (absolute value) of a complex number *z* can be computed using " -"the built-in :func:`abs` function. There is no separate :mod:`cmath` module " -"function for this operation." +"the built-in :func:`abs` function. There is no separate :mod:`!cmath` " +"module function for this operation." msgstr "" "複數 *z* 的絕對值可以使用內建的 :func:`abs` 函式計算。沒有單獨的 :mod:" "`cmath` 模組函式適用於此操作。" @@ -647,7 +648,8 @@ msgstr "實部為零和虛部為正無窮的複數。相當於 ``complex(0.0, fl msgid "" "A floating-point \"not a number\" (NaN) value. Equivalent to " "``float('nan')``. See also :data:`math.nan`." -msgstr "浮點「非數字」 (NaN) 值。相當於 ``float('nan')``。另請參閱 :data:`math.nan`。" +msgstr "" +"浮點「非數字」 (NaN) 值。相當於 ``float('nan')``。另請參閱 :data:`math.nan`。" #: ../../library/cmath.rst:348 msgid "" @@ -656,13 +658,14 @@ msgid "" msgstr "實部為零和虛部為 NaN 的複數。相當於 ``complex(0.0, float('nan'))``。" #: ../../library/cmath.rst:356 +#, fuzzy msgid "" "Note that the selection of functions is similar, but not identical, to that " "in module :mod:`math`. The reason for having two modules is that some users " "aren't interested in complex numbers, and perhaps don't even know what they " "are. They would rather have ``math.sqrt(-1)`` raise an exception than " -"return a complex number. Also note that the functions defined in :mod:" -"`cmath` always return a complex number, even if the answer can be expressed " +"return a complex number. Also note that the functions defined in :mod:`!" +"cmath` always return a complex number, even if the answer can be expressed " "as a real number (in which case the complex number has an imaginary part of " "zero)." msgstr "" diff --git a/library/cmd.po b/library/cmd.po index 5dcd7a7a48..665fdc2b4c 100644 --- a/library/cmd.po +++ b/library/cmd.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2025-05-19 20:25+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -45,8 +45,8 @@ msgid "" "methods." msgstr "" ":class:`Cmd` 實例或其子類別實例是一種列導向的直譯器架構。通常沒有必要直接實例" -"化 :class:`Cmd` 本身;它更適合作為你自己定義的直譯器類別的父類別,讓你能繼承 :" -"class:`Cmd` 的方法,並封裝動作方法。" +"化 :class:`Cmd` 本身;它更適合作為你自己定義的直譯器類別的父類別,讓你能繼" +"承 :class:`Cmd` 的方法,並封裝動作方法。" #: ../../library/cmd.rst:25 msgid "" @@ -370,9 +370,10 @@ msgid "Cmd Example" msgstr "Cmd 範例" #: ../../library/cmd.rst:248 +#, fuzzy msgid "" -"The :mod:`cmd` module is mainly useful for building custom shells that let a " -"user work with a program interactively." +"The :mod:`!cmd` module is mainly useful for building custom shells that let " +"a user work with a program interactively." msgstr "" ":mod:`cmd` module 主要用於建構自訂 shell,讓使用者能以互動方式操作程式。" diff --git a/library/codecs.po b/library/codecs.po index ab26604c3e..a404b2919c 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-22 16:55+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -364,7 +364,7 @@ msgstr "" #: ../../library/codecs.rst:313 msgid "" -"The :mod:`codecs` module defines a set of base classes which define the " +"The :mod:`!codecs` module defines a set of base classes which define the " "interfaces for working with codec objects, and can also be used as the basis " "for custom codec implementations." msgstr "" diff --git a/library/codeop.po b/library/codeop.po index 61d65f1399..ff1b79e4d2 100644 --- a/library/codeop.po +++ b/library/codeop.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-09 00:03+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2024-09-24 20:28+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,8 +28,9 @@ msgid "**Source code:** :source:`Lib/codeop.py`" msgstr "**原始碼:**\\ :source:`Lib/codeop.py`" #: ../../library/codeop.rst:14 +#, fuzzy msgid "" -"The :mod:`codeop` module provides utilities upon which the Python read-eval-" +"The :mod:`!codeop` module provides utilities upon which the Python read-eval-" "print loop can be emulated, as is done in the :mod:`code` module. As a " "result, you probably don't want to use the module directly; if you want to " "include such a loop in your program you probably want to use the :mod:`code` " @@ -60,9 +61,10 @@ msgstr "" "編譯。" #: ../../library/codeop.rst:28 +#, fuzzy msgid "" -"The :mod:`codeop` module provides a way of doing each of these things, and a " -"way of doing them both." +"The :mod:`!codeop` module provides a way of doing each of these things, and " +"a way of doing them both." msgstr "" ":mod:`codeop` 模組提供了一種完成上述每項任務的方法,以及同時完成這兩項任務的" "方法。" diff --git a/library/colorsys.po b/library/colorsys.po index 2259120e20..6b747b6c28 100644 --- a/library/colorsys.po +++ b/library/colorsys.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2022-02-15 20:58+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,10 +29,11 @@ msgid "**Source code:** :source:`Lib/colorsys.py`" msgstr "**原始碼:**\\ :source:`Lib/colorsys.py`" #: ../../library/colorsys.rst:13 +#, fuzzy msgid "" -"The :mod:`colorsys` module defines bidirectional conversions of color values " -"between colors expressed in the RGB (Red Green Blue) color space used in " -"computer monitors and three other coordinate systems: YIQ, HLS (Hue " +"The :mod:`!colorsys` module defines bidirectional conversions of color " +"values between colors expressed in the RGB (Red Green Blue) color space used " +"in computer monitors and three other coordinate systems: YIQ, HLS (Hue " "Lightness Saturation) and HSV (Hue Saturation Value). Coordinates in all of " "these color spaces are floating-point values. In the YIQ space, the Y " "coordinate is between 0 and 1, but the I and Q coordinates can be positive " @@ -54,7 +55,8 @@ msgstr "" "cambridgeincolour.com/tutorials/color-spaces.htm。" #: ../../library/colorsys.rst:27 -msgid "The :mod:`colorsys` module defines the following functions:" +#, fuzzy +msgid "The :mod:`!colorsys` module defines the following functions:" msgstr ":mod:`colorsys` 模組定義了以下函式:" #: ../../library/colorsys.rst:32 diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 00947fbd24..22be706c61 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-11 00:17+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2023-01-24 03:33+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -34,8 +34,9 @@ msgstr "" "interpreter.py`" #: ../../library/concurrent.futures.rst:15 +#, fuzzy msgid "" -"The :mod:`concurrent.futures` module provides a high-level interface for " +"The :mod:`!concurrent.futures` module provides a high-level interface for " "asynchronously executing callables." msgstr "" ":mod:`concurrent.futures` 模組提供了一個高階介面來非同步地 (asynchronously) " diff --git a/library/configparser.po b/library/configparser.po index 7354b91f23..2c0f3b1c96 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -6,7 +6,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-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -109,7 +109,7 @@ msgstr "" msgid "" "The structure of INI files is described `in the following section " "<#supported-ini-file-structure>`_. Essentially, the file consists of " -"sections, each of which contains keys with values. :mod:`configparser` " +"sections, each of which contains keys with values. :mod:`!configparser` " "classes can read and write such files. Let's start by creating the above " "configuration file programmatically." msgstr "" @@ -233,12 +233,12 @@ msgstr "" #: ../../library/configparser.rst:148 ../../library/configparser.rst:1003 msgid "" -"It is possible to read several configurations into a " -"single :class:`ConfigParser`, where the most recently added configuration " -"has the highest priority. Any conflicting keys are taken from the more " -"recent configuration while the previously existing keys are retained. The " -"example below reads in an ``override.ini`` file, which will override any " -"conflicting keys from the ``example.ini`` file." +"It is possible to read several configurations into a single :class:" +"`ConfigParser`, where the most recently added configuration has the highest " +"priority. Any conflicting keys are taken from the more recent configuration " +"while the previously existing keys are retained. The example below reads in " +"an ``override.ini`` file, which will override any conflicting keys from the " +"``example.ini`` file." msgstr "" #: ../../library/configparser.rst:155 ../../library/configparser.rst:1010 @@ -384,10 +384,10 @@ msgstr "" #: ../../library/configparser.rst:241 msgid "" -"One more thing to be aware of is that the parser-" -"level :meth:`~ConfigParser.get` method provides a custom, more complex " -"interface, maintained for backwards compatibility. When using this method, " -"a fallback value can be provided via the ``fallback`` keyword-only argument:" +"One more thing to be aware of is that the parser-level :meth:`~ConfigParser." +"get` method provides a custom, more complex interface, maintained for " +"backwards compatibility. When using this method, a fallback value can be " +"provided via the ``fallback`` keyword-only argument:" msgstr "" #: ../../library/configparser.rst:246 @@ -402,9 +402,9 @@ msgstr "" #: ../../library/configparser.rst:252 msgid "" -"The same ``fallback`` argument can be used with " -"the :meth:`~ConfigParser.getint`, :meth:`~ConfigParser.getfloat` " -"and :meth:`~ConfigParser.getboolean` methods, for example:" +"The same ``fallback`` argument can be used with the :meth:`~ConfigParser." +"getint`, :meth:`~ConfigParser.getfloat` and :meth:`~ConfigParser.getboolean` " +"methods, for example:" msgstr "" #: ../../library/configparser.rst:256 @@ -590,8 +590,8 @@ msgstr "" #: ../../library/configparser.rst:396 msgid "" -"With ``interpolation`` set to ``None``, the parser would simply return ``%" -"(my_dir)s/Pictures`` as the value of ``my_pictures`` and ``%(home_dir)s/" +"With ``interpolation`` set to ``None``, the parser would simply return " +"``%(my_dir)s/Pictures`` as the value of ``my_pictures`` and ``%(home_dir)s/" "lumberjack`` as the value of ``my_dir``." msgstr "" @@ -600,9 +600,9 @@ msgid "" "An alternative handler for interpolation which implements a more advanced " "syntax, used for instance in ``zc.buildout``. Extended interpolation is " "using ``${section:option}`` to denote a value from a foreign section. " -"Interpolation can span multiple levels. For convenience, if the " -"``section:`` part is omitted, interpolation defaults to the current section " -"(and possibly the default values from the special section)." +"Interpolation can span multiple levels. For convenience, if the ``section:" +"`` part is omitted, interpolation defaults to the current section (and " +"possibly the default values from the special section)." msgstr "" #: ../../library/configparser.rst:411 @@ -671,8 +671,8 @@ msgstr "" #: ../../library/configparser.rst:451 msgid "" "Mapping protocol access is a generic name for functionality that enables " -"using custom objects as if they were dictionaries. In case " -"of :mod:`configparser`, the mapping interface implementation is using the " +"using custom objects as if they were dictionaries. In case of :mod:`!" +"configparser`, the mapping interface implementation is using the " "``parser['section']['option']`` notation." msgstr "" @@ -687,10 +687,10 @@ msgstr "" #: ../../library/configparser.rst:462 msgid "" -":mod:`configparser` objects behave as close to actual dictionaries as " -"possible. The mapping interface is complete and adheres to " -"the :class:`~collections.abc.MutableMapping` ABC. However, there are a few " -"differences that should be taken into account:" +":mod:`!configparser` objects behave as close to actual dictionaries as " +"possible. The mapping interface is complete and adheres to the :class:" +"`~collections.abc.MutableMapping` ABC. However, there are a few differences " +"that should be taken into account:" msgstr "" #: ../../library/configparser.rst:467 @@ -712,8 +712,8 @@ msgstr "" #: ../../library/configparser.rst:475 msgid "" -"All sections include ``DEFAULTSECT`` values as well which means that " -"``.clear()`` on a section may not leave the section visibly empty. This is " +"All sections include ``DEFAULTSECT`` values as well which means that ``." +"clear()`` on a section may not leave the section visibly empty. This is " "because default values cannot be deleted from the section (because " "technically they are not there). If they are overridden in the section, " "deleting causes the default value to be visible again. Trying to delete a " @@ -747,10 +747,10 @@ msgstr "" msgid "" "``parser.items()`` is compatible with the mapping protocol (returns a list " "of *section_name*, *section_proxy* pairs including the DEFAULTSECT). " -"However, this method can also be invoked with arguments: " -"``parser.items(section, raw, vars)``. The latter call returns a list of " -"*option*, *value* pairs for a specified ``section``, with all interpolations " -"expanded (unless ``raw=True`` is provided)." +"However, this method can also be invoked with arguments: ``parser." +"items(section, raw, vars)``. The latter call returns a list of *option*, " +"*value* pairs for a specified ``section``, with all interpolations expanded " +"(unless ``raw=True`` is provided)." msgstr "" #: ../../library/configparser.rst:501 @@ -767,7 +767,7 @@ msgstr "" #: ../../library/configparser.rst:509 msgid "" "There are nearly as many INI format variants as there are applications using " -"it. :mod:`configparser` goes a long way to provide support for the largest " +"it. :mod:`!configparser` goes a long way to provide support for the largest " "sensible set of INI styles available. The default functionality is mainly " "dictated by historical background and it's very likely that you will want to " "customize some of the features." @@ -793,8 +793,8 @@ msgstr "" #: ../../library/configparser.rst:525 msgid "" -"Hint: if you want to specify default values for a specific section, " -"use :meth:`~ConfigParser.read_dict` before you read the actual file." +"Hint: if you want to specify default values for a specific section, use :" +"meth:`~ConfigParser.read_dict` before you read the actual file." msgstr "" #: ../../library/configparser.rst:528 @@ -863,9 +863,9 @@ msgstr "" #: ../../library/configparser.rst:562 msgid "" "Some configuration files are known to include settings without values, but " -"which otherwise conform to the syntax supported by :mod:`configparser`. The " -"*allow_no_value* parameter to the constructor can be used to indicate that " -"such values should be accepted:" +"which otherwise conform to the syntax supported by :mod:`!configparser`. " +"The *allow_no_value* parameter to the constructor can be used to indicate " +"that such values should be accepted:" msgstr "" #: ../../library/configparser.rst:567 @@ -912,8 +912,8 @@ msgstr "" #: ../../library/configparser.rst:603 msgid "" -"See also the *space_around_delimiters* argument " -"to :meth:`ConfigParser.write`." +"See also the *space_around_delimiters* argument to :meth:`ConfigParser." +"write`." msgstr "" #: ../../library/configparser.rst:606 @@ -936,7 +936,7 @@ msgstr "" #: ../../library/configparser.rst:617 msgid "" -"In previous versions of :mod:`configparser` behaviour matched " +"In previous versions of :mod:`!configparser` behaviour matched " "``comment_prefixes=('#',';')`` and ``inline_comment_prefixes=(';',)``." msgstr "" @@ -999,15 +999,14 @@ msgstr "" #: ../../library/configparser.rst:669 msgid "" "When set to ``True``, the parser will not allow for any section or option " -"duplicates while reading from a single source " -"(using :meth:`~ConfigParser.read_file`, :meth:`~ConfigParser.read_string` " -"or :meth:`~ConfigParser.read_dict`). It is recommended to use strict " -"parsers in new applications." +"duplicates while reading from a single source (using :meth:`~ConfigParser." +"read_file`, :meth:`~ConfigParser.read_string` or :meth:`~ConfigParser." +"read_dict`). It is recommended to use strict parsers in new applications." msgstr "" #: ../../library/configparser.rst:674 msgid "" -"In previous versions of :mod:`configparser` behaviour matched " +"In previous versions of :mod:`!configparser` behaviour matched " "``strict=False``." msgstr "" @@ -1063,9 +1062,9 @@ msgid "" "other valid section name. Some typical values include: ``\"general\"`` or " "``\"common\"``. The name provided is used for recognizing default sections " "when reading from any source and is used when writing configuration back to " -"a file. Its current value can be retrieved using the " -"``parser_instance.default_section`` attribute and may be modified at runtime " -"(i.e. to convert files from one format to another)." +"a file. Its current value can be retrieved using the ``parser_instance." +"default_section`` attribute and may be modified at runtime (i.e. to convert " +"files from one format to another)." msgstr "" #: ../../library/configparser.rst:715 @@ -1078,8 +1077,8 @@ msgid "" "through the *interpolation* argument. ``None`` can be used to turn off " "interpolation completely, ``ExtendedInterpolation()`` provides a more " "advanced variant inspired by ``zc.buildout``. More on the subject in the " -"`dedicated documentation section <#interpolation-of-" -"values>`_. :class:`RawConfigParser` has a default value of ``None``." +"`dedicated documentation section <#interpolation-of-values>`_. :class:" +"`RawConfigParser` has a default value of ``None``." msgstr "" #: ../../library/configparser.rst:724 @@ -1093,9 +1092,9 @@ msgid "" "and :meth:`~ConfigParser.getboolean` are implemented. Should other getters " "be desirable, users may define them in a subclass or pass a dictionary where " "each key is a name of the converter and each value is a callable " -"implementing said conversion. For instance, passing ``{'decimal': " -"decimal.Decimal}`` would add :meth:`!getdecimal` on both the parser object " -"and all section proxies. In other words, it will be possible to write both " +"implementing said conversion. For instance, passing ``{'decimal': decimal." +"Decimal}`` would add :meth:`!getdecimal` on both the parser object and all " +"section proxies. In other words, it will be possible to write both " "``parser_instance.getdecimal('section', 'key', fallback=0)`` and " "``parser_instance['section'].getdecimal('key', 0)``." msgstr "" @@ -1271,7 +1270,7 @@ msgstr "" #: ../../library/configparser.rst:845 msgid "" -"Mainly because of backwards compatibility concerns, :mod:`configparser` " +"Mainly because of backwards compatibility concerns, :mod:`!configparser` " "provides also a legacy API with explicit ``get``/``set`` methods. While " "there are valid use cases for the methods outlined below, mapping protocol " "access is preferred for new projects. The legacy API is at times more " @@ -1413,13 +1412,13 @@ msgstr "" msgid "" "When *strict* is ``True`` (the default), the parser won't allow for any " "section or option duplicates while reading from a single source (file, " -"string or dictionary), raising :exc:`DuplicateSectionError` " -"or :exc:`DuplicateOptionError`. When *empty_lines_in_values* is ``False`` " -"(default: ``True``), each empty line marks the end of an option. Otherwise, " -"internal empty lines of a multiline option are kept as part of the value. " -"When *allow_no_value* is ``True`` (default: ``False``), options without " -"values are accepted; the value held for these is ``None`` and they are " -"serialized without the trailing delimiter." +"string or dictionary), raising :exc:`DuplicateSectionError` or :exc:" +"`DuplicateOptionError`. When *empty_lines_in_values* is ``False`` (default: " +"``True``), each empty line marks the end of an option. Otherwise, internal " +"empty lines of a multiline option are kept as part of the value. When " +"*allow_no_value* is ``True`` (default: ``False``), options without values " +"are accepted; the value held for these is ``None`` and they are serialized " +"without the trailing delimiter." msgstr "" #: ../../library/configparser.rst:974 @@ -1443,11 +1442,11 @@ msgstr "" #: ../../library/configparser.rst:987 msgid "" -"All option names used in interpolation will be passed through " -"the :meth:`optionxform` method just like any other option name reference. " -"For example, using the default implementation of :meth:`optionxform` (which " -"converts option names to lower case), the values ``foo %(bar)s`` and ``foo %" -"(BAR)s`` are equivalent." +"All option names used in interpolation will be passed through the :meth:" +"`optionxform` method just like any other option name reference. For " +"example, using the default implementation of :meth:`optionxform` (which " +"converts option names to lower case), the values ``foo %(bar)s`` and ``foo " +"%(BAR)s`` are equivalent." msgstr "" #: ../../library/configparser.rst:993 @@ -1537,9 +1536,9 @@ msgstr "" #: ../../library/configparser.rst:1090 msgid "" -"If the given *section* exists, and contains the given *option*, " -"return :const:`True`; otherwise return :const:`False`. If the specified " -"*section* is :const:`None` or an empty string, DEFAULT is assumed." +"If the given *section* exists, and contains the given *option*, return :" +"const:`True`; otherwise return :const:`False`. If the specified *section* " +"is :const:`None` or an empty string, DEFAULT is assumed." msgstr "" #: ../../library/configparser.rst:1097 @@ -1563,8 +1562,8 @@ msgstr "" msgid "" "If none of the named files exist, the :class:`ConfigParser` instance will " "contain an empty dataset. An application which requires initial values to " -"be loaded from a file should load the required file or files " -"using :meth:`read_file` before calling :meth:`read` for any optional files::" +"be loaded from a file should load the required file or files using :meth:" +"`read_file` before calling :meth:`read` for any optional files::" msgstr "" #: ../../library/configparser.rst:1115 @@ -1688,9 +1687,9 @@ msgid "" "``'1'``, ``'yes'``, ``'true'``, and ``'on'``, which cause this method to " "return ``True``, and ``'0'``, ``'no'``, ``'false'``, and ``'off'``, which " "cause it to return ``False``. These string values are checked in a case-" -"insensitive manner. Any other value will cause it to " -"raise :exc:`ValueError`. See :meth:`get` for explanation of *raw*, *vars* " -"and *fallback*." +"insensitive manner. Any other value will cause it to raise :exc:" +"`ValueError`. See :meth:`get` for explanation of *raw*, *vars* and " +"*fallback*." msgstr "" #: ../../library/configparser.rst:1219 @@ -1702,8 +1701,8 @@ msgstr "" #: ../../library/configparser.rst:1222 msgid "" "Otherwise, return a list of *name*, *value* pairs for the options in the " -"given *section*. Optional arguments have the same meaning as for " -"the :meth:`get` method." +"given *section*. Optional arguments have the same meaning as for the :meth:" +"`get` method." msgstr "" #: ../../library/configparser.rst:1226 @@ -1794,9 +1793,9 @@ msgstr "" #: ../../library/configparser.rst:1300 msgid "" -"The maximum depth for recursive interpolation " -"for :meth:`~configparser.ConfigParser.get` when the *raw* parameter is " -"false. This is relevant only when the default *interpolation* is used." +"The maximum depth for recursive interpolation for :meth:`~configparser." +"ConfigParser.get` when the *raw* parameter is false. This is relevant only " +"when the default *interpolation* is used." msgstr "" #: ../../library/configparser.rst:1308 @@ -1826,9 +1825,9 @@ msgstr "" #: ../../library/configparser.rst:1349 msgid "" "If the given section already exists, :exc:`DuplicateSectionError` is raised. " -"If the *default section* name is passed, :exc:`ValueError` is raised. " -"If :const:`UNNAMED_SECTION` is passed and support is " -"disabled, :exc:`UnnamedSectionDisabledError` is raised." +"If the *default section* name is passed, :exc:`ValueError` is raised. If :" +"const:`UNNAMED_SECTION` is passed and support is disabled, :exc:" +"`UnnamedSectionDisabledError` is raised." msgstr "" #: ../../library/configparser.rst:1354 @@ -1844,9 +1843,9 @@ msgstr "新增對 :const:`UNNAMED_SECTION` 的支援。" #: ../../library/configparser.rst:1363 msgid "" "If the given section exists, set the given option to the specified value; " -"otherwise raise :exc:`NoSectionError`. While it is possible to " -"use :class:`RawConfigParser` (or :class:`ConfigParser` with *raw* parameters " -"set to true) for *internal* storage of non-string values, full functionality " +"otherwise raise :exc:`NoSectionError`. While it is possible to use :class:" +"`RawConfigParser` (or :class:`ConfigParser` with *raw* parameters set to " +"true) for *internal* storage of non-string values, full functionality " "(including interpolation and output to files) can only be achieved using " "string values." msgstr "" @@ -1864,7 +1863,7 @@ msgid "Exceptions" msgstr "例外" #: ../../library/configparser.rst:1381 -msgid "Base class for all other :mod:`configparser` exceptions." +msgid "Base class for all other :mod:`!configparser` exceptions." msgstr "" #: ../../library/configparser.rst:1386 @@ -1880,8 +1879,8 @@ msgstr "" #: ../../library/configparser.rst:1395 msgid "" -"Added the optional *source* and *lineno* attributes and parameters " -"to :meth:`!__init__`." +"Added the optional *source* and *lineno* attributes and parameters to :meth:" +"`!__init__`." msgstr "" #: ../../library/configparser.rst:1402 @@ -1907,8 +1906,8 @@ msgstr "" #: ../../library/configparser.rst:1422 msgid "" "Exception raised when string interpolation cannot be completed because the " -"number of iterations exceeds :const:`MAX_INTERPOLATION_DEPTH`. Subclass " -"of :exc:`InterpolationError`." +"number of iterations exceeds :const:`MAX_INTERPOLATION_DEPTH`. Subclass of :" +"exc:`InterpolationError`." msgstr "" #: ../../library/configparser.rst:1429 diff --git a/library/contextlib.po b/library/contextlib.po index 95c6fea015..0ddd017f21 100644 --- a/library/contextlib.po +++ b/library/contextlib.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-11 00:15+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,9 +28,9 @@ msgstr "**原始碼:**\\ :source:`Lib/contextlib.py`" #: ../../library/contextlib.rst:11 msgid "" -"This module provides utilities for common tasks involving " -"the :keyword:`with` statement. For more information see " -"also :ref:`typecontextmanager` and :ref:`context-managers`." +"This module provides utilities for common tasks involving the :keyword:" +"`with` statement. For more information see also :ref:`typecontextmanager` " +"and :ref:`context-managers`." msgstr "" #: ../../library/contextlib.rst:17 @@ -43,38 +43,36 @@ msgstr "" #: ../../library/contextlib.rst:23 msgid "" -"An :term:`abstract base class` for classes that " -"implement :meth:`object.__enter__` and :meth:`object.__exit__`. A default " -"implementation for :meth:`object.__enter__` is provided which returns " -"``self`` while :meth:`object.__exit__` is an abstract method which by " -"default returns ``None``. See also the definition " -"of :ref:`typecontextmanager`." +"An :term:`abstract base class` for classes that implement :meth:`object." +"__enter__` and :meth:`object.__exit__`. A default implementation for :meth:" +"`object.__enter__` is provided which returns ``self`` while :meth:`object." +"__exit__` is an abstract method which by default returns ``None``. See also " +"the definition of :ref:`typecontextmanager`." msgstr "" #: ../../library/contextlib.rst:34 msgid "" -"An :term:`abstract base class` for classes that " -"implement :meth:`object.__aenter__` and :meth:`object.__aexit__`. A default " -"implementation for :meth:`object.__aenter__` is provided which returns " -"``self`` while :meth:`object.__aexit__` is an abstract method which by " -"default returns ``None``. See also the definition of :ref:`async-context-" -"managers`." +"An :term:`abstract base class` for classes that implement :meth:`object." +"__aenter__` and :meth:`object.__aexit__`. A default implementation for :meth:" +"`object.__aenter__` is provided which returns ``self`` while :meth:`object." +"__aexit__` is an abstract method which by default returns ``None``. See also " +"the definition of :ref:`async-context-managers`." msgstr "" #: ../../library/contextlib.rst:46 msgid "" "This function is a :term:`decorator` that can be used to define a factory " "function for :keyword:`with` statement context managers, without needing to " -"create a class or separate :meth:`~object.__enter__` " -"and :meth:`~object.__exit__` methods." +"create a class or separate :meth:`~object.__enter__` and :meth:`~object." +"__exit__` methods." msgstr "" #: ../../library/contextlib.rst:50 msgid "" "While many objects natively support use in with statements, sometimes a " "resource needs to be managed that isn't a context manager in its own right, " -"and doesn't implement a ``close()`` method for use with " -"``contextlib.closing``." +"and doesn't implement a ``close()`` method for use with ``contextlib." +"closing``." msgstr "" #: ../../library/contextlib.rst:54 @@ -118,18 +116,18 @@ msgstr "" #: ../../library/contextlib.rst:79 msgid "" -"At the point where the generator yields, the block nested in " -"the :keyword:`with` statement is executed. The generator is then resumed " -"after the block is exited. If an unhandled exception occurs in the block, it " -"is reraised inside the generator at the point where the yield occurred. " -"Thus, you can use a :keyword:`try`...\\ :keyword:`except`..." -"\\ :keyword:`finally` statement to trap the error (if any), or ensure that " -"some cleanup takes place. If an exception is trapped merely in order to log " -"it or to perform some action (rather than to suppress it entirely), the " -"generator must reraise that exception. Otherwise the generator context " -"manager will indicate to the :keyword:`!with` statement that the exception " -"has been handled, and execution will resume with the statement immediately " -"following the :keyword:`!with` statement." +"At the point where the generator yields, the block nested in the :keyword:" +"`with` statement is executed. The generator is then resumed after the block " +"is exited. If an unhandled exception occurs in the block, it is reraised " +"inside the generator at the point where the yield occurred. Thus, you can " +"use a :keyword:`try`...\\ :keyword:`except`...\\ :keyword:`finally` " +"statement to trap the error (if any), or ensure that some cleanup takes " +"place. If an exception is trapped merely in order to log it or to perform " +"some action (rather than to suppress it entirely), the generator must " +"reraise that exception. Otherwise the generator context manager will " +"indicate to the :keyword:`!with` statement that the exception has been " +"handled, and execution will resume with the statement immediately following " +"the :keyword:`!with` statement." msgstr "" #: ../../library/contextlib.rst:91 @@ -149,8 +147,8 @@ msgstr "" #: ../../library/contextlib.rst:104 msgid "" -"Similar to :func:`~contextlib.contextmanager`, but creates " -"an :ref:`asynchronous context manager `." +"Similar to :func:`~contextlib.contextmanager`, but creates an :ref:" +"`asynchronous context manager `." msgstr "" #: ../../library/contextlib.rst:107 @@ -158,8 +156,8 @@ msgid "" "This function is a :term:`decorator` that can be used to define a factory " "function for :keyword:`async with` statement asynchronous context managers, " "without needing to create a class or separate :meth:`~object.__aenter__` " -"and :meth:`~object.__aexit__` methods. It must be applied to " -"an :term:`asynchronous generator` function." +"and :meth:`~object.__aexit__` methods. It must be applied to an :term:" +"`asynchronous generator` function." msgstr "" #: ../../library/contextlib.rst:113 @@ -289,11 +287,10 @@ msgstr "" #: ../../library/contextlib.rst:187 msgid "" "Most types managing resources support the :term:`context manager` protocol, " -"which closes *thing* on leaving the :keyword:`with` statement. As " -"such, :func:`!closing` is most useful for third party types that don't " -"support context managers. This example is purely for illustration purposes, " -"as :func:`~urllib.request.urlopen` would normally be used in a context " -"manager." +"which closes *thing* on leaving the :keyword:`with` statement. As such, :" +"func:`!closing` is most useful for third party types that don't support " +"context managers. This example is purely for illustration purposes, as :func:" +"`~urllib.request.urlopen` would normally be used in a context manager." msgstr "" #: ../../library/contextlib.rst:196 @@ -486,17 +483,17 @@ msgstr "" #: ../../library/contextlib.rst:315 msgid "" -"If the code within the :keyword:`!with` block raises " -"a :exc:`BaseExceptionGroup`, suppressed exceptions are removed from the " -"group. Any exceptions of the group which are not suppressed are re-raised " -"in a new group which is created using the original " -"group's :meth:`~BaseExceptionGroup.derive` method." +"If the code within the :keyword:`!with` block raises a :exc:" +"`BaseExceptionGroup`, suppressed exceptions are removed from the group. Any " +"exceptions of the group which are not suppressed are re-raised in a new " +"group which is created using the original group's :meth:`~BaseExceptionGroup." +"derive` method." msgstr "" #: ../../library/contextlib.rst:323 msgid "" -"``suppress`` now supports suppressing exceptions raised as part of " -"a :exc:`BaseExceptionGroup`." +"``suppress`` now supports suppressing exceptions raised as part of a :exc:" +"`BaseExceptionGroup`." msgstr "" #: ../../library/contextlib.rst:329 @@ -514,10 +511,10 @@ msgstr "" #: ../../library/contextlib.rst:335 msgid "" "For example, the output of :func:`help` normally is sent to *sys.stdout*. " -"You can capture that output in a string by redirecting the output to " -"an :class:`io.StringIO` object. The replacement stream is returned from the " -"``__enter__`` method and so is available as the target of " -"the :keyword:`with` statement::" +"You can capture that output in a string by redirecting the output to an :" +"class:`io.StringIO` object. The replacement stream is returned from the " +"``__enter__`` method and so is available as the target of the :keyword:" +"`with` statement::" msgstr "" #: ../../library/contextlib.rst:341 @@ -568,8 +565,8 @@ msgstr "" #: ../../library/contextlib.rst:369 msgid "" -"Similar to :func:`~contextlib.redirect_stdout` but " -"redirecting :data:`sys.stderr` to another file or file-like object." +"Similar to :func:`~contextlib.redirect_stdout` but redirecting :data:`sys." +"stderr` to another file or file-like object." msgstr "" #: ../../library/contextlib.rst:379 @@ -903,16 +900,15 @@ msgstr "" #: ../../library/contextlib.rst:571 msgid "" "As ``__enter__`` is *not* invoked, this method can be used to cover part of " -"an :meth:`~object.__enter__` implementation with a context manager's " -"own :meth:`~object.__exit__` method." +"an :meth:`~object.__enter__` implementation with a context manager's own :" +"meth:`~object.__exit__` method." msgstr "" #: ../../library/contextlib.rst:575 msgid "" "If passed an object that is not a context manager, this method assumes it is " -"a callback with the same signature as a context " -"manager's :meth:`~object.__exit__` method and adds it directly to the " -"callback stack." +"a callback with the same signature as a context manager's :meth:`~object." +"__exit__` method and adds it directly to the callback stack." msgstr "" #: ../../library/contextlib.rst:579 @@ -980,10 +976,9 @@ msgstr "" #: ../../library/contextlib.rst:624 msgid "" -"An :ref:`asynchronous context manager `, similar " -"to :class:`ExitStack`, that supports combining both synchronous and " -"asynchronous context managers, as well as having coroutines for cleanup " -"logic." +"An :ref:`asynchronous context manager `, similar to :" +"class:`ExitStack`, that supports combining both synchronous and asynchronous " +"context managers, as well as having coroutines for cleanup logic." msgstr "" #: ../../library/contextlib.rst:629 @@ -1039,7 +1034,7 @@ msgstr "" #: ../../library/contextlib.rst:670 msgid "" "This section describes some examples and recipes for making effective use of " -"the tools provided by :mod:`contextlib`." +"the tools provided by :mod:`!contextlib`." msgstr "" #: ../../library/contextlib.rst:675 @@ -1081,10 +1076,10 @@ msgstr "" #: ../../library/contextlib.rst:700 msgid "" "It is occasionally desirable to catch exceptions from an ``__enter__`` " -"method implementation, *without* inadvertently catching exceptions from " -"the :keyword:`with` statement body or the context manager's ``__exit__`` " -"method. By using :class:`ExitStack` the steps in the context management " -"protocol can be separated slightly in order to allow this::" +"method implementation, *without* inadvertently catching exceptions from the :" +"keyword:`with` statement body or the context manager's ``__exit__`` method. " +"By using :class:`ExitStack` the steps in the context management protocol can " +"be separated slightly in order to allow this::" msgstr "" #: ../../library/contextlib.rst:706 @@ -1102,12 +1097,12 @@ msgstr "" #: ../../library/contextlib.rst:715 msgid "" "Actually needing to do this is likely to indicate that the underlying API " -"should be providing a direct resource management interface for use " -"with :keyword:`try`/:keyword:`except`/:keyword:`finally` statements, but not " -"all APIs are well designed in that regard. When a context manager is the " -"only resource management API provided, then :class:`ExitStack` can make it " -"easier to handle various situations that can't be handled directly in " -"a :keyword:`with` statement." +"should be providing a direct resource management interface for use with :" +"keyword:`try`/:keyword:`except`/:keyword:`finally` statements, but not all " +"APIs are well designed in that regard. When a context manager is the only " +"resource management API provided, then :class:`ExitStack` can make it easier " +"to handle various situations that can't be handled directly in a :keyword:" +"`with` statement." msgstr "" #: ../../library/contextlib.rst:725 @@ -1117,8 +1112,8 @@ msgstr "" #: ../../library/contextlib.rst:727 msgid "" "As noted in the documentation of :meth:`ExitStack.push`, this method can be " -"useful in cleaning up an already allocated resource if later steps in " -"the :meth:`~object.__enter__` implementation fail." +"useful in cleaning up an already allocated resource if later steps in the :" +"meth:`~object.__enter__` implementation fail." msgstr "" #: ../../library/contextlib.rst:731 @@ -1277,8 +1272,8 @@ msgstr "" #: ../../library/contextlib.rst:824 msgid "" "If the resource cleanup isn't already neatly bundled into a standalone " -"function, then it is still possible to use the decorator form " -"of :meth:`ExitStack.callback` to declare the resource cleanup in advance::" +"function, then it is still possible to use the decorator form of :meth:" +"`ExitStack.callback` to declare the resource cleanup in advance::" msgstr "" #: ../../library/contextlib.rst:829 @@ -1394,9 +1389,9 @@ msgstr "" #: ../../library/contextlib.rst:884 msgid "" "Note that there is one additional limitation when using context managers as " -"function decorators: there's no way to access the return value " -"of :meth:`~object.__enter__`. If that value is needed, then it is still " -"necessary to use an explicit ``with`` statement." +"function decorators: there's no way to access the return value of :meth:" +"`~object.__enter__`. If that value is needed, then it is still necessary to " +"use an explicit ``with`` statement." msgstr "" #: ../../library/contextlib.rst:891 @@ -1546,8 +1541,8 @@ msgstr "" msgid "" "Note also that being reentrant is *not* the same thing as being thread " "safe. :func:`redirect_stdout`, for example, is definitely not thread safe, " -"as it makes a global modification to the system state by " -"binding :data:`sys.stdout` to a different stream." +"as it makes a global modification to the system state by binding :data:`sys." +"stdout` to a different stream." msgstr "" #: ../../library/contextlib.rst:981 @@ -1567,16 +1562,15 @@ msgstr "" #: ../../library/contextlib.rst:990 msgid "" ":class:`threading.Lock` is an example of a reusable, but not reentrant, " -"context manager (for a reentrant lock, it is necessary to " -"use :class:`threading.RLock` instead)." +"context manager (for a reentrant lock, it is necessary to use :class:" +"`threading.RLock` instead)." msgstr "" #: ../../library/contextlib.rst:994 msgid "" -"Another example of a reusable, but not reentrant, context manager " -"is :class:`ExitStack`, as it invokes *all* currently registered callbacks " -"when leaving any with statement, regardless of where those callbacks were " -"added::" +"Another example of a reusable, but not reentrant, context manager is :class:" +"`ExitStack`, as it invokes *all* currently registered callbacks when leaving " +"any with statement, regardless of where those callbacks were added::" msgstr "" #: ../../library/contextlib.rst:999 diff --git a/library/copy.po b/library/copy.po index 0d7aa89b79..3298cd8ca7 100644 --- a/library/copy.po +++ b/library/copy.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-27 07:36+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2022-01-20 18:49+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -147,10 +147,11 @@ msgstr "" "個 list 的切片 (slice) 完成,例如,``copied_list = original_list[:]``。" #: ../../library/copy.rst:81 +#, fuzzy msgid "" "Classes can use the same interfaces to control copying that they use to " "control pickling. See the description of module :mod:`pickle` for " -"information on these methods. In fact, the :mod:`copy` module uses the " +"information on these methods. In fact, the :mod:`!copy` module uses the " "registered pickle functions from the :mod:`copyreg` module." msgstr "" "類別可以使用與操作 pickle 相同的介面來控制複製操作,關於這些方法的描述資訊請" @@ -179,8 +180,8 @@ msgid "" msgstr "" "用來實作深層複製操作;它會傳遞一個引數,即 *memo* 字典。如果 " "``__deepcopy__`` 實現需要建立一個元件的深層複製,它應當呼叫 :func:`~copy." -"deepcopy` 函式並以該元件作為第一個引數、以該 *memo* 字典作為第二個引數。*memo* " -"字典應當被當作不透明物件 (opaque object) 來處理" +"deepcopy` 函式並以該元件作為第一個引數、以該 *memo* 字典作為第二個引數。" +"*memo* 字典應當被當作不透明物件 (opaque object) 來處理" #: ../../library/copy.rst:114 msgid "" diff --git a/library/copyreg.po b/library/copyreg.po index eb99e7b7fc..0fe48e83eb 100644 --- a/library/copyreg.po +++ b/library/copyreg.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-09 00:03+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2023-12-29 00:29+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,8 +28,9 @@ msgid "**Source code:** :source:`Lib/copyreg.py`" msgstr "**原始碼:**\\ :source:`Lib/copyreg.py`" #: ../../library/copyreg.rst:15 +#, fuzzy msgid "" -"The :mod:`copyreg` module offers a way to define functions used while " +"The :mod:`!copyreg` module offers a way to define functions used while " "pickling specific objects. The :mod:`pickle` and :mod:`copy` modules use " "those functions when pickling/copying those objects. The module provides " "configuration information about object constructors which are not classes. " diff --git a/library/csv.po b/library/csv.po index a88e275851..9152198e27 100644 --- a/library/csv.po +++ b/library/csv.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-12 00:16+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2023-11-08 15:06+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -47,8 +47,9 @@ msgstr "" "一模組來高效率的操作這樣的資料,讓程式設計師可以隱藏讀取及寫入資料的細節。" #: ../../library/csv.rst:28 +#, fuzzy msgid "" -"The :mod:`csv` module implements classes to read and write tabular data in " +"The :mod:`!csv` module implements classes to read and write tabular data in " "CSV format. It allows programmers to say, \"write this data in the format " "preferred by Excel,\" or \"read data from this file which was generated by " "Excel,\" without knowing the precise details of the CSV format used by " @@ -61,9 +62,10 @@ msgstr "" "可以描述其他應用程式所理解的 CSV 格式或他們自行定義具有特殊意義的 CSV 格式。" #: ../../library/csv.rst:35 +#, fuzzy msgid "" -"The :mod:`csv` module's :class:`reader` and :class:`writer` objects read and " -"write sequences. Programmers can also read and write data in dictionary " +"The :mod:`!csv` module's :class:`reader` and :class:`writer` objects read " +"and write sequences. Programmers can also read and write data in dictionary " "form using the :class:`DictReader` and :class:`DictWriter` classes." msgstr "" ":mod:`csv` 模組的 :class:`reader` 及 :class:`writer` 物件可以讀取及寫入序列。" @@ -83,7 +85,8 @@ msgid "Module Contents" msgstr "模組內容" #: ../../library/csv.rst:50 -msgid "The :mod:`csv` module defines the following functions:" +#, fuzzy +msgid "The :mod:`!csv` module defines the following functions:" msgstr ":mod:`csv` 模組定義了以下函式:" #: ../../library/csv.rst:58 @@ -237,7 +240,8 @@ msgstr "" "成新的最大字串大小。" #: ../../library/csv.rst:149 -msgid "The :mod:`csv` module defines the following classes:" +#, fuzzy +msgid "The :mod:`!csv` module defines the following classes:" msgstr ":mod:`csv` 模組定義了下列的類別:" #: ../../library/csv.rst:154 @@ -516,7 +520,8 @@ msgstr "" " # ... 在這邊處理 CSV 檔案 ..." #: ../../library/csv.rst:317 -msgid "The :mod:`csv` module defines the following constants:" +#, fuzzy +msgid "The :mod:`!csv` module defines the following constants:" msgstr ":mod:`csv` 模組定義了以下常數:" #: ../../library/csv.rst:321 @@ -606,7 +611,8 @@ msgstr "" "`QUOTE_NONNUMERIC` 有相同的表現方式。" #: ../../library/csv.rst:378 -msgid "The :mod:`csv` module defines the following exception:" +#, fuzzy +msgid "The :mod:`!csv` module defines the following exception:" msgstr ":mod:`csv` 模組定義下列例外:" #: ../../library/csv.rst:383 diff --git a/library/ctypes.po b/library/ctypes.po index a6cf4970b2..0fb583c228 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-03 00:20+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2023-04-26 02:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,7 +28,7 @@ msgstr "**原始碼:**\\ :source:`Lib/ctypes`" #: ../../library/ctypes.rst:13 msgid "" -":mod:`ctypes` is a foreign function library for Python. It provides C " +":mod:`!ctypes` is a foreign function library for Python. It provides C " "compatible data types, and allows calling functions in DLLs or shared " "libraries. It can be used to wrap these libraries in pure Python." msgstr "" @@ -66,7 +66,7 @@ msgstr "" #: ../../library/ctypes.rst:39 msgid "" -":mod:`ctypes` exports the *cdll*, and on Windows *windll* and *oledll* " +":mod:`!ctypes` exports the *cdll*, and on Windows *windll* and *oledll* " "objects, for loading dynamic link libraries." msgstr "" @@ -339,7 +339,7 @@ msgstr "" #: ../../library/ctypes.rst:185 msgid "" -"On Windows, :mod:`ctypes` uses win32 structured exception handling to " +"On Windows, :mod:`!ctypes` uses win32 structured exception handling to " "prevent crashes from general protection faults when functions are called " "with invalid argument values::" msgstr "" @@ -360,7 +360,7 @@ msgstr "" #: ../../library/ctypes.rst:195 msgid "" -"There are, however, enough ways to crash Python with :mod:`ctypes`, so you " +"There are, however, enough ways to crash Python with :mod:`!ctypes`, so you " "should be careful anyway. The :mod:`faulthandler` module can be helpful in " "debugging crashes (e.g. from segmentation faults produced by erroneous C " "library calls)." @@ -380,7 +380,7 @@ msgstr "" #: ../../library/ctypes.rst:207 msgid "" "Before we move on calling functions with other parameter types, we have to " -"learn more about :mod:`ctypes` data types." +"learn more about :mod:`!ctypes` data types." msgstr "" #: ../../library/ctypes.rst:214 ../../library/ctypes.rst:2433 @@ -388,7 +388,7 @@ msgid "Fundamental data types" msgstr "" #: ../../library/ctypes.rst:216 -msgid ":mod:`ctypes` defines a number of primitive C compatible data types:" +msgid ":mod:`!ctypes` defines a number of primitive C compatible data types:" msgstr "" #: ../../library/ctypes.rst:219 ../../library/ctypes.rst:291 @@ -903,7 +903,7 @@ msgstr "" #: ../../library/ctypes.rst:399 msgid "" "As has been mentioned before, all Python types except integers, strings, and " -"bytes objects have to be wrapped in their corresponding :mod:`ctypes` type, " +"bytes objects have to be wrapped in their corresponding :mod:`!ctypes` type, " "so that they can be converted to the required C data type::" msgstr "" @@ -954,10 +954,10 @@ msgstr "" #: ../../library/ctypes.rst:434 msgid "" -"You can also customize :mod:`ctypes` argument conversion to allow instances " -"of your own classes be used as function arguments. :mod:`ctypes` looks for " +"You can also customize :mod:`!ctypes` argument conversion to allow instances " +"of your own classes be used as function arguments. :mod:`!ctypes` looks for " "an :attr:`!_as_parameter_` attribute and uses this as the function argument. " -"The attribute must be an integer, string, bytes, a :mod:`ctypes` instance, " +"The attribute must be an integer, string, bytes, a :mod:`!ctypes` instance, " "or an object with an :attr:`!_as_parameter_` attribute::" msgstr "" @@ -1062,7 +1062,7 @@ msgid "" "this object is acceptable, and then return the object itself, its :attr:`!" "_as_parameter_` attribute, or whatever you want to pass as the C function " "argument in this case. Again, the result should be an integer, string, " -"bytes, a :mod:`ctypes` instance, or an object with an :attr:`!" +"bytes, a :mod:`!ctypes` instance, or an object with an :attr:`!" "_as_parameter_` attribute." msgstr "" @@ -1250,7 +1250,7 @@ msgstr "" #: ../../library/ctypes.rst:603 msgid "" -":mod:`ctypes` exports the :func:`byref` function which is used to pass " +":mod:`!ctypes` exports the :func:`byref` function which is used to pass " "parameters by reference. The same effect can be achieved with the :func:" "`pointer` function, although :func:`pointer` does a lot more work since it " "constructs a real pointer object, so it is faster to use :func:`byref` if " @@ -1290,7 +1290,7 @@ msgstr "" #: ../../library/ctypes.rst:627 msgid "" "Structures and unions must derive from the :class:`Structure` and :class:" -"`Union` base classes which are defined in the :mod:`ctypes` module. Each " +"`Union` base classes which are defined in the :mod:`!ctypes` module. Each " "subclass must define a :attr:`~Structure._fields_` attribute. :attr:`!" "_fields_` must be a list of *2-tuples*, containing a *field name* and a " "*field type*." @@ -1298,8 +1298,8 @@ msgstr "" #: ../../library/ctypes.rst:632 msgid "" -"The field type must be a :mod:`ctypes` type like :class:`c_int`, or any " -"other derived :mod:`ctypes` type: structure, union, array, pointer." +"The field type must be a :mod:`!ctypes` type like :class:`c_int`, or any " +"other derived :mod:`!ctypes` type: structure, union, array, pointer." msgstr "" #: ../../library/ctypes.rst:635 @@ -1418,7 +1418,7 @@ msgstr "" #: ../../library/ctypes.rst:692 msgid "" -":mod:`ctypes` does not support passing unions or structures with bit-fields " +":mod:`!ctypes` does not support passing unions or structures with bit-fields " "to functions by value. While this may work on 32-bit x86, it's not " "guaranteed by the library to work in the general case. Unions and " "structures with bit-fields should always be passed to functions by pointer." @@ -1446,7 +1446,7 @@ msgstr "" #: ../../library/ctypes.rst:710 msgid "" -":mod:`ctypes` uses the native byte order for Structures and Unions. To " +":mod:`!ctypes` uses the native byte order for Structures and Unions. To " "build structures with non-native byte order, you can use one of the :class:" "`BigEndianStructure`, :class:`LittleEndianStructure`, :class:" "`BigEndianUnion`, and :class:`LittleEndianUnion` base classes. These " @@ -1600,7 +1600,7 @@ msgstr "指標" #: ../../library/ctypes.rst:798 msgid "" "Pointer instances are created by calling the :func:`pointer` function on a :" -"mod:`ctypes` type::" +"mod:`!ctypes` type::" msgstr "" #: ../../library/ctypes.rst:801 @@ -1633,7 +1633,7 @@ msgstr "" #: ../../library/ctypes.rst:813 msgid "" -"Note that :mod:`ctypes` does not have OOR (original object return), it " +"Note that :mod:`!ctypes` does not have OOR (original object return), it " "constructs a new, equivalent object each time you retrieve an attribute::" msgstr "" @@ -1719,7 +1719,7 @@ msgstr "" msgid "" "Behind the scenes, the :func:`pointer` function does more than simply create " "pointer instances, it has to create pointer *types* first. This is done with " -"the :func:`POINTER` function, which accepts any :mod:`ctypes` type, and " +"the :func:`POINTER` function, which accepts any :mod:`!ctypes` type, and " "returns a new type::" msgstr "" @@ -1767,7 +1767,7 @@ msgstr "" #: ../../library/ctypes.rst:879 msgid "" -":mod:`ctypes` checks for ``NULL`` when dereferencing pointers (but " +":mod:`!ctypes` checks for ``NULL`` when dereferencing pointers (but " "dereferencing invalid non-\\ ``NULL`` pointers would crash Python)::" msgstr "" @@ -1916,7 +1916,7 @@ msgstr "" #: ../../library/ctypes.rst:963 msgid "" "Sometimes you have instances of incompatible types. In C, you can cast one " -"type into another type. :mod:`ctypes` provides a :func:`cast` function " +"type into another type. :mod:`!ctypes` provides a :func:`cast` function " "which can be used in the same way. The ``Bar`` structure defined above " "accepts ``POINTER(c_int)`` pointers or :class:`c_int` arrays for its " "``values`` field, but not instances of other types::" @@ -2035,8 +2035,8 @@ msgstr "" #: ../../library/ctypes.rst:1027 msgid "" "because the new ``class cell`` is not available in the class statement " -"itself. In :mod:`ctypes`, we can define the ``cell`` class and set the :attr:" -"`~Structure._fields_` attribute later, after the class statement::" +"itself. In :mod:`!ctypes`, we can define the ``cell`` class and set the :" +"attr:`~Structure._fields_` attribute later, after the class statement::" msgstr "" #: ../../library/ctypes.rst:1031 @@ -2099,7 +2099,7 @@ msgstr "回呼函式" #: ../../library/ctypes.rst:1062 msgid "" -":mod:`ctypes` allows creating C callable function pointers from Python " +":mod:`!ctypes` allows creating C callable function pointers from Python " "callables. These are sometimes called *callback functions*." msgstr "" @@ -2299,7 +2299,7 @@ msgstr "" #: ../../library/ctypes.rst:1160 msgid "" "Make sure you keep references to :func:`CFUNCTYPE` objects as long as they " -"are used from C code. :mod:`ctypes` doesn't, and if you don't, they may be " +"are used from C code. :mod:`!ctypes` doesn't, and if you don't, they may be " "garbage collected, crashing your program when a callback is made." msgstr "" @@ -2326,7 +2326,7 @@ msgstr "" #: ../../library/ctypes.rst:1180 msgid "" -":mod:`ctypes` can access values like this with the :meth:`~_CData.in_dll` " +":mod:`!ctypes` can access values like this with the :meth:`~_CData.in_dll` " "class methods of the type. *pythonapi* is a predefined symbol giving access " "to the Python C api::" msgstr "" @@ -2363,7 +2363,7 @@ msgstr "" #: ../../library/ctypes.rst:1198 msgid "" "So manipulating this pointer could even prove useful. To restrict the " -"example size, we show only how this table can be read with :mod:`ctypes`::" +"example size, we show only how this table can be read with :mod:`!ctypes`::" msgstr "" #: ../../library/ctypes.rst:1201 @@ -2450,8 +2450,8 @@ msgstr "" #: ../../library/ctypes.rst:1245 msgid "" -"There are some edges in :mod:`ctypes` where you might expect something other " -"than what actually happens." +"There are some edges in :mod:`!ctypes` where you might expect something " +"other than what actually happens." msgstr "" #: ../../library/ctypes.rst:1248 @@ -2575,7 +2575,8 @@ msgstr "" #: ../../library/ctypes.rst:1313 msgid "" -":mod:`ctypes` provides some support for variable-sized arrays and structures." +":mod:`!ctypes` provides some support for variable-sized arrays and " +"structures." msgstr "" #: ../../library/ctypes.rst:1315 @@ -2644,7 +2645,7 @@ msgstr "" #: ../../library/ctypes.rst:1347 msgid "" -"Another way to use variable-sized data types with :mod:`ctypes` is to use " +"Another way to use variable-sized data types with :mod:`!ctypes` is to use " "the dynamic nature of Python, and (re-)define the data type after the " "required size is already known, on a case by case basis." msgstr "" @@ -2775,7 +2776,7 @@ msgstr "" #: ../../library/ctypes.rst:1428 msgid "" -"If wrapping a shared library with :mod:`ctypes`, it *may* be better to " +"If wrapping a shared library with :mod:`!ctypes`, it *may* be better to " "determine the shared library name at development time, and hardcode that " "into the wrapper module instead of using :func:`~ctypes.util.find_library` " "to locate the library at runtime." @@ -2934,8 +2935,8 @@ msgstr "" #: ../../library/ctypes.rst:1552 msgid "" "The *use_errno* parameter, when set to true, enables a ctypes mechanism that " -"allows accessing the system :data:`errno` error number in a safe way. :mod:" -"`ctypes` maintains a thread-local copy of the system's :data:`errno` " +"allows accessing the system :data:`errno` error number in a safe way. :mod:`!" +"ctypes` maintains a thread-local copy of the system's :data:`errno` " "variable; if you call foreign functions created with ``use_errno=True`` then " "the :data:`errno` value before the function call is swapped with the ctypes " "private copy, the same happens immediately after the function call." @@ -3418,7 +3419,7 @@ msgstr "" " UINT uType);" #: ../../library/ctypes.rst:1932 ../../library/ctypes.rst:1955 -msgid "Here is the wrapping with :mod:`ctypes`::" +msgid "Here is the wrapping with :mod:`!ctypes`::" msgstr "" #: ../../library/ctypes.rst:1934 @@ -3527,10 +3528,11 @@ msgstr "" #: ../../library/ctypes.rst:1982 msgid "" "If the :attr:`~_CFuncPtr.errcheck` function returns the argument tuple it " -"receives unchanged, :mod:`ctypes` continues the normal processing it does on " -"the output parameters. If you want to return a tuple of window coordinates " -"instead of a ``RECT`` instance, you can retrieve the fields in the function " -"and return them instead, the normal processing will no longer take place::" +"receives unchanged, :mod:`!ctypes` continues the normal processing it does " +"on the output parameters. If you want to return a tuple of window " +"coordinates instead of a ``RECT`` instance, you can retrieve the fields in " +"the function and return them instead, the normal processing will no longer " +"take place::" msgstr "" #: ../../library/ctypes.rst:1988 @@ -4115,7 +4117,7 @@ msgstr "" #: ../../library/ctypes.rst:2452 msgid "" "When the ``value`` attribute is retrieved from a ctypes instance, usually a " -"new object is returned each time. :mod:`ctypes` does *not* implement " +"new object is returned each time. :mod:`!ctypes` does *not* implement " "original object return, always a new object is constructed. The same is " "true for all other ctypes object instances." msgstr "" @@ -4412,8 +4414,8 @@ msgstr "" #: ../../library/ctypes.rst:2751 msgid "" "Concrete structure and union types must be created by subclassing one of " -"these types, and at least define a :attr:`_fields_` class variable. :mod:" -"`ctypes` will create :term:`descriptor`\\s which allow reading and writing " +"these types, and at least define a :attr:`_fields_` class variable. :mod:`!" +"ctypes` will create :term:`descriptor`\\s which allow reading and writing " "the fields by direct attribute accesses. These are the" msgstr "" @@ -4496,7 +4498,7 @@ msgstr "" msgid "" "Setting :attr:`!_pack_` to 0 is the same as not setting it at all. " "Otherwise, the value must be a positive power of two. The effect is " -"equivalent to ``#pragma pack(N)`` in C, except :mod:`ctypes` may allow " +"equivalent to ``#pragma pack(N)`` in C, except :mod:`!ctypes` may allow " "larger *n* than what the compiler accepts." msgstr "" @@ -4524,7 +4526,7 @@ msgstr "" msgid "" "The value must not be negative. The effect is equivalent to " "``__attribute__((aligned(N)))`` on GCC or ``#pragma align(N)`` on MSVC, " -"except :mod:`ctypes` may allow values that the compiler would reject." +"except :mod:`!ctypes` may allow values that the compiler would reject." msgstr "" #: ../../library/ctypes.rst:2830 @@ -4602,7 +4604,7 @@ msgstr "" #: ../../library/ctypes.rst:2875 msgid "" "The fields listed in this variable must be structure or union type fields. :" -"mod:`ctypes` will create descriptors in the structure type that allows " +"mod:`!ctypes` will create descriptors in the structure type that allows " "accessing the nested fields directly, without the need to create the " "structure or union field." msgstr "" @@ -4817,7 +4819,7 @@ msgstr "" #: ../../library/ctypes.rst:3019 msgid "" "The recommended way to create concrete array types is by multiplying any :" -"mod:`ctypes` data type with a non-negative integer. Alternatively, you can " +"mod:`!ctypes` data type with a non-negative integer. Alternatively, you can " "subclass this type and define :attr:`_length_` and :attr:`_type_` class " "variables. Array elements can be read and written using standard subscript " "and slice accesses; for slice reads, the resulting object is *not* itself " @@ -4843,8 +4845,8 @@ msgstr "" #: ../../library/ctypes.rst:3044 msgid "" -"Create an array. Equivalent to ``type * length``, where *type* is a :mod:" -"`ctypes` data type and *length* an integer." +"Create an array. Equivalent to ``type * length``, where *type* is a :mod:`!" +"ctypes` data type and *length* an integer." msgstr "" #: ../../library/ctypes.rst:3048 diff --git a/library/curses.ascii.po b/library/curses.ascii.po index bc02ebebee..904fd61b46 100644 --- a/library/curses.ascii.po +++ b/library/curses.ascii.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-09 00:03+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/curses/ascii.py`" #: ../../library/curses.ascii.rst:14 msgid "" -"The :mod:`curses.ascii` module supplies name constants for ASCII characters " +"The :mod:`!curses.ascii` module supplies name constants for ASCII characters " "and functions to test membership in various ASCII character classes. The " "constants supplied are names for control characters as follows:" msgstr "" diff --git a/library/curses.panel.po b/library/curses.panel.po index 6be0d1be8a..ab51ad6c7a 100644 --- a/library/curses.panel.po +++ b/library/curses.panel.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-09 00:03+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,7 +33,8 @@ msgid "Functions" msgstr "函式" #: ../../library/curses.panel.rst:21 -msgid "The module :mod:`curses.panel` defines the following functions:" +#, fuzzy +msgid "The module :mod:`!curses.panel` defines the following functions:" msgstr ":mod:`curses.panel` 模組定義了以下函式:" #: ../../library/curses.panel.rst:26 diff --git a/library/curses.po b/library/curses.po index 5cf6e031f0..4417c145d6 100644 --- a/library/curses.po +++ b/library/curses.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-10 16:45+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,8 +27,8 @@ msgstr "**原始碼:**\\ :source:`Lib/curses`" #: ../../library/curses.rst:16 msgid "" -"The :mod:`curses` module provides an interface to the curses library, the de-" -"facto standard for portable advanced terminal handling." +"The :mod:`!curses` module provides an interface to the curses library, the " +"de-facto standard for portable advanced terminal handling." msgstr "" #: ../../library/curses.rst:19 @@ -48,8 +48,8 @@ msgid "" "This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." msgstr "" -"此模組在\\ :ref:`行動平台 `\\ 或 :ref:`WebAssembly 平" -"台 `\\ 上不支援。" +"此模組在\\ :ref:`行動平台 `\\ 或 :ref:`WebAssembly 平台 " +"`\\ 上不支援。" #: ../../includes/optional-module.rst:1 msgid "" @@ -114,7 +114,8 @@ msgid "Functions" msgstr "函式" #: ../../library/curses.rst:57 -msgid "The module :mod:`curses` defines the following exception:" +#, fuzzy +msgid "The module :mod:`!curses` defines the following exception:" msgstr ":mod:`curses` 模組定義了以下例外:" #: ../../library/curses.rst:62 @@ -129,7 +130,8 @@ msgid "" msgstr "" #: ../../library/curses.rst:70 -msgid "The module :mod:`curses` defines the following functions:" +#, fuzzy +msgid "The module :mod:`!curses` defines the following functions:" msgstr ":mod:`curses` 模組定義了以下函式:" #: ../../library/curses.rst:75 @@ -664,7 +666,7 @@ msgstr "" msgid "" ":func:`start_color` initializes eight basic colors (black, red, green, " "yellow, blue, magenta, cyan, and white), and two global variables in the :" -"mod:`curses` module, :const:`COLORS` and :const:`COLOR_PAIRS`, containing " +"mod:`!curses` module, :const:`COLORS` and :const:`COLOR_PAIRS`, containing " "the maximum number of colors and color-pairs the terminal can support. It " "also restores the colors on the terminal to the values they had when the " "terminal was just turned on." @@ -1177,7 +1179,7 @@ msgstr "" #: ../../library/curses.rst:1024 msgid "" -"If *flag* is ``True``, :mod:`curses` will try and use hardware line editing " +"If *flag* is ``True``, :mod:`!curses` will try and use hardware line editing " "facilities. Otherwise, line insertion/deletion are disabled." msgstr "" @@ -1260,8 +1262,8 @@ msgstr "" #: ../../library/curses.rst:1111 msgid "" "If *flag* is ``True``, escape sequences generated by some keys (keypad, " -"function keys) will be interpreted by :mod:`curses`. If *flag* is ``False``, " -"escape sequences will be left as is in the input stream." +"function keys) will be interpreted by :mod:`!curses`. If *flag* is " +"``False``, escape sequences will be left as is in the input stream." msgstr "" #: ../../library/curses.rst:1118 @@ -1494,7 +1496,8 @@ msgid "Constants" msgstr "" #: ../../library/curses.rst:1338 -msgid "The :mod:`curses` module defines the following data members:" +#, fuzzy +msgid "The :mod:`!curses` module defines the following data members:" msgstr ":mod:`curses` 模組定義了以下資料成員:" #: ../../library/curses.rst:1343 diff --git a/library/dbm.po b/library/dbm.po index 1e095eea0b..22d8a6ea88 100644 --- a/library/dbm.po +++ b/library/dbm.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-08 00:15+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,8 +27,9 @@ msgid "**Source code:** :source:`Lib/dbm/__init__.py`" msgstr "**原始碼:**\\ :source:`Lib/dbm/__init__.py`" #: ../../library/dbm.rst:11 -msgid ":mod:`dbm` is a generic interface to variants of the DBM database:" -msgstr "" +#, fuzzy +msgid ":mod:`!dbm` is a generic interface to variants of the DBM database:" +msgstr ":mod:`!dbm` --- Unix \"databases\" 的介面" #: ../../library/dbm.rst:13 msgid ":mod:`dbm.sqlite3`" @@ -174,10 +175,11 @@ msgid "" msgstr "" #: ../../library/dbm.rst:102 +#, fuzzy msgid "" ":meth:`!get` and :meth:`!setdefault` methods are now available for all :mod:" -"`dbm` backends." -msgstr "" +"`!dbm` backends." +msgstr ":meth:`!clear` 方法現在可用於所有 :mod:`dbm` 後端。" #: ../../library/dbm.rst:106 msgid "" @@ -192,7 +194,8 @@ msgid "" msgstr "" #: ../../library/dbm.rst:114 -msgid ":meth:`!clear` methods are now available for all :mod:`dbm` backends." +#, fuzzy +msgid ":meth:`!clear` methods are now available for all :mod:`!dbm` backends." msgstr ":meth:`!clear` 方法現在可用於所有 :mod:`dbm` 後端。" #: ../../library/dbm.rst:118 @@ -251,7 +254,7 @@ msgstr "**原始碼:**\\ :source:`Lib/dbm/sqlite3.py`" #: ../../library/dbm.rst:167 msgid "" "This module uses the standard library :mod:`sqlite3` module to provide an " -"SQLite backend for the :mod:`dbm` module. The files created by :mod:`dbm." +"SQLite backend for the :mod:`!dbm` module. The files created by :mod:`dbm." "sqlite3` can thus be opened by :mod:`sqlite3`, or any other SQLite browser, " "including the SQLite CLI." msgstr "" @@ -324,8 +327,8 @@ msgid "" "This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." msgstr "" -"此模組在\\ :ref:`行動平台 `\\ 或 :ref:`WebAssembly 平" -"台 `\\ 上不支援。" +"此模組在\\ :ref:`行動平台 `\\ 或 :ref:`WebAssembly 平台 " +"`\\ 上不支援。" #: ../../library/dbm.rst:229 msgid "" @@ -531,7 +534,7 @@ msgstr "**原始碼:**\\ :source:`Lib/dbm/dumb.py`" #: ../../library/dbm.rst:418 msgid "" "The :mod:`dbm.dumb` module is intended as a last resort fallback for the :" -"mod:`dbm` module when a more robust module is not available. The :mod:`dbm." +"mod:`!dbm` module when a more robust module is not available. The :mod:`dbm." "dumb` module is not written for speed and is not nearly as heavily used as " "the other database modules." msgstr "" @@ -539,7 +542,7 @@ msgstr "" #: ../../library/dbm.rst:425 msgid "" "The :mod:`dbm.dumb` module provides a persistent :class:`dict`-like " -"interface which is written entirely in Python. Unlike other :mod:`dbm` " +"interface which is written entirely in Python. Unlike other :mod:`!dbm` " "backends, such as :mod:`dbm.gnu`, no external library is required." msgstr "" diff --git a/library/decimal.po b/library/decimal.po index 919d7811ca..542bf485b3 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-17 17:02+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/decimal.py`" #: ../../library/decimal.rst:33 msgid "" -"The :mod:`decimal` module provides support for fast correctly rounded " +"The :mod:`!decimal` module provides support for fast correctly rounded " "decimal floating-point arithmetic. It offers several advantages over the :" "class:`float` datatype:" msgstr "" @@ -408,7 +408,7 @@ msgstr "" #: ../../library/decimal.rst:292 msgid "" -"In accordance with the standard, the :mod:`decimal` module provides two " +"In accordance with the standard, the :mod:`!decimal` module provides two " "ready to use standard contexts, :const:`BasicContext` and :const:" "`ExtendedContext`. The former is especially useful for debugging because " "many of the traps are enabled:" @@ -2326,7 +2326,7 @@ msgstr "" #: ../../library/decimal.rst:1841 msgid "" -"The :mod:`decimal` module makes it possible to restore the identities by " +"The :mod:`!decimal` module makes it possible to restore the identities by " "expanding the precision sufficiently to avoid loss of significance:" msgstr "" @@ -2364,7 +2364,7 @@ msgstr "特殊值" #: ../../library/decimal.rst:1863 msgid "" -"The number system for the :mod:`decimal` module provides special values " +"The number system for the :mod:`!decimal` module provides special values " "including ``NaN``, ``sNaN``, ``-Infinity``, ``Infinity``, and two zeros, " "``+0`` and ``-0``." msgstr "" diff --git a/library/dis.po b/library/dis.po index 86f01b1f75..bf95cf67b2 100644 --- a/library/dis.po +++ b/library/dis.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-08 00:16+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,8 +28,9 @@ msgid "**Source code:** :source:`Lib/dis.py`" msgstr "**原始碼:**\\ :source:`Lib/dis.py`" #: ../../library/dis.rst:17 +#, fuzzy msgid "" -"The :mod:`dis` module supports the analysis of CPython :term:`bytecode` by " +"The :mod:`!dis` module supports the analysis of CPython :term:`bytecode` by " "disassembling it. The CPython bytecode which this module takes as an input " "is defined in the file :file:`Include/opcode.h` and used by the compiler and " "the interpreter." @@ -61,8 +62,8 @@ msgstr "" msgid "" "Some instructions are accompanied by one or more inline cache entries, which " "take the form of :opcode:`CACHE` instructions. These instructions are hidden " -"by default, but can be shown by passing ``show_caches=True`` to any :mod:" -"`dis` utility. Furthermore, the interpreter now adapts the bytecode to " +"by default, but can be shown by passing ``show_caches=True`` to any :mod:`!" +"dis` utility. Furthermore, the interpreter now adapts the bytecode to " "specialize it for different runtime conditions. The adaptive bytecode can be " "shown by passing ``adaptive=True``." msgstr "" @@ -143,7 +144,8 @@ msgid "Command-line interface" msgstr "命令列介面" #: ../../library/dis.rst:90 -msgid "The :mod:`dis` module can be invoked as a script from the command line:" +msgid "" +"The :mod:`!dis` module can be invoked as a script from the command line:" msgstr "" #: ../../library/dis.rst:92 @@ -323,7 +325,7 @@ msgstr "分析函式" #: ../../library/dis.rst:226 msgid "" -"The :mod:`dis` module also defines the following analysis functions that " +"The :mod:`!dis` module also defines the following analysis functions that " "convert the input directly to the desired output. They can be useful if only " "a single operation is being performed, so the intermediate analysis object " "isn't useful:" @@ -1940,6 +1942,7 @@ msgstr "``oparg == 1``:對 *value* 呼叫 :func:`str`" #: ../../library/dis.rst:1721 msgid "``oparg == 2``: call :func:`repr` on *value*" msgstr "``oparg == 2``:對 *value* 呼叫 :func:`repr`" + #: ../../library/dis.rst:1722 msgid "``oparg == 3``: call :func:`ascii` on *value*" msgstr "``oparg == 3``:對 *value* 呼叫 :func:`ascii`" @@ -2073,7 +2076,7 @@ msgstr "" #: ../../library/dis.rst:1829 msgid "" -"Pseudo instructions were added to the :mod:`dis` module, and for them it is " +"Pseudo instructions were added to the :mod:`!dis` module, and for them it is " "not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " "their arg." msgstr "" diff --git a/library/doctest.po b/library/doctest.po index 4b4508a442..5fed487ed6 100644 --- a/library/doctest.po +++ b/library/doctest.po @@ -6,7 +6,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-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/doctest.py`" #: ../../library/doctest.rst:16 msgid "" -"The :mod:`doctest` module searches for pieces of text that look like " +"The :mod:`!doctest` module searches for pieces of text that look like " "interactive Python sessions, and then executes those sessions to verify that " "they work exactly as shown. There are several common ways to use doctest:" msgstr "" @@ -116,8 +116,8 @@ msgstr "" #: ../../library/doctest.rst:88 msgid "" -"If you run :file:`example.py` directly from the command line, :mod:`doctest` " -"works its magic:" +"If you run :file:`example.py` directly from the command line, :mod:`!" +"doctest` works its magic:" msgstr "" #: ../../library/doctest.rst:91 @@ -131,7 +131,7 @@ msgstr "" #: ../../library/doctest.rst:96 msgid "" "There's no output! That's normal, and it means all the examples worked. " -"Pass ``-v`` to the script, and :mod:`doctest` prints a detailed log of what " +"Pass ``-v`` to the script, and :mod:`!doctest` prints a detailed log of what " "it's trying, and prints a summary at the end:" msgstr "" @@ -199,11 +199,11 @@ msgstr "" #: ../../library/doctest.rst:133 msgid "" -"That's all you need to know to start making productive use " -"of :mod:`doctest`! Jump in. The following sections provide full details. " -"Note that there are many examples of doctests in the standard Python test " -"suite and libraries. Especially useful examples can be found in the standard " -"test file :file:`Lib/test/test_doctest/test_doctest.py`." +"That's all you need to know to start making productive use of :mod:`!" +"doctest`! Jump in. The following sections provide full details. Note that " +"there are many examples of doctests in the standard Python test suite and " +"libraries. Especially useful examples can be found in the standard test " +"file :file:`Lib/test/test_doctest/test_doctest.py`." msgstr "" #: ../../library/doctest.rst:139 @@ -271,9 +271,9 @@ msgstr "" #: ../../library/doctest.rst:175 msgid "" "You can force verbose mode by passing ``verbose=True`` to :func:`testmod`, " -"or prohibit it by passing ``verbose=False``. In either of those " -"cases, :data:`sys.argv` is not examined by :func:`testmod` (so passing ``-" -"v`` or not has no effect)." +"or prohibit it by passing ``verbose=False``. In either of those cases, :" +"data:`sys.argv` is not examined by :func:`testmod` (so passing ``-v`` or not " +"has no effect)." msgstr "" #: ../../library/doctest.rst:180 @@ -376,8 +376,8 @@ msgstr "" msgid "" "As with :func:`testmod`, :func:`testfile` won't display anything unless an " "example fails. If an example does fail, then the failing example(s) and the " -"cause(s) of the failure(s) are printed to stdout, using the same format " -"as :func:`!testmod`." +"cause(s) of the failure(s) are printed to stdout, using the same format as :" +"func:`!testmod`." msgstr "" #: ../../library/doctest.rst:236 @@ -411,8 +411,9 @@ msgid "Command-line Usage" msgstr "命令列用法" #: ../../library/doctest.rst:255 +#, fuzzy msgid "" -"The :mod:`doctest` module can be invoked as a script from the command line:" +"The :mod:`!doctest` module can be invoked as a script from the command line:" msgstr "可以從命令列以腳本方式叫用 :mod:`doctest` 模組:" #: ../../library/doctest.rst:257 @@ -431,9 +432,9 @@ msgstr "python -m doctest -v example.py" #: ../../library/doctest.rst:270 msgid "" -"This will import :file:`example.py` as a standalone module and " -"run :func:`testmod` on it. Note that this may not work correctly if the file " -"is part of a package and imports other submodules from that package." +"This will import :file:`example.py` as a standalone module and run :func:" +"`testmod` on it. Note that this may not work correctly if the file is part " +"of a package and imports other submodules from that package." msgstr "" #: ../../library/doctest.rst:274 @@ -448,8 +449,8 @@ msgstr "python -m doctest -v example.txt" #: ../../library/doctest.rst:281 msgid "" -"Option flags control various aspects of doctest's behavior, see " -"section :ref:`doctest-options`." +"Option flags control various aspects of doctest's behavior, see section :ref:" +"`doctest-options`." msgstr "" #: ../../library/doctest.rst:288 @@ -487,10 +488,10 @@ msgid "" "the docstring. Doctest looks for a module-level variable called ``__test__`` " "and uses it to locate other tests. If ``M.__test__`` exists, it must be a " "dict, and each entry maps a (string) name to a function object, class " -"object, or string. Function and class object docstrings found from " -"``M.__test__`` are searched, and strings are treated as if they were " -"docstrings. In output, a key ``K`` in ``M.__test__`` appears with name " -"``M.__test__.K``." +"object, or string. Function and class object docstrings found from ``M." +"__test__`` are searched, and strings are treated as if they were " +"docstrings. In output, a key ``K`` in ``M.__test__`` appears with name ``M." +"__test__.K``." msgstr "" #: ../../library/doctest.rst:330 @@ -523,8 +524,8 @@ msgstr "" msgid "" "The value of ``example.__test__[\"numbers\"]`` will be treated as a " "docstring and all the tests inside it will be run. It is important to note " -"that the value can be mapped to a function, class object, or module; if " -"so, :mod:`!doctest` searches them recursively for docstrings, which are then " +"that the value can be mapped to a function, class object, or module; if so, :" +"mod:`!doctest` searches them recursively for docstrings, which are then " "scanned for tests." msgstr "" @@ -615,14 +616,14 @@ msgid "" "All hard tab characters are expanded to spaces, using 8-column tab stops. " "Tabs in output generated by the tested code are not modified. Because any " "hard tabs in the sample output *are* expanded, this means that if the code " -"output includes hard tabs, the only way the doctest can pass is if " -"the :const:`NORMALIZE_WHITESPACE` option or :ref:`directive ` is in effect. Alternatively, the test can be rewritten to " -"capture the output and compare it to an expected value as part of the test. " -"This handling of tabs in the source was arrived at through trial and error, " -"and has proven to be the least error prone way of handling them. It is " -"possible to use a different algorithm for handling tabs by writing a " -"custom :class:`DocTestParser` class." +"output includes hard tabs, the only way the doctest can pass is if the :" +"const:`NORMALIZE_WHITESPACE` option or :ref:`directive ` " +"is in effect. Alternatively, the test can be rewritten to capture the output " +"and compare it to an expected value as part of the test. This handling of " +"tabs in the source was arrived at through trial and error, and has proven to " +"be the least error prone way of handling them. It is possible to use a " +"different algorithm for handling tabs by writing a custom :class:" +"`DocTestParser` class." msgstr "" #: ../../library/doctest.rst:414 @@ -692,7 +693,7 @@ msgstr "" #: ../../library/doctest.rst:453 msgid "" -"By default, each time :mod:`doctest` finds a docstring to test, it uses a " +"By default, each time :mod:`!doctest` finds a docstring to test, it uses a " "*shallow copy* of :mod:`!M`'s globals, so that running tests doesn't change " "the module's real globals, and so that one test in :mod:`!M` can't leave " "behind crumbs that accidentally allow another test to work. This means " @@ -738,8 +739,8 @@ msgstr "" #: ../../library/doctest.rst:483 msgid "" -"That doctest succeeds if :exc:`ValueError` is raised, with the " -"``list.remove(x): x not in list`` detail as shown." +"That doctest succeeds if :exc:`ValueError` is raised, with the ``list." +"remove(x): x not in list`` detail as shown." msgstr "" #: ../../library/doctest.rst:486 @@ -820,10 +821,10 @@ msgstr "" #: ../../library/doctest.rst:522 msgid "" "Note that tracebacks are treated very specially. In particular, in the " -"rewritten example, the use of ``...`` is independent of " -"doctest's :const:`ELLIPSIS` option. The ellipsis in that example could be " -"left out, or could just as well be three (or three hundred) commas or " -"digits, or an indented transcript of a Monty Python skit." +"rewritten example, the use of ``...`` is independent of doctest's :const:" +"`ELLIPSIS` option. The ellipsis in that example could be left out, or could " +"just as well be three (or three hundred) commas or digits, or an indented " +"transcript of a Monty Python skit." msgstr "" #: ../../library/doctest.rst:528 @@ -858,8 +859,8 @@ msgstr "" #: ../../library/doctest.rst:547 msgid "" -"The interactive shell omits the traceback header line for " -"some :exc:`SyntaxError`\\ s. But doctest uses the traceback header line to " +"The interactive shell omits the traceback header line for some :exc:" +"`SyntaxError`\\ s. But doctest uses the traceback header line to " "distinguish exceptions from non-exceptions. So in the rare case where you " "need to test a :exc:`!SyntaxError` that omits the traceback header, you will " "need to manually add the traceback header line to your test example." @@ -914,11 +915,11 @@ msgstr "可選旗標" #: ../../library/doctest.rst:581 msgid "" "A number of option flags control various aspects of doctest's behavior. " -"Symbolic names for the flags are supplied as module constants, which can " -"be :ref:`bitwise ORed ` together and passed to various functions. " -"The names can also be used in :ref:`doctest directives `, and may be passed to the doctest command line interface via " -"the ``-o`` option." +"Symbolic names for the flags are supplied as module constants, which can be :" +"ref:`bitwise ORed ` together and passed to various functions. The " +"names can also be used in :ref:`doctest directives `, " +"and may be passed to the doctest command line interface via the ``-o`` " +"option." msgstr "" #: ../../library/doctest.rst:587 @@ -931,12 +932,12 @@ msgstr "" msgid "" "By default, if an expected output block contains just ``1``, an actual " "output block containing just ``1`` or just ``True`` is considered to be a " -"match, and similarly for ``0`` versus ``False``. " -"When :const:`DONT_ACCEPT_TRUE_FOR_1` is specified, neither substitution is " -"allowed. The default behavior caters to that Python changed the return type " -"of many functions from integer to boolean; doctests expecting \"little " -"integer\" output still work in these cases. This option will probably go " -"away, but not for several years." +"match, and similarly for ``0`` versus ``False``. When :const:" +"`DONT_ACCEPT_TRUE_FOR_1` is specified, neither substitution is allowed. The " +"default behavior caters to that Python changed the return type of many " +"functions from integer to boolean; doctests expecting \"little integer\" " +"output still work in these cases. This option will probably go away, but " +"not for several years." msgstr "" #: ../../library/doctest.rst:605 @@ -944,9 +945,8 @@ msgid "" "By default, if an expected output block contains a line containing only the " "string ````, then that line will match a blank line in the actual " "output. Because a genuinely blank line delimits the expected output, this " -"is the only way to communicate that a blank line is expected. " -"When :const:`DONT_ACCEPT_BLANKLINE` is specified, this substitution is not " -"allowed." +"is the only way to communicate that a blank line is expected. When :const:" +"`DONT_ACCEPT_BLANKLINE` is specified, this substitution is not allowed." msgstr "" #: ../../library/doctest.rst:614 @@ -978,11 +978,11 @@ msgstr "" #: ../../library/doctest.rst:638 msgid "" "For example, an example expecting ``ValueError: 42`` will pass if the actual " -"exception raised is ``ValueError: 3*14``, but will fail if, say, " -"a :exc:`TypeError` is raised instead. It will also ignore any fully " -"qualified name included before the exception class, which can vary between " -"implementations and versions of Python and the code/libraries in use. Hence, " -"all three of these variations will work with the flag specified:" +"exception raised is ``ValueError: 3*14``, but will fail if, say, a :exc:" +"`TypeError` is raised instead. It will also ignore any fully qualified name " +"included before the exception class, which can vary between implementations " +"and versions of Python and the code/libraries in use. Hence, all three of " +"these variations will work with the flag specified:" msgstr "" #: ../../library/doctest.rst:646 @@ -1094,16 +1094,16 @@ msgstr "" #: ../../library/doctest.rst:732 msgid "" "There is also a way to register new option flag names, though this isn't " -"useful unless you intend to extend :mod:`doctest` internals via subclassing:" +"useful unless you intend to extend :mod:`!doctest` internals via subclassing:" msgstr "" #: ../../library/doctest.rst:738 msgid "" "Create a new option flag with a given name, and return the new flag's " -"integer value. :func:`register_optionflag` can be used when " -"subclassing :class:`OutputChecker` or :class:`DocTestRunner` to create new " -"options that are supported by your subclasses. :func:`register_optionflag` " -"should always be called using the following idiom::" +"integer value. :func:`register_optionflag` can be used when subclassing :" +"class:`OutputChecker` or :class:`DocTestRunner` to create new options that " +"are supported by your subclasses. :func:`register_optionflag` should always " +"be called using the following idiom::" msgstr "" #: ../../library/doctest.rst:744 @@ -1227,12 +1227,12 @@ msgstr "警告" #: ../../library/doctest.rst:836 msgid "" -":mod:`doctest` is serious about requiring exact matches in expected output. " -"If even a single character doesn't match, the test fails. This will " -"probably surprise you a few times, as you learn exactly what Python does and " -"doesn't guarantee about output. For example, when printing a set, Python " -"doesn't guarantee that the element is printed in any particular order, so a " -"test like ::" +":mod:`!doctest` is serious about requiring exact matches in expected " +"output. If even a single character doesn't match, the test fails. This " +"will probably surprise you a few times, as you learn exactly what Python " +"does and doesn't guarantee about output. For example, when printing a set, " +"Python doesn't guarantee that the element is printed in any particular " +"order, so a test like ::" msgstr "" #: ../../library/doctest.rst:842 @@ -1441,9 +1441,8 @@ msgstr "" #: ../../library/doctest.rst:961 msgid "" -"Optional argument *optionflags* (default value ``0``) takes " -"the :ref:`bitwise OR ` of option flags. See section :ref:`doctest-" -"options`." +"Optional argument *optionflags* (default value ``0``) takes the :ref:" +"`bitwise OR ` of option flags. See section :ref:`doctest-options`." msgstr "" #: ../../library/doctest.rst:965 @@ -1482,10 +1481,10 @@ msgstr "" #: ../../library/doctest.rst:987 msgid "" -"Also test examples reachable from dict ``m.__test__``, if it exists. " -"``m.__test__`` maps names (strings) to functions, classes and strings; " -"function and class docstrings are searched for examples; strings are " -"searched directly, as if they were docstrings." +"Also test examples reachable from dict ``m.__test__``, if it exists. ``m." +"__test__`` maps names (strings) to functions, classes and strings; function " +"and class docstrings are searched for examples; strings are searched " +"directly, as if they were docstrings." msgstr "" #: ../../library/doctest.rst:992 @@ -1507,11 +1506,11 @@ msgstr "" msgid "" "Optional argument *exclude_empty* defaults to false. If true, objects for " "which no doctests are found are excluded from consideration. The default is " -"a backward compatibility hack, so that code still " -"using :meth:`doctest.master.summarize ` in " -"conjunction with :func:`testmod` continues to get output for objects with no " -"tests. The *exclude_empty* argument to the newer :class:`DocTestFinder` " -"constructor defaults to true." +"a backward compatibility hack, so that code still using :meth:`doctest." +"master.summarize ` in conjunction with :func:" +"`testmod` continues to get output for objects with no tests. The " +"*exclude_empty* argument to the newer :class:`DocTestFinder` constructor " +"defaults to true." msgstr "" #: ../../library/doctest.rst:1007 @@ -1566,7 +1565,7 @@ msgstr "Unittest API" #: ../../library/doctest.rst:1037 msgid "" "As your collection of doctest'ed modules grows, you'll want a way to run all " -"their doctests systematically. :mod:`doctest` provides two functions that " +"their doctests systematically. :mod:`!doctest` provides two functions that " "can be used to create :mod:`unittest` test suites from modules and text " "files containing doctests. To integrate with :mod:`unittest` test " "discovery, include a :ref:`load_tests ` function in " @@ -1599,19 +1598,19 @@ msgstr "" #: ../../library/doctest.rst:1057 msgid "" -"Convert doctest tests from one or more text files to " -"a :class:`unittest.TestSuite`." +"Convert doctest tests from one or more text files to a :class:`unittest." +"TestSuite`." msgstr "" #: ../../library/doctest.rst:1060 msgid "" "The returned :class:`unittest.TestSuite` is to be run by the unittest " "framework and runs the interactive examples in each file. If an example in " -"any file fails, then the synthesized unit test fails, and " -"a :exc:`~unittest.TestCase.failureException` exception is raised showing the " -"name of the file containing the test and a (sometimes approximate) line " -"number. If all the examples in a file are skipped, then the synthesized " -"unit test is also marked as skipped." +"any file fails, then the synthesized unit test fails, and a :exc:`~unittest." +"TestCase.failureException` exception is raised showing the name of the file " +"containing the test and a (sometimes approximate) line number. If all the " +"examples in a file are skipped, then the synthesized unit test is also " +"marked as skipped." msgstr "" #: ../../library/doctest.rst:1067 @@ -1683,10 +1682,9 @@ msgstr "" #: ../../library/doctest.rst:1108 msgid "" "Optional argument *optionflags* specifies the default doctest options for " -"the tests, created by or-ing together individual option flags. See " -"section :ref:`doctest-options`. See " -"function :func:`set_unittest_reportflags` below for a better way to set " -"reporting options." +"the tests, created by or-ing together individual option flags. See section :" +"ref:`doctest-options`. See function :func:`set_unittest_reportflags` below " +"for a better way to set reporting options." msgstr "" #: ../../library/doctest.rst:1120 @@ -1771,9 +1769,9 @@ msgstr "" #: ../../library/doctest.rst:1169 msgid "" -"So both ways of creating a :class:`unittest.TestSuite` run instances " -"of :class:`!DocTestCase`. This is important for a subtle reason: when you " -"run :mod:`doctest` functions yourself, you can control the :mod:`!doctest` " +"So both ways of creating a :class:`unittest.TestSuite` run instances of :" +"class:`!DocTestCase`. This is important for a subtle reason: when you run :" +"mod:`!doctest` functions yourself, you can control the :mod:`!doctest` " "options in use directly, by passing option flags to :mod:`!doctest` " "functions. However, if you're writing a :mod:`unittest` framework, :mod:`!" "unittest` ultimately controls when and how tests get run. The framework " @@ -1784,12 +1782,12 @@ msgstr "" #: ../../library/doctest.rst:1179 msgid "" -"For this reason, :mod:`doctest` also supports a notion of :mod:`!doctest` " +"For this reason, :mod:`!doctest` also supports a notion of :mod:`!doctest` " "reporting flags specific to :mod:`unittest` support, via this function:" msgstr "" #: ../../library/doctest.rst:1185 -msgid "Set the :mod:`doctest` reporting flags to use." +msgid "Set the :mod:`!doctest` reporting flags to use." msgstr "" #: ../../library/doctest.rst:1187 @@ -1802,15 +1800,14 @@ msgstr "" msgid "" "This is a module-global setting, and affects all future doctests run by " "module :mod:`unittest`: the :meth:`!runTest` method of :class:`!" -"DocTestCase` looks at the option flags specified for the test case when " -"the :class:`!DocTestCase` instance was constructed. If no reporting flags " -"were specified (which is the typical and expected case), :mod:`!" -"doctest`'s :mod:`!unittest` reporting flags are :ref:`bitwise ORed " -"` into the option flags, and the option flags so augmented are " -"passed to the :class:`DocTestRunner` instance created to run the doctest. " -"If any reporting flags were specified when the :class:`!DocTestCase` " -"instance was constructed, :mod:`!doctest`'s :mod:`!unittest` reporting flags " -"are ignored." +"DocTestCase` looks at the option flags specified for the test case when the :" +"class:`!DocTestCase` instance was constructed. If no reporting flags were " +"specified (which is the typical and expected case), :mod:`!doctest`'s :mod:`!" +"unittest` reporting flags are :ref:`bitwise ORed ` into the option " +"flags, and the option flags so augmented are passed to the :class:" +"`DocTestRunner` instance created to run the doctest. If any reporting flags " +"were specified when the :class:`!DocTestCase` instance was constructed, :mod:" +"`!doctest`'s :mod:`!unittest` reporting flags are ignored." msgstr "" #: ../../library/doctest.rst:1201 @@ -1857,9 +1854,9 @@ msgstr "" #: ../../library/doctest.rst:1227 msgid "" -":class:`DocTestFinder`: Finds all docstrings in a given module, and uses " -"a :class:`DocTestParser` to create a :class:`DocTest` from every docstring " -"that contains interactive examples." +":class:`DocTestFinder`: Finds all docstrings in a given module, and uses a :" +"class:`DocTestParser` to create a :class:`DocTest` from every docstring that " +"contains interactive examples." msgstr "" #: ../../library/doctest.rst:1231 @@ -1933,8 +1930,8 @@ msgstr "" msgid "" "The namespace (aka globals) that the examples should be run in. This is a " "dictionary mapping names to values. Any changes to the namespace made by " -"the examples (such as binding new variables) will be reflected " -"in :attr:`globs` after the test is run." +"the examples (such as binding new variables) will be reflected in :attr:" +"`globs` after the test is run." msgstr "" #: ../../library/doctest.rst:1285 @@ -1999,9 +1996,9 @@ msgstr "" msgid "" "The exception message generated by the example, if the example is expected " "to generate an exception; or ``None`` if it is not expected to generate an " -"exception. This exception message is compared against the return value " -"of :func:`traceback.format_exception_only`. :attr:`exc_msg` ends with a " -"newline unless it's ``None``. The constructor adds a newline if needed." +"exception. This exception message is compared against the return value of :" +"func:`traceback.format_exception_only`. :attr:`exc_msg` ends with a newline " +"unless it's ``None``. The constructor adds a newline if needed." msgstr "" #: ../../library/doctest.rst:1352 @@ -2058,9 +2055,8 @@ msgstr "" #: ../../library/doctest.rst:1394 msgid "" -"If the optional argument *exclude_empty* is false, " -"then :meth:`DocTestFinder.find` will include tests for objects with empty " -"docstrings." +"If the optional argument *exclude_empty* is false, then :meth:`DocTestFinder." +"find` will include tests for objects with empty docstrings." msgstr "" #: ../../library/doctest.rst:1398 @@ -2121,9 +2117,9 @@ msgid "" "The globals for each :class:`DocTest` is formed by combining *globs* and " "*extraglobs* (bindings in *extraglobs* override bindings in *globs*). A new " "shallow copy of the globals dictionary is created for each :class:`!" -"DocTest`. If *globs* is not specified, then it defaults to the " -"module's :attr:`~module.__dict__`, if specified, or ``{}`` otherwise. If " -"*extraglobs* is not specified, then it defaults to ``{}``." +"DocTest`. If *globs* is not specified, then it defaults to the module's :" +"attr:`~module.__dict__`, if specified, or ``{}`` otherwise. If *extraglobs* " +"is not specified, then it defaults to ``{}``." msgstr "" #: ../../library/doctest.rst:1441 @@ -2142,15 +2138,15 @@ msgstr ":class:`DocTestParser` 定義了以下方法:" #: ../../library/doctest.rst:1455 msgid "" -"Extract all doctest examples from the given string, and collect them into " -"a :class:`DocTest` object." +"Extract all doctest examples from the given string, and collect them into a :" +"class:`DocTest` object." msgstr "" #: ../../library/doctest.rst:1458 msgid "" -"*globs*, *name*, *filename*, and *lineno* are attributes for the " -"new :class:`!DocTest` object. See the documentation for :class:`DocTest` " -"for more information." +"*globs*, *name*, *filename*, and *lineno* are attributes for the new :class:" +"`!DocTest` object. See the documentation for :class:`DocTest` for more " +"information." msgstr "" #: ../../library/doctest.rst:1465 @@ -2191,16 +2187,16 @@ msgstr "DocTestRunner 物件" #: ../../library/doctest.rst:1507 msgid "" -"A processing class used to execute and verify the interactive examples in " -"a :class:`DocTest`." +"A processing class used to execute and verify the interactive examples in a :" +"class:`DocTest`." msgstr "" #: ../../library/doctest.rst:1510 msgid "" -"The comparison between expected outputs and actual outputs is done by " -"an :class:`OutputChecker`. This comparison may be customized with a number " -"of option flags; see section :ref:`doctest-options` for more information. " -"If the option flags are insufficient, then the comparison may also be " +"The comparison between expected outputs and actual outputs is done by an :" +"class:`OutputChecker`. This comparison may be customized with a number of " +"option flags; see section :ref:`doctest-options` for more information. If " +"the option flags are insufficient, then the comparison may also be " "customized by passing a subclass of :class:`!OutputChecker` to the " "constructor." msgstr "" @@ -2209,12 +2205,11 @@ msgstr "" msgid "" "The test runner's display output can be controlled in two ways. First, an " "output function can be passed to :meth:`run`; this function will be called " -"with strings that should be displayed. It defaults to " -"``sys.stdout.write``. If capturing the output is not sufficient, then the " -"display output can be also customized by subclassing DocTestRunner, and " -"overriding the " -"methods :meth:`report_start`, :meth:`report_success`, :meth:`report_unexpected_exception`, " -"and :meth:`report_failure`." +"with strings that should be displayed. It defaults to ``sys.stdout." +"write``. If capturing the output is not sufficient, then the display output " +"can be also customized by subclassing DocTestRunner, and overriding the " +"methods :meth:`report_start`, :meth:`report_success`, :meth:" +"`report_unexpected_exception`, and :meth:`report_failure`." msgstr "" #: ../../library/doctest.rst:1524 @@ -2226,12 +2221,11 @@ msgstr "" #: ../../library/doctest.rst:1528 msgid "" -"The optional keyword argument *verbose* controls " -"the :class:`DocTestRunner`'s verbosity. If *verbose* is ``True``, then " -"information is printed about each example, as it is run. If *verbose* is " -"``False``, then only failures are printed. If *verbose* is unspecified, or " -"``None``, then verbose output is used iff the command-line switch ``-v`` is " -"used." +"The optional keyword argument *verbose* controls the :class:" +"`DocTestRunner`'s verbosity. If *verbose* is ``True``, then information is " +"printed about each example, as it is run. If *verbose* is ``False``, then " +"only failures are printed. If *verbose* is unspecified, or ``None``, then " +"verbose output is used iff the command-line switch ``-v`` is used." msgstr "" #: ../../library/doctest.rst:1534 @@ -2244,10 +2238,9 @@ msgstr "" #: ../../library/doctest.rst:1538 msgid "" "The test runner accumulates statistics. The aggregated number of attempted, " -"failed and skipped examples is also available via " -"the :attr:`tries`, :attr:`failures` and :attr:`skips` attributes. " -"The :meth:`run` and :meth:`summarize` methods return a :class:`TestResults` " -"instance." +"failed and skipped examples is also available via the :attr:`tries`, :attr:" +"`failures` and :attr:`skips` attributes. The :meth:`run` and :meth:" +"`summarize` methods return a :class:`TestResults` instance." msgstr "" #: ../../library/doctest.rst:1543 @@ -2264,8 +2257,8 @@ msgstr "" #: ../../library/doctest.rst:1552 msgid "" "*example* is the example about to be processed. *test* is the test " -"containing *example*. *out* is the output function that was passed " -"to :meth:`DocTestRunner.run`." +"containing *example*. *out* is the output function that was passed to :meth:" +"`DocTestRunner.run`." msgstr "" #: ../../library/doctest.rst:1559 @@ -2299,9 +2292,9 @@ msgstr "" #: ../../library/doctest.rst:1585 msgid "" "*example* is the example about to be processed. *exc_info* is a tuple " -"containing information about the unexpected exception (as returned " -"by :func:`sys.exc_info`). *test* is the test containing *example*. *out* is " -"the output function that was passed to :meth:`DocTestRunner.run`." +"containing information about the unexpected exception (as returned by :func:" +"`sys.exc_info`). *test* is the test containing *example*. *out* is the " +"output function that was passed to :meth:`DocTestRunner.run`." msgstr "" #: ../../library/doctest.rst:1593 @@ -2329,8 +2322,8 @@ msgstr "" #: ../../library/doctest.rst:1606 msgid "" "The output of each example is checked using the :class:`DocTestRunner`'s " -"output checker, and the results are formatted by the :meth:`!" -"DocTestRunner.report_\\*` methods." +"output checker, and the results are formatted by the :meth:`!DocTestRunner." +"report_\\*` methods." msgstr "" #: ../../library/doctest.rst:1613 @@ -2369,10 +2362,10 @@ msgstr "OutputChecker 物件" #: ../../library/doctest.rst:1645 msgid "" "A class used to check the whether the actual output from a doctest example " -"matches the expected output. :class:`OutputChecker` defines two " -"methods: :meth:`check_output`, which compares a given pair of outputs, and " -"returns ``True`` if they match; and :meth:`output_difference`, which returns " -"a string describing the differences between two outputs." +"matches the expected output. :class:`OutputChecker` defines two methods: :" +"meth:`check_output`, which compares a given pair of outputs, and returns " +"``True`` if they match; and :meth:`output_difference`, which returns a " +"string describing the differences between two outputs." msgstr "" #: ../../library/doctest.rst:1652 @@ -2384,8 +2377,8 @@ msgid "" "Return ``True`` iff the actual output from an example (*got*) matches the " "expected output (*want*). These strings are always considered to match if " "they are identical; but depending on what option flags the test runner is " -"using, several non-exact match types are also possible. See " -"section :ref:`doctest-options` for more information about option flags." +"using, several non-exact match types are also possible. See section :ref:" +"`doctest-options` for more information about option flags." msgstr "" #: ../../library/doctest.rst:1665 @@ -2419,16 +2412,16 @@ msgstr "" #: ../../library/doctest.rst:1685 msgid "" -"The :mod:`unittest` cases generated by :func:`DocTestSuite` support " -"the :meth:`debug` method defined by :class:`unittest.TestCase`." +"The :mod:`unittest` cases generated by :func:`DocTestSuite` support the :" +"meth:`debug` method defined by :class:`unittest.TestCase`." msgstr "" #: ../../library/doctest.rst:1688 msgid "" "You can add a call to :func:`pdb.set_trace` in a doctest example, and you'll " "drop into the Python debugger when that line is executed. Then you can " -"inspect current values of variables, and so on. For example, " -"suppose :file:`a.py` contains just this module docstring::" +"inspect current values of variables, and so on. For example, suppose :file:" +"`a.py` contains just this module docstring::" msgstr "" #: ../../library/doctest.rst:1693 @@ -2606,10 +2599,10 @@ msgstr "" #: ../../library/doctest.rst:1796 msgid "" -"The *module* and *name* arguments are the same as for " -"function :func:`testsource` above. The synthesized Python script for the " -"named object's docstring is written to a temporary file, and then that file " -"is run under the control of the Python debugger, :mod:`pdb`." +"The *module* and *name* arguments are the same as for function :func:" +"`testsource` above. The synthesized Python script for the named object's " +"docstring is written to a temporary file, and then that file is run under " +"the control of the Python debugger, :mod:`pdb`." msgstr "" #: ../../library/doctest.rst:1801 @@ -2623,8 +2616,8 @@ msgid "" "Optional argument *pm* controls whether post-mortem debugging is used. If " "*pm* has a true value, the script file is run directly, and the debugger " "gets involved only if the script terminates via raising an unhandled " -"exception. If it does, then post-mortem debugging is invoked, " -"via :func:`pdb.post_mortem`, passing the traceback object from the unhandled " +"exception. If it does, then post-mortem debugging is invoked, via :func:" +"`pdb.post_mortem`, passing the traceback object from the unhandled " "exception. If *pm* is not specified, or is false, the script is run under " "the debugger from the start, via passing an appropriate :func:`exec` call " "to :func:`pdb.run`." @@ -2664,11 +2657,11 @@ msgstr "" #: ../../library/doctest.rst:1835 msgid "" "A subclass of :class:`DocTestRunner` that raises an exception as soon as a " -"failure is encountered. If an unexpected exception occurs, " -"an :exc:`UnexpectedException` exception is raised, containing the test, the " -"example, and the original exception. If the output doesn't match, then " -"a :exc:`DocTestFailure` exception is raised, containing the test, the " -"example, and the actual output." +"failure is encountered. If an unexpected exception occurs, an :exc:" +"`UnexpectedException` exception is raised, containing the test, the example, " +"and the original exception. If the output doesn't match, then a :exc:" +"`DocTestFailure` exception is raised, containing the test, the example, and " +"the actual output." msgstr "" #: ../../library/doctest.rst:1842 @@ -2730,7 +2723,7 @@ msgstr "" #: ../../library/doctest.rst:1902 msgid "" -"As mentioned in the introduction, :mod:`doctest` has grown to have three " +"As mentioned in the introduction, :mod:`!doctest` has grown to have three " "primary uses:" msgstr "" @@ -2761,7 +2754,7 @@ msgid "" "often be worth many words. If done with care, the examples will be " "invaluable for your users, and will pay back the time it takes to collect " "them many times over as the years go by and things change. I'm still amazed " -"at how often one of my :mod:`doctest` examples stops working after a " +"at how often one of my :mod:`!doctest` examples stops working after a " "\"harmless\" change." msgstr "" diff --git a/library/email.charset.po b/library/email.charset.po index d5fa76c922..6dd6cef846 100644 --- a/library/email.charset.po +++ b/library/email.charset.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-09 00:03+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -47,12 +47,13 @@ msgid "" "Instances of :class:`Charset` are used in several other modules within the :" "mod:`email` package." msgstr "" -"此模組提供一個類別 :class:`Charset` 來表示電子郵件訊息中的字元集合和字元集合轉" -"換,也包含字元集合登錄檔 (registry) 和其他許多運用此登錄檔的便捷方法。:class:" -"`Charset` 的實例被 :mod:`email` 套件中其他數個模組所使用。" +"此模組提供一個類別 :class:`Charset` 來表示電子郵件訊息中的字元集合和字元集合" +"轉換,也包含字元集合登錄檔 (registry) 和其他許多運用此登錄檔的便捷方法。:" +"class:`Charset` 的實例被 :mod:`email` 套件中其他數個模組所使用。" #: ../../library/email.charset.rst:22 -msgid "Import this class from the :mod:`email.charset` module." +#, fuzzy +msgid "Import this class from the :mod:`!email.charset` module." msgstr "從 :mod:`email.charset` 模組中引入此類別" #: ../../library/email.charset.rst:27 @@ -94,9 +95,9 @@ msgid "" "with base64, bodies will not be encoded, but output text will be converted " "from the ``euc-jp`` character set to the ``iso-2022-jp`` character set." msgstr "" -"可選的 *input_charset* 描述如下;*input_charset* 會被強制轉換 (coerced) 為小寫。經過" -"別名標準化 (alias normalize) 後,會進到字元集合登錄檔 (registry) 去查詢此字元" -"集合使用的標頭編碼、內文編碼以及輸出轉換編解碼器。舉例來說,如果 " +"可選的 *input_charset* 描述如下;*input_charset* 會被強制轉換 (coerced) 為小" +"寫。經過別名標準化 (alias normalize) 後,會進到字元集合登錄檔 (registry) 去查" +"詢此字元集合使用的標頭編碼、內文編碼以及輸出轉換編解碼器。舉例來說,如果 " "*input_charset* 是 ``iso-8859-1``,標頭跟內文會以可列印字元編碼並且不需要輸出" "轉換編解碼器。如果 *input_charset* 是 ``euc-jp``,標頭則會被編碼成 base64、內" "文不會被編碼,但輸出文字則會從 ``euc-jp`` 字元集合被轉換成 ``iso-2022-jp`` 字" @@ -123,9 +124,9 @@ msgid "" "shortest of QP or BASE64 encoding. Otherwise, it will be ``None``." msgstr "" "如果字元集合在被用於電子郵件標頭前必須被編碼的話,這個屬性會被設為 ``charset." -"QP``\\ (表示可列印字元編碼)、``charset.BASE64``\\ (表示 base64 編碼格式)或" -"是 ``charset.SHORTEST`` 表示最短的 QP 或是 base64 編碼格式。不然這個屬性會是 " -"``None``。" +"QP``\\ (表示可列印字元編碼)、``charset.BASE64``\\ (表示 base64 編碼格式)" +"或是 ``charset.SHORTEST`` 表示最短的 QP 或是 base64 編碼格式。不然這個屬性會" +"是 ``None``。" #: ../../library/email.charset.rst:69 msgid "" @@ -268,8 +269,9 @@ msgid "" msgstr "此方法讓你比較兩個 :class:`Charset` 實例的不相等性。" #: ../../library/email.charset.rst:167 +#, fuzzy msgid "" -"The :mod:`email.charset` module also provides the following functions for " +"The :mod:`!email.charset` module also provides the following functions for " "adding new entries to the global character set, alias, and codec registries:" msgstr "" ":mod:`email.charset` 模組還提供以下函式,用於將項目新增至全域字元集合、別名和" diff --git a/library/email.errors.po b/library/email.errors.po index 8ff458b07f..be24c0afa8 100644 --- a/library/email.errors.po +++ b/library/email.errors.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-03-04 00:14+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/email/errors.py`" #: ../../library/email.errors.rst:11 msgid "" -"The following exception classes are defined in the :mod:`email.errors` " +"The following exception classes are defined in the :mod:`!email.errors` " "module:" msgstr "" diff --git a/library/email.generator.po b/library/email.generator.po index 3ab3635a49..9d1b16bc02 100644 --- a/library/email.generator.po +++ b/library/email.generator.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -247,7 +247,7 @@ msgstr "" #: ../../library/email.generator.rst:235 msgid "" -"The :mod:`email.generator` module also provides a derived class, :class:" +"The :mod:`!email.generator` module also provides a derived class, :class:" "`DecodedGenerator`, which is like the :class:`Generator` base class, except " "that non-\\ :mimetype:`text` parts are not serialized, but are instead " "represented in the output stream by a string derived from a template filled " diff --git a/library/email.header.po b/library/email.header.po index 6cf77fc3c8..f6b68d087d 100644 --- a/library/email.header.po +++ b/library/email.header.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-27 07:36+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -59,7 +59,7 @@ msgid "" "been written describing how to encode email containing non-ASCII characters " "into :rfc:`2822`\\ -compliant format. These RFCs include :rfc:`2045`, :rfc:" "`2046`, :rfc:`2047`, and :rfc:`2231`. The :mod:`email` package supports " -"these standards in its :mod:`email.header` and :mod:`email.charset` modules." +"these standards in its :mod:`!email.header` and :mod:`email.charset` modules." msgstr "" #: ../../library/email.header.rst:33 @@ -68,8 +68,8 @@ msgid "" "the :mailheader:`Subject` or :mailheader:`To` fields, you should use the :" "class:`Header` class and assign the field in the :class:`~email.message." "Message` object to an instance of :class:`Header` instead of using a string " -"for the header value. Import the :class:`Header` class from the :mod:`email." -"header` module. For example::" +"for the header value. Import the :class:`Header` class from the :mod:`!" +"email.header` module. For example::" msgstr "" #: ../../library/email.header.rst:40 @@ -262,7 +262,7 @@ msgstr "" #: ../../library/email.header.rst:173 msgid "" -"The :mod:`email.header` module also provides the following convenient " +"The :mod:`!email.header` module also provides the following convenient " "functions." msgstr "" diff --git a/library/email.iterators.po b/library/email.iterators.po index 5a0856c018..882f65bda4 100644 --- a/library/email.iterators.po +++ b/library/email.iterators.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2016-11-19 00:30+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,7 +28,7 @@ msgstr "**原始碼:**\\ :source:`Lib/email/iterators.py`" #: ../../library/email.iterators.rst:11 msgid "" "Iterating over a message object tree is fairly easy with the :meth:`Message." -"walk ` method. The :mod:`email.iterators` " +"walk ` method. The :mod:`!email.iterators` " "module provides some useful higher level iterations over message object " "trees." msgstr "" diff --git a/library/email.message.po b/library/email.message.po index 7e1526c920..993b808ab1 100644 --- a/library/email.message.po +++ b/library/email.message.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-07 00:14+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,7 +32,7 @@ msgstr "[1]_" #: ../../library/email.message.rst:16 msgid "" "The central class in the :mod:`email` package is the :class:`EmailMessage` " -"class, imported from the :mod:`email.message` module. It is the base class " +"class, imported from the :mod:`!email.message` module. It is the base class " "for the :mod:`email` object model. :class:`EmailMessage` provides the core " "functionality for setting and querying header fields, for accessing message " "bodies, and for creating or modifying structured messages." diff --git a/library/email.parser.po b/library/email.parser.po index 6decb9220c..5e9426c501 100644 --- a/library/email.parser.po +++ b/library/email.parser.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-07-14 11:31+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -172,10 +172,10 @@ msgstr "" #: ../../library/email.parser.rst:128 msgid "" -"The :class:`BytesParser` class, imported from the :mod:`email.parser` " +"The :class:`BytesParser` class, imported from the :mod:`!email.parser` " "module, provides an API that can be used to parse a message when the " "complete contents of the message are available in a :term:`bytes-like " -"object` or file. The :mod:`email.parser` module also provides :class:" +"object` or file. The :mod:`!email.parser` module also provides :class:" "`Parser` for parsing strings, and header-only parsers, :class:" "`BytesHeaderParser` and :class:`HeaderParser`, which can be used if you're " "only interested in the headers of the message. :class:`BytesHeaderParser` " diff --git a/library/email.po b/library/email.po index f0bad9cfcb..5c026bf62f 100644 --- a/library/email.po +++ b/library/email.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,10 +27,10 @@ msgstr "**原始碼:**\\ :source:`Lib/email/__init__.py`" #: ../../library/email.rst:15 msgid "" -"The :mod:`email` package is a library for managing email messages. It is " +"The :mod:`!email` package is a library for managing email messages. It is " "specifically *not* designed to do any sending of email messages to SMTP (:" "rfc:`2821`), NNTP, or other servers; those are functions of modules such as :" -"mod:`smtplib`. The :mod:`email` package attempts to be as RFC-compliant as " +"mod:`smtplib`. The :mod:`!email` package attempts to be as RFC-compliant as " "possible, supporting :rfc:`5322` and :rfc:`6532`, as well as such MIME-" "related RFCs as :rfc:`2045`, :rfc:`2046`, :rfc:`2047`, :rfc:`2183`, and :rfc:" "`2231`." @@ -102,7 +102,7 @@ msgstr "" #: ../../library/email.rst:71 msgid "" -"The following sections describe the functionality of the :mod:`email` " +"The following sections describe the functionality of the :mod:`!email` " "package. We start with the :mod:`~email.message` object model, which is the " "primary interface an application will use, and follow that with the :mod:" "`~email.parser` and :mod:`~email.generator` components. Then we cover the :" @@ -148,7 +148,7 @@ msgid "" msgstr "" #: ../../library/email.rst:105 -msgid "Contents of the :mod:`email` package documentation:" +msgid "Contents of the :mod:`!email` package documentation:" msgstr "" #: ../../library/email.rst:120 diff --git a/library/email.utils.po b/library/email.utils.po index 37cc9eb500..8ea1e5d97e 100644 --- a/library/email.utils.po +++ b/library/email.utils.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-02-07 00:19+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-" @@ -27,17 +27,17 @@ msgstr "**原始碼:**\\ :source:`Lib/email/utils.py`" #: ../../library/email.utils.rst:11 msgid "" -"There are a couple of useful utilities provided in the :mod:`email.utils` " +"There are a couple of useful utilities provided in the :mod:`!email.utils` " "module:" msgstr "" #: ../../library/email.utils.rst:16 msgid "" "Return local time as an aware datetime object. If called without arguments, " -"return current time. Otherwise *dt* argument should be " -"a :class:`~datetime.datetime` instance, and it is converted to the local " -"time zone according to the system time zone database. If *dt* is naive " -"(that is, ``dt.tzinfo`` is ``None``), it is assumed to be in local time." +"return current time. Otherwise *dt* argument should be a :class:`~datetime." +"datetime` instance, and it is converted to the local time zone according to " +"the system time zone database. If *dt* is naive (that is, ``dt.tzinfo`` is " +"``None``), it is assumed to be in local time." msgstr "" #: ../../library/email.utils.rst:24 @@ -46,13 +46,13 @@ msgstr "" #: ../../library/email.utils.rst:29 msgid "" -"Returns a string suitable for an :rfc:`2822`\\ " -"-compliant :mailheader:`Message-ID` header. Optional *idstring* if given, " -"is a string used to strengthen the uniqueness of the message id. Optional " -"*domain* if given provides the portion of the msgid after the '@'. The " -"default is the local hostname. It is not normally necessary to override " -"this default, but may be useful certain cases, such as a constructing " -"distributed system that uses a consistent domain name across multiple hosts." +"Returns a string suitable for an :rfc:`2822`\\ -compliant :mailheader:" +"`Message-ID` header. Optional *idstring* if given, is a string used to " +"strengthen the uniqueness of the message id. Optional *domain* if given " +"provides the portion of the msgid after the '@'. The default is the local " +"hostname. It is not normally necessary to override this default, but may be " +"useful certain cases, such as a constructing distributed system that uses a " +"consistent domain name across multiple hosts." msgstr "" #: ../../library/email.utils.rst:37 @@ -100,17 +100,17 @@ msgstr "" #: ../../library/email.utils.rst:75 msgid "" "The inverse of :meth:`parseaddr`, this takes a 2-tuple of the form " -"``(realname, email_address)`` and returns the string value suitable for " -"a :mailheader:`To` or :mailheader:`Cc` header. If the first element of " -"*pair* is false, then the second element is returned unmodified." +"``(realname, email_address)`` and returns the string value suitable for a :" +"mailheader:`To` or :mailheader:`Cc` header. If the first element of *pair* " +"is false, then the second element is returned unmodified." msgstr "" #: ../../library/email.utils.rst:80 msgid "" "Optional *charset* is the character set that will be used in the :rfc:`2047` " "encoding of the ``realname`` if the ``realname`` contains non-ASCII " -"characters. Can be an instance of :class:`str` or " -"a :class:`~email.charset.Charset`. Defaults to ``utf-8``." +"characters. Can be an instance of :class:`str` or a :class:`~email.charset." +"Charset`. Defaults to ``utf-8``." msgstr "" #: ../../library/email.utils.rst:85 @@ -150,10 +150,10 @@ msgstr "" msgid "" "Attempts to parse a date according to the rules in :rfc:`2822`. however, " "some mailers don't follow that format as specified, so :func:`parsedate` " -"tries to guess correctly in such cases. *date* is a string containing " -"an :rfc:`2822` date, such as ``\"Mon, 20 Nov 1995 19:12:08 -0500\"``. If " -"it succeeds in parsing the date, :func:`parsedate` returns a 9-tuple that " -"can be passed directly to :func:`time.mktime`; otherwise ``None`` will be " +"tries to guess correctly in such cases. *date* is a string containing an :" +"rfc:`2822` date, such as ``\"Mon, 20 Nov 1995 19:12:08 -0500\"``. If it " +"succeeds in parsing the date, :func:`parsedate` returns a 9-tuple that can " +"be passed directly to :func:`time.mktime`; otherwise ``None`` will be " "returned. Note that indexes 6, 7, and 8 of the result tuple are not usable." msgstr "" @@ -170,15 +170,15 @@ msgstr "" #: ../../library/email.utils.rst:134 msgid "" -"The inverse of :func:`format_datetime`. Performs the same function " -"as :func:`parsedate`, but on success returns a :mod:`~datetime.datetime`; " -"otherwise ``ValueError`` is raised if *date* contains an invalid value such " -"as an hour greater than 23 or a timezone offset not between -24 and 24 " -"hours. If the input date has a timezone of ``-0000``, the ``datetime`` will " -"be a naive ``datetime``, and if the date is conforming to the RFCs it will " -"represent a time in UTC but with no indication of the actual source timezone " -"of the message the date comes from. If the input date has any other valid " -"timezone offset, the ``datetime`` will be an aware ``datetime`` with the " +"The inverse of :func:`format_datetime`. Performs the same function as :func:" +"`parsedate`, but on success returns a :mod:`~datetime.datetime`; otherwise " +"``ValueError`` is raised if *date* contains an invalid value such as an hour " +"greater than 23 or a timezone offset not between -24 and 24 hours. If the " +"input date has a timezone of ``-0000``, the ``datetime`` will be a naive " +"``datetime``, and if the date is conforming to the RFCs it will represent a " +"time in UTC but with no indication of the actual source timezone of the " +"message the date comes from. If the input date has any other valid timezone " +"offset, the ``datetime`` will be an aware ``datetime`` with the " "corresponding a :class:`~datetime.timezone` :class:`~datetime.tzinfo`." msgstr "" @@ -199,9 +199,9 @@ msgstr "Fri, 09 Nov 2001 01:08:47 -0000" #: ../../library/email.utils.rst:161 msgid "" -"Optional *timeval* if given is a floating-point time value as accepted " -"by :func:`time.gmtime` and :func:`time.localtime`, otherwise the current " -"time is used." +"Optional *timeval* if given is a floating-point time value as accepted by :" +"func:`time.gmtime` and :func:`time.localtime`, otherwise the current time is " +"used." msgstr "" #: ../../library/email.utils.rst:165 @@ -247,14 +247,14 @@ msgstr "" #: ../../library/email.utils.rst:205 msgid "" -"When a header parameter is encoded in :rfc:`2231` " -"format, :meth:`Message.get_param ` may " -"return a 3-tuple containing the character set, language, and " -"value. :func:`collapse_rfc2231_value` turns this into a unicode string. " -"Optional *errors* is passed to the *errors* argument " -"of :class:`str`'s :func:`~str.encode` method; it defaults to ``'replace'``. " -"Optional *fallback_charset* specifies the character set to use if the one in " -"the :rfc:`2231` header is not known by Python; it defaults to ``'us-ascii'``." +"When a header parameter is encoded in :rfc:`2231` format, :meth:`Message." +"get_param ` may return a 3-tuple containing " +"the character set, language, and value. :func:`collapse_rfc2231_value` " +"turns this into a unicode string. Optional *errors* is passed to the " +"*errors* argument of :class:`str`'s :func:`~str.encode` method; it defaults " +"to ``'replace'``. Optional *fallback_charset* specifies the character set " +"to use if the one in the :rfc:`2231` header is not known by Python; it " +"defaults to ``'us-ascii'``." msgstr "" #: ../../library/email.utils.rst:214 diff --git a/library/ensurepip.po b/library/ensurepip.po index a1d344920b..da2727b384 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-18 00:15+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,8 +26,9 @@ msgid "**Source code:** :source:`Lib/ensurepip`" msgstr "**原始碼:**\\ :source:`Lib/ensurepip`" #: ../../library/ensurepip.rst:14 +#, fuzzy msgid "" -"The :mod:`ensurepip` package provides support for bootstrapping the ``pip`` " +"The :mod:`!ensurepip` package provides support for bootstrapping the ``pip`` " "installer into an existing Python installation or virtual environment. This " "bootstrapping approach reflects the fact that ``pip`` is an independent " "project with its own release cycle, and the latest available stable version " @@ -55,8 +56,8 @@ msgid "" "This module *does not* access the internet. All of the components needed to " "bootstrap ``pip`` are included as internal parts of the package." msgstr "" -"此模組\\ *不會*\\ 存取網路。所有需要用來初始建置 ``pip`` 的元件都已包含在" -"套件之內。" +"此模組\\ *不會*\\ 存取網路。所有需要用來初始建置 ``pip`` 的元件都已包含在套件" +"之內。" #: ../../includes/optional-module.rst:1 msgid "" @@ -91,8 +92,8 @@ msgid "" "This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." msgstr "" -"此模組在\\ :ref:`行動平台 `\\ 或 :ref:`WebAssembly 平" -"台 `\\ 上不支援。" +"此模組在\\ :ref:`行動平台 `\\ 或 :ref:`WebAssembly 平台 " +"`\\ 上不支援。" #: ../../library/ensurepip.rst:48 msgid "Command-line interface" @@ -185,7 +186,8 @@ msgid "Module API" msgstr "模組 API" #: ../../library/ensurepip.rst:102 -msgid ":mod:`ensurepip` exposes two functions for programmatic use:" +#, fuzzy +msgid ":mod:`!ensurepip` exposes two functions for programmatic use:" msgstr ":mod:`ensurepip` 開放了兩個用於編寫程式的函式:" #: ../../library/ensurepip.rst:106 diff --git a/library/fcntl.po b/library/fcntl.po index 7f8e4b7a7f..f242f24fe4 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -6,7 +6,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-02-07 00:19+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -24,8 +24,8 @@ msgstr ":mod:`!fcntl` --- ``fcntl`` 和 ``ioctl`` 系統呼叫" #: ../../library/fcntl.rst:16 msgid "" "This module performs file and I/O control on file descriptors. It is an " -"interface to the :c:func:`fcntl` and :c:func:`ioctl` Unix routines. See " -"the :manpage:`fcntl(2)` and :manpage:`ioctl(2)` Unix manual pages for full " +"interface to the :c:func:`fcntl` and :c:func:`ioctl` Unix routines. See the :" +"manpage:`fcntl(2)` and :manpage:`ioctl(2)` Unix manual pages for full " "details." msgstr "" @@ -36,10 +36,10 @@ msgstr "可用性" #: ../../library/fcntl.rst:23 msgid "" "All functions in this module take a file descriptor *fd* as their first " -"argument. This can be an integer file descriptor, such as returned by " -"``sys.stdin.fileno()``, or an :class:`io.IOBase` object, such as " -"``sys.stdin`` itself, which provides a :meth:`~io.IOBase.fileno` that " -"returns a genuine file descriptor." +"argument. This can be an integer file descriptor, such as returned by ``sys." +"stdin.fileno()``, or an :class:`io.IOBase` object, such as ``sys.stdin`` " +"itself, which provides a :meth:`~io.IOBase.fileno` that returns a genuine " +"file descriptor." msgstr "" #: ../../library/fcntl.rst:29 @@ -58,8 +58,8 @@ msgstr "" #: ../../library/fcntl.rst:38 msgid "" "On macOS, the :mod:`!fcntl` module exposes the ``F_GETPATH`` constant, which " -"obtains the path of a file from a file descriptor. On Linux(>=3.15), " -"the :mod:`!fcntl` module exposes the ``F_OFD_GETLK``, ``F_OFD_SETLK`` and " +"obtains the path of a file from a file descriptor. On Linux(>=3.15), the :" +"mod:`!fcntl` module exposes the ``F_OFD_GETLK``, ``F_OFD_SETLK`` and " "``F_OFD_SETLKW`` constants, which are used when working with open file " "description locks." msgstr "" @@ -80,7 +80,7 @@ msgstr "" #: ../../library/fcntl.rst:55 msgid "" -"On Linux >= 4.5, the :mod:`fcntl` module exposes the ``FICLONE`` and " +"On Linux >= 4.5, the :mod:`!fcntl` module exposes the ``FICLONE`` and " "``FICLONERANGE`` constants, which allow to share some data of one file with " "another file by reflinking on some filesystems (e.g., btrfs, OCFS2, and " "XFS). This behavior is commonly referred to as \"copy-on-write\"." @@ -122,11 +122,11 @@ msgid "" "Perform the operation *cmd* on file descriptor *fd* (file objects providing " "a :meth:`~io.IOBase.fileno` method are accepted as well). The values used " "for *cmd* are operating system dependent, and are available as constants in " -"the :mod:`fcntl` module, using the same names as used in the relevant C " -"header files. The argument *arg* can either be an integer value, " -"a :term:`bytes-like object`, or a string. The type and size of *arg* must " -"match the type and size of the argument of the operation as specified in the " -"relevant C documentation." +"the :mod:`!fcntl` module, using the same names as used in the relevant C " +"header files. The argument *arg* can either be an integer value, a :term:" +"`bytes-like object`, or a string. The type and size of *arg* must match the " +"type and size of the argument of the operation as specified in the relevant " +"C documentation." msgstr "" #: ../../library/fcntl.rst:100 @@ -208,8 +208,8 @@ msgid "" "code is passed back to the calling Python, and the buffer's new contents " "reflect the action of the :c:func:`ioctl`. This is a slight simplification, " "because if the supplied buffer is less than 1024 bytes long it is first " -"copied into a static buffer 1024 bytes long which is then passed " -"to :func:`ioctl` and copied back into the supplied buffer." +"copied into a static buffer 1024 bytes long which is then passed to :func:" +"`ioctl` and copied back into the supplied buffer." msgstr "" #: ../../library/fcntl.rst:158 @@ -293,9 +293,9 @@ msgstr "" #: ../../library/fcntl.rst:202 msgid "" "This is essentially a wrapper around the :func:`~fcntl.fcntl` locking calls. " -"*fd* is the file descriptor (file objects providing " -"a :meth:`~io.IOBase.fileno` method are accepted as well) of the file to lock " -"or unlock, and *cmd* is one of the following values:" +"*fd* is the file descriptor (file objects providing a :meth:`~io.IOBase." +"fileno` method are accepted as well) of the file to lock or unlock, and " +"*cmd* is one of the following values:" msgstr "" #: ../../library/fcntl.rst:209 @@ -318,19 +318,19 @@ msgstr "" #: ../../library/fcntl.rst:224 msgid "" -"If :const:`!LOCK_NB` is used and the lock cannot be acquired, " -"an :exc:`OSError` will be raised and the exception will have an *errno* " -"attribute set to :const:`~errno.EACCES` or :const:`~errno.EAGAIN` (depending " -"on the operating system; for portability, check for both values). On at " -"least some systems, :const:`!LOCK_EX` can only be used if the file " -"descriptor refers to a file opened for writing." +"If :const:`!LOCK_NB` is used and the lock cannot be acquired, an :exc:" +"`OSError` will be raised and the exception will have an *errno* attribute " +"set to :const:`~errno.EACCES` or :const:`~errno.EAGAIN` (depending on the " +"operating system; for portability, check for both values). On at least some " +"systems, :const:`!LOCK_EX` can only be used if the file descriptor refers to " +"a file opened for writing." msgstr "" #: ../../library/fcntl.rst:231 msgid "" "*len* is the number of bytes to lock, *start* is the byte offset at which " -"the lock starts, relative to *whence*, and *whence* is as " -"with :func:`io.IOBase.seek`, specifically:" +"the lock starts, relative to *whence*, and *whence* is as with :func:`io." +"IOBase.seek`, specifically:" msgstr "" #: ../../library/fcntl.rst:235 diff --git a/library/filecmp.po b/library/filecmp.po index 972ad9527f..78652b3d9d 100644 --- a/library/filecmp.po +++ b/library/filecmp.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-19 00:13+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,13 +27,14 @@ msgstr "**原始碼:**\\ :source:`Lib/filecmp.py`" #: ../../library/filecmp.rst:13 msgid "" -"The :mod:`filecmp` module defines functions to compare files and " +"The :mod:`!filecmp` module defines functions to compare files and " "directories, with various optional time/correctness trade-offs. For " "comparing files, see also the :mod:`difflib` module." msgstr "" #: ../../library/filecmp.rst:17 -msgid "The :mod:`filecmp` module defines the following functions:" +#, fuzzy +msgid "The :mod:`!filecmp` module defines the following functions:" msgstr ":mod:`filecmp` 模組定義了以下函式:" #: ../../library/filecmp.rst:22 @@ -86,8 +87,8 @@ msgstr "" #: ../../library/filecmp.rst:51 msgid "" -"The *shallow* parameter has the same meaning and default value as " -"for :func:`filecmp.cmp`." +"The *shallow* parameter has the same meaning and default value as for :func:" +"`filecmp.cmp`." msgstr "" #: ../../library/filecmp.rst:54 @@ -111,9 +112,9 @@ msgstr "" #: ../../library/filecmp.rst:75 msgid "" "Construct a new directory comparison object, to compare the directories *a* " -"and *b*. *ignore* is a list of names to ignore, and defaults " -"to :const:`filecmp.DEFAULT_IGNORES`. *hide* is a list of names to hide, and " -"defaults to ``[os.curdir, os.pardir]``." +"and *b*. *ignore* is a list of names to ignore, and defaults to :const:" +"`filecmp.DEFAULT_IGNORES`. *hide* is a list of names to hide, and defaults " +"to ``[os.curdir, os.pardir]``." msgstr "" #: ../../library/filecmp.rst:80 diff --git a/library/fractions.po b/library/fractions.po index 03799a18f9..f385888240 100644 --- a/library/fractions.po +++ b/library/fractions.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-08 00:15+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2016-01-31 07:18+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/fractions.py`" #: ../../library/fractions.rst:14 msgid "" -"The :mod:`fractions` module provides support for rational number arithmetic." +"The :mod:`!fractions` module provides support for rational number arithmetic." msgstr "" #: ../../library/fractions.rst:17 diff --git a/library/ftplib.po b/library/ftplib.po index d453fa16ca..9d1ab058e5 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 00:13+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2023-04-26 19:44+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -58,7 +58,8 @@ msgstr "" "availability`。" #: ../../library/ftplib.rst:26 -msgid "Here's a sample session using the :mod:`ftplib` module::" +#, fuzzy +msgid "Here's a sample session using the :mod:`!ftplib` module::" msgstr "這是一個使用 :mod:`ftplib` 模組的會話範例:" #: ../../library/ftplib.rst:28 diff --git a/library/functools.po b/library/functools.po index 60b55ae508..d414afc230 100644 --- a/library/functools.po +++ b/library/functools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-19 00:14+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2024-05-11 16:02+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,8 +29,9 @@ msgid "**Source code:** :source:`Lib/functools.py`" msgstr "**原始碼:**\\ :source:`Lib/functools.py`" #: ../../library/functools.rst:23 +#, fuzzy msgid "" -"The :mod:`functools` module is for higher-order functions: functions that " +"The :mod:`!functools` module is for higher-order functions: functions that " "act on or return other functions. In general, any callable object can be " "treated as a function for the purposes of this module." msgstr "" @@ -38,7 +39,8 @@ msgstr "" "可呼叫物件都可以被視為用於此模組的函式。" #: ../../library/functools.rst:27 -msgid "The :mod:`functools` module defines the following functions:" +#, fuzzy +msgid "The :mod:`!functools` module defines the following functions:" msgstr ":mod:`functools` 模組定義了以下函式:" #: ../../library/functools.rst:31 diff --git a/library/gc.po b/library/gc.po index abcbc0941b..6bcdc574c2 100644 --- a/library/gc.po +++ b/library/gc.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-29 00:15+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2023-04-24 21:25+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -47,7 +47,8 @@ msgstr "" "``gc.DEBUG_SAVEALL``,使得被回收的物件會被存放在 gc.garbage 中以待檢查。" #: ../../library/gc.rst:23 -msgid "The :mod:`gc` module provides the following functions:" +#, fuzzy +msgid "The :mod:`!gc` module provides the following functions:" msgstr ":mod:`gc` module 提供下列函式:" #: ../../library/gc.rst:28 @@ -202,8 +203,8 @@ msgid "" "have survived a collection. New objects are placed in the young generation. " "If an object survives a collection it is moved into the old generation." msgstr "" -"GC 根據物件是否在回收中倖存下來而將其分為兩代。新的物件會被放置在年輕代中。如果一" -"個物件在回收中倖存下來,它將被移動到年老代中。" +"GC 根據物件是否在回收中倖存下來而將其分為兩代。新的物件會被放置在年輕代中。如" +"果一個物件在回收中倖存下來,它將被移動到年老代中。" #: ../../library/gc.rst:125 msgid "" @@ -213,9 +214,9 @@ msgid "" "*threshold0*, collection starts. For each collection, all the objects in the " "young generation and some fraction of the old generation is collected." msgstr "" -"為了決定何時運行,回收器會追蹤自上次回收以來物件分配和釋放的數量。當分配數" -"量減去釋放數量超過 *threshold0* 時,回收就會開始。每次回收都會去回收年輕代中的所有物件" -"和年老代的部分物件。" +"為了決定何時運行,回收器會追蹤自上次回收以來物件分配和釋放的數量。當分配數量" +"減去釋放數量超過 *threshold0* 時,回收就會開始。每次回收都會去回收年輕代中的" +"所有物件和年老代的部分物件。" #: ../../library/gc.rst:131 msgid "" @@ -224,9 +225,9 @@ msgid "" "by 10% since the last collection and the net number of object allocations " "has not exceeded 40 times *threshold0*, the collection is not run." msgstr "" -"在自由執行緒建置 (free-threaded build) 中,在運行回收器之前還會檢查行程記憶體使用量的" -"增加。如果自上次回收以來記憶體使用量未增加 10%,且物件分配的淨數量未超過 *threshold0* " -"的 40 倍,則不會運行回收。" +"在自由執行緒建置 (free-threaded build) 中,在運行回收器之前還會檢查行程記憶體" +"使用量的增加。如果自上次回收以來記憶體使用量未增加 10%,且物件分配的淨數量未" +"超過 *threshold0* 的 40 倍,則不會運行回收。" #: ../../library/gc.rst:136 msgid "" @@ -235,8 +236,8 @@ msgid "" "in the old generation are collected. For the default value of 10, 1% of the " "old generation is scanned during each collection." msgstr "" -"年老代中被回收的物件比例與 *threshold1* 成\\ **反比**。*threshold1* 越大,年老代中" -"物件的回收就越慢。以預設值 10 來說,每次回收時會掃描年老代中的 1%。" +"年老代中被回收的物件比例與 *threshold1* 成\\ **反比**。*threshold1* 越大,年" +"老代中物件的回收就越慢。以預設值 10 來說,每次回收時會掃描年老代中的 1%。" #: ../../library/gc.rst:141 msgid "*threshold2* is ignored." @@ -247,8 +248,8 @@ msgid "" "See `Garbage collector design `_ for more information." msgstr "" -"有關更多資訊,請參閱\\ `垃圾回收器設計 `_。" +"有關更多資訊,請參閱\\ `垃圾回收器設計 `_。" #: ../../library/gc.rst:145 msgid "*threshold2* is ignored" diff --git a/library/getpass.po b/library/getpass.po index 93118b2782..641c4fdbf3 100644 --- a/library/getpass.po +++ b/library/getpass.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-18 00:15+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2022-02-11 12:04+0800\n" "Last-Translator: Weilin Du\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -40,7 +40,8 @@ msgstr "" "availability`。" #: ../../library/getpass.rst:17 -msgid "The :mod:`getpass` module provides two functions:" +#, fuzzy +msgid "The :mod:`!getpass` module provides two functions:" msgstr ":mod:`getpass` 模組 (module) 提供了兩個函式:" #: ../../library/getpass.rst:21 diff --git a/library/gettext.po b/library/gettext.po index bc20d1e31f..068658e0fb 100644 --- a/library/gettext.po +++ b/library/gettext.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/gettext.py`" #: ../../library/gettext.rst:14 msgid "" -"The :mod:`gettext` module provides internationalization (I18N) and " +"The :mod:`!gettext` module provides internationalization (I18N) and " "localization (L10N) services for your Python modules and applications. It " "supports both the GNU :program:`gettext` message catalog API and a higher " "level, class-based API that may be more appropriate for Python files. The " @@ -47,7 +47,7 @@ msgstr "GNU :program:`gettext` API" #: ../../library/gettext.rst:28 msgid "" -"The :mod:`gettext` module defines the following API, which is very similar " +"The :mod:`!gettext` module defines the following API, which is very similar " "to the GNU :program:`gettext` API. If you use this API you will affect the " "translation of your entire application globally. Often this is what you " "want if your application is monolingual, with the choice of language " @@ -59,7 +59,7 @@ msgstr "" #: ../../library/gettext.rst:39 msgid "" "Bind the *domain* to the locale directory *localedir*. More concretely, :" -"mod:`gettext` will look for binary :file:`.mo` files for the given domain " +"mod:`!gettext` will look for binary :file:`.mo` files for the given domain " "using the path (on Unix): :file:`{localedir}/{language}/LC_MESSAGES/{domain}." "mo`, where *language* is searched for in the environment variables :envvar:" "`LANGUAGE`, :envvar:`LC_ALL`, :envvar:`LC_MESSAGES`, and :envvar:`LANG` " @@ -153,7 +153,7 @@ msgstr "" #: ../../library/gettext.rst:117 msgid "" -"The class-based API of the :mod:`gettext` module gives you more flexibility " +"The class-based API of the :mod:`!gettext` module gives you more flexibility " "and greater convenience than the GNU :program:`gettext` API. It is the " "recommended way of localizing your Python applications and modules. :mod:`!" "gettext` defines a :class:`GNUTranslations` class which implements the " @@ -516,7 +516,7 @@ msgstr "" #: ../../library/gettext.rst:396 msgid "" -"GNOME uses a version of the :mod:`gettext` module by James Henstridge, but " +"GNOME uses a version of the :mod:`!gettext` module by James Henstridge, but " "this version has a slightly different API. Its documented usage was::" msgstr "" @@ -574,7 +574,8 @@ msgstr "" #: ../../library/gettext.rst:428 msgid "" -"use the :mod:`gettext` module so that message strings are properly translated" +"use the :mod:`!gettext` module so that message strings are properly " +"translated" msgstr "" #: ../../library/gettext.rst:430 @@ -645,13 +646,13 @@ msgid "" "language. They send back the completed language-specific versions as a :" "file:`.po` file that's compiled into a machine-readable :file:" "`.mo` binary catalog file using the :program:`msgfmt` program. The :file:`." -"mo` files are used by the :mod:`gettext` module for the actual translation " +"mo` files are used by the :mod:`!gettext` module for the actual translation " "processing at run-time." msgstr "" #: ../../library/gettext.rst:479 msgid "" -"How you use the :mod:`gettext` module in your code depends on whether you " +"How you use the :mod:`!gettext` module in your code depends on whether you " "are internationalizing a single module or your entire application. The next " "two sections will discuss each case." msgstr "" diff --git a/library/graphlib.po b/library/graphlib.po index 25e220b4df..8e0b390a9c 100644 --- a/library/graphlib.po +++ b/library/graphlib.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-02-07 00:19+0000\n" "PO-Revision-Date: 2023-01-04 16:35+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -93,15 +93,15 @@ msgid "" "nodes returned by :meth:`~TopologicalSorter.get_ready` and process them. " "Call :meth:`~TopologicalSorter.done` on each node as it finishes processing." msgstr "" -"當 :meth:`~TopologicalSorter.is_active` 為 ``True`` 時,疊" -"代 :meth:`~TopologicalSorter.get_ready` 回傳的節點並處理它們。在每個節點完成" -"處理時呼叫 :meth:`~TopologicalSorter.done`。" +"當 :meth:`~TopologicalSorter.is_active` 為 ``True`` 時,疊代 :meth:" +"`~TopologicalSorter.get_ready` 回傳的節點並處理它們。在每個節點完成處理時呼" +"叫 :meth:`~TopologicalSorter.done`。" #: ../../library/graphlib.rst:49 msgid "" "In case just an immediate sorting of the nodes in the graph is required and " -"no parallelism is involved, the convenience " -"method :meth:`TopologicalSorter.static_order` can be used directly:" +"no parallelism is involved, the convenience method :meth:`TopologicalSorter." +"static_order` can be used directly:" msgstr "" "如果只需要立即對圖中的節點進行排序且不涉及平行性 (parallelism),則可以直接使" "用便捷方法 :meth:`TopologicalSorter.static_order`:" @@ -179,27 +179,27 @@ msgstr "" msgid "" "Raises :exc:`ValueError` if called after :meth:`~TopologicalSorter.prepare`." msgstr "" -"如果在 :meth:`~TopologicalSorter.prepare` 之後呼叫,則引" -"發 :exc:`ValueError`。" +"如果在 :meth:`~TopologicalSorter.prepare` 之後呼叫,則引發 :exc:" +"`ValueError`。" #: ../../library/graphlib.rst:102 msgid "" "Mark the graph as finished and check for cycles in the graph. If any cycle " -"is detected, :exc:`CycleError` will be raised, " -"but :meth:`~TopologicalSorter.get_ready` can still be used to obtain as many " -"nodes as possible until cycles block more progress. After a call to this " -"function, the graph cannot be modified, and therefore no more nodes can be " -"added using :meth:`~TopologicalSorter.add`." +"is detected, :exc:`CycleError` will be raised, but :meth:`~TopologicalSorter." +"get_ready` can still be used to obtain as many nodes as possible until " +"cycles block more progress. After a call to this function, the graph cannot " +"be modified, and therefore no more nodes can be added using :meth:" +"`~TopologicalSorter.add`." msgstr "" -"將圖標記為已完成並檢查圖中的循環。如果檢測到任何循環,將引" -"發 :exc:`CycleError`,但 :meth:`~TopologicalSorter.get_ready` 仍可用於盡可能" -"獲得更多的節點,直到循環阻塞了進度。呼叫此函式後就無法修改圖,因此無法使" -"用 :meth:`~TopologicalSorter.add` 來新增更多節點。" +"將圖標記為已完成並檢查圖中的循環。如果檢測到任何循環,將引發 :exc:" +"`CycleError`,但 :meth:`~TopologicalSorter.get_ready` 仍可用於盡可能獲得更多" +"的節點,直到循環阻塞了進度。呼叫此函式後就無法修改圖,因此無法使用 :meth:" +"`~TopologicalSorter.add` 來新增更多節點。" #: ../../library/graphlib.rst:109 msgid "" -"A :exc:`ValueError` will be raised if the sort has been started " -"by :meth:`~.static_order` or :meth:`~.get_ready`." +"A :exc:`ValueError` will be raised if the sort has been started by :meth:`~." +"static_order` or :meth:`~.get_ready`." msgstr "" #: ../../library/graphlib.rst:114 @@ -212,16 +212,15 @@ msgstr "" msgid "" "Returns ``True`` if more progress can be made and ``False`` otherwise. " "Progress can be made if cycles do not block the resolution and either there " -"are still nodes ready that haven't yet been returned " -"by :meth:`TopologicalSorter.get_ready` or the number of nodes " -"marked :meth:`TopologicalSorter.done` is less than the number that have been " -"returned by :meth:`TopologicalSorter.get_ready`." +"are still nodes ready that haven't yet been returned by :meth:" +"`TopologicalSorter.get_ready` or the number of nodes marked :meth:" +"`TopologicalSorter.done` is less than the number that have been returned by :" +"meth:`TopologicalSorter.get_ready`." msgstr "" "如果可以有更多進度則回傳 ``True``,否則回傳 ``False``。如果循環不阻塞解析 " -"(resolution) 並且仍有節點準備就緒但尚未" -"由 :meth:`TopologicalSorter.get_ready` 回傳或標記" -"為 :meth:`TopologicalSorter.done` 的節點數量" -"較 :meth:`TopologicalSorter.get_ready` 所回傳的少,則可以繼續取得進度。" +"(resolution) 並且仍有節點準備就緒但尚未由 :meth:`TopologicalSorter." +"get_ready` 回傳或標記為 :meth:`TopologicalSorter.done` 的節點數量較 :meth:" +"`TopologicalSorter.get_ready` 所回傳的少,則可以繼續取得進度。" #: ../../library/graphlib.rst:126 msgid "" @@ -251,11 +250,11 @@ msgstr "" #: ../../library/graphlib.rst:137 ../../library/graphlib.rst:160 msgid "" -"Raises :exc:`ValueError` if called without " -"calling :meth:`~TopologicalSorter.prepare` previously." +"Raises :exc:`ValueError` if called without calling :meth:`~TopologicalSorter." +"prepare` previously." msgstr "" -"如果呼叫之前沒有先呼叫 :meth:`~TopologicalSorter.prepare` 則引" -"發 :exc:`ValueError`。" +"如果呼叫之前沒有先呼叫 :meth:`~TopologicalSorter.prepare` 則引發 :exc:" +"`ValueError`。" #: ../../library/graphlib.rst:142 msgid "" @@ -264,21 +263,21 @@ msgid "" "returned in the future by a call to :meth:`TopologicalSorter.get_ready`." msgstr "" "將 :meth:`TopologicalSorter.get_ready` 回傳的一組節點標記為已處理,停止阻塞 " -"*nodes* 中每個節點的任何後繼節點 (successor),以便將來透過呼" -"叫 :meth:`TopologicalSorter.get_ready` 回傳。" +"*nodes* 中每個節點的任何後繼節點 (successor),以便將來透過呼叫 :meth:" +"`TopologicalSorter.get_ready` 回傳。" #: ../../library/graphlib.rst:146 msgid "" "Raises :exc:`ValueError` if any node in *nodes* has already been marked as " "processed by a previous call to this method or if a node was not added to " -"the graph by using :meth:`TopologicalSorter.add`, if called without " -"calling :meth:`~TopologicalSorter.prepare` or if node has not yet been " -"returned by :meth:`~TopologicalSorter.get_ready`." +"the graph by using :meth:`TopologicalSorter.add`, if called without calling :" +"meth:`~TopologicalSorter.prepare` or if node has not yet been returned by :" +"meth:`~TopologicalSorter.get_ready`." msgstr "" -"若沒有和該呼叫一起呼叫 :meth:`~TopologicalSorter.prepare` 或節點還沒有" -"被 :meth:`~TopologicalSorter.get_ready` 回傳,且如果 *nodes* 中有任何節點已被" -"先前對此方法的呼叫標記為已處理、或者未使用 :meth:`TopologicalSorter.add` 將節" -"點新增到圖中,則引發 :exc:`ValueError`。" +"若沒有和該呼叫一起呼叫 :meth:`~TopologicalSorter.prepare` 或節點還沒有被 :" +"meth:`~TopologicalSorter.get_ready` 回傳,且如果 *nodes* 中有任何節點已被先前" +"對此方法的呼叫標記為已處理、或者未使用 :meth:`TopologicalSorter.add` 將節點新" +"增到圖中,則引發 :exc:`ValueError`。" #: ../../library/graphlib.rst:154 msgid "" @@ -296,13 +295,13 @@ msgstr "" #: ../../library/graphlib.rst:165 msgid "" "Returns an iterator object which will iterate over nodes in a topological " -"order. When using this method, :meth:`~TopologicalSorter.prepare` " -"and :meth:`~TopologicalSorter.done` should not be called. This method is " -"equivalent to::" +"order. When using this method, :meth:`~TopologicalSorter.prepare` and :meth:" +"`~TopologicalSorter.done` should not be called. This method is equivalent " +"to::" msgstr "" -"回傳一個可疊代物件,它將按拓撲排序疊代節點。使用此方法時,不應呼" -"叫 :meth:`~TopologicalSorter.prepare` 和 :meth:`~TopologicalSorter.done`。此" -"方法等效於: ::" +"回傳一個可疊代物件,它將按拓撲排序疊代節點。使用此方法時,不應呼叫 :meth:" +"`~TopologicalSorter.prepare` 和 :meth:`~TopologicalSorter.done`。此方法等效" +"於: ::" #: ../../library/graphlib.rst:170 msgid "" @@ -355,13 +354,13 @@ msgstr "" #: ../../library/graphlib.rst:194 msgid "" "This is due to the fact that \"0\" and \"2\" are in the same level in the " -"graph (they would have been returned in the same call " -"to :meth:`~TopologicalSorter.get_ready`) and the order between them is " -"determined by the order of insertion." +"graph (they would have been returned in the same call to :meth:" +"`~TopologicalSorter.get_ready`) and the order between them is determined by " +"the order of insertion." msgstr "" -"這是因為 \"0\" 和 \"2\" 在圖中處於同一級別(它們將在" -"對 :meth:`~TopologicalSorter.get_ready` 的同一呼叫中回傳)並且它們之間的順序" -"取決於插入順序。" +"這是因為 \"0\" 和 \"2\" 在圖中處於同一級別(它們將在對 :meth:" +"`~TopologicalSorter.get_ready` 的同一呼叫中回傳)並且它們之間的順序取決於插入" +"順序。" #: ../../library/graphlib.rst:200 msgid "If any cycle is detected, :exc:`CycleError` will be raised." @@ -372,7 +371,8 @@ msgid "Exceptions" msgstr "例外" #: ../../library/graphlib.rst:207 -msgid "The :mod:`graphlib` module defines the following exception classes:" +#, fuzzy +msgid "The :mod:`!graphlib` module defines the following exception classes:" msgstr ":mod:`graphlib` 模組定義了以下例外類別:" #: ../../library/graphlib.rst:211 @@ -381,18 +381,17 @@ msgid "" "cycles exist in the working graph. If multiple cycles exist, only one " "undefined choice among them will be reported and included in the exception." msgstr "" -":exc:`ValueError` 的子類別,如果作用的圖中存在循環則" -"由 :meth:`TopologicalSorter.prepare` 引發。如果存在多個循環,則只會報告未定義" -"的其中一個並包含在例外中。" +":exc:`ValueError` 的子類別,如果作用的圖中存在循環則由 :meth:" +"`TopologicalSorter.prepare` 引發。如果存在多個循環,則只會報告未定義的其中一" +"個並包含在例外中。" #: ../../library/graphlib.rst:215 msgid "" -"The detected cycle can be accessed via the second element in " -"the :attr:`~BaseException.args` attribute of the exception instance and " -"consists in a list of nodes, such that each node is, in the graph, an " -"immediate predecessor of the next node in the list. In the reported list, " -"the first and the last node will be the same, to make it clear that it is " -"cyclic." +"The detected cycle can be accessed via the second element in the :attr:" +"`~BaseException.args` attribute of the exception instance and consists in a " +"list of nodes, such that each node is, in the graph, an immediate " +"predecessor of the next node in the list. In the reported list, the first " +"and the last node will be the same, to make it clear that it is cyclic." msgstr "" "檢測到的循環可以透過例外實例的 :attr:`~BaseException.args` 屬性中第二個元素來" "存取,其為一個節點列表,每個節點在圖中都是列表中下一個節點的直接前驅節點" diff --git a/library/gzip.po b/library/gzip.po index f78de511c3..706115d1f9 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-18 00:15+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -46,11 +46,11 @@ msgstr "" #: ../../library/gzip.rst:18 msgid "" -"The :mod:`gzip` module provides the :class:`GzipFile` class, as well as the :" -"func:`.open`, :func:`compress` and :func:`decompress` convenience functions. " -"The :class:`GzipFile` class reads and writes :program:`gzip`\\ -format " -"files, automatically compressing or decompressing the data so that it looks " -"like an ordinary :term:`file object`." +"The :mod:`!gzip` module provides the :class:`GzipFile` class, as well as " +"the :func:`.open`, :func:`compress` and :func:`decompress` convenience " +"functions. The :class:`GzipFile` class reads and writes :program:`gzip`\\ -" +"format files, automatically compressing or decompressing the data so that it " +"looks like an ordinary :term:`file object`." msgstr "" #: ../../library/gzip.rst:24 @@ -416,12 +416,12 @@ msgstr "命令列介面" #: ../../library/gzip.rst:275 msgid "" -"The :mod:`gzip` module provides a simple command line interface to compress " +"The :mod:`!gzip` module provides a simple command line interface to compress " "or decompress files." msgstr "" #: ../../library/gzip.rst:278 -msgid "Once executed the :mod:`gzip` module keeps the input file(s)." +msgid "Once executed the :mod:`!gzip` module keeps the input file(s)." msgstr "" #: ../../library/gzip.rst:282 diff --git a/library/hashlib.po b/library/hashlib.po index 91b8e4ca77..e72da452a4 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-03 00:13+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2024-05-11 16:03+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -99,9 +99,10 @@ msgstr "" "或者不被允許使用。以上會對應到 :data:`algorithms_guaranteed`。" #: ../../library/hashlib.rst:63 +#, fuzzy msgid "" "Additional algorithms may also be available if your Python distribution's :" -"mod:`hashlib` was linked against a build of OpenSSL that provides others. " +"mod:`!hashlib` was linked against a build of OpenSSL that provides others. " "Others *are not guaranteed available* on all installations and will only be " "accessible by name via :func:`new`. See :data:`algorithms_available`." msgstr "" @@ -557,9 +558,10 @@ msgstr "" "鹽雜湊 (salted hashing)**、**個人化**\\ 和\\ **樹狀雜湊**。" #: ../../library/hashlib.rst:392 +#, fuzzy msgid "" -"Hash objects from this module follow the API of standard library's :mod:" -"`hashlib` objects." +"Hash objects from this module follow the API of standard library's :mod:`!" +"hashlib` objects." msgstr "該模組中的雜湊物件遵循標準函式庫的 :mod:`hashlib` 物件 API。" #: ../../library/hashlib.rst:397 diff --git a/library/http.cookiejar.po b/library/http.cookiejar.po index 57ed00add3..d8f86cb756 100644 --- a/library/http.cookiejar.po +++ b/library/http.cookiejar.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-05 00:16+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2025-06-28 00:56+0800\n" "Last-Translator: Weilin Du\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,8 +28,9 @@ msgid "**Source code:** :source:`Lib/http/cookiejar.py`" msgstr "**原始碼:**\\ :source:`Lib/http/cookiejar.py`" #: ../../library/http.cookiejar.rst:14 +#, fuzzy msgid "" -"The :mod:`http.cookiejar` module defines classes for automatic handling of " +"The :mod:`!http.cookiejar` module defines classes for automatic handling of " "HTTP cookies. It is useful for accessing websites that require small pieces " "of data -- :dfn:`cookies` -- to be set on the client machine by an HTTP " "response from a web server, and then returned to the server in later HTTP " @@ -40,13 +41,14 @@ msgstr "" "回應來設置於用戶端機器,並在之後的請求中被回傳到伺服器。" #: ../../library/http.cookiejar.rst:19 +#, fuzzy msgid "" "Both the regular Netscape cookie protocol and the protocol defined by :rfc:" "`2965` are handled. RFC 2965 handling is switched off by default. :rfc:" "`2109` cookies are parsed as Netscape cookies and subsequently treated " "either as Netscape or RFC 2965 cookies according to the 'policy' in effect. " "Note that the great majority of cookies on the internet are Netscape " -"cookies. :mod:`http.cookiejar` attempts to follow the de-facto Netscape " +"cookies. :mod:`!http.cookiejar` attempts to follow the de-facto Netscape " "cookie protocol (which differs substantially from that set out in the " "original Netscape specification), including taking note of the ``max-age`` " "and ``port`` cookie-attributes introduced with RFC 2965." @@ -184,9 +186,10 @@ msgstr "" "`DefaultCookiePolicy` 也提供了一些參數來允許對策略進行一些微調。" #: ../../library/http.cookiejar.rst:111 +#, fuzzy msgid "" "This class represents Netscape, :rfc:`2109` and :rfc:`2965` cookies. It is " -"not expected that users of :mod:`http.cookiejar` construct their own :class:" +"not expected that users of :mod:`!http.cookiejar` construct their own :class:" "`Cookie` instances. Instead, if necessary, call :meth:`make_cookies` on a :" "class:`CookieJar` instance." msgstr "" @@ -207,9 +210,10 @@ msgid "Module :mod:`http.cookies`" msgstr ":mod:`http.cookies` 模組" #: ../../library/http.cookiejar.rst:123 +#, fuzzy msgid "" -"HTTP cookie classes, principally useful for server-side code. The :mod:" -"`http.cookiejar` and :mod:`http.cookies` modules do not depend on each other." +"HTTP cookie classes, principally useful for server-side code. The :mod:`!" +"http.cookiejar` and :mod:`http.cookies` modules do not depend on each other." msgstr "" "HTTP cookie 類別,主要用於伺服器端程式碼。 :mod:`http.cookiejar` 和 :mod:" "`http.cookies` 模組不互相依賴。" @@ -219,10 +223,11 @@ msgid "https://curl.se/rfc/cookie_spec.html" msgstr "https://curl.se/rfc/cookie_spec.html" #: ../../library/http.cookiejar.rst:128 +#, fuzzy msgid "" "The specification of the original Netscape cookie protocol. Though this is " "still the dominant protocol, the 'Netscape cookie protocol' implemented by " -"all the major browsers (and :mod:`http.cookiejar`) only bears a passing " +"all the major browsers (and :mod:`!http.cookiejar`) only bears a passing " "resemblance to the one sketched out in ``cookie_spec.html``." msgstr "" "原始 Netscape cookie 協定的規範。雖然這仍是主流協定,但所有主要瀏覽器(以及 :" @@ -976,13 +981,14 @@ msgid "Cookie Objects" msgstr "Cookie 物件" #: ../../library/http.cookiejar.rst:615 +#, fuzzy msgid "" ":class:`Cookie` instances have Python attributes roughly corresponding to " "the standard cookie-attributes specified in the various cookie standards. " "The correspondence is not one-to-one, because there are complicated rules " "for assigning default values, because the ``max-age`` and ``expires`` cookie-" "attributes contain equivalent information, and because :rfc:`2109` cookies " -"may be 'downgraded' by :mod:`http.cookiejar` from version 1 to version 0 " +"may be 'downgraded' by :mod:`!http.cookiejar` from version 1 to version 0 " "(Netscape) cookies." msgstr "" ":class:`Cookie` 實例的 Python 屬性大致對應於各種 cookie 標準中指定的標準 " @@ -1001,11 +1007,12 @@ msgstr "" "這個類別不會強制執行內部一致性,所以如果你這麼做,你應該要知道你在做什麼。" #: ../../library/http.cookiejar.rst:630 +#, fuzzy msgid "" "Integer or :const:`None`. Netscape cookies have :attr:`version` 0. :rfc:" "`2965` and :rfc:`2109` cookies have a ``version`` cookie-attribute of 1. " -"However, note that :mod:`http.cookiejar` may 'downgrade' RFC 2109 cookies to " -"Netscape cookies, in which case :attr:`version` is 0." +"However, note that :mod:`!http.cookiejar` may 'downgrade' RFC 2109 cookies " +"to Netscape cookies, in which case :attr:`version` is 0." msgstr "" "整數或 :const:`None`。 Netscape cookie 的 :attr:`version` 為 0。 :rfc:`2965` " "和 :rfc:`2109` cookie 的 ``version`` cookie 屬性為 1。但是,請注意 :mod:" @@ -1066,11 +1073,12 @@ msgstr "" "鏈接到來自伺服器的解釋此 cookie 功能的註釋的 URL,或者為 :const:`None`。" #: ../../library/http.cookiejar.rst:692 +#, fuzzy msgid "" "``True`` if this cookie was received as an :rfc:`2109` cookie (ie. the " "cookie arrived in a :mailheader:`Set-Cookie` header, and the value of the " "Version cookie-attribute in that header was 1). This attribute is provided " -"because :mod:`http.cookiejar` may 'downgrade' RFC 2109 cookies to Netscape " +"because :mod:`!http.cookiejar` may 'downgrade' RFC 2109 cookies to Netscape " "cookies, in which case :attr:`version` is 0." msgstr "" "``True`` 如果這個 cookie 是以 :rfc:`2109` cookie 的形式收到的 (即這個 cookie " @@ -1136,8 +1144,9 @@ msgid "Examples" msgstr "範例" #: ../../library/http.cookiejar.rst:747 +#, fuzzy msgid "" -"The first example shows the most common usage of :mod:`http.cookiejar`::" +"The first example shows the most common usage of :mod:`!http.cookiejar`::" msgstr "第一個範例展示了 :mod:`http.cookiejar`: 最常見的用法: ::" #: ../../library/http.cookiejar.rst:749 diff --git a/library/http.cookies.po b/library/http.cookies.po index c5989efd59..76a0eb425a 100644 --- a/library/http.cookies.po +++ b/library/http.cookies.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-24 22:47+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2024-12-24 18:49+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,8 +26,9 @@ msgid "**Source code:** :source:`Lib/http/cookies.py`" msgstr "**原始碼:**\\ :source:`Lib/http/cookies.py`" #: ../../library/http.cookies.rst:14 +#, fuzzy msgid "" -"The :mod:`http.cookies` module defines classes for abstracting the concept " +"The :mod:`!http.cookies` module defines classes for abstracting the concept " "of cookies, an HTTP state management mechanism. It supports both simple " "string-only cookies, and provides an abstraction for having any serializable " "data-type as cookie value." @@ -111,9 +112,10 @@ msgid "Module :mod:`http.cookiejar`" msgstr ":mod:`http.cookiejar` 模組" #: ../../library/http.cookies.rst:67 +#, fuzzy msgid "" "HTTP cookie handling for web *clients*. The :mod:`http.cookiejar` and :mod:" -"`http.cookies` modules do not depend on each other." +"`!http.cookies` modules do not depend on each other." msgstr "" "用於網路\\ *用戶端*\\ 的 HTTP cookie 處理。:mod:`http.cookiejar` 和 :mod:" "`http.cookies` 模組互不相依。" @@ -365,8 +367,10 @@ msgid "Example" msgstr "範例" #: ../../library/http.cookies.rst:267 +#, fuzzy msgid "" -"The following example demonstrates how to use the :mod:`http.cookies` module." +"The following example demonstrates how to use the :mod:`!http.cookies` " +"module." msgstr "以下範例示範如何使用 :mod:`http.cookies` 模組。" #: ../../library/http.cookies.rst:269 diff --git a/library/http.po b/library/http.po index 38be94095c..5f20a7a93c 100644 --- a/library/http.po +++ b/library/http.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-15 00:16+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,8 +28,9 @@ msgid "**Source code:** :source:`Lib/http/__init__.py`" msgstr "**原始碼:**\\ :source:`Lib/http/__init__.py`" #: ../../library/http.rst:15 +#, fuzzy msgid "" -":mod:`http` is a package that collects several modules for working with the " +":mod:`!http` is a package that collects several modules for working with the " "HyperText Transfer Protocol:" msgstr "" ":mod:`http` 是一個收集了多個用於處理超文本傳輸協定 (HyperText Transfer " @@ -62,7 +63,7 @@ msgstr ":mod:`http.cookiejar` 提供了 cookies 的持續留存 (persistence)" #: ../../library/http.rst:25 msgid "" -"The :mod:`http` module also defines the following enums that help you work " +"The :mod:`!http` module also defines the following enums that help you work " "with http related code:" msgstr "" diff --git a/library/http.server.po b/library/http.server.po index 310c1b276e..aeb423d275 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-05 00:16+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,7 +31,7 @@ msgstr "此模組定義了用於實作 HTTP 伺服器的類別。" #: ../../library/http.server.rst:22 msgid "" -":mod:`http.server` is not recommended for production. It only implements :" +":mod:`!http.server` is not recommended for production. It only implements :" "ref:`basic security checks `." msgstr "" @@ -657,7 +657,7 @@ msgstr "命令列介面" #: ../../library/http.server.rst:515 msgid "" -":mod:`http.server` can also be invoked directly using the :option:`-m` " +":mod:`!http.server` can also be invoked directly using the :option:`-m` " "switch of the interpreter. The following example illustrates how to serve " "files relative to the current directory::" msgstr "" @@ -730,7 +730,7 @@ msgstr "python -m http.server --cgi" #: ../../library/http.server.rst:575 msgid "" -":mod:`http.server` command line ``--cgi`` support is being removed because :" +":mod:`!http.server` command line ``--cgi`` support is being removed because :" "class:`CGIHTTPRequestHandler` is being removed." msgstr "" diff --git a/library/imaplib.po b/library/imaplib.po index d1d70d69c3..dc393ecd35 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -6,7 +6,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-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,11 +27,11 @@ msgstr "**原始碼:**\\ :source:`Lib/imaplib.py`" #: ../../library/imaplib.rst:24 msgid "" -"This module defines three classes, :class:`IMAP4`, :class:`IMAP4_SSL` " -"and :class:`IMAP4_stream`, which encapsulate a connection to an IMAP4 server " -"and implement a large subset of the IMAP4rev1 client protocol as defined " -"in :rfc:`2060`. It is backward compatible with IMAP4 (:rfc:`1730`) servers, " -"but note that the ``STATUS`` command is not supported in IMAP4." +"This module defines three classes, :class:`IMAP4`, :class:`IMAP4_SSL` and :" +"class:`IMAP4_stream`, which encapsulate a connection to an IMAP4 server and " +"implement a large subset of the IMAP4rev1 client protocol as defined in :rfc:" +"`2060`. It is backward compatible with IMAP4 (:rfc:`1730`) servers, but note " +"that the ``STATUS`` command is not supported in IMAP4." msgstr "" #: ../../includes/wasm-notavail.rst:3 @@ -48,7 +48,7 @@ msgstr "" #: ../../library/imaplib.rst:32 msgid "" -"Three classes are provided by the :mod:`imaplib` module, :class:`IMAP4` is " +"Three classes are provided by the :mod:`!imaplib` module, :class:`IMAP4` is " "the base class:" msgstr "" @@ -66,8 +66,8 @@ msgstr "" #: ../../library/imaplib.rst:45 msgid "" "The :class:`IMAP4` class supports the :keyword:`with` statement. When used " -"like this, the IMAP4 ``LOGOUT`` command is issued automatically when " -"the :keyword:`!with` statement exits. E.g.::" +"like this, the IMAP4 ``LOGOUT`` command is issued automatically when the :" +"keyword:`!with` statement exits. E.g.::" msgstr "" #: ../../library/imaplib.rst:49 @@ -146,9 +146,8 @@ msgstr "新增 *ssl_context* 參數。" #: ../../library/imaplib.rst:107 msgid "" -"The class now supports hostname check " -"with :attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* " -"(see :const:`ssl.HAS_SNI`)." +"The class now supports hostname check with :attr:`ssl.SSLContext." +"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" #: ../../library/imaplib.rst:115 @@ -162,8 +161,8 @@ msgstr "" #: ../../library/imaplib.rst:123 msgid "" "This is a subclass derived from :class:`IMAP4` that connects to the ``stdin/" -"stdout`` file descriptors created by passing *command* to " -"``subprocess.Popen()``." +"stdout`` file descriptors created by passing *command* to ``subprocess." +"Popen()``." msgstr "" #: ../../library/imaplib.rst:128 @@ -194,9 +193,9 @@ msgid "" "double-quotes). The *date_time* argument can be a number (int or float) " "representing seconds since epoch (as returned by :func:`time.time`), a 9-" "tuple representing local time an instance of :class:`time.struct_time` (as " -"returned by :func:`time.localtime`), an aware instance " -"of :class:`datetime.datetime`, or a double-quoted string. In the last case, " -"it is assumed to already be in the correct format." +"returned by :func:`time.localtime`), an aware instance of :class:`datetime." +"datetime`, or a double-quoted string. In the last case, it is assumed to " +"already be in the correct format." msgstr "" #: ../../library/imaplib.rst:160 @@ -330,8 +329,8 @@ msgstr "" #: ../../library/imaplib.rst:265 msgid "" "Enable *capability* (see :rfc:`5161`). Most capabilities do not need to be " -"enabled. Currently only the ``UTF8=ACCEPT`` capability is supported " -"(see :RFC:`6855`)." +"enabled. Currently only the ``UTF8=ACCEPT`` capability is supported (see :" +"RFC:`6855`)." msgstr "" #: ../../library/imaplib.rst:269 @@ -384,9 +383,9 @@ msgstr "" #: ../../library/imaplib.rst:316 msgid "" -"The returned object sends the ``IDLE`` command when activated by " -"the :keyword:`with` statement, produces IMAP untagged responses via " -"the :term:`iterator` protocol, and sends ``DONE`` upon context exit." +"The returned object sends the ``IDLE`` command when activated by the :" +"keyword:`with` statement, produces IMAP untagged responses via the :term:" +"`iterator` protocol, and sends ``DONE`` upon context exit." msgstr "" #: ../../library/imaplib.rst:320 @@ -407,8 +406,8 @@ msgstr "" #: ../../library/imaplib.rst:329 msgid "" "The *duration* argument sets a maximum duration (in seconds) to keep idling, " -"after which any ongoing iteration will stop. It can be an :class:`int` " -"or :class:`float`, or ``None`` for no time limit. Callers wishing to avoid " +"after which any ongoing iteration will stop. It can be an :class:`int` or :" +"class:`float`, or ``None`` for no time limit. Callers wishing to avoid " "inactivity timeouts on servers that impose them should keep this at most 29 " "minutes (1740 seconds). Requires a socket connection; *duration* must be " "``None`` on :class:`IMAP4_stream` connections." @@ -473,10 +472,10 @@ msgstr "" #: ../../library/imaplib.rst:383 msgid "" -"The iterator returned by :meth:`IMAP4.idle` is usable only within " -"a :keyword:`with` statement. Before or after that context, unsolicited " -"responses are collected internally whenever a command finishes, and can be " -"retrieved with :meth:`IMAP4.response`." +"The iterator returned by :meth:`IMAP4.idle` is usable only within a :keyword:" +"`with` statement. Before or after that context, unsolicited responses are " +"collected internally whenever a command finishes, and can be retrieved with :" +"meth:`IMAP4.response`." msgstr "" #: ../../library/imaplib.rst:390 @@ -543,12 +542,12 @@ msgid "" "Opens socket to *port* at *host*. The optional *timeout* parameter specifies " "a timeout in seconds for the connection attempt. If timeout is not given or " "is ``None``, the global default socket timeout is used. Also note that if " -"the *timeout* parameter is set to be zero, it will raise " -"a :class:`ValueError` to reject creating a non-blocking socket. This method " -"is implicitly called by the :class:`IMAP4` constructor. The connection " -"objects established by this method will be used in " -"the :meth:`IMAP4.read`, :meth:`IMAP4.readline`, :meth:`IMAP4.send`, " -"and :meth:`IMAP4.shutdown` methods. You may override this method." +"the *timeout* parameter is set to be zero, it will raise a :class:" +"`ValueError` to reject creating a non-blocking socket. This method is " +"implicitly called by the :class:`IMAP4` constructor. The connection objects " +"established by this method will be used in the :meth:`IMAP4.read`, :meth:" +"`IMAP4.readline`, :meth:`IMAP4.send`, and :meth:`IMAP4.shutdown` methods. " +"You may override this method." msgstr "" #: ../../library/imaplib.rst:462 @@ -606,8 +605,8 @@ msgid "" "case no ``CHARSET`` will be specified in the request to the server. The " "IMAP protocol requires that at least one criterion be specified; an " "exception will be raised when the server returns an error. *charset* must " -"be ``None`` if the ``UTF8=ACCEPT`` capability was enabled using " -"the :meth:`enable` command." +"be ``None`` if the ``UTF8=ACCEPT`` capability was enabled using the :meth:" +"`enable` command." msgstr "" #: ../../library/imaplib.rst:515 @@ -702,9 +701,8 @@ msgstr "" #: ../../library/imaplib.rst:594 msgid "" -"The method now supports hostname check " -"with :attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* " -"(see :const:`ssl.HAS_SNI`)." +"The method now supports hostname check with :attr:`ssl.SSLContext." +"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" #: ../../library/imaplib.rst:602 @@ -821,9 +819,8 @@ msgstr "" #: ../../library/imaplib.rst:699 msgid "" -"Boolean value that is normally ``False``, but is set to ``True`` if " -"an :meth:`enable` command is successfully issued for the ``UTF8=ACCEPT`` " -"capability." +"Boolean value that is normally ``False``, but is set to ``True`` if an :meth:" +"`enable` command is successfully issued for the ``UTF8=ACCEPT`` capability." msgstr "" #: ../../library/imaplib.rst:709 diff --git a/library/importlib.po b/library/importlib.po index 968b405316..efeefe30e6 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-24 22:47+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,7 +30,8 @@ msgid "Introduction" msgstr "簡介" #: ../../library/importlib.rst:20 -msgid "The purpose of the :mod:`importlib` package is three-fold." +#, fuzzy +msgid "The purpose of the :mod:`!importlib` package is three-fold." msgstr ":mod:`importlib` 的目的可分為三個部分。" #: ../../library/importlib.rst:22 diff --git a/library/inspect.po b/library/inspect.po index 9444944dcd..b831eb6ab9 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-24 22:47+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,7 +28,7 @@ msgstr "**原始碼:**\\ :source:`Lib/inspect.py`" #: ../../library/inspect.rst:19 msgid "" -"The :mod:`inspect` module provides several useful functions to help get " +"The :mod:`!inspect` module provides several useful functions to help get " "information about live objects such as modules, classes, methods, functions, " "tracebacks, frame objects, and code objects. For example, it can help you " "examine the contents of a class, retrieve the source code of a method, " @@ -2377,7 +2377,7 @@ msgid "" "The flags are specific to CPython, and may not be defined in other Python " "implementations. Furthermore, the flags are an implementation detail, and " "can be removed or deprecated in future Python releases. It's recommended to " -"use public APIs from the :mod:`inspect` module for any introspection needs." +"use public APIs from the :mod:`!inspect` module for any introspection needs." msgstr "" #: ../../library/inspect.rst:1763 @@ -2401,7 +2401,7 @@ msgstr "命令列介面" #: ../../library/inspect.rst:1800 msgid "" -"The :mod:`inspect` module also provides a basic introspection capability " +"The :mod:`!inspect` module also provides a basic introspection capability " "from the command line." msgstr "" diff --git a/library/io.po b/library/io.po index dfdb7f7e2b..d856e7c7a4 100644 --- a/library/io.po +++ b/library/io.po @@ -6,7 +6,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-02-07 00:19+0000\n" "PO-Revision-Date: 2023-12-08 00:08+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,8 +31,9 @@ msgid "Overview" msgstr "總覽" #: ../../library/io.rst:27 +#, fuzzy msgid "" -"The :mod:`io` module provides Python's main facilities for dealing with " +"The :mod:`!io` module provides Python's main facilities for dealing with " "various types of I/O. There are three main types of I/O: *text I/O*, " "*binary I/O* and *raw I/O*. These are generic categories, and various " "backing stores can be used for each of them. A concrete object belonging to " @@ -61,21 +62,21 @@ msgstr "" msgid "" "All streams are careful about the type of data you give to them. For " "example giving a :class:`str` object to the :meth:`!write` method of a " -"binary stream will raise a :exc:`TypeError`. So will giving " -"a :class:`bytes` object to the :meth:`!write` method of a text stream." +"binary stream will raise a :exc:`TypeError`. So will giving a :class:" +"`bytes` object to the :meth:`!write` method of a text stream." msgstr "" -"所有的資料串流都會謹慎處理你所提供的資料的型別。舉例來說,提供一" -"個 :class:`str` 物件給二進位資料串流的 :meth:`!write` 方法將會引" -"發 :exc:`TypeError`。同樣地,若提供一個 :class:`bytes` 物件給文字資料串流" -"的 :meth:`!write` 方法,也會引發同樣的錯誤。" +"所有的資料串流都會謹慎處理你所提供的資料的型別。舉例來說,提供一個 :class:" +"`str` 物件給二進位資料串流的 :meth:`!write` 方法將會引發 :exc:`TypeError`。同" +"樣地,若提供一個 :class:`bytes` 物件給文字資料串流的 :meth:`!write` 方法,也" +"會引發同樣的錯誤。" #: ../../library/io.rst:45 msgid "" "Operations that used to raise :exc:`IOError` now raise :exc:`OSError`, " "since :exc:`IOError` is now an alias of :exc:`OSError`." msgstr "" -"原本會引發 :exc:`IOError` 的操作,現在將改成引發 :exc:`OSError`。因" -"為 :exc:`IOError` 現在是 :exc:`OSError` 的別名。" +"原本會引發 :exc:`IOError` 的操作,現在將改成引發 :exc:`OSError`。因為 :exc:" +"`IOError` 現在是 :exc:`OSError` 的別名。" #: ../../library/io.rst:51 ../../library/io.rst:867 ../../library/io.rst:1217 msgid "Text I/O" @@ -121,8 +122,8 @@ msgstr "" #: ../../library/io.rst:73 msgid "" -"The text stream API is described in detail in the documentation " -"of :class:`TextIOBase`." +"The text stream API is described in detail in the documentation of :class:" +"`TextIOBase`." msgstr "文字資料串流 API 的詳細說明在 :class:`TextIOBase` 文件當中。" #: ../../library/io.rst:78 ../../library/io.rst:1205 @@ -165,8 +166,8 @@ msgstr "f = io.BytesIO(b\"some initial binary data: \\x00\\x01\")" #: ../../library/io.rst:95 msgid "" -"The binary stream API is described in detail in the docs " -"of :class:`BufferedIOBase`." +"The binary stream API is described in detail in the docs of :class:" +"`BufferedIOBase`." msgstr "二進位資料串流 API 的詳細說明在 :class:`BufferedIOBase` 文件當中。" #: ../../library/io.rst:98 @@ -174,8 +175,8 @@ msgid "" "Other library modules may provide additional ways to create text or binary " "streams. See :meth:`socket.socket.makefile` for example." msgstr "" -"其它函式庫模組可能提供額外的方法來建立文字或二進位資料串流。例" -"如 :meth:`socket.socket.makefile`。" +"其它函式庫模組可能提供額外的方法來建立文字或二進位資料串流。例如 :meth:" +"`socket.socket.makefile`。" #: ../../library/io.rst:103 msgid "Raw I/O" @@ -271,29 +272,28 @@ msgstr "更多資訊請見 :pep:`597`。" #: ../../library/io.rst:154 msgid "" -"To find where the default locale encoding is used, you can enable " -"the :option:`-X warn_default_encoding <-X>` command line option or set " -"the :envvar:`PYTHONWARNDEFAULTENCODING` environment variable, which will " -"emit an :exc:`EncodingWarning` when the default encoding is used." +"To find where the default locale encoding is used, you can enable the :" +"option:`-X warn_default_encoding <-X>` command line option or set the :" +"envvar:`PYTHONWARNDEFAULTENCODING` environment variable, which will emit an :" +"exc:`EncodingWarning` when the default encoding is used." msgstr "" "要找出哪些地方使用到預設的地區編碼,你可以啟用 :option:`-X " -"warn_default_encoding <-X>` 命令列選項,或者設定環境變" -"數 :envvar:`PYTHONWARNDEFAULTENCODING`。當使用到預設編碼時,會引" -"發 :exc:`EncodingWarning`。" +"warn_default_encoding <-X>` 命令列選項,或者設定環境變數 :envvar:" +"`PYTHONWARNDEFAULTENCODING`。當使用到預設編碼時,會引發 :exc:" +"`EncodingWarning`。" #: ../../library/io.rst:159 msgid "" "If you are providing an API that uses :func:`open` or :class:`TextIOWrapper` " -"and passes ``encoding=None`` as a parameter, you can " -"use :func:`text_encoding` so that callers of the API will emit " -"an :exc:`EncodingWarning` if they don't pass an ``encoding``. However, " -"please consider using UTF-8 by default (i.e. ``encoding=\"utf-8\"``) for new " -"APIs." +"and passes ``encoding=None`` as a parameter, you can use :func:" +"`text_encoding` so that callers of the API will emit an :exc:" +"`EncodingWarning` if they don't pass an ``encoding``. However, please " +"consider using UTF-8 by default (i.e. ``encoding=\"utf-8\"``) for new APIs." msgstr "" "如果你正在提供一個使用 :func:`open` 或 :class:`TextIOWrapper` 且傳遞 " "``encoding=None`` 作為參數的 API,你可以使用 :func:`text_encoding`。如此一來" -"如果 API 的呼叫方沒有傳遞 ``encoding``,呼叫方就會發出一" -"個 :exc:`EncodingWarning`。然而,對於新的 API,請考慮預設使用 UTF-8(即 " +"如果 API 的呼叫方沒有傳遞 ``encoding``,呼叫方就會發出一個 :exc:" +"`EncodingWarning`。然而,對於新的 API,請考慮預設使用 UTF-8(即 " "``encoding=\"utf-8\"``)。" #: ../../library/io.rst:168 @@ -303,11 +303,11 @@ msgstr "高階模組介面" #: ../../library/io.rst:172 msgid "" "An int containing the default buffer size used by the module's buffered I/O " -"classes. :func:`open` uses the file's blksize (as obtained " -"by :func:`os.stat`) if possible." +"classes. :func:`open` uses the file's blksize (as obtained by :func:`os." +"stat`) if possible." msgstr "" -"一個包含模組中緩衝 I/O 類別所使用的預設緩衝區大小的整數。若可能的" -"話,:func:`open` 會使用檔案的 blksize (透過 :func:`os.stat` 取得)。" +"一個包含模組中緩衝 I/O 類別所使用的預設緩衝區大小的整數。若可能的話,:func:" +"`open` 會使用檔案的 blksize (透過 :func:`os.stat` 取得)。" #: ../../library/io.rst:179 msgid "This is an alias for the builtin :func:`open` function." @@ -337,11 +337,11 @@ msgstr "*path* 應該要屬於 :class:`str` 類別,且是個絕對路徑。" #: ../../library/io.rst:195 msgid "" -"The behavior of this function may be overridden by an earlier call to " -"the :c:func:`PyFile_SetOpenCodeHook`. However, assuming that *path* is " -"a :class:`str` and an absolute path, ``open_code(path)`` should always " -"behave the same as ``open(path, 'rb')``. Overriding the behavior is intended " -"for additional validation or preprocessing of the file." +"The behavior of this function may be overridden by an earlier call to the :c:" +"func:`PyFile_SetOpenCodeHook`. However, assuming that *path* is a :class:" +"`str` and an absolute path, ``open_code(path)`` should always behave the " +"same as ``open(path, 'rb')``. Overriding the behavior is intended for " +"additional validation or preprocessing of the file." msgstr "" "這個函式的行為可能會被之前對 :c:func:`PyFile_SetOpenCodeHook` 的呼叫覆寫。然" "而,假設 *path* 是個 :class:`str` 且為絕對路徑,則 ``open_code(path)`` 總是" @@ -350,8 +350,8 @@ msgstr "" #: ../../library/io.rst:206 msgid "" -"This is a helper function for callables that use :func:`open` " -"or :class:`TextIOWrapper` and have an ``encoding=None`` parameter." +"This is a helper function for callables that use :func:`open` or :class:" +"`TextIOWrapper` and have an ``encoding=None`` parameter." msgstr "" "這是個輔助函式,適用於使用 :func:`open` 或 :class:`TextIOWrapper` 且具有 " "``encoding=None`` 參數的可呼叫物件。" @@ -362,15 +362,14 @@ msgid "" "returns ``\"locale\"`` or ``\"utf-8\"`` depending on :ref:`UTF-8 Mode `." msgstr "" -"若 *encoding* 不為 ``None``,此函式將回傳 *encoding*。否則,將根" -"據 :ref:`UTF-8 Mode ` 回傳 ``\"locale\"`` 或 ``\"utf-8\"``。" +"若 *encoding* 不為 ``None``,此函式將回傳 *encoding*。否則,將根據 :ref:" +"`UTF-8 Mode ` 回傳 ``\"locale\"`` 或 ``\"utf-8\"``。" #: ../../library/io.rst:213 msgid "" -"This function emits an :class:`EncodingWarning` " -"if :data:`sys.flags.warn_default_encoding ` is true and " -"*encoding* is ``None``. *stacklevel* specifies where the warning is emitted. " -"For example::" +"This function emits an :class:`EncodingWarning` if :data:`sys.flags." +"warn_default_encoding ` is true and *encoding* is ``None``. " +"*stacklevel* specifies where the warning is emitted. For example::" msgstr "" "若 :data:`sys.flags.warn_default_encoding ` 為真,且 *encoding* " "為 ``None``,此函式會發出一個 :class:`EncodingWarning`。*stacklevel* 指定警告" @@ -393,8 +392,8 @@ msgid "" "In this example, an :class:`EncodingWarning` is emitted for the caller of " "``read_text()``." msgstr "" -"在此範例中,對於 ``read_text()`` 的呼叫方會引發一" -"個 :class:`EncodingWarning`。" +"在此範例中,對於 ``read_text()`` 的呼叫方會引發一個 :class:" +"`EncodingWarning`。" #: ../../library/io.rst:226 msgid "See :ref:`io-text-encoding` for more information." @@ -419,8 +418,8 @@ msgid "" "An exception inheriting :exc:`OSError` and :exc:`ValueError` that is raised " "when an unsupported operation is called on a stream." msgstr "" -"當在資料串流上呼叫不支援的操作時,會引發繼承自 :exc:`OSError` " -"與 :exc:`ValueError` 的例外。" +"當在資料串流上呼叫不支援的操作時,會引發繼承自 :exc:`OSError` 與 :exc:" +"`ValueError` 的例外。" #: ../../library/io.rst:249 msgid ":mod:`sys`" @@ -431,8 +430,8 @@ msgid "" "contains the standard IO streams: :data:`sys.stdin`, :data:`sys.stdout`, " "and :data:`sys.stderr`." msgstr "" -"包含標準的 IO 資料串流::data:`sys.stdin`、:data:`sys.stdout` 以" -"及 :data:`sys.stderr`。" +"包含標準的 IO 資料串流::data:`sys.stdin`、:data:`sys.stdout` 以及 :data:" +"`sys.stderr`。" #: ../../library/io.rst:255 msgid "Class hierarchy" @@ -453,11 +452,11 @@ msgstr "" msgid "" "The abstract base classes also provide default implementations of some " "methods in order to help implementation of concrete stream classes. For " -"example, :class:`BufferedIOBase` provides unoptimized implementations " -"of :meth:`!readinto` and :meth:`!readline`." +"example, :class:`BufferedIOBase` provides unoptimized implementations of :" +"meth:`!readinto` and :meth:`!readline`." msgstr "" -"為了協助具體串流類別的實作,抽象基底類別提供了某些方法的預設實作。舉例來" -"說,:class:`BufferedIOBase` 提供未經最佳化的 :meth:`!readinto` 與 :meth:`!" +"為了協助具體串流類別的實作,抽象基底類別提供了某些方法的預設實作。舉例來說,:" +"class:`BufferedIOBase` 提供未經最佳化的 :meth:`!readinto` 與 :meth:`!" "readline` 實作。" #: ../../library/io.rst:269 @@ -475,9 +474,8 @@ msgstr "" #: ../../library/io.rst:274 msgid "" "The :class:`RawIOBase` ABC extends :class:`IOBase`. It deals with the " -"reading and writing of bytes to a stream. :class:`FileIO` " -"subclasses :class:`RawIOBase` to provide an interface to files in the " -"machine's file system." +"reading and writing of bytes to a stream. :class:`FileIO` subclasses :class:" +"`RawIOBase` to provide an interface to files in the machine's file system." msgstr "" "抽象基底類別 :class:`RawIOBase` 繼承 :class:`IOBase`。此類別處理對串流的位元" "組讀寫。:class:`FileIO` 則繼承 :class:`RawIOBase` 來提供一個介面以存取機器檔" @@ -486,21 +484,19 @@ msgstr "" #: ../../library/io.rst:278 msgid "" "The :class:`BufferedIOBase` ABC extends :class:`IOBase`. It deals with " -"buffering on a raw binary stream (:class:`RawIOBase`). Its " -"subclasses, :class:`BufferedWriter`, :class:`BufferedReader`, " -"and :class:`BufferedRWPair` buffer raw binary streams that are writable, " -"readable, and both readable and writable, " -"respectively. :class:`BufferedRandom` provides a buffered interface to " -"seekable streams. Another :class:`BufferedIOBase` " -"subclass, :class:`BytesIO`, is a stream of in-memory bytes." +"buffering on a raw binary stream (:class:`RawIOBase`). Its subclasses, :" +"class:`BufferedWriter`, :class:`BufferedReader`, and :class:`BufferedRWPair` " +"buffer raw binary streams that are writable, readable, and both readable and " +"writable, respectively. :class:`BufferedRandom` provides a buffered " +"interface to seekable streams. Another :class:`BufferedIOBase` subclass, :" +"class:`BytesIO`, is a stream of in-memory bytes." msgstr "" "抽象基底類別 :class:`BufferedIOBase` 繼承 :class:`IOBase`。此類別緩衝原始二進" -"位串流 (:class:`RawIOBase`)。它的子類" -"別 :class:`BufferedWriter`、:class:`BufferedReader` " -"與 :class:`BufferedRWPair` 分別緩衝可寫、可讀、可讀也可寫的的原始二進位串流。" -"類別 :class:`BufferedRandom` 則提供一個對可搜尋串流 (seekable stream) 的緩衝" -"介面。另一個類別 :class:`BufferedIOBase` 的子類別 :class:`BytesIO`,是一個記" -"憶體內位元組串流。" +"位串流 (:class:`RawIOBase`)。它的子類別 :class:`BufferedWriter`、:class:" +"`BufferedReader` 與 :class:`BufferedRWPair` 分別緩衝可寫、可讀、可讀也可寫的" +"的原始二進位串流。類別 :class:`BufferedRandom` 則提供一個對可搜尋串流 " +"(seekable stream) 的緩衝介面。另一個類別 :class:`BufferedIOBase` 的子類別 :" +"class:`BytesIO`,是一個記憶體內位元組串流。" #: ../../library/io.rst:286 msgid "" @@ -511,19 +507,20 @@ msgid "" "Finally, :class:`StringIO` is an in-memory stream for text." msgstr "" "抽象基底類別 :class:`TextIOBase` 繼承 :class:`IOBase`。此類別處理文本位元組串" -"流,並處理字串的編碼和解碼。類別 :class:`TextIOWrapper` 繼承" -"自 :class:`TextIOBase`,這是個對緩衝原始串流 (:class:`BufferedIOBase`) 的緩衝" -"文本介面。最後,:class:`StringIO` 是個文字記憶體內串流。" +"流,並處理字串的編碼和解碼。類別 :class:`TextIOWrapper` 繼承自 :class:" +"`TextIOBase`,這是個對緩衝原始串流 (:class:`BufferedIOBase`) 的緩衝文本介面。" +"最後,:class:`StringIO` 是個文字記憶體內串流。" #: ../../library/io.rst:292 msgid "" -"Argument names are not part of the specification, and only the arguments " -"of :func:`open` are intended to be used as keyword arguments." +"Argument names are not part of the specification, and only the arguments of :" +"func:`open` are intended to be used as keyword arguments." msgstr "引數名稱不是規範的一部份,只有 :func:`open` 的引數將作為關鍵字引數。" #: ../../library/io.rst:295 +#, fuzzy msgid "" -"The following table summarizes the ABCs provided by the :mod:`io` module:" +"The following table summarizes the ABCs provided by the :mod:`!io` module:" msgstr "以下表格總結了 :mod:`io` 模組提供的抽象基底類別 (ABC):" #: ../../library/io.rst:300 @@ -624,17 +621,16 @@ msgid "" "raise a :exc:`ValueError` (or :exc:`UnsupportedOperation`) when operations " "they do not support are called." msgstr "" -"即使 :class:`IOBase` 因為實作的簽名差異巨大而沒有宣告 :meth:`!read` " -"或 :meth:`!write` 方法,實作與用戶端應把這些方法視為介面的一部份。此外,當呼" -"叫不被它們支援的操作時,可能會引發 :exc:`ValueError` " -"(或 :exc:`UnsupportedOperation`)例外。" +"即使 :class:`IOBase` 因為實作的簽名差異巨大而沒有宣告 :meth:`!read` 或 :meth:" +"`!write` 方法,實作與用戶端應把這些方法視為介面的一部份。此外,當呼叫不被它們" +"支援的操作時,可能會引發 :exc:`ValueError` (或 :exc:`UnsupportedOperation`)" +"例外。" #: ../../library/io.rst:335 msgid "" -"The basic type used for binary data read from or written to a file " -"is :class:`bytes`. Other :term:`bytes-like objects ` are " -"accepted as method arguments too. Text I/O classes work with :class:`str` " -"data." +"The basic type used for binary data read from or written to a file is :class:" +"`bytes`. Other :term:`bytes-like objects ` are accepted " +"as method arguments too. Text I/O classes work with :class:`str` data." msgstr "" #: ../../library/io.rst:339 @@ -656,10 +652,9 @@ msgstr "" #: ../../library/io.rst:348 msgid "" -":class:`IOBase` is also a context manager and therefore supports " -"the :keyword:`with` statement. In this example, *file* is closed after " -"the :keyword:`!with` statement's suite is finished---even if an exception " -"occurs::" +":class:`IOBase` is also a context manager and therefore supports the :" +"keyword:`with` statement. In this example, *file* is closed after the :" +"keyword:`!with` statement's suite is finished---even if an exception occurs::" msgstr "" ":class:`IOBase` 也是個情境管理器,因此支援 :keyword:`with` 陳述式。在這個例子" "中,*file* 會在 :keyword:`!with` 陳述式執行完畢後關閉——即使發生了異常。" @@ -798,22 +793,20 @@ msgstr ":data:`!SEEK_*` 常數。" #: ../../library/io.rst:429 msgid "" -"Some operating systems could support additional values, " -"like :const:`os.SEEK_HOLE` or :const:`os.SEEK_DATA`. The valid values for a " -"file could depend on it being open in text or binary mode." +"Some operating systems could support additional values, like :const:`os." +"SEEK_HOLE` or :const:`os.SEEK_DATA`. The valid values for a file could " +"depend on it being open in text or binary mode." msgstr "" -"某些作業系統可以支援額外的值,例如 :const:`os.SEEK_HOLE` " -"或 :const:`os.SEEK_DATA`。檔案的合法值取決於它是以文字模式還是二進位模式開" -"啟。" +"某些作業系統可以支援額外的值,例如 :const:`os.SEEK_HOLE` 或 :const:`os." +"SEEK_DATA`。檔案的合法值取決於它是以文字模式還是二進位模式開啟。" #: ../../library/io.rst:436 msgid "" -"Return ``True`` if the stream supports random access. If " -"``False``, :meth:`seek`, :meth:`tell` and :meth:`truncate` will " -"raise :exc:`OSError`." +"Return ``True`` if the stream supports random access. If ``False``, :meth:" +"`seek`, :meth:`tell` and :meth:`truncate` will raise :exc:`OSError`." msgstr "" -"如果串流支援隨機存取,則回傳 ``True``。如果是 ``False``," -"則 :meth:`seek`、:meth:`tell` 和 :meth:`truncate` 會引發 :exc:`OSError`。" +"如果串流支援隨機存取,則回傳 ``True``。如果是 ``False``,則 :meth:`seek`、:" +"meth:`tell` 和 :meth:`truncate` 會引發 :exc:`OSError`。" #: ../../library/io.rst:441 msgid "Return the current stream position." @@ -841,8 +834,8 @@ msgid "" "Return ``True`` if the stream supports writing. If ``False``, :meth:`!" "write` and :meth:`truncate` will raise :exc:`OSError`." msgstr "" -"如果串流支援寫入,則回傳 ``True``。如果是 ``False``,:meth:`!write` " -"和 :meth:`truncate` 將會引發 :exc:`OSError`。" +"如果串流支援寫入,則回傳 ``True``。如果是 ``False``,:meth:`!write` 和 :meth:" +"`truncate` 將會引發 :exc:`OSError`。" #: ../../library/io.rst:462 msgid "" @@ -855,8 +848,8 @@ msgstr "" #: ../../library/io.rst:468 msgid "" "Prepare for object destruction. :class:`IOBase` provides a default " -"implementation of this method that calls the " -"instance's :meth:`~IOBase.close` method." +"implementation of this method that calls the instance's :meth:`~IOBase." +"close` method." msgstr "" "為物件銷毀做準備。:class:`IOBase` 提供了這個方法的預設實作,該實作會呼叫實例" "的 :meth:`~IOBase.close` 方法。" @@ -878,8 +871,8 @@ msgstr "" #: ../../library/io.rst:482 msgid "" -":class:`RawIOBase` provides these methods in addition to those " -"from :class:`IOBase`:" +":class:`RawIOBase` provides these methods in addition to those from :class:" +"`IOBase`:" msgstr ":class:`RawIOBase` 除了 :class:`IOBase` 的方法外,還提供以下這些方法:" #: ../../library/io.rst:487 @@ -916,14 +909,13 @@ msgstr "讀取並回傳串流中直到檔案結尾的所有位元組,必要時 #: ../../library/io.rst:506 msgid "" "Read bytes into a pre-allocated, writable :term:`bytes-like object` *b*, and " -"return the number of bytes read. For example, *b* might be " -"a :class:`bytearray`. If the object is in non-blocking mode and no bytes are " +"return the number of bytes read. For example, *b* might be a :class:" +"`bytearray`. If the object is in non-blocking mode and no bytes are " "available, ``None`` is returned." msgstr "" "將位元組讀入一個預先分配的、可寫的 :term:`bytes-like object` (類位元組物" -"件) *b* 中,並回傳讀取的位元組數量。例如,*b* 可能是一" -"個 :class:`bytearray`。如果物件處於非阻塞模式且沒有可用的位元組,則回傳 " -"``None``。" +"件) *b* 中,並回傳讀取的位元組數量。例如,*b* 可能是一個 :class:" +"`bytearray`。如果物件處於非阻塞模式且沒有可用的位元組,則回傳 ``None``。" #: ../../library/io.rst:514 msgid "" @@ -949,14 +941,12 @@ msgstr "支援某種緩衝的二進位串流的基底類別。它繼承自 :clas #: ../../library/io.rst:530 msgid "" -"The main difference with :class:`RawIOBase` is that " -"methods :meth:`read`, :meth:`readinto` and :meth:`write` will try " -"(respectively) to read as much input as requested or to emit all provided " -"data." +"The main difference with :class:`RawIOBase` is that methods :meth:`read`, :" +"meth:`readinto` and :meth:`write` will try (respectively) to read as much " +"input as requested or to emit all provided data." msgstr "" -"與 :class:`RawIOBase` 的主要差異在於,:meth:`read`、:meth:`readinto` " -"及 :meth:`write` 方法將分別嘗試讀取所請求的盡可能多的輸入,或發出所有提供的資" -"料。" +"與 :class:`RawIOBase` 的主要差異在於,:meth:`read`、:meth:`readinto` 及 :" +"meth:`write` 方法將分別嘗試讀取所請求的盡可能多的輸入,或發出所有提供的資料。" #: ../../library/io.rst:534 msgid "" @@ -974,13 +964,13 @@ msgstr "此外,:meth:`read` 方法不存在一個遵從 :meth:`readinto` 的 #: ../../library/io.rst:542 msgid "" -"A typical :class:`BufferedIOBase` implementation should not inherit from " -"a :class:`RawIOBase` implementation, but wrap one, " -"like :class:`BufferedWriter` and :class:`BufferedReader` do." +"A typical :class:`BufferedIOBase` implementation should not inherit from a :" +"class:`RawIOBase` implementation, but wrap one, like :class:`BufferedWriter` " +"and :class:`BufferedReader` do." msgstr "" "一個典型的 :class:`BufferedIOBase` 實作不應該繼承自一個 :class:`RawIOBase` 的" -"實作,而是應該改用包裝的方式,像 :class:`BufferedWriter` " -"和 :class:`BufferedReader` 那樣的作法。" +"實作,而是應該改用包裝的方式,像 :class:`BufferedWriter` 和 :class:" +"`BufferedReader` 那樣的作法。" #: ../../library/io.rst:546 msgid "" @@ -992,9 +982,9 @@ msgstr "" #: ../../library/io.rst:551 msgid "" -"The underlying raw stream (a :class:`RawIOBase` instance) " -"that :class:`BufferedIOBase` deals with. This is not part of " -"the :class:`BufferedIOBase` API and may not exist on some implementations." +"The underlying raw stream (a :class:`RawIOBase` instance) that :class:" +"`BufferedIOBase` deals with. This is not part of the :class:" +"`BufferedIOBase` API and may not exist on some implementations." msgstr "" "底層的原始串流(一個 :class:`RawIOBase` 實例),:class:`BufferedIOBase` 處理" "的對象。這不是 :class:`BufferedIOBase` API 的一部分,且在某些實作可能不存在。" @@ -1028,26 +1018,25 @@ msgstr "" msgid "" "Fewer bytes may be returned than requested. An empty :class:`bytes` object " "is returned if the stream is already at EOF. More than one read may be made " -"and calls may be retried if specific errors are encountered, " -"see :meth:`os.read` and :pep:`475` for more details. Less than size bytes " -"being returned does not imply that EOF is imminent." +"and calls may be retried if specific errors are encountered, see :meth:`os." +"read` and :pep:`475` for more details. Less than size bytes being returned " +"does not imply that EOF is imminent." msgstr "" #: ../../library/io.rst:579 msgid "" -"When reading as much as possible the default implementation will use " -"``raw.readall`` if available (which should " -"implement :meth:`RawIOBase.readall`), otherwise will read in a loop until " -"read returns ``None``, an empty :class:`bytes`, or a non-retryable error. " -"For most streams this is to EOF, but for non-blocking streams more data may " -"become available." +"When reading as much as possible the default implementation will use ``raw." +"readall`` if available (which should implement :meth:`RawIOBase.readall`), " +"otherwise will read in a loop until read returns ``None``, an empty :class:" +"`bytes`, or a non-retryable error. For most streams this is to EOF, but for " +"non-blocking streams more data may become available." msgstr "" #: ../../library/io.rst:588 ../../library/io.rst:601 msgid "" "When the underlying raw stream is non-blocking, implementations may either " -"raise :exc:`BlockingIOError` or return ``None`` if no data is " -"available. :mod:`io` implementations return ``None``." +"raise :exc:`BlockingIOError` or return ``None`` if no data is available. :" +"mod:`!io` implementations return ``None``." msgstr "" #: ../../library/io.rst:594 @@ -1061,8 +1050,8 @@ msgstr "" #: ../../library/io.rst:607 msgid "" "Read bytes into a pre-allocated, writable :term:`bytes-like object` *b* and " -"return the number of bytes read. For example, *b* might be " -"a :class:`bytearray`." +"return the number of bytes read. For example, *b* might be a :class:" +"`bytearray`." msgstr "" "讀取位元組到一個預先分配的、可寫的 :term:`bytes-like object` *b* 當中,並回傳" "讀取的位元組數量。例如,*b* 可能是一個 :class:`bytearray`。" @@ -1080,15 +1069,15 @@ msgid "" "A :exc:`BlockingIOError` is raised if the underlying raw stream is in non " "blocking-mode, and has no data available at the moment." msgstr "" -"如果底層原始串流處於非阻塞模式,且目前沒有可用資料,則會引" -"發 :exc:`BlockingIOError`。" +"如果底層原始串流處於非阻塞模式,且目前沒有可用資料,則會引發 :exc:" +"`BlockingIOError`。" #: ../../library/io.rst:619 msgid "" "Read bytes into a pre-allocated, writable :term:`bytes-like object` *b*, " -"using at most one call to the underlying raw " -"stream's :meth:`~RawIOBase.read` (or :meth:`~RawIOBase.readinto`) method. " -"Return the number of bytes read." +"using at most one call to the underlying raw stream's :meth:`~RawIOBase." +"read` (or :meth:`~RawIOBase.readinto`) method. Return the number of bytes " +"read." msgstr "" "讀取位元組到一個預先分配的、可寫的 :term:`bytes-like object` *b* 中,最多呼叫" "一次底層原始串流的 :meth:`~RawIOBase.read` (或 :meth:`~RawIOBase.readinto`)" @@ -1133,8 +1122,8 @@ msgid "" "A raw binary stream representing an OS-level file containing bytes data. It " "inherits from :class:`RawIOBase`." msgstr "" -"一個代表包含位元組資料的 OS 層級檔案的原始二進制串流。它繼承" -"自 :class:`RawIOBase`。" +"一個代表包含位元組資料的 OS 層級檔案的原始二進制串流。它繼承自 :class:" +"`RawIOBase`。" #: ../../library/io.rst:654 msgid "The *name* can be one of two things:" @@ -1170,9 +1159,9 @@ msgstr "" #: ../../library/io.rst:672 msgid "" -"The :meth:`~RawIOBase.read` (when called with a positive " -"argument), :meth:`~RawIOBase.readinto` and :meth:`~RawIOBase.write` methods " -"on this class will only make one system call." +"The :meth:`~RawIOBase.read` (when called with a positive argument), :meth:" +"`~RawIOBase.readinto` and :meth:`~RawIOBase.write` methods on this class " +"will only make one system call." msgstr "" #: ../../library/io.rst:676 @@ -1204,8 +1193,8 @@ msgstr "" #: ../../library/io.rst:694 msgid "" -":class:`FileIO` provides these data attributes in addition to those " -"from :class:`RawIOBase` and :class:`IOBase`:" +":class:`FileIO` provides these data attributes in addition to those from :" +"class:`RawIOBase` and :class:`IOBase`:" msgstr "" #: ../../library/io.rst:699 @@ -1230,9 +1219,9 @@ msgstr "" #: ../../library/io.rst:715 msgid "" -"A binary stream using an in-memory bytes buffer. It inherits " -"from :class:`BufferedIOBase`. The buffer is discarded when " -"the :meth:`~IOBase.close` method is called." +"A binary stream using an in-memory bytes buffer. It inherits from :class:" +"`BufferedIOBase`. The buffer is discarded when the :meth:`~IOBase.close` " +"method is called." msgstr "" #: ../../library/io.rst:719 @@ -1294,8 +1283,8 @@ msgstr "" #: ../../library/io.rst:763 msgid "" "A buffered binary stream providing higher-level access to a readable, non " -"seekable :class:`RawIOBase` raw binary stream. It inherits " -"from :class:`BufferedIOBase`." +"seekable :class:`RawIOBase` raw binary stream. It inherits from :class:" +"`BufferedIOBase`." msgstr "" #: ../../library/io.rst:767 @@ -1308,8 +1297,8 @@ msgstr "" #: ../../library/io.rst:771 msgid "" "The constructor creates a :class:`BufferedReader` for the given readable " -"*raw* stream and *buffer_size*. If *buffer_size* is " -"omitted, :data:`DEFAULT_BUFFER_SIZE` is used." +"*raw* stream and *buffer_size*. If *buffer_size* is omitted, :data:" +"`DEFAULT_BUFFER_SIZE` is used." msgstr "" #: ../../library/io.rst:775 @@ -1332,15 +1321,15 @@ msgstr "" #: ../../library/io.rst:790 msgid "" -"In :class:`BufferedReader` this is the same " -"as :meth:`io.BufferedIOBase.read1`" +"In :class:`BufferedReader` this is the same as :meth:`io.BufferedIOBase." +"read1`" msgstr "" #: ../../library/io.rst:797 msgid "" "A buffered binary stream providing higher-level access to a writeable, non " -"seekable :class:`RawIOBase` raw binary stream. It inherits " -"from :class:`BufferedIOBase`." +"seekable :class:`RawIOBase` raw binary stream. It inherits from :class:" +"`BufferedIOBase`." msgstr "" #: ../../library/io.rst:801 @@ -1371,8 +1360,8 @@ msgstr "" #: ../../library/io.rst:810 msgid "" "The constructor creates a :class:`BufferedWriter` for the given writeable " -"*raw* stream. If the *buffer_size* is not given, it defaults " -"to :data:`DEFAULT_BUFFER_SIZE`." +"*raw* stream. If the *buffer_size* is not given, it defaults to :data:" +"`DEFAULT_BUFFER_SIZE`." msgstr "" #: ../../library/io.rst:814 @@ -1383,58 +1372,58 @@ msgstr "" #: ../../library/io.rst:819 msgid "" -"Force bytes held in the buffer into the raw stream. " -"A :exc:`BlockingIOError` should be raised if the raw stream blocks." +"Force bytes held in the buffer into the raw stream. A :exc:" +"`BlockingIOError` should be raised if the raw stream blocks." msgstr "" #: ../../library/io.rst:824 msgid "" "Write the :term:`bytes-like object`, *b*, and return the number of bytes " -"written. When in non-blocking mode, a :exc:`BlockingIOError` " -"with :attr:`BlockingIOError.characters_written` set is raised if the buffer " -"needs to be written out but the raw stream blocks." +"written. When in non-blocking mode, a :exc:`BlockingIOError` with :attr:" +"`BlockingIOError.characters_written` set is raised if the buffer needs to be " +"written out but the raw stream blocks." msgstr "" #: ../../library/io.rst:832 msgid "" -"A buffered binary stream providing higher-level access to a " -"seekable :class:`RawIOBase` raw binary stream. It inherits " -"from :class:`BufferedReader` and :class:`BufferedWriter`." +"A buffered binary stream providing higher-level access to a seekable :class:" +"`RawIOBase` raw binary stream. It inherits from :class:`BufferedReader` " +"and :class:`BufferedWriter`." msgstr "" #: ../../library/io.rst:836 msgid "" "The constructor creates a reader and writer for a seekable raw stream, given " -"in the first argument. If the *buffer_size* is omitted it defaults " -"to :data:`DEFAULT_BUFFER_SIZE`." +"in the first argument. If the *buffer_size* is omitted it defaults to :data:" +"`DEFAULT_BUFFER_SIZE`." msgstr "" #: ../../library/io.rst:840 msgid "" -":class:`BufferedRandom` is capable of anything :class:`BufferedReader` " -"or :class:`BufferedWriter` can do. In addition, :meth:`~IOBase.seek` " -"and :meth:`~IOBase.tell` are guaranteed to be implemented." +":class:`BufferedRandom` is capable of anything :class:`BufferedReader` or :" +"class:`BufferedWriter` can do. In addition, :meth:`~IOBase.seek` and :meth:" +"`~IOBase.tell` are guaranteed to be implemented." msgstr "" #: ../../library/io.rst:847 msgid "" -"A buffered binary stream providing higher-level access to two non " -"seekable :class:`RawIOBase` raw binary streams---one readable, the other " -"writeable. It inherits from :class:`BufferedIOBase`." +"A buffered binary stream providing higher-level access to two non seekable :" +"class:`RawIOBase` raw binary streams---one readable, the other writeable. It " +"inherits from :class:`BufferedIOBase`." msgstr "" #: ../../library/io.rst:851 msgid "" "*reader* and *writer* are :class:`RawIOBase` objects that are readable and " -"writeable respectively. If the *buffer_size* is omitted it defaults " -"to :data:`DEFAULT_BUFFER_SIZE`." +"writeable respectively. If the *buffer_size* is omitted it defaults to :" +"data:`DEFAULT_BUFFER_SIZE`." msgstr "" #: ../../library/io.rst:855 msgid "" ":class:`BufferedRWPair` implements all of :class:`BufferedIOBase`\\'s " -"methods except for :meth:`~BufferedIOBase.detach`, which " -"raises :exc:`UnsupportedOperation`." +"methods except for :meth:`~BufferedIOBase.detach`, which raises :exc:" +"`UnsupportedOperation`." msgstr "" #: ../../library/io.rst:861 @@ -1475,10 +1464,9 @@ msgstr "" #: ../../library/io.rst:894 msgid "" -"The underlying binary buffer (a :class:`BufferedIOBase` " -"or :class:`RawIOBase` instance) that :class:`TextIOBase` deals with. This is " -"not part of the :class:`TextIOBase` API and may not exist in some " -"implementations." +"The underlying binary buffer (a :class:`BufferedIOBase` or :class:" +"`RawIOBase` instance) that :class:`TextIOBase` deals with. This is not part " +"of the :class:`TextIOBase` API and may not exist in some implementations." msgstr "" "底層的二進位緩衝(一個 :class:`BufferedIOBase` 或 :class:`RawIOBase` 實例)," "為 :class:`TextIOBase` 處理的對象。這不是 :class:`TextIOBase` API 的一部分," @@ -1499,14 +1487,14 @@ msgstr "" #: ../../library/io.rst:907 msgid "" "Some :class:`TextIOBase` implementations, like :class:`StringIO`, may not " -"have the concept of an underlying buffer and calling this method will " -"raise :exc:`UnsupportedOperation`." +"have the concept of an underlying buffer and calling this method will raise :" +"exc:`UnsupportedOperation`." msgstr "" #: ../../library/io.rst:915 msgid "" -"Read and return at most *size* characters from the stream as a " -"single :class:`str`. If *size* is negative or ``None``, reads until EOF." +"Read and return at most *size* characters from the stream as a single :class:" +"`str`. If *size* is negative or ``None``, reads until EOF." msgstr "" #: ../../library/io.rst:920 @@ -1562,9 +1550,9 @@ msgstr "" #: ../../library/io.rst:961 msgid "" -"A buffered text stream providing higher-level access to " -"a :class:`BufferedIOBase` buffered binary stream. It inherits " -"from :class:`TextIOBase`." +"A buffered text stream providing higher-level access to a :class:" +"`BufferedIOBase` buffered binary stream. It inherits from :class:" +"`TextIOBase`." msgstr "" #: ../../library/io.rst:965 @@ -1599,10 +1587,10 @@ msgstr "" #: ../../library/io.rst:990 msgid "" -"When reading input from the stream, if *newline* is " -"``None``, :term:`universal newlines` mode is enabled. Lines in the input " -"can end in ``'\\n'``, ``'\\r'``, or ``'\\r\\n'``, and these are translated " -"into ``'\\n'`` before being returned to the caller. If *newline* is ``''``, " +"When reading input from the stream, if *newline* is ``None``, :term:" +"`universal newlines` mode is enabled. Lines in the input can end in " +"``'\\n'``, ``'\\r'``, or ``'\\r\\n'``, and these are translated into " +"``'\\n'`` before being returned to the caller. If *newline* is ``''``, " "universal newlines mode is enabled, but line endings are returned to the " "caller untranslated. If *newline* has any of the other legal values, input " "lines are only terminated by the given string, and the line ending is " @@ -1612,10 +1600,10 @@ msgstr "" #: ../../library/io.rst:999 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " -"characters written are translated to the system default line " -"separator, :data:`os.linesep`. If *newline* is ``''`` or ``'\\n'``, no " -"translation takes place. If *newline* is any of the other legal values, any " -"``'\\n'`` characters written are translated to the given string." +"characters written are translated to the system default line separator, :" +"data:`os.linesep`. If *newline* is ``''`` or ``'\\n'``, no translation " +"takes place. If *newline* is any of the other legal values, any ``'\\n'`` " +"characters written are translated to the given string." msgstr "" #: ../../library/io.rst:1005 @@ -1627,9 +1615,9 @@ msgstr "" #: ../../library/io.rst:1008 msgid "" "If *write_through* is ``True``, calls to :meth:`~BufferedIOBase.write` are " -"guaranteed not to be buffered: any data written on " -"the :class:`TextIOWrapper` object is immediately handled to its underlying " -"binary *buffer*." +"guaranteed not to be buffered: any data written on the :class:" +"`TextIOWrapper` object is immediately handled to its underlying binary " +"*buffer*." msgstr "" #: ../../library/io.rst:1012 @@ -1742,8 +1730,8 @@ msgstr "" #: ../../library/io.rst:1095 msgid "" -"A text stream using an in-memory text buffer. It inherits " -"from :class:`TextIOBase`." +"A text stream using an in-memory text buffer. It inherits from :class:" +"`TextIOBase`." msgstr "" #: ../../library/io.rst:1098 @@ -1754,10 +1742,10 @@ msgstr "" #: ../../library/io.rst:1101 msgid "" "The initial value of the buffer can be set by providing *initial_value*. If " -"newline translation is enabled, newlines will be encoded as if " -"by :meth:`~TextIOBase.write`. The stream is positioned at the start of the " -"buffer which emulates opening an existing file in a ``w+`` mode, making it " -"ready for an immediate write from the beginning or for a write that would " +"newline translation is enabled, newlines will be encoded as if by :meth:" +"`~TextIOBase.write`. The stream is positioned at the start of the buffer " +"which emulates opening an existing file in a ``w+`` mode, making it ready " +"for an immediate write from the beginning or for a write that would " "overwrite the initial value. To emulate opening a file in an ``a+`` mode " "ready for appending, use ``f.seek(0, io.SEEK_END)`` to reposition the stream " "at the end of the buffer." @@ -1772,8 +1760,8 @@ msgstr "" #: ../../library/io.rst:1114 msgid "" -":class:`StringIO` provides this method in addition to those " -"from :class:`TextIOBase` and :class:`IOBase`:" +":class:`StringIO` provides this method in addition to those from :class:" +"`TextIOBase` and :class:`IOBase`:" msgstr "" #: ../../library/io.rst:1119 @@ -1904,9 +1892,9 @@ msgid "" "Text I/O over a binary storage (such as a file) is significantly slower than " "binary I/O over the same storage, because it requires conversions between " "unicode and binary data using a character codec. This can become noticeable " -"handling huge amounts of text data like large log files. " -"Also, :meth:`~TextIOBase.tell` and :meth:`~TextIOBase.seek` are both quite " -"slow due to the reconstruction algorithm used." +"handling huge amounts of text data like large log files. Also, :meth:" +"`~TextIOBase.tell` and :meth:`~TextIOBase.seek` are both quite slow due to " +"the reconstruction algorithm used." msgstr "" #: ../../library/io.rst:1226 @@ -1928,10 +1916,10 @@ msgstr "" #: ../../library/io.rst:1235 msgid "" -"Binary buffered objects (instances " -"of :class:`BufferedReader`, :class:`BufferedWriter`, :class:`BufferedRandom` " -"and :class:`BufferedRWPair`) protect their internal structures using a lock; " -"it is therefore safe to call them from multiple threads at once." +"Binary buffered objects (instances of :class:`BufferedReader`, :class:" +"`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) " +"protect their internal structures using a lock; it is therefore safe to call " +"them from multiple threads at once." msgstr "" #: ../../library/io.rst:1240 @@ -1944,13 +1932,13 @@ msgstr "" #: ../../library/io.rst:1245 msgid "" -"Binary buffered objects (instances " -"of :class:`BufferedReader`, :class:`BufferedWriter`, :class:`BufferedRandom` " -"and :class:`BufferedRWPair`) are not reentrant. While reentrant calls will " -"not happen in normal situations, they can arise from doing I/O in " -"a :mod:`signal` handler. If a thread tries to re-enter a buffered object " -"which it is already accessing, a :exc:`RuntimeError` is raised. Note this " -"doesn't prohibit a different thread from entering the buffered object." +"Binary buffered objects (instances of :class:`BufferedReader`, :class:" +"`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) are " +"not reentrant. While reentrant calls will not happen in normal situations, " +"they can arise from doing I/O in a :mod:`signal` handler. If a thread tries " +"to re-enter a buffered object which it is already accessing, a :exc:" +"`RuntimeError` is raised. Note this doesn't prohibit a different thread " +"from entering the buffered object." msgstr "" #: ../../library/io.rst:1253 @@ -2004,14 +1992,13 @@ msgstr "io.IncrementalNewlineDecoder 類別" #~ msgid "" #~ "Read and return up to *size* bytes, with at most one call to the " -#~ "underlying raw stream's :meth:`~RawIOBase.read` " -#~ "(or :meth:`~RawIOBase.readinto`) method. This can be useful if you are " -#~ "implementing your own buffering on top of a :class:`BufferedIOBase` " -#~ "object." +#~ "underlying raw stream's :meth:`~RawIOBase.read` (or :meth:`~RawIOBase." +#~ "readinto`) method. This can be useful if you are implementing your own " +#~ "buffering on top of a :class:`BufferedIOBase` object." #~ msgstr "" -#~ "讀取並回傳最多 *size* 個位元組,最多呼叫一次底層原始串流" -#~ "的 :meth:`~RawIOBase.read` (或 :meth:`~RawIOBase.readinto`) 方法。如果你正" -#~ "在 :class:`BufferedIOBase` 物件之上實作自己的緩衝區,這可能會很有用。" +#~ "讀取並回傳最多 *size* 個位元組,最多呼叫一次底層原始串流的 :meth:" +#~ "`~RawIOBase.read` (或 :meth:`~RawIOBase.readinto`) 方法。如果你正在 :" +#~ "class:`BufferedIOBase` 物件之上實作自己的緩衝區,這可能會很有用。" #~ msgid "" #~ "If *size* is ``-1`` (the default), an arbitrary number of bytes are " diff --git a/library/ipaddress.po b/library/ipaddress.po index 6a600f83b2..668f963252 100644 --- a/library/ipaddress.po +++ b/library/ipaddress.po @@ -6,7 +6,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-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,8 +27,8 @@ msgstr "**原始碼:**\\ :source:`Lib/ipaddress.py`" #: ../../library/ipaddress.rst:13 msgid "" -":mod:`ipaddress` provides the capabilities to create, manipulate and operate " -"on IPv4 and IPv6 addresses and networks." +":mod:`!ipaddress` provides the capabilities to create, manipulate and " +"operate on IPv4 and IPv6 addresses and networks." msgstr "" #: ../../library/ipaddress.rst:16 @@ -42,8 +42,8 @@ msgstr "" #: ../../library/ipaddress.rst:22 msgid "" -"This is the full module API reference—for an overview and introduction, " -"see :ref:`ipaddress-howto`." +"This is the full module API reference—for an overview and introduction, see :" +"ref:`ipaddress-howto`." msgstr "" #: ../../library/ipaddress.rst:35 @@ -52,7 +52,7 @@ msgstr "" #: ../../library/ipaddress.rst:37 msgid "" -"The :mod:`ipaddress` module provides factory functions to conveniently " +"The :mod:`!ipaddress` module provides factory functions to conveniently " "create IP addresses, networks and interfaces:" msgstr "" @@ -81,9 +81,9 @@ msgid "" "Return an :class:`IPv4Interface` or :class:`IPv6Interface` object depending " "on the IP address passed as argument. *address* is a string or integer " "representing the IP address. Either IPv4 or IPv6 addresses may be supplied; " -"integers less than ``2**32`` will be considered to be IPv4 by default. " -"A :exc:`ValueError` is raised if *address* does not represent a valid IPv4 " -"or IPv6 address." +"integers less than ``2**32`` will be considered to be IPv4 by default. A :" +"exc:`ValueError` is raised if *address* does not represent a valid IPv4 or " +"IPv6 address." msgstr "" #: ../../library/ipaddress.rst:77 @@ -303,8 +303,8 @@ msgstr "" #: ../../library/ipaddress.rst:238 msgid "" -"``True`` if the address is unspecified. See :RFC:`5735` (for IPv4) " -"or :RFC:`2373` (for IPv6)." +"``True`` if the address is unspecified. See :RFC:`5735` (for IPv4) or :RFC:" +"`2373` (for IPv6)." msgstr "" #: ../../library/ipaddress.rst:243 @@ -324,14 +324,14 @@ msgstr "" #: ../../library/ipaddress.rst:251 msgid "" "For IPv6, ``fec0::/10`` a former Site-Local scoped address prefix is " -"currently excluded from that list (see :attr:`~IPv6Address.is_site_local` " -"& :rfc:`3879`)." +"currently excluded from that list (see :attr:`~IPv6Address.is_site_local` & :" +"rfc:`3879`)." msgstr "" #: ../../library/ipaddress.rst:256 msgid "" -"``True`` if this is a loopback address. See :RFC:`3330` (for IPv4) " -"or :RFC:`2373` (for IPv6)." +"``True`` if this is a loopback address. See :RFC:`3330` (for IPv4) or :RFC:" +"`2373` (for IPv6)." msgstr "" #: ../../library/ipaddress.rst:261 @@ -341,8 +341,8 @@ msgstr "" #: ../../library/ipaddress.rst:266 msgid "" -":class:`IPv4Address` object representing the IPv4-mapped IPv6 address. " -"See :RFC:`4291`." +":class:`IPv4Address` object representing the IPv4-mapped IPv6 address. See :" +"RFC:`4291`." msgstr "" #: ../../library/ipaddress.rst:277 @@ -421,15 +421,15 @@ msgstr "" #: ../../library/ipaddress.rst:365 msgid "" "``True`` if the address is reserved for site-local usage. Note that the " -"site-local address space has been deprecated by :RFC:`3879`. " -"Use :attr:`~IPv4Address.is_private` to test if this address is in the space " -"of unique local addresses as defined by :RFC:`4193`." +"site-local address space has been deprecated by :RFC:`3879`. Use :attr:" +"`~IPv4Address.is_private` to test if this address is in the space of unique " +"local addresses as defined by :RFC:`4193`." msgstr "" #: ../../library/ipaddress.rst:372 msgid "" -"For addresses that appear to be IPv4 mapped addresses (starting with " -"``::FFFF/96``), this property will report the embedded IPv4 address. For any " +"For addresses that appear to be IPv4 mapped addresses (starting with ``::" +"FFFF/96``), this property will report the embedded IPv4 address. For any " "other address, this property will be ``None``." msgstr "" @@ -615,10 +615,10 @@ msgstr "" msgid "" "All attributes implemented by address objects are implemented by network " "objects as well. In addition, network objects implement additional " -"attributes. All of these are common between :class:`IPv4Network` " -"and :class:`IPv6Network`, so to avoid duplication they are only documented " -"for :class:`IPv4Network`. Network objects are :term:`hashable`, so they can " -"be used as keys in dictionaries." +"attributes. All of these are common between :class:`IPv4Network` and :class:" +"`IPv6Network`, so to avoid duplication they are only documented for :class:" +"`IPv4Network`. Network objects are :term:`hashable`, so they can be used as " +"keys in dictionaries." msgstr "" #: ../../library/ipaddress.rst:501 @@ -675,9 +675,9 @@ msgstr "" #: ../../library/ipaddress.rst:533 ../../library/ipaddress.rst:753 msgid "" -"If *strict* is ``True`` and host bits are set in the supplied address, " -"then :exc:`ValueError` is raised. Otherwise, the host bits are masked out " -"to determine the appropriate network address." +"If *strict* is ``True`` and host bits are set in the supplied address, then :" +"exc:`ValueError` is raised. Otherwise, the host bits are masked out to " +"determine the appropriate network address." msgstr "" #: ../../library/ipaddress.rst:537 @@ -770,9 +770,8 @@ msgstr "" #: ../../library/ipaddress.rst:633 msgid "" "Computes the network definitions resulting from removing the given *network* " -"from this one. Returns an iterator of network objects. " -"Raises :exc:`ValueError` if *network* is not completely contained in this " -"network." +"from this one. Returns an iterator of network objects. Raises :exc:" +"`ValueError` if *network* is not completely contained in this network." msgstr "" #: ../../library/ipaddress.rst:646 @@ -830,16 +829,15 @@ msgstr "" #: ../../library/ipaddress.rst:733 msgid "" -"Note that currently expanded netmasks are not supported. That means " -"``2001:db00::0/24`` is a valid argument while ``2001:db00::0/ffff:ff00::`` " -"is not." +"Note that currently expanded netmasks are not supported. That means ``2001:" +"db00::0/24`` is a valid argument while ``2001:db00::0/ffff:ff00::`` is not." msgstr "" #: ../../library/ipaddress.rst:737 msgid "" "An integer that fits into 128 bits. This is equivalent to a single-address " -"network, with the network address being *address* and the mask being ``/" -"128``." +"network, with the network address being *address* and the mask being " +"``/128``." msgstr "" #: ../../library/ipaddress.rst:741 @@ -1086,36 +1084,36 @@ msgstr "" #: ../../library/ipaddress.rst:973 msgid "" "Represent an address as 4 packed bytes in network (big-endian) order. " -"*address* is an integer representation of an IPv4 IP address. " -"A :exc:`ValueError` is raised if the integer is negative or too large to be " -"an IPv4 IP address." +"*address* is an integer representation of an IPv4 IP address. A :exc:" +"`ValueError` is raised if the integer is negative or too large to be an IPv4 " +"IP address." msgstr "" #: ../../library/ipaddress.rst:986 msgid "" "Represent an address as 16 packed bytes in network (big-endian) order. " -"*address* is an integer representation of an IPv6 IP address. " -"A :exc:`ValueError` is raised if the integer is negative or too large to be " -"an IPv6 IP address." +"*address* is an integer representation of an IPv6 IP address. A :exc:" +"`ValueError` is raised if the integer is negative or too large to be an IPv6 " +"IP address." msgstr "" #: ../../library/ipaddress.rst:994 msgid "" "Return an iterator of the summarized network range given the first and last " -"IP addresses. *first* is the first :class:`IPv4Address` " -"or :class:`IPv6Address` in the range and *last* is the " -"last :class:`IPv4Address` or :class:`IPv6Address` in the range. " -"A :exc:`TypeError` is raised if *first* or *last* are not IP addresses or " -"are not of the same version. A :exc:`ValueError` is raised if *last* is not " -"greater than *first* or if *first* address version is not 4 or 6." +"IP addresses. *first* is the first :class:`IPv4Address` or :class:" +"`IPv6Address` in the range and *last* is the last :class:`IPv4Address` or :" +"class:`IPv6Address` in the range. A :exc:`TypeError` is raised if *first* " +"or *last* are not IP addresses or are not of the same version. A :exc:" +"`ValueError` is raised if *last* is not greater than *first* or if *first* " +"address version is not 4 or 6." msgstr "" #: ../../library/ipaddress.rst:1010 msgid "" -"Return an iterator of the collapsed :class:`IPv4Network` " -"or :class:`IPv6Network` objects. *addresses* is an :term:`iterable` " -"of :class:`IPv4Network` or :class:`IPv6Network` objects. A :exc:`TypeError` " -"is raised if *addresses* contains mixed version objects." +"Return an iterator of the collapsed :class:`IPv4Network` or :class:" +"`IPv6Network` objects. *addresses* is an :term:`iterable` of :class:" +"`IPv4Network` or :class:`IPv6Network` objects. A :exc:`TypeError` is raised " +"if *addresses* contains mixed version objects." msgstr "" #: ../../library/ipaddress.rst:1023 @@ -1132,7 +1130,7 @@ msgstr "IPv4Address('192.0.2.0') <= IPv4Network('192.0.2.0/24')" #: ../../library/ipaddress.rst:1029 msgid "" "doesn't make sense. There are some times however, where you may wish to " -"have :mod:`ipaddress` sort these anyway. If you need to do this, you can " +"have :mod:`!ipaddress` sort these anyway. If you need to do this, you can " "use this function as the *key* argument to :func:`sorted`." msgstr "" diff --git a/library/json.po b/library/json.po index f7f634a860..78aed2fe84 100644 --- a/library/json.po +++ b/library/json.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-09 00:17+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2023-08-05 15:25+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -249,7 +249,8 @@ msgid "" msgstr "" #: ../../library/json.rst:124 -msgid "Using :mod:`json` from the shell to validate and pretty-print:" +#, fuzzy +msgid "Using :mod:`!json` from the shell to validate and pretty-print:" msgstr "在 shell 使用 :mod:`json` 來驗證和美化印出:" #: ../../library/json.rst:126 @@ -843,9 +844,9 @@ msgid "" "characters that must be escaped: quotation mark, reverse solidus, and the " "control characters U+0000 through U+001F." msgstr "" -"如果 *ensure_ascii* 為 true(預設值),則輸出將保證所有非 ASCII 和非可列印" -"字元都會被跳脫。如果 *ensure_ascii* 為 false,則所有字元都將按原樣輸出," -"唯有必須跳脫的字元例外:引號、反斜線,以及控制字元 U+0000 到 U+001F。" +"如果 *ensure_ascii* 為 true(預設值),則輸出將保證所有非 ASCII 和非可列印字" +"元都會被跳脫。如果 *ensure_ascii* 為 false,則所有字元都將按原樣輸出,唯有必" +"須跳脫的字元例外:引號、反斜線,以及控制字元 U+0000 到 U+001F。" #: ../../library/json.rst:505 msgid "" @@ -1077,8 +1078,8 @@ msgid "" "*ensure_ascii=True* by default, thus escaping the output so that the " "resulting strings only contain printable ASCII characters." msgstr "" -"RFC 准許但並不強制編碼器預設要設定 *ensure_ascii=True*,因此跳脫輸出" -"使得結果字串只包含可列印的 ASCII 字元。" +"RFC 准許但並不強制編碼器預設要設定 *ensure_ascii=True*,因此跳脫輸出使得結果" +"字串只包含可列印的 ASCII 字元。" #: ../../library/json.rst:645 msgid "" @@ -1263,7 +1264,7 @@ msgstr "**原始碼:**\\ :source:`Lib/json/tool.py`" #: ../../library/json.rst:750 msgid "" -"The :mod:`json` module can be invoked as a script via ``python -m json`` to " +"The :mod:`!json` module can be invoked as a script via ``python -m json`` to " "validate and pretty-print JSON objects. The :mod:`json.tool` submodule " "implements this interface." msgstr "" @@ -1302,7 +1303,7 @@ msgstr "" #: ../../library/json.rst:771 msgid "" -"The :mod:`json` module may now be directly executed as ``python -m json``. " +"The :mod:`!json` module may now be directly executed as ``python -m json``. " "For backwards compatibility, invoking the CLI as ``python -m json.tool`` " "remains supported." msgstr "" diff --git a/library/linecache.po b/library/linecache.po index 11c56a83cd..d40f74f094 100644 --- a/library/linecache.po +++ b/library/linecache.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-28 00:16+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2025-07-07 23:50+0800\n" "Last-Translator: Weilin Du <1372449351@qq.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,8 +28,9 @@ msgid "**Source code:** :source:`Lib/linecache.py`" msgstr "**原始碼:**\\ :source:`Lib/linecache.py`" #: ../../library/linecache.rst:13 +#, fuzzy msgid "" -"The :mod:`linecache` module allows one to get any line from a Python source " +"The :mod:`!linecache` module allows one to get any line from a Python source " "file, while attempting to optimize internally, using a cache, the common " "case where many lines are read from a single file. This is used by the :mod:" "`traceback` module to retrieve source lines for inclusion in the formatted " @@ -50,7 +51,8 @@ msgstr "" "UTF-8。" #: ../../library/linecache.rst:22 -msgid "The :mod:`linecache` module defines the following functions:" +#, fuzzy +msgid "The :mod:`!linecache` module defines the following functions:" msgstr ":mod:`linecache` 模組定義了下列函式:" #: ../../library/linecache.rst:27 diff --git a/library/locale.po b/library/locale.po index b104cbda19..6e37f8ac31 100644 --- a/library/locale.po +++ b/library/locale.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-17 00:14+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/locale.py`" #: ../../library/locale.rst:14 msgid "" -"The :mod:`locale` module opens access to the POSIX locale database and " +"The :mod:`!locale` module opens access to the POSIX locale database and " "functionality. The POSIX locale mechanism allows programmers to deal with " "certain cultural issues in an application, without requiring the programmer " "to know all the specifics of each country where the software is executed." @@ -35,12 +35,13 @@ msgstr "" #: ../../library/locale.rst:21 msgid "" -"The :mod:`locale` module is implemented on top of the :mod:`!_locale` " +"The :mod:`!locale` module is implemented on top of the :mod:`!_locale` " "module, which in turn uses an ANSI C locale implementation if available." msgstr "" #: ../../library/locale.rst:24 -msgid "The :mod:`locale` module defines the following exception and functions:" +msgid "" +"The :mod:`!locale` module defines the following exception and functions:" msgstr "" #: ../../library/locale.rst:29 @@ -738,7 +739,7 @@ msgstr "" #: ../../library/locale.rst:537 msgid "" "Locale category for sorting strings. The functions :func:`strcoll` and :" -"func:`strxfrm` of the :mod:`locale` module are affected." +"func:`strxfrm` of the :mod:`!locale` module are affected." msgstr "" #: ../../library/locale.rst:543 @@ -770,8 +771,8 @@ msgstr "" #: ../../library/locale.rst:566 msgid "" "Locale category for formatting numbers. The functions :func:" -"`format_string`, :func:`atoi`, :func:`atof` and :func:`.str` of the :mod:" -"`locale` module are affected by that category. All other numeric formatting " +"`format_string`, :func:`atoi`, :func:`atof` and :func:`.str` of the :mod:`!" +"locale` module are affected by that category. All other numeric formatting " "operations are not affected." msgstr "" @@ -938,7 +939,7 @@ msgstr "" #: ../../library/locale.rst:691 msgid "" -"When Python code uses the :mod:`locale` module to change the locale, this " +"When Python code uses the :mod:`!locale` module to change the locale, this " "also affects the embedding application. If the embedding application " "doesn't want this to happen, it should remove the :mod:`!_locale` extension " "module (which does all the work) from the table of built-in modules in the :" diff --git a/library/logging.config.po b/library/logging.config.po index d0c5307537..4a2d8e9166 100644 --- a/library/logging.config.po +++ b/library/logging.config.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-22 16:55+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -53,7 +53,7 @@ msgstr "" #: ../../library/logging.config.rst:30 msgid "" "The following functions configure the logging module. They are located in " -"the :mod:`logging.config` module. Their use is optional --- you can " +"the :mod:`!logging.config` module. Their use is optional --- you can " "configure the logging module using these functions or by making calls to the " "main API (defined in :mod:`logging` itself) and defining handlers which are " "declared either in :mod:`logging` or :mod:`logging.handlers`." @@ -103,7 +103,7 @@ msgstr "" msgid "" "Parsing is performed by the :class:`DictConfigurator` class, whose " "constructor is passed the dictionary used for configuration, and has a :meth:" -"`configure` method. The :mod:`logging.config` module has a callable " +"`configure` method. The :mod:`!logging.config` module has a callable " "attribute :attr:`dictConfigClass` which is initially set to :class:" "`DictConfigurator`. You can replace the value of :attr:`dictConfigClass` " "with a suitable implementation of your own." diff --git a/library/logging.handlers.po b/library/logging.handlers.po index 0455bcb787..f6eae728ae 100644 --- a/library/logging.handlers.po +++ b/library/logging.handlers.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-22 16:55+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -212,7 +212,7 @@ msgstr "WatchedFileHandler" #: ../../library/logging.handlers.rst:163 msgid "" -"The :class:`WatchedFileHandler` class, located in the :mod:`logging." +"The :class:`WatchedFileHandler` class, located in the :mod:`!logging." "handlers` module, is a :class:`FileHandler` which watches the file it is " "logging to. If the file changes, it is closed and reopened using the file " "name." @@ -267,7 +267,7 @@ msgstr "BaseRotatingHandler" #: ../../library/logging.handlers.rst:216 msgid "" -"The :class:`BaseRotatingHandler` class, located in the :mod:`logging." +"The :class:`BaseRotatingHandler` class, located in the :mod:`!logging." "handlers` module, is the base class for the rotating file handlers, :class:" "`RotatingFileHandler` and :class:`TimedRotatingFileHandler`. You should not " "need to instantiate this class, but it has attributes and methods you may " @@ -385,7 +385,7 @@ msgstr "RotatingFileHandler" #: ../../library/logging.handlers.rst:310 msgid "" -"The :class:`RotatingFileHandler` class, located in the :mod:`logging." +"The :class:`RotatingFileHandler` class, located in the :mod:`!logging." "handlers` module, supports rotation of disk log files." msgstr "" @@ -441,7 +441,7 @@ msgstr "TimedRotatingFileHandler" #: ../../library/logging.handlers.rst:364 msgid "" -"The :class:`TimedRotatingFileHandler` class, located in the :mod:`logging." +"The :class:`TimedRotatingFileHandler` class, located in the :mod:`!logging." "handlers` module, supports rotation of disk log files at certain timed " "intervals." msgstr "" @@ -633,7 +633,7 @@ msgstr "SocketHandler" #: ../../library/logging.handlers.rst:478 msgid "" -"The :class:`SocketHandler` class, located in the :mod:`logging.handlers` " +"The :class:`SocketHandler` class, located in the :mod:`!logging.handlers` " "module, sends logging output to a network socket. The base class uses a TCP " "socket." msgstr "" @@ -758,7 +758,7 @@ msgstr "DatagramHandler" #: ../../library/logging.handlers.rst:574 msgid "" -"The :class:`DatagramHandler` class, located in the :mod:`logging.handlers` " +"The :class:`DatagramHandler` class, located in the :mod:`!logging.handlers` " "module, inherits from :class:`SocketHandler` to support sending logging " "messages over UDP sockets." msgstr "" @@ -812,7 +812,7 @@ msgstr "SysLogHandler" #: ../../library/logging.handlers.rst:621 msgid "" -"The :class:`SysLogHandler` class, located in the :mod:`logging.handlers` " +"The :class:`SysLogHandler` class, located in the :mod:`!logging.handlers` " "module, supports sending logging messages to a remote or local Unix syslog." msgstr "" @@ -1186,10 +1186,10 @@ msgstr "NTEventLogHandler" #: ../../library/logging.handlers.rst:800 msgid "" -"The :class:`NTEventLogHandler` class, located in the :mod:`logging.handlers` " -"module, supports sending logging messages to a local Windows NT, Windows " -"2000 or Windows XP event log. Before you can use it, you need Mark Hammond's " -"Win32 extensions for Python installed." +"The :class:`NTEventLogHandler` class, located in the :mod:`!logging." +"handlers` module, supports sending logging messages to a local Windows NT, " +"Windows 2000 or Windows XP event log. Before you can use it, you need Mark " +"Hammond's Win32 extensions for Python installed." msgstr "" #: ../../library/logging.handlers.rst:808 @@ -1255,7 +1255,7 @@ msgstr "SMTPHandler" #: ../../library/logging.handlers.rst:867 msgid "" -"The :class:`SMTPHandler` class, located in the :mod:`logging.handlers` " +"The :class:`SMTPHandler` class, located in the :mod:`!logging.handlers` " "module, supports sending logging messages to an email address via SMTP." msgstr "" @@ -1306,7 +1306,7 @@ msgstr "MemoryHandler" #: ../../library/logging.handlers.rst:908 msgid "" -"The :class:`MemoryHandler` class, located in the :mod:`logging.handlers` " +"The :class:`MemoryHandler` class, located in the :mod:`!logging.handlers` " "module, supports buffering of logging records in memory, periodically " "flushing them to a :dfn:`target` handler. Flushing occurs whenever the " "buffer is full, or when an event of a certain severity or greater is seen." @@ -1388,7 +1388,7 @@ msgstr "HTTPHandler" #: ../../library/logging.handlers.rst:988 msgid "" -"The :class:`HTTPHandler` class, located in the :mod:`logging.handlers` " +"The :class:`HTTPHandler` class, located in the :mod:`!logging.handlers` " "module, supports sending logging messages to a web server, using either " "``GET`` or ``POST`` semantics." msgstr "" @@ -1443,7 +1443,7 @@ msgstr "QueueHandler" #: ../../library/logging.handlers.rst:1040 msgid "" -"The :class:`QueueHandler` class, located in the :mod:`logging.handlers` " +"The :class:`QueueHandler` class, located in the :mod:`!logging.handlers` " "module, supports sending logging messages to a queue, such as those " "implemented in the :mod:`queue` or :mod:`multiprocessing` modules." msgstr "" @@ -1554,7 +1554,7 @@ msgstr "QueueListener" #: ../../library/logging.handlers.rst:1133 msgid "" -"The :class:`QueueListener` class, located in the :mod:`logging.handlers` " +"The :class:`QueueListener` class, located in the :mod:`!logging.handlers` " "module, supports receiving logging messages from a queue, such as those " "implemented in the :mod:`queue` or :mod:`multiprocessing` modules. The " "messages are received from a queue in an internal thread and passed, on the " diff --git a/library/logging.po b/library/logging.po index f13d09f62c..71c7fa9b49 100644 --- a/library/logging.po +++ b/library/logging.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-22 16:55+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2024-03-28 22:40+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2273,8 +2273,8 @@ msgstr "" #: ../../library/logging.rst:1537 msgid "" -"The :func:`captureWarnings` function can be used to integrate :mod:`logging` " -"with the :mod:`warnings` module." +"The :func:`captureWarnings` function can be used to integrate :mod:`!" +"logging` with the :mod:`warnings` module." msgstr "" #: ../../library/logging.rst:1542 @@ -2332,9 +2332,9 @@ msgstr "" #: ../../library/logging.rst:1568 msgid "" -"This is the original source for the :mod:`logging` package. The version of " +"This is the original source for the :mod:`!logging` package. The version of " "the package available from this site is suitable for use with Python 1.5.2, " -"2.1.x and 2.2.x, which do not include the :mod:`logging` package in the " +"2.1.x and 2.2.x, which do not include the :mod:`!logging` package in the " "standard library." msgstr "" diff --git a/library/marshal.po b/library/marshal.po index c525f3826a..08015478dc 100644 --- a/library/marshal.po +++ b/library/marshal.po @@ -9,7 +9,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-02-07 00:19+0000\n" "PO-Revision-Date: 2023-04-24 21:28+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -40,20 +40,20 @@ msgstr "" "不同 Python 版本中被改變(雖然這種情況極少發生)。[#]_" #: ../../library/marshal.rst:21 +#, fuzzy msgid "" "This is not a general \"persistence\" module. For general persistence and " "transfer of Python objects through RPC calls, see the modules :mod:`pickle` " -"and :mod:`shelve`. The :mod:`marshal` module exists mainly to support " -"reading and writing the \"pseudo-compiled\" code for Python modules " -"of :file:`.pyc` files. Therefore, the Python maintainers reserve the right " -"to modify the marshal format in backward incompatible ways should the need " -"arise. The format of code objects is not compatible between Python versions, " -"even if the version of the format is the same. De-serializing a code object " -"in the incorrect Python version has undefined behavior. If you're " -"serializing and de-serializing Python objects, use the :mod:`pickle` module " -"instead -- the performance is comparable, version independence is " -"guaranteed, and pickle supports a substantially wider range of objects than " -"marshal." +"and :mod:`shelve`. The :mod:`!marshal` module exists mainly to support " +"reading and writing the \"pseudo-compiled\" code for Python modules of :file:" +"`.pyc` files. Therefore, the Python maintainers reserve the right to modify " +"the marshal format in backward incompatible ways should the need arise. The " +"format of code objects is not compatible between Python versions, even if " +"the version of the format is the same. De-serializing a code object in the " +"incorrect Python version has undefined behavior. If you're serializing and " +"de-serializing Python objects, use the :mod:`pickle` module instead -- the " +"performance is comparable, version independence is guaranteed, and pickle " +"supports a substantially wider range of objects than marshal." msgstr "" "這不是一個通用「持久性 (persistence)」模組。關於通用持久性以及透過 RPC 呼叫傳" "遞 Python 物件,請參閱 :mod:`pickle` 和 :mod:`shelve` 等模組。:mod:`marshal` " @@ -65,8 +65,9 @@ msgstr "" "有保證版本獨立性,且實質上 pickle 還支援比 marshal 更多樣的物件。" #: ../../library/marshal.rst:37 +#, fuzzy msgid "" -"The :mod:`marshal` module is not intended to be secure against erroneous or " +"The :mod:`!marshal` module is not intended to be secure against erroneous or " "maliciously constructed data. Never unmarshal data received from an " "untrusted or unauthenticated source." msgstr "" @@ -147,16 +148,16 @@ msgstr "" #: ../../library/marshal.rst:83 msgid "" -"If the value has (or contains an object that has) an unsupported type, " -"a :exc:`ValueError` exception is raised --- but garbage data will also be " -"written to the file. The object will not be properly read back " -"by :func:`load`. :ref:`Code objects ` are only supported if " +"If the value has (or contains an object that has) an unsupported type, a :" +"exc:`ValueError` exception is raised --- but garbage data will also be " +"written to the file. The object will not be properly read back by :func:" +"`load`. :ref:`Code objects ` are only supported if " "*allow_code* is true." msgstr "" "如果值具有(或其所包含的物件具有)不支援的型別,則會引發 :exc:`ValueError` 例" -"外 --- 但是垃圾資料 (garbage data) 也將寫入檔案,物件也無法正確地透" -"過 :func:`load` 重新讀取。:ref:`程式碼物件 `\\ 只有在 " -"*allow_code* 為 true 時才會支援。" +"外 --- 但是垃圾資料 (garbage data) 也將寫入檔案,物件也無法正確地透過 :func:" +"`load` 重新讀取。:ref:`程式碼物件 `\\ 只有在 *allow_code* 為 " +"true 時才會支援。" #: ../../library/marshal.rst:88 msgid "" @@ -181,15 +182,14 @@ msgstr "新增 *allow_code* 參數。" msgid "" "Read one value from the open file and return it. If no valid value is read " "(e.g. because the data has a different Python version's incompatible marshal " -"format), raise :exc:`EOFError`, :exc:`ValueError` " -"or :exc:`TypeError`. :ref:`Code objects ` are only supported " -"if *allow_code* is true. The file must be a readable :term:`binary file`." +"format), raise :exc:`EOFError`, :exc:`ValueError` or :exc:`TypeError`. :ref:" +"`Code objects ` are only supported if *allow_code* is true. " +"The file must be a readable :term:`binary file`." msgstr "" "從開啟的檔案讀取一個值並回傳。如果讀不到有效的值(例如,由於資料為不同 " -"Python 版本的不相容 marshal 格式),則會引" -"發 :exc:`EOFError`、:exc:`ValueError` 或 :exc:`TypeError`。:ref:`程式碼物件 " -"`\\ 只有在 *allow_code* 為 true 時才會支援。檔案必須為可讀取" -"的 :term:`binary file`。" +"Python 版本的不相容 marshal 格式),則會引發 :exc:`EOFError`、:exc:" +"`ValueError` 或 :exc:`TypeError`。:ref:`程式碼物件 `\\ 只有在 " +"*allow_code* 為 true 時才會支援。檔案必須為可讀取的 :term:`binary file`。" #: ../../library/marshal.rst:105 msgid "" @@ -199,9 +199,8 @@ msgstr "引發一個沒有附帶引數的\\ :ref:`稽核事件 ` ``mar #: ../../library/marshal.rst:109 msgid "" -"If an object containing an unsupported type was marshalled " -"with :func:`dump`, :func:`load` will substitute ``None`` for the " -"unmarshallable type." +"If an object containing an unsupported type was marshalled with :func:" +"`dump`, :func:`load` will substitute ``None`` for the unmarshallable type." msgstr "" "如果透過 :func:`dump` marshal 了一個包含不支援型別的物件,:func:`load` 會將不" "可 marshal 的型別替換為 ``None``。" @@ -223,9 +222,9 @@ msgid "" "is true." msgstr "" "回傳將透過 ``dump(value, file)`` 來被寫入一個檔案的位元組串物件,其值必須是有" -"支援的型別,如果值(或其包含的任一物件)為不支援的型別則會引" -"發 :exc:`ValueError`。:ref:`程式碼物件 `\\ 只有在 *allow_code* " -"為 true 時才會支援。" +"支援的型別,如果值(或其包含的任一物件)為不支援的型別則會引發 :exc:" +"`ValueError`。:ref:`程式碼物件 `\\ 只有在 *allow_code* 為 true " +"時才會支援。" #: ../../library/marshal.rst:128 msgid "" @@ -236,22 +235,22 @@ msgstr "*version* 引數指明 ``dumps`` 應當使用的資料型別(見下文 #: ../../library/marshal.rst:139 msgid "" "Convert the :term:`bytes-like object` to a value. If no valid value is " -"found, raise :exc:`EOFError`, :exc:`ValueError` " -"or :exc:`TypeError`. :ref:`Code objects ` are only supported " -"if *allow_code* is true. Extra bytes in the input are ignored." +"found, raise :exc:`EOFError`, :exc:`ValueError` or :exc:`TypeError`. :ref:" +"`Code objects ` are only supported if *allow_code* is true. " +"Extra bytes in the input are ignored." msgstr "" -"將 :term:`bytes-like object` 轉換為一個值。如果找不到有效的值,則會引" -"發 :exc:`EOFError`、:exc:`ValueError` 或 :exc:`TypeError`。:ref:`程式碼物件 " -"`\\ 只有在 *allow_code* 為 true 時才會支援。輸入中額外的位元組" -"串會被忽略。" +"將 :term:`bytes-like object` 轉換為一個值。如果找不到有效的值,則會引發 :exc:" +"`EOFError`、:exc:`ValueError` 或 :exc:`TypeError`。:ref:`程式碼物件 `\\ 只有在 *allow_code* 為 true 時才會支援。輸入中額外的位元組串會被" +"忽略。" #: ../../library/marshal.rst:144 msgid "" "Raises an :ref:`auditing event ` ``marshal.loads`` with argument " "``bytes``." msgstr "" -"引發一個附帶引數 ``bytes`` 的\\ :ref:`稽核事件 ` " -"``marshal.loads``。" +"引發一個附帶引數 ``bytes`` 的\\ :ref:`稽核事件 ` ``marshal." +"loads``。" #: ../../library/marshal.rst:148 msgid "" @@ -271,8 +270,8 @@ msgid "" "version; subsequent versions add new features. Generally, a new version " "becomes the default when it is introduced." msgstr "" -"表示模組所使用的格式。第 0 版為歷史上第一版本;後續版本會新增功能。當引入新版本時," -"它通常會成為預設版本。" +"表示模組所使用的格式。第 0 版為歷史上第一版本;後續版本會新增功能。當引入新版" +"本時,它通常會成為預設版本。" #: ../../library/marshal.rst:165 msgid "Version" @@ -402,6 +401,6 @@ msgstr "code object(程式碼物件)" #~ "列 (bytearray)、元組 (tuple)、list、集合 (set)、凍結集合 (frozenset)、" #~ "dictionary 和程式碼物件(如 *allow_code* 為 true),需要了解的一點是元組、" #~ "list、集合、凍結集合和 dictionary 只在其所包含的值也屬於這些型別時才會支" -#~ "援。單例 (singleton) 物件 :const:`None`、:const:`Ellipsis` " -#~ "和 :exc:`StopIteration` 也可以被 marshal 和 unmarshal。對於 *version* 低" -#~ "於 3 的格式,遞迴 list、集合和 dictionary 無法被寫入(見下文)。" +#~ "援。單例 (singleton) 物件 :const:`None`、:const:`Ellipsis` 和 :exc:" +#~ "`StopIteration` 也可以被 marshal 和 unmarshal。對於 *version* 低於 3 的格" +#~ "式,遞迴 list、集合和 dictionary 無法被寫入(見下文)。" diff --git a/library/math.po b/library/math.po index 37fdeb724b..de3a58588a 100644 --- a/library/math.po +++ b/library/math.po @@ -6,7 +6,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-02-07 00:19+0000\n" "PO-Revision-Date: 2024-10-06 23:31+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -522,7 +522,8 @@ msgstr ":func:`erf(x) `" #: ../../library/math.rst:109 msgid "`Error function `_ at *x*" -msgstr "在 *x* 處的\\ `誤差函式 `_\\ 值" +msgstr "" +"在 *x* 處的\\ `誤差函式 `_\\ 值" #: ../../library/math.rst:110 msgid ":func:`erfc(x) `" @@ -542,7 +543,8 @@ msgstr ":func:`gamma(x) `" #: ../../library/math.rst:111 msgid "`Gamma function `_ at *x*" -msgstr "在 *x* 處的 `Gamma 函式 `_\\ 值" +msgstr "" +"在 *x* 處的 `Gamma 函式 `_\\ 值" #: ../../library/math.rst:112 msgid ":func:`lgamma(x) `" @@ -550,11 +552,11 @@ msgstr ":func:`lgamma(x) `" #: ../../library/math.rst:112 msgid "" -"Natural logarithm of the absolute value of the `Gamma function `_ at *x*" +"Natural logarithm of the absolute value of the `Gamma function `_ at *x*" msgstr "" -"在 *x* 處的 `Gamma 函式 `_\\ 絕對值的自然對數" +"在 *x* 處的 `Gamma 函式 `_\\ 絕" +"對值的自然對數" #: ../../library/math.rst:114 msgid "**Constants**" @@ -626,11 +628,11 @@ msgstr "" #: ../../library/math.rst:139 ../../library/math.rst:204 msgid "" -"Raises :exc:`TypeError` if either of the arguments are not integers. " -"Raises :exc:`ValueError` if either of the arguments are negative." +"Raises :exc:`TypeError` if either of the arguments are not integers. Raises :" +"exc:`ValueError` if either of the arguments are negative." msgstr "" -"當任一參數非整數型別時會引發 :exc:`TypeError`。當任一參數為負數時會引" -"發 :exc:`ValueError`。" +"當任一參數非整數型別時會引發 :exc:`TypeError`。當任一參數為負數時會引發 :exc:" +"`ValueError`。" #: ../../library/math.rst:147 msgid "Return factorial of the nonnegative integer *n*." @@ -716,12 +718,12 @@ msgstr "浮點數算術運算" #: ../../library/math.rst:215 msgid "" "Return the ceiling of *x*, the smallest integer greater than or equal to " -"*x*. If *x* is not a float, delegates to :meth:`x.__ceil__ " -"`, which should return an :class:`~numbers.Integral` value." +"*x*. If *x* is not a float, delegates to :meth:`x.__ceil__ `, which should return an :class:`~numbers.Integral` value." msgstr "" "回傳 *x* 經上取整的值,即大於或等於 *x* 的最小整數。若 *x* 並非浮點數,此函式" -"將委派給 :meth:`x.__ceil__ `,並回" -"傳 :class:`~numbers.Integral` 型別的值。" +"將委派給 :meth:`x.__ceil__ `,並回傳 :class:`~numbers." +"Integral` 型別的值。" #: ../../library/math.rst:222 msgid "Return the absolute value of *x*." @@ -734,8 +736,8 @@ msgid "" "which should return an :class:`~numbers.Integral` value." msgstr "" "回傳 *x* 經下取整的值,即小於或等於 *x* 的最大整數。若 *x* 並非浮點數,此函式" -"將委派給 :meth:`x.__floor__ `,並回" -"傳 :class:`~numbers.Integral` 型別的值。" +"將委派給 :meth:`x.__floor__ `,並回傳 :class:`~numbers." +"Integral` 型別的值。" #: ../../library/math.rst:234 msgid "" @@ -744,8 +746,9 @@ msgid "" "``float`` format. This operation often provides better accuracy than the " "direct expression ``(x * y) + z``." msgstr "" -"融合乘加運算。回傳 ``(x * y) + z``,用近似於無限精密度及範圍的方式計算,而後一" -"次轉換為 ``float`` 格式。此操作通常能提供比運算式 ``(x * y) + z`` 更高的精確度。" +"融合乘加運算。回傳 ``(x * y) + z``,用近似於無限精密度及範圍的方式計算,而後" +"一次轉換為 ``float`` 格式。此操作通常能提供比運算式 ``(x * y) + z`` 更高的精" +"確度。" #: ../../library/math.rst:239 msgid "" @@ -776,13 +779,13 @@ msgid "" msgstr "" "回傳 ``x / y`` 的浮點數餘數,其以平臺上的 C 函式庫 ``fmod(x, y)`` 函式定義。" "請注意此函式與 Python 運算式 ``x % y`` 可能不會回傳相同結果。C 標準要求 " -"``fmod(x, y)`` 的回傳值完全等同(數學定義上,即無限精密度)於 ``x - n*y``,*n*" -"為可使回傳值與 *x* 同號且量值小於 ``abs(y)`` 的整數。Python 運算式 ``x % y`` " -"的回傳值則與 *y* 同號,且可能無法精確地計算浮點數引數。例如:``fmod(-1e-100, " -"1e100)`` 的值為 ``-1e-100``,但 Python 運算式 ``-1e-100 % 1e100`` 的結果為 " -"``1e100-1e-100``,此值無法準確地表示成浮點數,並會四捨五入為出乎意料的 " -"``1e100``。因此,處理浮點數時通常會選擇函式 :func:`fmod`,而處理整數時會選擇 " -"Python 運算式 ``x % y``。" +"``fmod(x, y)`` 的回傳值完全等同(數學定義上,即無限精密度)於 ``x - n*y``," +"*n*為可使回傳值與 *x* 同號且量值小於 ``abs(y)`` 的整數。Python 運算式 ``x % " +"y`` 的回傳值則與 *y* 同號,且可能無法精確地計算浮點數引數。例如:" +"``fmod(-1e-100, 1e100)`` 的值為 ``-1e-100``,但 Python 運算式 ``-1e-100 % " +"1e100`` 的結果為 ``1e100-1e-100``,此值無法準確地表示成浮點數,並會四捨五入為" +"出乎意料的 ``1e100``。因此,處理浮點數時通常會選擇函式 :func:`fmod`,而處理整" +"數時會選擇 Python 運算式 ``x % y``。" #: ../../library/math.rst:266 msgid "" @@ -797,9 +800,9 @@ msgid "" "than returning its second return value through an 'output parameter' (there " "is no such thing in Python)." msgstr "" -"請注意 :func:`modf` 的呼叫/回傳模式與 C 語言中相應的函式不同:" -"它們接受一個引數並回傳一對值,而非透過一個「輸出參數(output parameter)」傳" -"遞第二個回傳值(Python 沒有那種東西)。" +"請注意 :func:`modf` 的呼叫/回傳模式與 C 語言中相應的函式不同:它們接受一個引" +"數並回傳一對值,而非透過一個「輸出參數(output parameter)」傳遞第二個回傳值" +"(Python 沒有那種東西)。" #: ../../library/math.rst:277 msgid "" @@ -810,9 +813,9 @@ msgid "" "*even* integer is used for ``n``. The remainder ``r = remainder(x, y)`` " "thus always satisfies ``abs(r) <= 0.5 * abs(y)``." msgstr "" -"回傳 *x* 對 *y* 根據 IEEE 754 定義的餘數。對有限數 *x* 及有限非零數 *y*,該" -"值為 ``x - n*y`` 差值,``n`` 是最接近商數 ``x / y`` 的整數。若 ``x / y`` 剛好" -"位於兩個連續整數的正中間,``n`` 為最接近的\\ *偶*\\ 數。因此該餘數 ``r = " +"回傳 *x* 對 *y* 根據 IEEE 754 定義的餘數。對有限數 *x* 及有限非零數 *y*,該值" +"為 ``x - n*y`` 差值,``n`` 是最接近商數 ``x / y`` 的整數。若 ``x / y`` 剛好位" +"於兩個連續整數的正中間,``n`` 為最接近的\\ *偶*\\ 數。因此該餘數 ``r = " "remainder(x, y)`` 總是滿足 ``abs(r) <= 0.5 * abs(y)``。" #: ../../library/math.rst:284 @@ -823,9 +826,9 @@ msgid "" "remainder operation is zero, that zero will have the same sign as *x*." msgstr "" "特殊情況遵循 IEEE 754:特別是,對任何有限數 *x*,``remainder(x, math.inf)`` " -"的值為 *x*;對任何非 NaN 值的 *x*,``remainder(x, 0)`` 及 " -"``remainder(math.inf, x)`` 會引發 :exc:`ValueError`。若取餘數操作的結果為零," -"則該零值會與 *x* 同號。" +"的值為 *x*;對任何非 NaN 值的 *x*,``remainder(x, 0)`` 及 ``remainder(math." +"inf, x)`` 會引發 :exc:`ValueError`。若取餘數操作的結果為零,則該零值會與 *x* " +"同號。" #: ../../library/math.rst:290 msgid "" @@ -840,13 +843,13 @@ msgid "" "Return *x* with the fractional part removed, leaving the integer part. This " "rounds toward 0: ``trunc()`` is equivalent to :func:`floor` for positive " "*x*, and equivalent to :func:`ceil` for negative *x*. If *x* is not a float, " -"delegates to :meth:`x.__trunc__ `, which should return " -"an :class:`~numbers.Integral` value." +"delegates to :meth:`x.__trunc__ `, which should return an :" +"class:`~numbers.Integral` value." msgstr "" "回傳去除小數部分而僅餘整數部分的 *x*。此函式會向零捨入:若 *x* 為正值," -"``trunc()`` 等價於 :func:`floor`;若 *x* 為負值,``trunc()`` 等價" -"於 :func:`ceil`。若 *x* 非浮點數,此函式將委派給 :meth:`x.__trunc__ " -"`,而後回傳一 :class:`~numbers.Integral` 值。" +"``trunc()`` 等價於 :func:`floor`;若 *x* 為負值,``trunc()`` 等價於 :func:" +"`ceil`。若 *x* 非浮點數,此函式將委派給 :meth:`x.__trunc__ `,而後回傳一 :class:`~numbers.Integral` 值。" #: ../../library/math.rst:305 msgid "" @@ -856,10 +859,10 @@ msgid "" "(the same as the platform C double type), in which case any float *x* with " "``abs(x) >= 2**52`` necessarily has no fractional bits." msgstr "" -"使用 :func:`ceil`、:func:`floor` 及 :func:`modf` 三個函式時,請注意\\ *所有*\\ 足" -"夠大的浮點數都是精確的整數。Python 的浮點數型別的精密度通常不會超過 53 位元" -"(與 C 語言 double 型別相同),因此當浮點數 *x* 滿足 ``abs(x) >= 2**52`` 時," -"它必然沒有小數部分。" +"使用 :func:`ceil`、:func:`floor` 及 :func:`modf` 三個函式時,請注意\\ *所有" +"*\\ 足夠大的浮點數都是精確的整數。Python 的浮點數型別的精密度通常不會超過 53 " +"位元(與 C 語言 double 型別相同),因此當浮點數 *x* 滿足 ``abs(x) >= 2**52`` " +"時,它必然沒有小數部分。" #: ../../library/math.rst:313 msgid "Floating point manipulation functions" @@ -892,9 +895,9 @@ msgid "" "than returning its second return value through an 'output parameter' (there " "is no such thing in Python)." msgstr "" -"請注意 :func:`frexp` 的呼叫/回傳模式與 C 語言中相應的函式不同:" -"它們接受一個引數並回傳一對值,而非透過一個「輸出參數(output parameter)」傳" -"遞第二個回傳值(Python 沒有那種東西)。" +"請注意 :func:`frexp` 的呼叫/回傳模式與 C 語言中相應的函式不同:它們接受一個引" +"數並回傳一對值,而非透過一個「輸出參數(output parameter)」傳遞第二個回傳值" +"(Python 沒有那種東西)。" #: ../../library/math.rst:336 msgid "" @@ -934,9 +937,9 @@ msgid "" "argument to the call." msgstr "" "*abs_tol* 為絕對容許偏差;預設為 ``0.0`` 且必須不為負。當比較 ``x`` 與 " -"``0.0`` 時,``isclose(x, 0)`` 將計算為 ``abs(x) <= rel_tol * abs(x)``,此結果" -"對任何非零 ``x`` 及小於 ``1.0`` 的 *rel_tol* 而言皆為 ``False``。因此呼叫時應" -"加上適當的正數 *abs_tol* 引數。" +"``0.0`` 時,``isclose(x, 0)`` 將計算為 ``abs(x) <= rel_tol * abs(x)``,此結" +"果對任何非零 ``x`` 及小於 ``1.0`` 的 *rel_tol* 而言皆為 ``False``。因此呼叫時" +"應加上適當的正數 *abs_tol* 引數。" #: ../../library/math.rst:356 msgid "" @@ -958,8 +961,8 @@ msgid "" "Return ``True`` if *x* is neither an infinity nor a NaN, and ``False`` " "otherwise. (Note that ``0.0`` *is* considered finite.)" msgstr "" -"若 *x* 不是無限值或 NaN 便回傳 ``True``,否則回傳 ``False``。(注意 " -"``0.0`` 被視為有限數。)" +"若 *x* 不是無限值或 NaN 便回傳 ``True``,否則回傳 ``False``。(注意 ``0.0`` " +"被視為有限數。)" #: ../../library/math.rst:378 msgid "" @@ -971,13 +974,13 @@ msgstr "若 *x* 是正無限值或負無限值便回傳 ``True``,否則回傳 msgid "" "Return ``True`` if *x* is a NaN (not a number), and ``False`` otherwise." msgstr "" -"若 *x* 是 NaN ── 即非數值(NaN, not a number)── 便回傳 ``True``,否則回" -"傳 ``False``。" +"若 *x* 是 NaN ── 即非數值(NaN, not a number)── 便回傳 ``True``,否則回傳 " +"``False``。" #: ../../library/math.rst:389 msgid "" -"Return ``x * (2**i)``. This is essentially the inverse of " -"function :func:`frexp`." +"Return ``x * (2**i)``. This is essentially the inverse of function :func:" +"`frexp`." msgstr "回傳 ``x * (2**i)``。此函式本質上為 :func:`frexp` 的反函式。" #: ../../library/math.rst:395 @@ -1035,11 +1038,11 @@ msgstr "若 *x* 為正無限值,回傳 *x*。" #: ../../library/math.rst:421 msgid "" "If *x* is equal to zero, return the smallest positive *denormalized* " -"representable float (smaller than the minimum positive *normalized* " -"float, :data:`sys.float_info.min `)." +"representable float (smaller than the minimum positive *normalized* float, :" +"data:`sys.float_info.min `)." msgstr "" -"若 *x* 等於零,回傳\\ *反正規化*\\ 可表示的最小正浮點數(此值小於\\ *正規化*\\ 可表示" -"的最小正浮點數 :data:`sys.float_info.min `)。" +"若 *x* 等於零,回傳\\ *反正規化*\\ 可表示的最小正浮點數(此值小於\\ *正規化" +"*\\ 可表示的最小正浮點數 :data:`sys.float_info.min `)。" #: ../../library/math.rst:424 msgid "" @@ -1065,11 +1068,11 @@ msgstr "ULP 即最後一位上的單位值(Unit in the Last Place)。" #: ../../library/math.rst:433 msgid "" -"See also :func:`math.nextafter` and :data:`sys.float_info.epsilon " -"`." +"See also :func:`math.nextafter` and :data:`sys.float_info.epsilon `." msgstr "" -"另請參閱 :func:`math.nextafter` 及 :data:`sys.float_info.epsilon " -"`。" +"另請參閱 :func:`math.nextafter` 及 :data:`sys.float_info.epsilon `。" #: ../../library/math.rst:440 msgid "Power, exponential and logarithmic functions" @@ -1101,8 +1104,9 @@ msgid "" "compute this quantity to full precision:" msgstr "" "回傳 *e* 的 *x* 次方減 1。此處 *e* 為自然對數的底數。對於較小的浮點數 *x*," -"``exp(x) - 1`` 中的減法運算可能導致\\ `顯著的精密度損失 `_;:func:`expm1` 函式提供了一種能以完整精密度計算此值的方法:" +"``exp(x) - 1`` 中的減法運算可能導致\\ `顯著的精密度損失 `_;:func:`expm1` 函式提供了一種能以" +"完整精密度計算此值的方法:" #: ../../library/math.rst:482 msgid "With one argument, return the natural logarithm of *x* (to base *e*)." @@ -1113,8 +1117,8 @@ msgid "" "With two arguments, return the logarithm of *x* to the given *base*, " "calculated as ``log(x)/log(base)``." msgstr "" -"傳入兩個引數時,回傳 *x* 以給定 *base* 為底的對數,計算方式為 " -"``log(x)/log(base)``。" +"傳入兩個引數時,回傳 *x* 以給定 *base* 為底的對數,計算方式為 ``log(x)/" +"log(base)``。" #: ../../library/math.rst:490 msgid "" @@ -1127,22 +1131,21 @@ msgstr "" msgid "" "Return the base-2 logarithm of *x*. This is usually more accurate than " "``log(x, 2)``." -msgstr "" -"回傳 *x* 的以 2 為底的對數。此函式通常比 ``log(x, 2)`` 更為精確。" +msgstr "回傳 *x* 的以 2 為底的對數。此函式通常比 ``log(x, 2)`` 更為精確。" #: ../../library/math.rst:503 msgid "" ":meth:`int.bit_length` returns the number of bits necessary to represent an " "integer in binary, excluding the sign and leading zeros." msgstr "" -":meth:`int.bit_length` 回傳以二進位表示一個整數所需的位元數,不包含正負號及前導零。" +":meth:`int.bit_length` 回傳以二進位表示一個整數所需的位元數,不包含正負號及前" +"導零。" #: ../../library/math.rst:509 msgid "" "Return the base-10 logarithm of *x*. This is usually more accurate than " "``log(x, 10)``." -msgstr "" -"回傳 *x* 的以 10 為底的對數。此函式通常比 ``log(x, 10)`` 更為精確。" +msgstr "回傳 *x* 的以 10 為底的對數。此函式通常比 ``log(x, 10)`` 更為精確。" #: ../../library/math.rst:515 msgid "" @@ -1154,7 +1157,8 @@ msgid "" msgstr "" "回傳 *x* 的 *y* 次方。例外情況盡可能遵循 IEEE 754 標準。特別是,``pow(1.0, " "x)`` 和 ``pow(x, 0.0)`` 總是回傳 ``1.0``,即使 *x* 是零或 NaN 也是如此。若 " -"*x* 和 *y* 皆為有限數、*x* 為負數且 *y* 不是整數,則 ``pow(x, y)`` 是未定義的,並會引發 :exc:`ValueError`。" +"*x* 和 *y* 皆為有限數、*x* 為負數且 *y* 不是整數,則 ``pow(x, y)`` 是未定義" +"的,並會引發 :exc:`ValueError`。" #: ../../library/math.rst:522 msgid "" @@ -1162,8 +1166,9 @@ msgid "" "arguments to type :class:`float`. Use ``**`` or the built-in :func:`pow` " "function for computing exact integer powers." msgstr "" -"與內建 ``**`` 運算子不同,:func:`math.pow` 會將其兩個引數都轉換為 :class:`float` " -"型別。若需要計算精確的整數次方,請使用 ``**`` 或內建的 :func:`pow` 函式。" +"與內建 ``**`` 運算子不同,:func:`math.pow` 會將其兩個引數都轉換為 :class:" +"`float` 型別。若需要計算精確的整數次方,請使用 ``**`` 或內建的 :func:`pow` 函" +"式。" #: ../../library/math.rst:526 msgid "" @@ -1171,8 +1176,8 @@ msgid "" "return ``inf`` instead of raising :exc:`ValueError`, for consistency with " "IEEE 754." msgstr "" -"特殊情況 ``pow(0.0, -inf)`` 和 ``pow(-0.0, -inf)`` 已變更為回傳 ``inf`` 而非引發 " -":exc:`ValueError`,以符合 IEEE 754 標準。" +"特殊情況 ``pow(0.0, -inf)`` 和 ``pow(-0.0, -inf)`` 已變更為回傳 ``inf`` 而非" +"引發 :exc:`ValueError`,以符合 IEEE 754 標準。" #: ../../library/math.rst:534 msgid "Return the square root of *x*." @@ -1188,8 +1193,8 @@ msgid "" "a sequence (or iterable) of coordinates. The two points must have the same " "dimension." msgstr "" -"回傳兩點 *p* 與 *q* 之間的歐幾里得距離,各點以座標的序列(或可疊代物件)表示。" -"兩點必須具有相同的維度。" +"回傳兩點 *p* 與 *q* 之間的歐幾里得距離,各點以座標的序列(或可疊代物件)表" +"示。兩點必須具有相同的維度。" #: ../../library/math.rst:546 ../../library/math.rst:607 msgid "Roughly equivalent to::" @@ -1216,15 +1221,15 @@ msgid "" "least significant bit." msgstr "" "此演算法準確性奠基於保證 IEEE-754 浮點標準及典型奇進偶捨(half-even)模式。於" -"有些非 Windows 平台建置時,底層 C 函式庫使用延伸精密度加法運算,而可能導致對過" -"程中同一部分和重複捨入,並使其最低有效位不如預期。" +"有些非 Windows 平台建置時,底層 C 函式庫使用延伸精密度加法運算,而可能導致對" +"過程中同一部分和重複捨入,並使其最低有效位不如預期。" #: ../../library/math.rst:564 msgid "" "For further discussion and two alternative approaches, see the `ASPN " -"cookbook recipes for accurate floating-point summation `_\\." +"cookbook recipes for accurate floating-point summation `_\\." msgstr "" "更深入的討論及兩種替代做法請參閱 `ASPN cookbook recipes 精準的浮點數總和 " "`_。" @@ -1235,7 +1240,8 @@ msgid "" "the length of the vector from the origin to the point given by the " "coordinates." msgstr "" -"回傳歐幾里得範數 ``sqrt(sum(x**2 for x in coordinates))``。這是從原點到座標所給定的點之間的向量長度。" +"回傳歐幾里得範數 ``sqrt(sum(x**2 for x in coordinates))``。這是從原點到座標所" +"給定的點之間的向量長度。" #: ../../library/math.rst:575 msgid "" @@ -1258,8 +1264,8 @@ msgid "" "(unit in the last place). More typically, the result is almost always " "correctly rounded to within 1/2 ulp." msgstr "" -"改進了演算法的精確度,使最大誤差低於 1 ulp(最後一位上的單位值)。更典型的情況是," -"結果幾乎總是能正確捨入到 1/2 ulp 以內。" +"改進了演算法的精確度,使最大誤差低於 1 ulp(最後一位上的單位值)。更典型的情" +"況是,結果幾乎總是能正確捨入到 1/2 ulp 以內。" #: ../../library/math.rst:591 msgid "" @@ -1274,7 +1280,8 @@ msgid "" "intended specifically for use with numeric values and may reject non-numeric " "types." msgstr "" -"當可疊代物件為空時,回傳起始值。此函式專門設計用於數值運算,可能會拒絕非數值型別。" +"當可疊代物件為空時,回傳起始值。此函式專門設計用於數值運算,可能會拒絕非數值" +"型別。" #: ../../library/math.rst:603 msgid "Return the sum of products of values from two iterables *p* and *q*." @@ -1336,13 +1343,13 @@ msgid "" "``pi``. The vector in the plane from the origin to point ``(x, y)`` makes " "this angle with the positive X axis. The point of :func:`atan2` is that the " "signs of both inputs are known to it, so it can compute the correct quadrant " -"for the angle. For example, ``atan(1)`` and ``atan2(1, 1)`` are both ``pi/" -"4``, but ``atan2(-1, -1)`` is ``-3*pi/4``." +"for the angle. For example, ``atan(1)`` and ``atan2(1, 1)`` are both " +"``pi/4``, but ``atan2(-1, -1)`` is ``-3*pi/4``." msgstr "" -"回傳 ``atan(y / x)``,以弧度表示。結果介於 ``-pi`` 與 ``pi`` 之間。從原點到點 " -"``(x, y)`` 的平面向量與正 X 軸形成此角度。:func:`atan2` 的重點在於它知道兩個輸入的" -"正負號,因此能計算出角度所在的正確象限。例如,``atan(1)`` 和 ``atan2(1, 1)`` 都是 " -"``pi/4``,但 ``atan2(-1, -1)`` 是 ``-3*pi/4``。" +"回傳 ``atan(y / x)``,以弧度表示。結果介於 ``-pi`` 與 ``pi`` 之間。從原點到" +"點 ``(x, y)`` 的平面向量與正 X 軸形成此角度。:func:`atan2` 的重點在於它知道兩" +"個輸入的正負號,因此能計算出角度所在的正確象限。例如,``atan(1)`` 和 " +"``atan2(1, 1)`` 都是 ``pi/4``,但 ``atan2(-1, -1)`` 是 ``-3*pi/4``。" #: ../../library/math.rst:663 msgid "Return the cosine of *x* radians." @@ -1366,7 +1373,8 @@ msgid "" "are analogs of trigonometric functions that are based on hyperbolas instead " "of circles." msgstr "" -"`雙曲函式 `_\\ 是三角函式的類似物,但基於雙曲線而非圓。" +"`雙曲函式 `_\\ 是三角函式" +"的類似物,但基於雙曲線而非圓。" #: ../../library/math.rst:685 msgid "Return the inverse hyperbolic cosine of *x*." @@ -1401,13 +1409,14 @@ msgid "" "Return the `error function `_ " "at *x*." msgstr "" -"回傳在 *x* 處的\\ `誤差函式 `_\\ 值。" +"回傳在 *x* 處的\\ `誤差函式 `_\\ 值。" #: ../../library/math.rst:721 msgid "" "The :func:`erf` function can be used to compute traditional statistical " -"functions such as the `cumulative standard normal distribution `_::" +"functions such as the `cumulative standard normal distribution `_::" msgstr "" ":func:`erf` 函式可用於計算傳統的統計函式,例如\\ `累積標準常態分布 `_: ::" @@ -1431,8 +1440,8 @@ msgid "" "Loss_of_significance>`_\\." msgstr "" "回傳在 *x* 處的互補誤差函式值。`互補誤差函式 `_\\ 定義為 ``1.0 - erf(x)``。此函式用於較大的 *x* 值,因為在該情況下" -"從一減去會導致\\ `顯著性損失 `_\\ 定義為 ``1.0 - erf(x)``。此函式用於較大的 *x* 值,因為在" +"該情況下從一減去會導致\\ `顯著性損失 `_。" #: ../../library/math.rst:745 @@ -1440,7 +1449,8 @@ msgid "" "Return the `Gamma function `_ " "at *x*." msgstr "" -"回傳在 *x* 處的 `Gamma 函式 `_\\ 值。" +"回傳在 *x* 處的 `Gamma 函式 `_\\ 值。" #: ../../library/math.rst:753 msgid "" @@ -1468,17 +1478,18 @@ msgid "" "(still) Wrong `_, and start celebrating `Tau " "day `_ by eating twice as much pie!" msgstr "" -"數學常數 *τ* = 6.283185...,精確至可用精密度。Tau 是一個圓常數,等於 2\\ *π*," -"即圓的周長與半徑的比值。若想了解更多關於 Tau 的資訊,請觀看 Vi Hart 的影片 " -"`Pi is (still) Wrong `_,並開始慶祝 `Tau 日 " +"數學常數 *τ* = 6.283185...,精確至可用精密度。Tau 是一個圓常數,等於 2\\ " +"*π*,即圓的周長與半徑的比值。若想了解更多關於 Tau 的資訊,請觀看 Vi Hart 的影" +"片 `Pi is (still) Wrong `_,並開始慶祝 `Tau 日 " "`_,吃兩倍的派吧!" #: ../../library/math.rst:785 msgid "" -"A floating-point positive infinity. (For negative infinity, use ``-" -"math.inf``.) Equivalent to the output of ``float('inf')``." +"A floating-point positive infinity. (For negative infinity, use ``-math." +"inf``.) Equivalent to the output of ``float('inf')``." msgstr "" -"浮點數正無限值。(對於負無限值,請使用 ``-math.inf``。)等同於 ``float('inf')`` 的輸出。" +"浮點數正無限值。(對於負無限值,請使用 ``-math.inf``。)等同於 " +"``float('inf')`` 的輸出。" #: ../../library/math.rst:793 msgid "" @@ -1489,36 +1500,37 @@ msgid "" "check whether a number is a NaN, use the :func:`isnan` function to test for " "NaNs instead of ``is`` or ``==``. Example:" msgstr "" -"浮點數「非數值」(NaN)值。等同於 ``float('nan')`` 的輸出。根據 `IEEE-754 標準 " -"`_\\ 的要求,``math.nan`` 和 " -"``float('nan')`` 不被認為等於任何其他數值,包括它們自身。若要檢查一個數是否為 " -"NaN,請使用 :func:`isnan` 函式而非 ``is`` 或 ``==``。範例:" +"浮點數「非數值」(NaN)值。等同於 ``float('nan')`` 的輸出。根據 `IEEE-754 標" +"準 `_\\ 的要求,``math.nan`` 和 " +"``float('nan')`` 不被認為等於任何其他數值,包括它們自身。若要檢查一個數是否" +"為 NaN,請使用 :func:`isnan` 函式而非 ``is`` 或 ``==``。範例:" #: ../../library/math.rst:813 msgid "It is now always available." msgstr "現在總是可用。" #: ../../library/math.rst:819 +#, fuzzy msgid "" -"The :mod:`math` module consists mostly of thin wrappers around the platform " +"The :mod:`!math` module consists mostly of thin wrappers around the platform " "C math library functions. Behavior in exceptional cases follows Annex F of " -"the C99 standard where appropriate. The current implementation will " -"raise :exc:`ValueError` for invalid operations like ``sqrt(-1.0)`` or " -"``log(0.0)`` (where C99 Annex F recommends signaling invalid operation or " -"divide-by-zero), and :exc:`OverflowError` for results that overflow (for " -"example, ``exp(1000.0)``). A NaN will not be returned from any of the " -"functions above unless one or more of the input arguments was a NaN; in that " -"case, most functions will return a NaN, but (again following C99 Annex F) " -"there are some exceptions to this rule, for example ``pow(float('nan'), " -"0.0)`` or ``hypot(float('nan'), float('inf'))``." -msgstr "" -":mod:`math` 模組大部分由平臺 C 數學函式庫的輕量包裝函式組成。例外情況下的行為在適當" -"時遵循 C99 標準的附錄 F。目前的實作會對無效操作(如 ``sqrt(-1.0)`` 或 " -"``log(0.0)``,C99 附錄 F 建議發出無效操作或除以零的訊號)引發 :exc:`ValueError`,並" -"對溢位結果(例如 ``exp(1000.0)``)引發 :exc:`OverflowError`。除非一個或多個輸入引數" -"是 NaN,否則上述函式不會回傳 NaN;在該情況下,大多數函式會回傳 NaN,但(同樣遵循 " -"C99 附錄 F)此規則有一些例外,例如 ``pow(float('nan'), 0.0)`` 或 " -"``hypot(float('nan'), float('inf'))``。" +"the C99 standard where appropriate. The current implementation will raise :" +"exc:`ValueError` for invalid operations like ``sqrt(-1.0)`` or ``log(0.0)`` " +"(where C99 Annex F recommends signaling invalid operation or divide-by-" +"zero), and :exc:`OverflowError` for results that overflow (for example, " +"``exp(1000.0)``). A NaN will not be returned from any of the functions " +"above unless one or more of the input arguments was a NaN; in that case, " +"most functions will return a NaN, but (again following C99 Annex F) there " +"are some exceptions to this rule, for example ``pow(float('nan'), 0.0)`` or " +"``hypot(float('nan'), float('inf'))``." +msgstr "" +":mod:`math` 模組大部分由平臺 C 數學函式庫的輕量包裝函式組成。例外情況下的行為" +"在適當時遵循 C99 標準的附錄 F。目前的實作會對無效操作(如 ``sqrt(-1.0)`` 或 " +"``log(0.0)``,C99 附錄 F 建議發出無效操作或除以零的訊號)引發 :exc:" +"`ValueError`,並對溢位結果(例如 ``exp(1000.0)``)引發 :exc:`OverflowError`。" +"除非一個或多個輸入引數是 NaN,否則上述函式不會回傳 NaN;在該情況下,大多數函" +"式會回傳 NaN,但(同樣遵循 C99 附錄 F)此規則有一些例外,例如 " +"``pow(float('nan'), 0.0)`` 或 ``hypot(float('nan'), float('inf'))``。" #: ../../library/math.rst:831 msgid "" @@ -1526,8 +1538,8 @@ msgid "" "NaNs, and behavior for signaling NaNs remains unspecified. Typical behavior " "is to treat all NaNs as though they were quiet." msgstr "" -"請注意,Python 不會區分訊號型 NaN(signaling NaN)與安靜型 NaN(quiet NaN),且訊號型 " -"NaN 的行為仍未指定。典型的行為是將所有 NaN 視為安靜型 NaN。" +"請注意,Python 不會區分訊號型 NaN(signaling NaN)與安靜型 NaN(quiet NaN)," +"且訊號型 NaN 的行為仍未指定。典型的行為是將所有 NaN 視為安靜型 NaN。" #: ../../library/math.rst:838 msgid "Module :mod:`cmath`" diff --git a/library/mimetypes.po b/library/mimetypes.po index d585c2157a..9b692aa859 100644 --- a/library/mimetypes.po +++ b/library/mimetypes.po @@ -6,7 +6,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-02-07 00:19+0000\n" "PO-Revision-Date: 2016-11-19 00:32+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/mimetypes.py`" #: ../../library/mimetypes.rst:15 msgid "" -"The :mod:`mimetypes` module converts between a filename or URL and the MIME " +"The :mod:`!mimetypes` module converts between a filename or URL and the MIME " "type associated with the filename extension. Conversions are provided from " "filename to MIME type and from MIME type to filename extension; encodings " "are not supported for the latter conversion." @@ -64,8 +64,8 @@ msgstr "" msgid "" "*encoding* is ``None`` for no encoding or the name of the program used to " "encode (e.g. :program:`compress` or :program:`gzip`). The encoding is " -"suitable for use as a :mailheader:`Content-Encoding` header, **not** as " -"a :mailheader:`Content-Transfer-Encoding` header. The mappings are table " +"suitable for use as a :mailheader:`Content-Encoding` header, **not** as a :" +"mailheader:`Content-Transfer-Encoding` header. The mappings are table " "driven. Encoding suffixes are case sensitive; type suffixes are first tried " "case sensitively, then case insensitively." msgstr "" @@ -89,15 +89,15 @@ msgstr "新增 *url* 做為 :term:`path-like object` 的支援。" #: ../../library/mimetypes.rst:59 msgid "" -"Passing a file path instead of URL is :term:`soft deprecated`. " -"Use :func:`guess_file_type` for this." +"Passing a file path instead of URL is :term:`soft deprecated`. Use :func:" +"`guess_file_type` for this." msgstr "" #: ../../library/mimetypes.rst:68 msgid "" -"Guess the type of a file based on its path, given by *path*. Similar to " -"the :func:`guess_type` function, but accepts a path instead of URL. Path can " -"be a string, a bytes object or a :term:`path-like object`." +"Guess the type of a file based on its path, given by *path*. Similar to the :" +"func:`guess_type` function, but accepts a path instead of URL. Path can be a " +"string, a bytes object or a :term:`path-like object`." msgstr "" #: ../../library/mimetypes.rst:77 @@ -111,8 +111,8 @@ msgstr "" #: ../../library/mimetypes.rst:83 ../../library/mimetypes.rst:95 msgid "" -"The optional *strict* argument has the same meaning as with " -"the :func:`guess_type` function." +"The optional *strict* argument has the same meaning as with the :func:" +"`guess_type` function." msgstr "" #: ../../library/mimetypes.rst:88 @@ -120,8 +120,8 @@ msgid "" "Guess the extension for a file based on its MIME type, given by *type*. The " "return value is a string giving a filename extension, including the leading " "dot (``'.'``). The extension is not guaranteed to have been associated with " -"any particular data stream, but would be mapped to the MIME type *type* " -"by :func:`guess_type` and :func:`guess_file_type`. If no extension can be " +"any particular data stream, but would be mapped to the MIME type *type* by :" +"func:`guess_type` and :func:`guess_file_type`. If no extension can be " "guessed for *type*, ``None`` is returned." msgstr "" @@ -198,9 +198,8 @@ msgstr "" msgid "" "Dictionary mapping suffixes to suffixes. This is used to allow recognition " "of encoded files for which the encoding and the type are indicated by the " -"same extension. For example, the :file:`.tgz` extension is mapped " -"to :file:`.tar.gz` to allow the encoding and type to be recognized " -"separately." +"same extension. For example, the :file:`.tgz` extension is mapped to :file:" +"`.tar.gz` to allow the encoding and type to be recognized separately." msgstr "" #: ../../library/mimetypes.rst:164 @@ -253,7 +252,7 @@ msgstr "MimeTypes 物件" msgid "" "The :class:`MimeTypes` class may be useful for applications which may want " "more than one MIME-type database; it provides an interface similar to the " -"one of the :mod:`mimetypes` module." +"one of the :mod:`!mimetypes` module." msgstr "" #: ../../library/mimetypes.rst:204 @@ -261,10 +260,9 @@ msgid "" "This class represents a MIME-types database. By default, it provides access " "to the same database as the rest of this module. The initial database is a " "copy of that provided by the module, and may be extended by loading " -"additional :file:`mime.types`\\ -style files into the database using " -"the :meth:`read` or :meth:`readfp` methods. The mapping dictionaries may " -"also be cleared before loading additional data if the default data is not " -"desired." +"additional :file:`mime.types`\\ -style files into the database using the :" +"meth:`read` or :meth:`readfp` methods. The mapping dictionaries may also be " +"cleared before loading additional data if the default data is not desired." msgstr "" #: ../../library/mimetypes.rst:211 @@ -277,10 +275,9 @@ msgstr "" msgid "" "Dictionary mapping suffixes to suffixes. This is used to allow recognition " "of encoded files for which the encoding and the type are indicated by the " -"same extension. For example, the :file:`.tgz` extension is mapped " -"to :file:`.tar.gz` to allow the encoding and type to be recognized " -"separately. This is initially a copy of the global :data:`suffix_map` " -"defined in the module." +"same extension. For example, the :file:`.tgz` extension is mapped to :file:" +"`.tar.gz` to allow the encoding and type to be recognized separately. This " +"is initially a copy of the global :data:`suffix_map` defined in the module." msgstr "" #: ../../library/mimetypes.rst:226 @@ -301,8 +298,8 @@ msgstr "" msgid "" "Tuple containing two dictionaries, mapping MIME types to a list of filename " "extensions: the first dictionary is for the non-standards types and the " -"second one is for the standard types. They are initialized " -"by :data:`common_types` and :data:`types_map`." +"second one is for the standard types. They are initialized by :data:" +"`common_types` and :data:`types_map`." msgstr "" #: ../../library/mimetypes.rst:248 @@ -331,8 +328,8 @@ msgstr "" #: ../../library/mimetypes.rst:274 msgid "" -"Load MIME information from a file named *filename*. This " -"uses :meth:`readfp` to parse the file." +"Load MIME information from a file named *filename*. This uses :meth:" +"`readfp` to parse the file." msgstr "" #: ../../library/mimetypes.rst:277 diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 6751a683d1..20940fea1a 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-03 00:14+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -34,8 +34,8 @@ msgid "" "This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." msgstr "" -"此模組在\\ :ref:`行動平台 `\\ 或 :ref:`WebAssembly 平" -"台 `\\ 上不支援。" +"此模組在\\ :ref:`行動平台 `\\ 或 :ref:`WebAssembly 平台 " +"`\\ 上不支援。" #: ../../library/multiprocessing.rst:14 msgid "Introduction" @@ -43,18 +43,18 @@ msgstr "簡介" #: ../../library/multiprocessing.rst:16 msgid "" -":mod:`multiprocessing` is a package that supports spawning processes using " -"an API similar to the :mod:`threading` module. The :mod:`multiprocessing` " +":mod:`!multiprocessing` is a package that supports spawning processes using " +"an API similar to the :mod:`threading` module. The :mod:`!multiprocessing` " "package offers both local and remote concurrency, effectively side-stepping " "the :term:`Global Interpreter Lock ` by using " -"subprocesses instead of threads. Due to this, the :mod:`multiprocessing` " +"subprocesses instead of threads. Due to this, the :mod:`!multiprocessing` " "module allows the programmer to fully leverage multiple processors on a " "given machine. It runs on both POSIX and Windows." msgstr "" #: ../../library/multiprocessing.rst:25 msgid "" -"The :mod:`multiprocessing` module also introduces the :class:" +"The :mod:`!multiprocessing` module also introduces the :class:" "`~multiprocessing.pool.Pool` object which offers a convenient means of " "parallelizing the execution of a function across multiple input values, " "distributing the input data across processes (data parallelism). The " @@ -94,7 +94,7 @@ msgstr "[1, 4, 9]" #: ../../library/multiprocessing.rst:46 msgid "" -"The :mod:`multiprocessing` module also introduces APIs which do not have " +"The :mod:`!multiprocessing` module also introduces APIs which do not have " "analogs in the :mod:`threading` module, like the ability to :meth:`terminate " "`, :meth:`interrupt ` or :meth:`kill " "` a running process." @@ -116,7 +116,7 @@ msgstr ":class:`Process` 類別" #: ../../library/multiprocessing.rst:64 msgid "" -"In :mod:`multiprocessing`, processes are spawned by creating a :class:" +"In :mod:`!multiprocessing`, processes are spawned by creating a :class:" "`Process` object and then calling its :meth:`~Process.start` method. :class:" "`Process` follows the API of :class:`threading.Thread`. A trivial example " "of a multiprocess program is ::" @@ -209,7 +209,7 @@ msgstr "" #: ../../library/multiprocessing.rst:114 msgid "" -"Depending on the platform, :mod:`multiprocessing` supports three ways to " +"Depending on the platform, :mod:`!multiprocessing` supports three ways to " "start a process. These *start methods* are" msgstr "" @@ -407,7 +407,7 @@ msgstr "" #: ../../library/multiprocessing.rst:243 msgid "" -"Libraries using :mod:`multiprocessing` or :class:`~concurrent.futures." +"Libraries using :mod:`!multiprocessing` or :class:`~concurrent.futures." "ProcessPoolExecutor` should be designed to allow their users to provide " "their own multiprocessing context. Using a specific context of your own " "within a library can lead to incompatibilities with the rest of the library " @@ -429,7 +429,7 @@ msgstr "" #: ../../library/multiprocessing.rst:261 msgid "" -":mod:`multiprocessing` supports two types of communication channel between " +":mod:`!multiprocessing` supports two types of communication channel between " "processes:" msgstr "" @@ -535,7 +535,7 @@ msgstr "" #: ../../library/multiprocessing.rst:316 msgid "" -":mod:`multiprocessing` contains equivalents of all the synchronization " +":mod:`!multiprocessing` contains equivalents of all the synchronization " "primitives from :mod:`threading`. For instance one can use a lock to ensure " "that only one process prints to standard output at a time::" msgstr "" @@ -591,8 +591,8 @@ msgstr "" #: ../../library/multiprocessing.rst:346 msgid "" -"However, if you really do need to use some shared data then :mod:" -"`multiprocessing` provides a couple of ways of doing so." +"However, if you really do need to use some shared data then :mod:`!" +"multiprocessing` provides a couple of ways of doing so." msgstr "" #: ../../library/multiprocessing.rst:349 @@ -892,7 +892,7 @@ msgstr "" #: ../../library/multiprocessing.rst:521 msgid "" -"The :mod:`multiprocessing` package mostly replicates the API of the :mod:" +"The :mod:`!multiprocessing` package mostly replicates the API of the :mod:" "`threading` module." msgstr "" @@ -1173,7 +1173,7 @@ msgstr "" #: ../../library/multiprocessing.rst:707 msgid "" -"When :mod:`multiprocessing` is initialized the main process is assigned a " +"When :mod:`!multiprocessing` is initialized the main process is assigned a " "random string using :func:`os.urandom`." msgstr "" @@ -1314,7 +1314,7 @@ msgstr "" "True" #: ../../library/multiprocessing.rst:808 -msgid "The base class of all :mod:`multiprocessing` exceptions." +msgid "The base class of all :mod:`!multiprocessing` exceptions." msgstr "" #: ../../library/multiprocessing.rst:812 @@ -1374,10 +1374,10 @@ msgstr "" #: ../../library/multiprocessing.rst:848 msgid "" -"One difference from other Python queue implementations, is that :mod:" -"`multiprocessing` queues serializes all objects that are put into them " -"using :mod:`pickle`. The object returned by the get method is a re-created " -"object that does not share memory with the original object." +"One difference from other Python queue implementations, is that :mod:`!" +"multiprocessing` queues serializes all objects that are put into them using :" +"mod:`pickle`. The object returned by the get method is a re-created object " +"that does not share memory with the original object." msgstr "" #: ../../library/multiprocessing.rst:853 @@ -1388,9 +1388,9 @@ msgstr "" #: ../../library/multiprocessing.rst:858 msgid "" -":mod:`multiprocessing` uses the usual :exc:`queue.Empty` and :exc:`queue." -"Full` exceptions to signal a timeout. They are not available in the :mod:" -"`multiprocessing` namespace so you need to import them from :mod:`queue`." +":mod:`!multiprocessing` uses the usual :exc:`queue.Empty` and :exc:`queue." +"Full` exceptions to signal a timeout. They are not available in the :mod:`!" +"multiprocessing` namespace so you need to import them from :mod:`queue`." msgstr "" #: ../../library/multiprocessing.rst:865 @@ -1769,7 +1769,7 @@ msgstr "" #: ../../library/multiprocessing.rst:1155 msgid "" -"Add support for when a program which uses :mod:`multiprocessing` has been " +"Add support for when a program which uses :mod:`!multiprocessing` has been " "frozen to produce an executable. (Has been tested with **py2exe**, " "**PyInstaller** and **cx_Freeze**.)" msgstr "" @@ -1824,8 +1824,8 @@ msgstr "" #: ../../library/multiprocessing.rst:1190 msgid "" -"Return a context object which has the same attributes as the :mod:" -"`multiprocessing` module." +"Return a context object which has the same attributes as the :mod:`!" +"multiprocessing` module." msgstr "" #: ../../library/multiprocessing.rst:1193 @@ -1928,7 +1928,7 @@ msgstr "參閱 :ref:`multiprocessing-start-methods`。" #: ../../library/multiprocessing.rst:1272 msgid "" -":mod:`multiprocessing` contains no analogues of :func:`threading." +":mod:`!multiprocessing` contains no analogues of :func:`threading." "active_count`, :func:`threading.enumerate`, :func:`threading.settrace`, :" "func:`threading.setprofile`, :class:`threading.Timer`, or :class:`threading." "local`." @@ -2181,7 +2181,7 @@ msgstr "" #: ../../library/multiprocessing.rst:1465 msgid "" "If *lock* is specified then it should be a :class:`Lock` or :class:`RLock` " -"object from :mod:`multiprocessing`." +"object from :mod:`!multiprocessing`." msgstr "" #: ../../library/multiprocessing.rst:1471 @@ -3387,7 +3387,7 @@ msgstr "" #: ../../library/multiprocessing.rst:2324 msgid "" -"The proxy types in :mod:`multiprocessing` do nothing to support comparisons " +"The proxy types in :mod:`!multiprocessing` do nothing to support comparisons " "by value. So, for instance, we have:" msgstr "" @@ -4189,7 +4189,7 @@ msgstr "" #: ../../library/multiprocessing.rst:2920 msgid "" -"Returns the logger used by :mod:`multiprocessing`. If necessary, a new one " +"Returns the logger used by :mod:`!multiprocessing`. If necessary, a new one " "will be created." msgstr "" @@ -4258,7 +4258,7 @@ msgstr ":mod:`multiprocessing.dummy` 模組" #: ../../library/multiprocessing.rst:2964 msgid "" -":mod:`multiprocessing.dummy` replicates the API of :mod:`multiprocessing` " +":mod:`multiprocessing.dummy` replicates the API of :mod:`!multiprocessing` " "but is no more than a wrapper around the :mod:`threading` module." msgstr "" @@ -4317,7 +4317,7 @@ msgstr "" #: ../../library/multiprocessing.rst:3013 msgid "" "There are certain guidelines and idioms which should be adhered to when " -"using :mod:`multiprocessing`." +"using :mod:`!multiprocessing`." msgstr "" #: ../../library/multiprocessing.rst:3018 @@ -4389,9 +4389,9 @@ msgstr "" #: ../../library/multiprocessing.rst:3054 msgid "" -"When using the *spawn* or *forkserver* start methods many types from :mod:" -"`multiprocessing` need to be picklable so that child processes can use " -"them. However, one should generally avoid sending shared objects to other " +"When using the *spawn* or *forkserver* start methods many types from :mod:`!" +"multiprocessing` need to be picklable so that child processes can use them. " +"However, one should generally avoid sending shared objects to other " "processes using pipes or queues. Instead you should arrange the program so " "that a process which needs access to a shared resource created elsewhere can " "inherit it from an ancestor process." @@ -4541,7 +4541,7 @@ msgid "Beware of replacing :data:`sys.stdin` with a \"file like object\"" msgstr "" #: ../../library/multiprocessing.rst:3145 -msgid ":mod:`multiprocessing` originally unconditionally called::" +msgid ":mod:`!multiprocessing` originally unconditionally called::" msgstr "" #: ../../library/multiprocessing.rst:3147 diff --git a/library/operator.po b/library/operator.po index 14942f783d..41afcbe5c7 100644 --- a/library/operator.po +++ b/library/operator.po @@ -8,7 +8,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-02-07 00:19+0000\n" "PO-Revision-Date: 2023-02-18 14:49+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,14 +29,15 @@ msgid "**Source code:** :source:`Lib/operator.py`" msgstr "**原始碼:**\\ :source:`Lib/operator.py`" #: ../../library/operator.rst:18 -msgid "" -"The :mod:`operator` module exports a set of efficient functions " -"corresponding to the intrinsic operators of Python. For example, " -"``operator.add(x, y)`` is equivalent to the expression ``x+y``. Many " -"function names are those used for special methods, without the double " -"underscores. For backward compatibility, many of these have a variant with " -"the double underscores kept. The variants without the double underscores are " -"preferred for clarity." +#, fuzzy +msgid "" +"The :mod:`!operator` module exports a set of efficient functions " +"corresponding to the intrinsic operators of Python. For example, ``operator." +"add(x, y)`` is equivalent to the expression ``x+y``. Many function names are " +"those used for special methods, without the double underscores. For " +"backward compatibility, many of these have a variant with the double " +"underscores kept. The variants without the double underscores are preferred " +"for clarity." msgstr "" ":mod:`operator` module(模組)提供了一套與 Python 原生運算子對應的高效率函" "式。例如,``operator.add(x, y)`` 與表示式 ``x+y`` 相同。許多函式名與特殊方法" @@ -63,8 +64,8 @@ msgid "" "``eq(a, b)`` is equivalent to ``a == b``, ``ne(a, b)`` is equivalent to ``a !" "= b``, ``gt(a, b)`` is equivalent to ``a > b`` and ``ge(a, b)`` is " "equivalent to ``a >= b``. Note that these functions can return any value, " -"which may or may not be interpretable as a Boolean value. " -"See :ref:`comparisons` for more information about rich comparisons." +"which may or may not be interpretable as a Boolean value. See :ref:" +"`comparisons` for more information about rich comparisons." msgstr "" "在 *a* 和 *b* 之間進行 \"rich comparison\"。具體來說,``lt(a, b)`` 與 ``a < " "b`` 相同,``le(a, b)`` 與 ``a <= b`` 相同,``eq(a, b)`` 與 ``a == b`` 相同," @@ -83,8 +84,8 @@ msgstr "" msgid "" "Return the outcome of :keyword:`not` *obj*. (Note that there is no :meth:`!" "__not__` method for object instances; only the interpreter core defines this " -"operation. The result is affected by the :meth:`~object.__bool__` " -"and :meth:`~object.__len__` methods.)" +"operation. The result is affected by the :meth:`~object.__bool__` and :meth:" +"`~object.__len__` methods.)" msgstr "" "回傳 :keyword:`not` *obj* 的結果。(請注意物件實例並沒有 :meth:`!__not__` " "method(方法);只有直譯器核心定義此操作。結果會受 :meth:`~object.__bool__` " @@ -241,8 +242,8 @@ msgid "" "actual length, then an estimate using :meth:`object.__length_hint__`, and " "finally return the default value." msgstr "" -"回傳物件 *obj* 的估計長度。首先嘗試回傳其實際長度,再使" -"用 :meth:`object.__length_hint__` 得出估計值,最後才是回傳預設值。" +"回傳物件 *obj* 的估計長度。首先嘗試回傳其實際長度,再使用 :meth:`object." +"__length_hint__` 得出估計值,最後才是回傳預設值。" #: ../../library/operator.rst:268 msgid "The following operation works with callables:" @@ -253,16 +254,16 @@ msgid "Return ``obj(*args, **kwargs)``." msgstr "回傳 ``obj(*args, **kwargs)``。" #: ../../library/operator.rst:278 +#, fuzzy msgid "" -"The :mod:`operator` module also defines tools for generalized attribute and " +"The :mod:`!operator` module also defines tools for generalized attribute and " "item lookups. These are useful for making fast field extractors as " "arguments for :func:`map`, :func:`sorted`, :meth:`itertools.groupby`, or " "other functions that expect a function argument." msgstr "" ":mod:`operator` module 還定義了一些用於常規屬性和條目查詢的工具。這些工具適合" -"用來編寫快速欄位提取器以作" -"為 :func:`map`、:func:`sorted`、:meth:`itertools.groupby` 或其他需要函式引數" -"的函式之引數。" +"用來編寫快速欄位提取器以作為 :func:`map`、:func:`sorted`、:meth:`itertools." +"groupby` 或其他需要函式引數的函式之引數。" #: ../../library/operator.rst:287 msgid "" @@ -279,8 +280,8 @@ msgstr "在 ``f = attrgetter('name')`` 之後,呼叫 ``f(b)`` 將回傳 ``b.na #: ../../library/operator.rst:293 msgid "" -"After ``f = attrgetter('name', 'date')``, the call ``f(b)`` returns " -"``(b.name, b.date)``." +"After ``f = attrgetter('name', 'date')``, the call ``f(b)`` returns ``(b." +"name, b.date)``." msgstr "" "在 ``f = attrgetter('name', 'date')`` 之後,呼叫 ``f(b)`` 將回傳 ``(b.name, " "b.date)``。" @@ -379,10 +380,9 @@ msgstr "" #: ../../library/operator.rst:343 msgid "" -"The items can be any type accepted by the " -"operand's :meth:`~object.__getitem__` method. Dictionaries accept " -"any :term:`hashable` value. Lists, tuples, and strings accept an index or a " -"slice:" +"The items can be any type accepted by the operand's :meth:`~object." +"__getitem__` method. Dictionaries accept any :term:`hashable` value. " +"Lists, tuples, and strings accept an index or a slice:" msgstr "" "傳入的條目可以為運算元的 :meth:`~object.__getitem__` 所接受的任何型別。" "dictionary(字典)接受任意\\ :term:`可雜湊 `\\ 的值。list、tupple " @@ -414,8 +414,8 @@ msgid "" "After ``f = methodcaller('name', 'foo', bar=1)``, the call ``f(b)`` returns " "``b.name('foo', bar=1)``." msgstr "" -"在 ``f = methodcaller('name', 'foo', bar=1)`` 之後,呼叫 ``f(b)`` 將回傳 " -"``b.name('foo', bar=1)``。" +"在 ``f = methodcaller('name', 'foo', bar=1)`` 之後,呼叫 ``f(b)`` 將回傳 ``b." +"name('foo', bar=1)``。" #: ../../library/operator.rst:381 msgid "" @@ -434,9 +434,10 @@ msgid "Mapping Operators to Functions" msgstr "運算子與函式間的對映" #: ../../library/operator.rst:392 +#, fuzzy msgid "" "This table shows how abstract operations correspond to operator symbols in " -"the Python syntax and the functions in the :mod:`operator` module." +"the Python syntax and the functions in the :mod:`!operator` module." msgstr "" "以下表格表示了抽象運算是如何對應於 Python 語法中的運算子和 :mod:`operator` " "module中的函式。" @@ -885,9 +886,9 @@ msgid "" "y``." msgstr "" "許多運算都有「原地」版本。以下列出的是提供對原地運算子(與一般語法相比)更底" -"層存取的函式,例如 :term:`statement` ``x += y`` 相當於 ``x = " -"operator.iadd(x, y)``。換一種方式來講就是 ``z = operator.iadd(x, y)`` 等價於" -"複合陳述式 ``z = x; z += y``。" +"層存取的函式,例如 :term:`statement` ``x += y`` 相當於 ``x = operator." +"iadd(x, y)``。換一種方式來講就是 ``z = operator.iadd(x, y)`` 等價於複合陳述" +"式 ``z = x; z += y``。" #: ../../library/operator.rst:483 msgid "" diff --git a/library/optparse.po b/library/optparse.po index 220f935226..5fbd68a0ac 100644 --- a/library/optparse.po +++ b/library/optparse.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-29 11:18+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -42,7 +42,7 @@ msgstr "" #: ../../library/optparse.rst:23 msgid "" -":mod:`optparse`: a declarative replacement for ``getopt`` that provides " +":mod:`!optparse`: a declarative replacement for ``getopt`` that provides " "equivalent functionality without requiring each application to implement its " "own procedural option parsing logic. Included in the standard library since " "the Python 2.3 release." @@ -75,14 +75,15 @@ msgstr "" #: ../../library/optparse.rst:40 msgid "" -":mod:`optparse` should be considered as an alternative to :mod:`argparse` in " -"the following cases:" +":mod:`!optparse` should be considered as an alternative to :mod:`argparse` " +"in the following cases:" msgstr "" #: ../../library/optparse.rst:43 msgid "" -"an application is already using :mod:`optparse` and doesn't want to risk the " -"subtle behavioural changes that may arise when migrating to :mod:`argparse`" +"an application is already using :mod:`!optparse` and doesn't want to risk " +"the subtle behavioural changes that may arise when migrating to :mod:" +"`argparse`" msgstr "" #: ../../library/optparse.rst:45 @@ -115,7 +116,7 @@ msgstr "" #: ../../library/optparse.rst:58 msgid "" -"These considerations also mean that :mod:`optparse` is likely to provide a " +"These considerations also mean that :mod:`!optparse` is likely to provide a " "better foundation for library authors writing third party command line " "argument processing libraries." msgstr "" @@ -235,17 +236,17 @@ msgstr "" #: ../../library/optparse.rst:129 msgid "" -":mod:`optparse` is a more convenient, flexible, and powerful library for " +":mod:`!optparse` is a more convenient, flexible, and powerful library for " "parsing command-line options than the minimalist :mod:`getopt` module. :mod:" -"`optparse` uses a more declarative style of command-line parsing: you create " -"an instance of :class:`OptionParser`, populate it with options, and parse " -"the command line. :mod:`optparse` allows users to specify options in the " -"conventional GNU/POSIX syntax, and additionally generates usage and help " +"`!optparse` uses a more declarative style of command-line parsing: you " +"create an instance of :class:`OptionParser`, populate it with options, and " +"parse the command line. :mod:`!optparse` allows users to specify options in " +"the conventional GNU/POSIX syntax, and additionally generates usage and help " "messages for you." msgstr "" #: ../../library/optparse.rst:137 -msgid "Here's an example of using :mod:`optparse` in a simple script::" +msgid "Here's an example of using :mod:`!optparse` in a simple script::" msgstr "" #: ../../library/optparse.rst:139 @@ -284,11 +285,11 @@ msgstr " --file=outfile -q" #: ../../library/optparse.rst:155 msgid "" -"As it parses the command line, :mod:`optparse` sets attributes of the " +"As it parses the command line, :mod:`!optparse` sets attributes of the " "``options`` object returned by :meth:`~OptionParser.parse_args` based on " "user-supplied command-line values. When :meth:`~OptionParser.parse_args` " "returns from parsing this command line, ``options.filename`` will be " -"``\"outfile\"`` and ``options.verbose`` will be ``False``. :mod:`optparse` " +"``\"outfile\"`` and ``options.verbose`` will be ``False``. :mod:`!optparse` " "supports both long and short options, allows short options to be merged " "together, and allows options to be associated with their arguments in a " "variety of ways. Thus, the following command lines are all equivalent to " @@ -317,7 +318,7 @@ msgstr "" #: ../../library/optparse.rst:174 msgid "" -"and :mod:`optparse` will print out a brief summary of your script's options:" +"and :mod:`!optparse` will print out a brief summary of your script's options:" msgstr "" #: ../../library/optparse.rst:176 @@ -348,7 +349,7 @@ msgstr "背景" #: ../../library/optparse.rst:194 msgid "" -":mod:`optparse` was explicitly designed to encourage the creation of " +":mod:`!optparse` was explicitly designed to encourage the creation of " "programs with straightforward command-line interfaces that follow the " "conventions established by the :c:func:`!getopt` family of functions " "available to C developers. To that end, it supports only the most common " @@ -394,7 +395,7 @@ msgid "" "to be merged into a single argument, e.g. ``-x -F`` is equivalent to ``-" "xF``. The GNU project introduced ``--`` followed by a series of hyphen-" "separated words, e.g. ``--file`` or ``--dry-run``. These are the only two " -"option syntaxes provided by :mod:`optparse`." +"option syntaxes provided by :mod:`!optparse`." msgstr "" #: ../../library/optparse.rst:228 @@ -428,7 +429,7 @@ msgstr "" #: ../../library/optparse.rst:243 msgid "" -"These option syntaxes are not supported by :mod:`optparse`, and they never " +"These option syntaxes are not supported by :mod:`!optparse`, and they never " "will be. This is deliberate: the first three are non-standard on any " "environment, and the last only makes sense if you're exclusively targeting " "Windows or certain legacy platforms (e.g. VMS, MS-DOS)." @@ -441,8 +442,8 @@ msgstr "選項引數" #: ../../library/optparse.rst:249 msgid "" "an argument that follows an option, is closely associated with that option, " -"and is consumed from the argument list when that option is. With :mod:" -"`optparse`, option arguments may either be in a separate argument from their " +"and is consumed from the argument list when that option is. With :mod:`!" +"optparse`, option arguments may either be in a separate argument from their " "option:" msgstr "" @@ -473,7 +474,7 @@ msgid "" "options will take an argument if they see it, and won't if they don't. This " "is somewhat controversial, because it makes parsing ambiguous: if ``-a`` " "takes an optional argument and ``-b`` is another option entirely, how do we " -"interpret ``-ab``? Because of this ambiguity, :mod:`optparse` does not " +"interpret ``-ab``? Because of this ambiguity, :mod:`!optparse` does not " "support this feature." msgstr "" @@ -495,7 +496,7 @@ msgstr "" #: ../../library/optparse.rst:280 msgid "" "an option that must be supplied on the command-line; note that the phrase " -"\"required option\" is self-contradictory in English. :mod:`optparse` " +"\"required option\" is self-contradictory in English. :mod:`!optparse` " "doesn't prevent you from implementing required options, but doesn't give you " "much help at it either." msgstr "" @@ -606,9 +607,9 @@ msgstr "教學" #: ../../library/optparse.rst:360 msgid "" -"While :mod:`optparse` is quite flexible and powerful, it's also " +"While :mod:`!optparse` is quite flexible and powerful, it's also " "straightforward to use in most cases. This section covers the code patterns " -"that are common to any :mod:`optparse`\\ -based program." +"that are common to any :mod:`!optparse`\\ -based program." msgstr "" #: ../../library/optparse.rst:364 @@ -642,7 +643,7 @@ msgstr "" #: ../../library/optparse.rst:376 msgid "" "Each option has one or more option strings, such as ``-f`` or ``--file``, " -"and several option attributes that tell :mod:`optparse` what to expect and " +"and several option attributes that tell :mod:`!optparse` what to expect and " "what to do when it encounters that option on the command line." msgstr "" @@ -667,14 +668,14 @@ msgstr "" msgid "" "The option strings passed to :meth:`OptionParser.add_option` are effectively " "labels for the option defined by that call. For brevity, we will frequently " -"refer to *encountering an option* on the command line; in reality, :mod:" -"`optparse` encounters *option strings* and looks up options from them." +"refer to *encountering an option* on the command line; in reality, :mod:`!" +"optparse` encounters *option strings* and looks up options from them." msgstr "" #: ../../library/optparse.rst:395 msgid "" -"Once all of your options are defined, instruct :mod:`optparse` to parse your " -"program's command line::" +"Once all of your options are defined, instruct :mod:`!optparse` to parse " +"your program's command line::" msgstr "" #: ../../library/optparse.rst:398 @@ -719,17 +720,18 @@ msgstr "" #: ../../library/optparse.rst:423 msgid "" -"Actions tell :mod:`optparse` what to do when it encounters an option on the " -"command line. There is a fixed set of actions hard-coded into :mod:" -"`optparse`; adding new actions is an advanced topic covered in section :ref:" -"`optparse-extending-optparse`. Most actions tell :mod:`optparse` to store a " -"value in some variable---for example, take a string from the command line " +"Actions tell :mod:`!optparse` what to do when it encounters an option on the " +"command line. There is a fixed set of actions hard-coded into :mod:`!" +"optparse`; adding new actions is an advanced topic covered in section :ref:" +"`optparse-extending-optparse`. Most actions tell :mod:`!optparse` to store " +"a value in some variable---for example, take a string from the command line " "and store it in an attribute of ``options``." msgstr "" #: ../../library/optparse.rst:430 msgid "" -"If you don't specify an option action, :mod:`optparse` defaults to ``store``." +"If you don't specify an option action, :mod:`!optparse` defaults to " +"``store``." msgstr "" #: ../../library/optparse.rst:436 @@ -738,7 +740,7 @@ msgstr "" #: ../../library/optparse.rst:438 msgid "" -"The most common option action is ``store``, which tells :mod:`optparse` to " +"The most common option action is ``store``, which tells :mod:`!optparse` to " "take the next argument (or the remainder of the current argument), ensure " "that it is of the correct type, and store it to your chosen destination." msgstr "" @@ -757,7 +759,7 @@ msgstr "" #: ../../library/optparse.rst:447 msgid "" -"Now let's make up a fake command line and ask :mod:`optparse` to parse it::" +"Now let's make up a fake command line and ask :mod:`!optparse` to parse it::" msgstr "" #: ../../library/optparse.rst:449 @@ -770,7 +772,7 @@ msgstr "" #: ../../library/optparse.rst:452 msgid "" -"When :mod:`optparse` sees the option string ``-f``, it consumes the next " +"When :mod:`!optparse` sees the option string ``-f``, it consumes the next " "argument, ``foo.txt``, and stores it in ``options.filename``. So, after " "this call to :meth:`~OptionParser.parse_args`, ``options.filename`` is " "``\"foo.txt\"``." @@ -778,7 +780,7 @@ msgstr "" #: ../../library/optparse.rst:456 msgid "" -"Some other option types supported by :mod:`optparse` are ``int`` and " +"Some other option types supported by :mod:`!optparse` are ``int`` and " "``float``. Here's an option that expects an integer argument::" msgstr "" @@ -813,7 +815,7 @@ msgstr "會印出 ``42``。" #: ../../library/optparse.rst:473 msgid "" -"If you don't specify a type, :mod:`optparse` assumes ``string``. Combined " +"If you don't specify a type, :mod:`!optparse` assumes ``string``. Combined " "with the fact that the default action is ``store``, that means our first " "example can be a lot shorter::" msgstr "" @@ -824,16 +826,16 @@ msgstr "parser.add_option(\"-f\", \"--file\", dest=\"filename\")" #: ../../library/optparse.rst:479 msgid "" -"If you don't supply a destination, :mod:`optparse` figures out a sensible " +"If you don't supply a destination, :mod:`!optparse` figures out a sensible " "default from the option strings: if the first long option string is ``--foo-" "bar``, then the default destination is ``foo_bar``. If there are no long " -"option strings, :mod:`optparse` looks at the first short option string: the " +"option strings, :mod:`!optparse` looks at the first short option string: the " "default destination for ``-f`` is ``f``." msgstr "" #: ../../library/optparse.rst:485 msgid "" -":mod:`optparse` also includes the built-in ``complex`` type. Adding types " +":mod:`!optparse` also includes the built-in ``complex`` type. Adding types " "is covered in section :ref:`optparse-extending-optparse`." msgstr "" @@ -844,7 +846,7 @@ msgstr "" #: ../../library/optparse.rst:494 msgid "" "Flag options---set a variable to true or false when a particular option is " -"seen---are quite common. :mod:`optparse` supports them with two separate " +"seen---are quite common. :mod:`!optparse` supports them with two separate " "actions, ``store_true`` and ``store_false``. For example, you might have a " "``verbose`` flag that is turned on with ``-v`` and off with ``-q``::" msgstr "" @@ -866,7 +868,7 @@ msgstr "" #: ../../library/optparse.rst:506 msgid "" -"When :mod:`optparse` encounters ``-v`` on the command line, it sets " +"When :mod:`!optparse` encounters ``-v`` on the command line, it sets " "``options.verbose`` to ``True``; when it encounters ``-q``, ``options." "verbose`` is set to ``False``." msgstr "" @@ -876,7 +878,7 @@ msgid "Other actions" msgstr "" #: ../../library/optparse.rst:516 -msgid "Some other actions supported by :mod:`optparse` are:" +msgid "Some other actions supported by :mod:`!optparse` are:" msgstr "" #: ../../library/optparse.rst:518 ../../library/optparse.rst:1040 @@ -927,13 +929,13 @@ msgid "" "\"destination\") when certain command-line options are seen. What happens " "if those options are never seen? Since we didn't supply any defaults, they " "are all set to ``None``. This is usually fine, but sometimes you want more " -"control. :mod:`optparse` lets you supply a default value for each " +"control. :mod:`!optparse` lets you supply a default value for each " "destination, which is assigned before the command line is parsed." msgstr "" #: ../../library/optparse.rst:546 msgid "" -"First, consider the verbose/quiet example. If we want :mod:`optparse` to " +"First, consider the verbose/quiet example. If we want :mod:`!optparse` to " "set ``verbose`` to ``True`` unless ``-q`` is seen, then we can do this::" msgstr "" @@ -1013,7 +1015,7 @@ msgstr "" #: ../../library/optparse.rst:585 msgid "" -":mod:`optparse`'s ability to generate help and usage text automatically is " +":mod:`!optparse`'s ability to generate help and usage text automatically is " "useful for creating user-friendly command-line interfaces. All you have to " "do is supply a :attr:`~Option.help` value for each option, and optionally a " "short usage message for your whole program. Here's an OptionParser " @@ -1054,7 +1056,7 @@ msgstr "" #: ../../library/optparse.rst:606 msgid "" -"If :mod:`optparse` encounters either ``-h`` or ``--help`` on the command-" +"If :mod:`!optparse` encounters either ``-h`` or ``--help`` on the command-" "line, or if you just call :meth:`parser.print_help`, it prints the following " "to standard output:" msgstr "" @@ -1085,13 +1087,13 @@ msgstr "" #: ../../library/optparse.rst:623 msgid "" -"(If the help output is triggered by a help option, :mod:`optparse` exits " +"(If the help output is triggered by a help option, :mod:`!optparse` exits " "after printing the help text.)" msgstr "" #: ../../library/optparse.rst:626 msgid "" -"There's a lot going on here to help :mod:`optparse` generate the best " +"There's a lot going on here to help :mod:`!optparse` generate the best " "possible help message:" msgstr "" @@ -1105,14 +1107,14 @@ msgstr "usage = \"usage: %prog [options] arg1 arg2\"" #: ../../library/optparse.rst:633 msgid "" -":mod:`optparse` expands ``%prog`` in the usage string to the name of the " +":mod:`!optparse` expands ``%prog`` in the usage string to the name of the " "current program, i.e. ``os.path.basename(sys.argv[0])``. The expanded " "string is then printed before the detailed option help." msgstr "" #: ../../library/optparse.rst:637 msgid "" -"If you don't supply a usage string, :mod:`optparse` uses a bland but " +"If you don't supply a usage string, :mod:`!optparse` uses a bland but " "sensible default: ``\"Usage: %prog [options]\"``, which is fine if your " "script doesn't take any positional arguments." msgstr "" @@ -1120,7 +1122,7 @@ msgstr "" #: ../../library/optparse.rst:641 msgid "" "every option defines a help string, and doesn't worry about line-wrapping---" -"\\ :mod:`optparse` takes care of wrapping lines and making the help output " +"\\ :mod:`!optparse` takes care of wrapping lines and making the help output " "look good." msgstr "" @@ -1137,8 +1139,8 @@ msgstr "-m MODE, --mode=MODE" #: ../../library/optparse.rst:650 msgid "" "Here, \"MODE\" is called the meta-variable: it stands for the argument that " -"the user is expected to supply to ``-m``/``--mode``. By default, :mod:" -"`optparse` converts the destination variable name to uppercase and uses that " +"the user is expected to supply to ``-m``/``--mode``. By default, :mod:`!" +"optparse` converts the destination variable name to uppercase and uses that " "for the meta-variable. Sometimes, that's not what you want---for example, " "the ``--filename`` option explicitly sets ``metavar=\"FILE\"``, resulting in " "this automatically generated option description::" @@ -1161,9 +1163,9 @@ msgstr "" #: ../../library/optparse.rst:665 msgid "" "options that have a default value can include ``%default`` in the help " -"string---\\ :mod:`optparse` will replace it with :func:`str` of the option's " -"default value. If an option has no default value (or the default value is " -"``None``), ``%default`` expands to ``none``." +"string---\\ :mod:`!optparse` will replace it with :func:`str` of the " +"option's default value. If an option has no default value (or the default " +"value is ``None``), ``%default`` expands to ``none``." msgstr "" #: ../../library/optparse.rst:671 @@ -1378,7 +1380,7 @@ msgstr "" #: ../../library/optparse.rst:782 msgid "" -"Similar to the brief usage string, :mod:`optparse` can also print a version " +"Similar to the brief usage string, :mod:`!optparse` can also print a version " "string for your program. You have to supply the string as the ``version`` " "argument to OptionParser::" msgstr "" @@ -1391,8 +1393,8 @@ msgstr "" #: ../../library/optparse.rst:788 msgid "" "``%prog`` is expanded just like it is in ``usage``. Apart from that, " -"``version`` can contain anything you like. When you supply it, :mod:" -"`optparse` automatically adds a ``--version`` option to your parser. If it " +"``version`` can contain anything you like. When you supply it, :mod:`!" +"optparse` automatically adds a ``--version`` option to your parser. If it " "encounters this option on the command line, it expands your ``version`` " "string (by replacing ``%prog``), prints it to stdout, and exits." msgstr "" @@ -1430,12 +1432,13 @@ msgid "" msgstr "" #: ../../library/optparse.rst:819 -msgid "How :mod:`optparse` handles errors" -msgstr "" +#, fuzzy +msgid "How :mod:`!optparse` handles errors" +msgstr ":mod:`optparse` 將會設定: ::" #: ../../library/optparse.rst:821 msgid "" -"There are two broad classes of errors that :mod:`optparse` has to worry " +"There are two broad classes of errors that :mod:`!optparse` has to worry " "about: programmer errors and user errors. Programmer errors are usually " "erroneous calls to :func:`OptionParser.add_option`, e.g. invalid option " "strings, unknown option attributes, missing option attributes, etc. These " @@ -1446,12 +1449,12 @@ msgstr "" #: ../../library/optparse.rst:828 msgid "" "Handling user errors is much more important, since they are guaranteed to " -"happen no matter how stable your code is. :mod:`optparse` can automatically " -"detect some user errors, such as bad option arguments (passing ``-n 4x`` " -"where ``-n`` takes an integer argument), missing arguments (``-n`` at the " -"end of the command line, where ``-n`` takes an argument of any type). Also, " -"you can call :func:`OptionParser.error` to signal an application-defined " -"error condition::" +"happen no matter how stable your code is. :mod:`!optparse` can " +"automatically detect some user errors, such as bad option arguments (passing " +"``-n 4x`` where ``-n`` takes an integer argument), missing arguments (``-n`` " +"at the end of the command line, where ``-n`` takes an argument of any " +"type). Also, you can call :func:`OptionParser.error` to signal an " +"application-defined error condition::" msgstr "" #: ../../library/optparse.rst:836 @@ -1468,7 +1471,7 @@ msgstr "" #: ../../library/optparse.rst:841 msgid "" -"In either case, :mod:`optparse` handles the error the same way: it prints " +"In either case, :mod:`!optparse` handles the error the same way: it prints " "the program's usage message and an error message to standard error and exits " "with error status 2." msgstr "" @@ -1509,14 +1512,14 @@ msgstr "" #: ../../library/optparse.rst:864 msgid "" -":mod:`optparse`\\ -generated error messages take care always to mention the " +":mod:`!optparse`\\ -generated error messages take care always to mention the " "option involved in the error; be sure to do the same when calling :func:" "`OptionParser.error` from your application code." msgstr "" #: ../../library/optparse.rst:868 msgid "" -"If :mod:`optparse`'s default error-handling behaviour does not suit your " +"If :mod:`!optparse`'s default error-handling behaviour does not suit your " "needs, you'll need to subclass OptionParser and override its :meth:" "`~OptionParser.exit` and/or :meth:`~OptionParser.error` methods." msgstr "" @@ -1526,7 +1529,7 @@ msgid "Putting it all together" msgstr "" #: ../../library/optparse.rst:878 -msgid "Here's what :mod:`optparse`\\ -based scripts usually look like::" +msgid "Here's what :mod:`!optparse`\\ -based scripts usually look like::" msgstr "" #: ../../library/optparse.rst:880 @@ -1585,7 +1588,7 @@ msgstr "建立剖析器" #: ../../library/optparse.rst:914 msgid "" -"The first step in using :mod:`optparse` is to create an OptionParser " +"The first step in using :mod:`!optparse` is to create an OptionParser " "instance." msgstr "" @@ -1603,7 +1606,7 @@ msgstr "``usage``\\ (預設值:``\"%prog [options]\"``)" #: ../../library/optparse.rst:923 msgid "" "The usage summary to print when your program is run incorrectly or with a " -"help option. When :mod:`optparse` prints the usage string, it expands " +"help option. When :mod:`!optparse` prints the usage string, it expands " "``%prog`` to ``os.path.basename(sys.argv[0])`` (or to ``prog`` if you passed " "that keyword argument). To suppress a usage message, pass the special " "value :const:`optparse.SUPPRESS_USAGE`." @@ -1637,7 +1640,7 @@ msgstr "``version``\\ (預設值:``None``)" #: ../../library/optparse.rst:940 msgid "" "A version string to print when the user supplies a version option. If you " -"supply a true value for ``version``, :mod:`optparse` automatically adds a " +"supply a true value for ``version``, :mod:`!optparse` automatically adds a " "version option with the single option string ``--version``. The substring " "``%prog`` is expanded the same as for ``usage``." msgstr "" @@ -1658,10 +1661,10 @@ msgstr "``description``\\ (預設值:``None``)" #: ../../library/optparse.rst:951 msgid "" -"A paragraph of text giving a brief overview of your program. :mod:`optparse` " -"reformats this paragraph to fit the current terminal width and prints it " -"when the user requests help (after ``usage``, but before the list of " -"options)." +"A paragraph of text giving a brief overview of your program. :mod:`!" +"optparse` reformats this paragraph to fit the current terminal width and " +"prints it when the user requests help (after ``usage``, but before the list " +"of options)." msgstr "" #: ../../library/optparse.rst:956 @@ -1671,7 +1674,7 @@ msgstr "" #: ../../library/optparse.rst:957 msgid "" "An instance of optparse.HelpFormatter that will be used for printing help " -"text. :mod:`optparse` provides two concrete classes for this purpose: " +"text. :mod:`!optparse` provides two concrete classes for this purpose: " "IndentedHelpFormatter and TitledHelpFormatter." msgstr "" @@ -1681,7 +1684,7 @@ msgstr "``add_help_option``\\ (預設值:``True``)" #: ../../library/optparse.rst:962 msgid "" -"If true, :mod:`optparse` will add a help option (with option strings ``-h`` " +"If true, :mod:`!optparse` will add a help option (with option strings ``-h`` " "and ``--help``) to the parser." msgstr "" @@ -1753,7 +1756,7 @@ msgstr "" msgid "" "(:func:`make_option` is a factory function for creating Option instances; " "currently it is an alias for the Option constructor. A future version of :" -"mod:`optparse` may split Option into several classes, and :func:" +"mod:`!optparse` may split Option into several classes, and :func:" "`make_option` will pick the right class to instantiate. Do not instantiate " "Option directly.)" msgstr "" @@ -1796,15 +1799,15 @@ msgid "" "The keyword arguments define attributes of the new Option object. The most " "important option attribute is :attr:`~Option.action`, and it largely " "determines which other attributes are relevant or required. If you pass " -"irrelevant option attributes, or fail to pass required ones, :mod:`optparse` " -"raises an :exc:`OptionError` exception explaining your mistake." +"irrelevant option attributes, or fail to pass required ones, :mod:`!" +"optparse` raises an :exc:`OptionError` exception explaining your mistake." msgstr "" #: ../../library/optparse.rst:1033 msgid "" -"An option's *action* determines what :mod:`optparse` does when it encounters " -"this option on the command-line. The standard option actions hard-coded " -"into :mod:`optparse` are:" +"An option's *action* determines what :mod:`!optparse` does when it " +"encounters this option on the command-line. The standard option actions " +"hard-coded into :mod:`!optparse` are:" msgstr "" #: ../../library/optparse.rst:1037 @@ -1858,7 +1861,7 @@ msgstr "" #: ../../library/optparse.rst:1068 msgid "" "As you can see, most actions involve storing or updating a value somewhere. :" -"mod:`optparse` always creates a special object for this, conventionally " +"mod:`!optparse` always creates a special object for this, conventionally " "called ``options``, which is an instance of :class:`optparse.Values`." msgstr "" @@ -1887,7 +1890,7 @@ msgstr "parser.parse_args()" #: ../../library/optparse.rst:1087 msgid "" -"one of the first things :mod:`optparse` does is create the ``options`` " +"one of the first things :mod:`!optparse` does is create the ``options`` " "object::" msgstr "" @@ -1925,7 +1928,7 @@ msgstr "" #: ../../library/optparse.rst:1102 msgid "" -"then :mod:`optparse`, on seeing this option, will do the equivalent of ::" +"then :mod:`!optparse`, on seeing this option, will do the equivalent of ::" msgstr "" #: ../../library/optparse.rst:1104 @@ -1956,7 +1959,7 @@ msgid "" "The following option attributes may be passed as keyword arguments to :meth:" "`OptionParser.add_option`. If you pass an option attribute that is not " "relevant to a particular option, or fail to pass a required option " -"attribute, :mod:`optparse` raises :exc:`OptionError`." +"attribute, :mod:`!optparse` raises :exc:`OptionError`." msgstr "" #: ../../library/optparse.rst:1131 @@ -1965,7 +1968,7 @@ msgstr "(預設值: ``\"store\"`` )" #: ../../library/optparse.rst:1133 msgid "" -"Determines :mod:`optparse`'s behaviour when this option is seen on the " +"Determines :mod:`!optparse`'s behaviour when this option is seen on the " "command line; the available options are documented :ref:`here `." msgstr "" @@ -1988,9 +1991,9 @@ msgstr "" #: ../../library/optparse.rst:1149 msgid "" "If the option's action implies writing or modifying a value somewhere, this " -"tells :mod:`optparse` where to write it: :attr:`~Option.dest` names an " -"attribute of the ``options`` object that :mod:`optparse` builds as it parses " -"the command line." +"tells :mod:`!optparse` where to write it: :attr:`~Option.dest` names an " +"attribute of the ``options`` object that :mod:`!optparse` builds as it " +"parses the command line." msgstr "" #: ../../library/optparse.rst:1156 @@ -2006,7 +2009,7 @@ msgstr "(預設值:1)" #: ../../library/optparse.rst:1163 msgid "" "How many arguments of type :attr:`~Option.type` should be consumed when this " -"option is seen. If > 1, :mod:`optparse` will store a tuple of values to :" +"option is seen. If > 1, :mod:`!optparse` will store a tuple of values to :" "attr:`~Option.dest`." msgstr "" @@ -2055,7 +2058,7 @@ msgstr "標準選項動作" msgid "" "The various option actions all have slightly different requirements and " "effects. Most actions have several relevant option attributes which you may " -"specify to guide :mod:`optparse`'s behaviour; a few have required " +"specify to guide :mod:`!optparse`'s behaviour; a few have required " "attributes, which you must specify for any option using that action." msgstr "" @@ -2087,10 +2090,11 @@ msgstr "如果沒有提供 :attr:`~Option.type`,它的預設值是 ``\"string\ #: ../../library/optparse.rst:1228 msgid "" -"If :attr:`~Option.dest` is not supplied, :mod:`optparse` derives a " +"If :attr:`~Option.dest` is not supplied, :mod:`!optparse` derives a " "destination from the first long option string (e.g., ``--foo-bar`` implies " -"``foo_bar``). If there are no long option strings, :mod:`optparse` derives a " -"destination from the first short option string (e.g., ``-f`` implies ``f``)." +"``foo_bar``). If there are no long option strings, :mod:`!optparse` derives " +"a destination from the first short option string (e.g., ``-f`` implies " +"``f``)." msgstr "" #: ../../library/optparse.rst:1233 ../../library/optparse.rst:1253 @@ -2116,7 +2120,8 @@ msgid "-f foo.txt -p 1 -3.5 4 -fbar.txt" msgstr "-f foo.txt -p 1 -3.5 4 -fbar.txt" #: ../../library/optparse.rst:1242 -msgid ":mod:`optparse` will set ::" +#, fuzzy +msgid ":mod:`!optparse` will set ::" msgstr ":mod:`optparse` 將會設定: ::" #: ../../library/optparse.rst:1244 @@ -2156,8 +2161,9 @@ msgstr "" " action=\"store_const\", const=2, dest=\"verbose\")" #: ../../library/optparse.rst:1262 -msgid "If ``--noisy`` is seen, :mod:`optparse` will set ::" -msgstr "" +#, fuzzy +msgid "If ``--noisy`` is seen, :mod:`!optparse` will set ::" +msgstr ":mod:`optparse` 將會設定: ::" #: ../../library/optparse.rst:1264 msgid "options.verbose = 2" @@ -2199,7 +2205,7 @@ msgstr "" msgid "" "The option must be followed by an argument, which is appended to the list " "in :attr:`~Option.dest`. If no default value for :attr:`~Option.dest` is " -"supplied, an empty list is automatically created when :mod:`optparse` first " +"supplied, an empty list is automatically created when :mod:`!optparse` first " "encounters this option on the command-line. If :attr:`~Option.nargs` > 1, " "multiple arguments are consumed, and a tuple of length :attr:`~Option.nargs` " "is appended to :attr:`~Option.dest`." @@ -2219,7 +2225,7 @@ msgstr "" #: ../../library/optparse.rst:1297 msgid "" -"If ``-t3`` is seen on the command-line, :mod:`optparse` does the equivalent " +"If ``-t3`` is seen on the command-line, :mod:`!optparse` does the equivalent " "of::" msgstr "" @@ -2293,7 +2299,7 @@ msgstr "parser.add_option(\"-v\", action=\"count\", dest=\"verbosity\")" #: ../../library/optparse.rst:1336 msgid "" -"The first time ``-v`` is seen on the command line, :mod:`optparse` does the " +"The first time ``-v`` is seen on the command line, :mod:`!optparse` does the " "equivalent of::" msgstr "" @@ -2351,7 +2357,7 @@ msgstr "" #: ../../library/optparse.rst:1367 msgid "" -":mod:`optparse` automatically adds a :attr:`~Option.help` option to all " +":mod:`!optparse` automatically adds a :attr:`~Option.help` option to all " "OptionParsers, so you do not normally need to create one." msgstr "" @@ -2373,7 +2379,7 @@ msgstr "" #: ../../library/optparse.rst:1385 msgid "" -"If :mod:`optparse` sees either ``-h`` or ``--help`` on the command line, it " +"If :mod:`!optparse` sees either ``-h`` or ``--help`` on the command line, it " "will print something like the following help message to stdout (assuming " "``sys.argv[0]`` is ``\"foo.py\"``):" msgstr "" @@ -2396,7 +2402,7 @@ msgstr "" #: ../../library/optparse.rst:1398 msgid "" -"After printing the help message, :mod:`optparse` terminates your process " +"After printing the help message, :mod:`!optparse` terminates your process " "with ``sys.exit(0)``." msgstr "" @@ -2411,7 +2417,7 @@ msgid "" "``print_version()`` method of OptionParser. Generally only relevant if the " "``version`` argument is supplied to the OptionParser constructor. As with :" "attr:`~Option.help` options, you will rarely create ``version`` options, " -"since :mod:`optparse` automatically adds them when needed." +"since :mod:`!optparse` automatically adds them when needed." msgstr "" #: ../../library/optparse.rst:1414 @@ -2420,9 +2426,9 @@ msgstr "" #: ../../library/optparse.rst:1416 msgid "" -":mod:`optparse` has five built-in option types: ``\"string\"``, ``\"int\"``, " -"``\"choice\"``, ``\"float\"`` and ``\"complex\"``. If you need to add new " -"option types, see section :ref:`optparse-extending-optparse`." +":mod:`!optparse` has five built-in option types: ``\"string\"``, " +"``\"int\"``, ``\"choice\"``, ``\"float\"`` and ``\"complex\"``. If you need " +"to add new option types, see section :ref:`optparse-extending-optparse`." msgstr "" #: ../../library/optparse.rst:1420 @@ -2455,8 +2461,8 @@ msgstr "" #: ../../library/optparse.rst:1434 msgid "" "The conversion is done by calling :func:`int` with the appropriate base (2, " -"8, 10, or 16). If this fails, so will :mod:`optparse`, although with a more " -"useful error message." +"8, 10, or 16). If this fails, so will :mod:`!optparse`, although with a " +"more useful error message." msgstr "" #: ../../library/optparse.rst:1438 @@ -2523,7 +2529,7 @@ msgstr "``options``" #: ../../library/optparse.rst:1473 msgid "" "the same object that was passed in as *values*, or the ``optparse.Values`` " -"instance created by :mod:`optparse`" +"instance created by :mod:`!optparse`" msgstr "" #: ../../library/optparse.rst:1477 @@ -2560,8 +2566,8 @@ msgstr "" #: ../../library/optparse.rst:1501 msgid "" "Set parsing to stop on the first non-option. For example, if ``-a`` and ``-" -"b`` are both simple options that take no arguments, :mod:`optparse` normally " -"accepts this syntax::" +"b`` are both simple options that take no arguments, :mod:`!optparse` " +"normally accepts this syntax::" msgstr "" #: ../../library/optparse.rst:1505 @@ -2644,7 +2650,7 @@ msgstr "" #: ../../library/optparse.rst:1557 msgid "" -"Every time you add an option, :mod:`optparse` checks for conflicts with " +"Every time you add an option, :mod:`!optparse` checks for conflicts with " "existing options. If it finds any, it invokes the current conflict-handling " "mechanism. You can set the conflict-handling mechanism either in the " "constructor::" @@ -2702,7 +2708,7 @@ msgstr "" #: ../../library/optparse.rst:1584 msgid "" -"At this point, :mod:`optparse` detects that a previously added option is " +"At this point, :mod:`!optparse` detects that a previously added option is " "already using the ``-n`` option string. Since ``conflict_handler`` is " "``\"resolve\"``, it resolves the situation by removing ``-n`` from the " "earlier option's list of option strings. Now ``--dry-run`` is the only way " @@ -2722,7 +2728,7 @@ msgstr "" msgid "" "It's possible to whittle away the option strings for a previously added " "option until there are none left, and the user has no way of invoking that " -"option from the command-line. In that case, :mod:`optparse` removes that " +"option from the command-line. In that case, :mod:`!optparse` removes that " "option completely, so it doesn't show up in help text or anywhere else. " "Carrying on with our existing OptionParser::" msgstr "" @@ -2734,7 +2740,7 @@ msgstr "parser.add_option(\"--dry-run\", ..., help=\"new dry-run option\")" #: ../../library/optparse.rst:1603 msgid "" "At this point, the original ``-n``/``--dry-run`` option is no longer " -"accessible, so :mod:`optparse` removes it, leaving this help text::" +"accessible, so :mod:`!optparse` removes it, leaving this help text::" msgstr "" #: ../../library/optparse.rst:1606 @@ -2836,10 +2842,10 @@ msgstr "" #: ../../library/optparse.rst:1679 msgid "" -"When :mod:`optparse`'s built-in actions and types aren't quite enough for " -"your needs, you have two choices: extend :mod:`optparse` or define a " -"callback option. Extending :mod:`optparse` is more general, but overkill for " -"a lot of simple cases. Quite often a simple callback is all you need." +"When :mod:`!optparse`'s built-in actions and types aren't quite enough for " +"your needs, you have two choices: extend :mod:`!optparse` or define a " +"callback option. Extending :mod:`!optparse` is more general, but overkill " +"for a lot of simple cases. Quite often a simple callback is all you need." msgstr "" #: ../../library/optparse.rst:1684 @@ -2876,7 +2882,7 @@ msgstr "parser.add_option(\"-c\", action=\"callback\", callback=my_callback)" msgid "" "``callback`` is a function (or other callable object), so you must have " "already defined ``my_callback()`` when you create this callback option. In " -"this simple case, :mod:`optparse` doesn't even know if ``-c`` takes any " +"this simple case, :mod:`!optparse` doesn't even know if ``-c`` takes any " "arguments, which usually means that the option takes no arguments---the mere " "presence of ``-c`` on the command-line is all it needs to know. In some " "circumstances, though, you might want your callback to consume an arbitrary " @@ -2886,7 +2892,7 @@ msgstr "" #: ../../library/optparse.rst:1712 msgid "" -":mod:`optparse` always passes four particular arguments to your callback, " +":mod:`!optparse` always passes four particular arguments to your callback, " "and it will only pass additional arguments if you specify them via :attr:" "`~Option.callback_args` and :attr:`~Option.callback_kwargs`. Thus, the " "minimal callback function signature is::" @@ -2913,9 +2919,9 @@ msgstr ":attr:`~Option.type`" #: ../../library/optparse.rst:1725 msgid "" "has its usual meaning: as with the ``\"store\"`` or ``\"append\"`` actions, " -"it instructs :mod:`optparse` to consume one argument and convert it to :attr:" -"`~Option.type`. Rather than storing the converted value(s) anywhere, " -"though, :mod:`optparse` passes it to your callback function." +"it instructs :mod:`!optparse` to consume one argument and convert it to :" +"attr:`~Option.type`. Rather than storing the converted value(s) anywhere, " +"though, :mod:`!optparse` passes it to your callback function." msgstr "" #: ../../library/optparse.rst:1730 @@ -2924,7 +2930,7 @@ msgstr ":attr:`~Option.nargs`" #: ../../library/optparse.rst:1731 msgid "" -"also has its usual meaning: if it is supplied and > 1, :mod:`optparse` will " +"also has its usual meaning: if it is supplied and > 1, :mod:`!optparse` will " "consume :attr:`~Option.nargs` arguments, each of which must be convertible " "to :attr:`~Option.type`. It then passes a tuple of converted values to your " "callback." @@ -2981,7 +2987,7 @@ msgstr "``value``" #: ../../library/optparse.rst:1765 msgid "" -"is the argument to this option seen on the command-line. :mod:`optparse` " +"is the argument to this option seen on the command-line. :mod:`!optparse` " "will only expect an argument if :attr:`~Option.type` is set; the type of " "``value`` will be the type implied by the option's type. If :attr:`~Option." "type` for this option is ``None`` (no argument expected), then ``value`` " @@ -3031,7 +3037,7 @@ msgstr "``parser.values``" msgid "" "the object where option values are by default stored (an instance of " "optparse.OptionValues). This lets callbacks use the same mechanism as the " -"rest of :mod:`optparse` for storing option values; you don't need to mess " +"rest of :mod:`!optparse` for storing option values; you don't need to mess " "around with globals or closures. You can also access or modify the value(s) " "of any options already encountered on the command-line." msgstr "" @@ -3059,7 +3065,7 @@ msgstr "" #: ../../library/optparse.rst:1808 msgid "" "The callback function should raise :exc:`OptionValueError` if there are any " -"problems with the option or its argument(s). :mod:`optparse` catches this " +"problems with the option or its argument(s). :mod:`!optparse` catches this " "and terminates the program, printing the error message you supply to " "stderr. Your message should be clear, concise, accurate, and mention the " "option at fault. Otherwise, the user will have a hard time figuring out what " @@ -3229,9 +3235,9 @@ msgstr "" #: ../../library/optparse.rst:1909 msgid "" -"Note that :mod:`optparse` takes care of consuming 3 arguments and converting " -"them to integers for you; all you have to do is store them. (Or whatever; " -"obviously you don't need a callback for this example.)" +"Note that :mod:`!optparse` takes care of consuming 3 arguments and " +"converting them to integers for you; all you have to do is store them. (Or " +"whatever; obviously you don't need a callback for this example.)" msgstr "" #: ../../library/optparse.rst:1917 @@ -3241,10 +3247,10 @@ msgstr "" #: ../../library/optparse.rst:1919 msgid "" "Things get hairy when you want an option to take a variable number of " -"arguments. For this case, you must write a callback, as :mod:`optparse` " +"arguments. For this case, you must write a callback, as :mod:`!optparse` " "doesn't provide any built-in capabilities for it. And you have to deal with " -"certain intricacies of conventional Unix command-line parsing that :mod:" -"`optparse` normally handles for you. In particular, callbacks should " +"certain intricacies of conventional Unix command-line parsing that :mod:`!" +"optparse` normally handles for you. In particular, callbacks should " "implement the conventional rules for bare ``--`` and ``-`` arguments:" msgstr "" @@ -3269,8 +3275,8 @@ msgid "" "If you want an option that takes a variable number of arguments, there are " "several subtle, tricky issues to worry about. The exact implementation you " "choose will be based on which trade-offs you're willing to make for your " -"application (which is why :mod:`optparse` doesn't support this sort of thing " -"directly)." +"application (which is why :mod:`!optparse` doesn't support this sort of " +"thing directly)." msgstr "" #: ../../library/optparse.rst:1940 @@ -3310,12 +3316,12 @@ msgid "" msgstr "" #: ../../library/optparse.rst:1974 -msgid "Extending :mod:`optparse`" +msgid "Extending :mod:`!optparse`" msgstr "" #: ../../library/optparse.rst:1976 msgid "" -"Since the two major controlling factors in how :mod:`optparse` interprets " +"Since the two major controlling factors in how :mod:`!optparse` interprets " "command-line options are the action and type of each option, the most likely " "direction of extension is to add new actions and new types." msgstr "" @@ -3326,10 +3332,10 @@ msgstr "" #: ../../library/optparse.rst:1986 msgid "" -"To add new types, you need to define your own subclass of :mod:`optparse`'s :" -"class:`Option` class. This class has a couple of attributes that define :" -"mod:`optparse`'s types: :attr:`~Option.TYPES` and :attr:`~Option." -"TYPE_CHECKER`." +"To add new types, you need to define your own subclass of :mod:`!" +"optparse`'s :class:`Option` class. This class has a couple of attributes " +"that define :mod:`!optparse`'s types: :attr:`~Option.TYPES` and :attr:" +"`~Option.TYPE_CHECKER`." msgstr "" #: ../../library/optparse.rst:1992 @@ -3372,7 +3378,7 @@ msgstr "" msgid "" "Here's a silly example that demonstrates adding a ``\"complex\"`` option " "type to parse Python-style complex numbers on the command line. (This is " -"even sillier than it used to be, because :mod:`optparse` 1.3 added built-in " +"even sillier than it used to be, because :mod:`!optparse` 1.3 added built-in " "support for complex numbers, but never mind.)" msgstr "" @@ -3429,15 +3435,15 @@ msgstr "" #: ../../library/optparse.rst:2043 msgid "" "(If we didn't make a :func:`copy` of :attr:`Option.TYPE_CHECKER`, we would " -"end up modifying the :attr:`~Option.TYPE_CHECKER` attribute of :mod:" -"`optparse`'s Option class. This being Python, nothing stops you from doing " +"end up modifying the :attr:`~Option.TYPE_CHECKER` attribute of :mod:`!" +"optparse`'s Option class. This being Python, nothing stops you from doing " "that except good manners and common sense.)" msgstr "" #: ../../library/optparse.rst:2048 msgid "" "That's it! Now you can write a script that uses the new option type just " -"like any other :mod:`optparse`\\ -based script, except you have to instruct " +"like any other :mod:`!optparse`\\ -based script, except you have to instruct " "your OptionParser to use MyOption instead of Option::" msgstr "" @@ -3473,7 +3479,7 @@ msgstr "" #: ../../library/optparse.rst:2068 msgid "" "Adding new actions is a bit trickier, because you have to understand that :" -"mod:`optparse` has a couple of classifications for actions:" +"mod:`!optparse` has a couple of classifications for actions:" msgstr "" #: ../../library/optparse.rst:2071 @@ -3482,7 +3488,7 @@ msgstr "" #: ../../library/optparse.rst:2072 msgid "" -"actions that result in :mod:`optparse` storing a value to an attribute of " +"actions that result in :mod:`!optparse` storing a value to an attribute of " "the current OptionValues instance; these options require a :attr:`~Option." "dest` attribute to be supplied to the Option constructor." msgstr "" @@ -3528,7 +3534,7 @@ msgstr "" #: ../../library/optparse.rst:2103 msgid "" "Actions that always take a type (i.e. whose options always take a value) are " -"additionally listed here. The only effect of this is that :mod:`optparse` " +"additionally listed here. The only effect of this is that :mod:`!optparse` " "assigns the default type, ``\"string\"``, to options with no explicit type " "whose action is listed in :attr:`ALWAYS_TYPED_ACTIONS`." msgstr "" @@ -3610,15 +3616,15 @@ msgstr "" #: ../../library/optparse.rst:2147 msgid "" -"to ensure that :mod:`optparse` assigns the default type of ``\"string\"`` to " -"``\"extend\"`` actions, we put the ``\"extend\"`` action in :attr:`~Option." -"ALWAYS_TYPED_ACTIONS` as well." +"to ensure that :mod:`!optparse` assigns the default type of ``\"string\"`` " +"to ``\"extend\"`` actions, we put the ``\"extend\"`` action in :attr:" +"`~Option.ALWAYS_TYPED_ACTIONS` as well." msgstr "" #: ../../library/optparse.rst:2151 msgid "" ":meth:`MyOption.take_action` implements just this one new action, and passes " -"control back to :meth:`Option.take_action` for the standard :mod:`optparse` " +"control back to :meth:`Option.take_action` for the standard :mod:`!optparse` " "actions." msgstr "" diff --git a/library/os.path.po b/library/os.path.po index b2c49802ad..4da31640e4 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-04 00:17+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2023-07-13 14:06+0800\n" "Last-Translator: Po-Chuan Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -66,13 +66,14 @@ msgstr "" "果將是相同型別的物件。" #: ../../library/os.path.rst:37 +#, fuzzy msgid "" "Since different operating systems have different path name conventions, " "there are several versions of this module in the standard library. The :mod:" -"`os.path` module is always the path module suitable for the operating system " -"Python is running on, and therefore usable for local paths. However, you " -"can also import and use the individual modules if you want to manipulate a " -"path that is *always* in one of the different formats. They all have the " +"`!os.path` module is always the path module suitable for the operating " +"system Python is running on, and therefore usable for local paths. However, " +"you can also import and use the individual modules if you want to manipulate " +"a path that is *always* in one of the different formats. They all have the " "same interface:" msgstr "" "由於不同的作業系統具有不同的路徑命名慣例,在標準函式庫中的路徑模組有數個版本" diff --git a/library/os.po b/library/os.po index 4cfda9d099..504f356560 100644 --- a/library/os.po +++ b/library/os.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-27 00:17+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2024-04-29 15:24+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -59,9 +59,10 @@ msgstr "" "於 *path* 的統計資訊(這剛好來自於 POSIX 的介面。)。" #: ../../library/os.rst:27 +#, fuzzy msgid "" "Extensions peculiar to a particular operating system are also available " -"through the :mod:`os` module, but using them is of course a threat to " +"through the :mod:`!os` module, but using them is of course a threat to " "portability." msgstr "" "對於特定的作業系統獨有的擴充功能也可以透過 :mod:`os` 取得,但使用它們的時候對" @@ -82,8 +83,9 @@ msgid "" msgstr "在 VxWorks, 不支援 os.popen、os.fork、os.execv 和 os.spawn*p*。" #: ../../library/os.rst:37 +#, fuzzy msgid "" -"On WebAssembly platforms, Android and iOS, large parts of the :mod:`os` " +"On WebAssembly platforms, Android and iOS, large parts of the :mod:`!os` " "module are not available or behave differently. APIs related to processes (e." "g. :func:`~os.fork`, :func:`~os.execve`) and resources (e.g. :func:`~os." "nice`) are not available. Others like :func:`~os.getuid` and :func:`~os." @@ -409,7 +411,7 @@ msgstr "" #: ../../library/os.rst:191 msgid "" -"This mapping is captured the first time the :mod:`os` module is imported, " +"This mapping is captured the first time the :mod:`!os` module is imported, " "typically during Python startup as part of processing :file:`site.py`. " "Changes to the environment made after this time are not reflected in :data:" "`os.environ`, except for changes made by modifying :data:`os.environ` " @@ -1495,7 +1497,7 @@ msgstr "" msgid "" "For a description of the flag and mode values, see the C run-time " "documentation; flag constants (like :const:`O_RDONLY` and :const:`O_WRONLY`) " -"are defined in the :mod:`os` module. In particular, on Windows adding :" +"are defined in the :mod:`!os` module. In particular, on Windows adding :" "const:`O_BINARY` is needed to open files in binary mode." msgstr "" @@ -2182,7 +2184,7 @@ msgstr "" #: ../../library/os.rst:2008 msgid "" "**specifying a file descriptor:** Normally the *path* argument provided to " -"functions in the :mod:`os` module must be a string specifying a file path. " +"functions in the :mod:`!os` module must be a string specifying a file path. " "However, some functions now alternatively accept an open file descriptor for " "their *path* argument. The function will then operate on the file referred " "to by the descriptor. For POSIX systems, Python will call the variant of the " @@ -3884,7 +3886,7 @@ msgstr "新增 :attr:`f_fsid` 屬性。" #: ../../library/os.rst:3420 msgid "" -"A :class:`set` object indicating which functions in the :mod:`os` module " +"A :class:`set` object indicating which functions in the :mod:`!os` module " "accept an open file descriptor for their *dir_fd* parameter. Different " "platforms provide different features, and the underlying functionality " "Python uses to implement the *dir_fd* parameter is not available on all " @@ -3939,7 +3941,7 @@ msgstr "" #: ../../library/os.rst:3464 msgid "" -"A :class:`set` object indicating which functions in the :mod:`os` module " +"A :class:`set` object indicating which functions in the :mod:`!os` module " "permit specifying their *path* parameter as an open file descriptor on the " "local platform. Different platforms provide different features, and the " "underlying functionality Python uses to accept open file descriptors as " @@ -3961,7 +3963,7 @@ msgstr "os.chdir in os.supports_fd" #: ../../library/os.rst:3484 msgid "" -"A :class:`set` object indicating which functions in the :mod:`os` module " +"A :class:`set` object indicating which functions in the :mod:`!os` module " "accept ``False`` for their *follow_symlinks* parameter on the local " "platform. Different platforms provide different features, and the underlying " "functionality Python uses to implement *follow_symlinks* is not available on " diff --git a/library/pathlib.po b/library/pathlib.po index b1b767e474..28c9724bfb 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-01-12 00:16+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+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-" @@ -3259,7 +3259,8 @@ msgid ":mod:`os` and :mod:`os.path`" msgstr ":mod:`os` 和 :mod:`os.path`" #: ../../library/pathlib.rst:1900 -msgid ":mod:`pathlib`" +#, fuzzy +msgid ":mod:`!pathlib`" msgstr ":mod:`pathlib`" #: ../../library/pathlib.rst:1902 diff --git a/library/pickle.po b/library/pickle.po index 0aeb4c5403..e1a11eb690 100644 --- a/library/pickle.po +++ b/library/pickle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-27 00:17+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,8 +35,9 @@ msgstr "**原始碼:**\\ :source:`Lib/pickle.py`" # 因為不確定是否與醃漬的這個梗有關,我暫時選擇使用 `封裝` 與 `拆封` 作為譯文,大致保存那個把東西處裡後裝起來的感覺但又不至於太奇怪。 # 唯一需要擔心的是是否有與 `encapsulation` (封裝,網路協定名詞)或 `package`(封包,網路協定名詞)搞混的可能。 #: ../../library/pickle.rst:22 +#, fuzzy msgid "" -"The :mod:`pickle` module implements binary protocols for serializing and de-" +"The :mod:`!pickle` module implements binary protocols for serializing and de-" "serializing a Python object structure. *\"Pickling\"* is the process " "whereby a Python object hierarchy is converted into a byte stream, and " "*\"unpickling\"* is the inverse operation, whereby a byte stream (from a :" @@ -89,9 +90,10 @@ msgid "Comparison with ``marshal``" msgstr "和 ``marshal`` 的比較" #: ../../library/pickle.rst:52 +#, fuzzy msgid "" "Python has a more primitive serialization module called :mod:`marshal`, but " -"in general :mod:`pickle` should always be the preferred way to serialize " +"in general :mod:`!pickle` should always be the preferred way to serialize " "Python objects. :mod:`marshal` exists primarily to support Python's :file:`." "pyc` files." msgstr "" @@ -100,15 +102,17 @@ msgstr "" "`pickle`,沒事不要用 :mod:`marshal`。" #: ../../library/pickle.rst:57 +#, fuzzy msgid "" -"The :mod:`pickle` module differs from :mod:`marshal` in several significant " +"The :mod:`!pickle` module differs from :mod:`marshal` in several significant " "ways:" msgstr ":mod:`pickle` 和 :mod:`marshal` 有幾個明顯不同的地方:" #: ../../library/pickle.rst:59 +#, fuzzy msgid "" ":mod:`marshal` cannot be used to serialize user-defined classes and their " -"instances. :mod:`pickle` can save and restore class instances " +"instances. :mod:`!pickle` can save and restore class instances " "transparently, however the class definition must be importable and live in " "the same module as when the object was stored." msgstr "" @@ -117,12 +121,13 @@ msgstr "" "在的模組中、且可以被引入(import)。" #: ../../library/pickle.rst:64 +#, fuzzy msgid "" "The :mod:`marshal` serialization format is not guaranteed to be portable " "across Python versions. Because its primary job in life is to support :file:" "`.pyc` files, the Python implementers reserve the right to change the " "serialization format in non-backwards compatible ways should the need arise. " -"The :mod:`pickle` serialization format is guaranteed to be backwards " +"The :mod:`!pickle` serialization format is guaranteed to be backwards " "compatible across Python releases provided a compatible pickle protocol is " "chosen and pickling and unpickling code deals with Python 2 to Python 3 type " "differences if your data is crossing that unique breaking change language " @@ -206,8 +211,9 @@ msgid "Data stream format" msgstr "資料串流格式" #: ../../library/pickle.rst:113 +#, fuzzy msgid "" -"The data format used by :mod:`pickle` is Python-specific. This has the " +"The data format used by :mod:`!pickle` is Python-specific. This has the " "advantage that there are no restrictions imposed by external standards such " "as JSON (which can't represent pointer sharing); however it means that non-" "Python programs may not be able to reconstruct pickled Python objects." @@ -217,8 +223,9 @@ msgstr "" "無法重建 pickle 封裝的 Python 物件。" #: ../../library/pickle.rst:118 +#, fuzzy msgid "" -"By default, the :mod:`pickle` data format uses a relatively compact binary " +"By default, the :mod:`!pickle` data format uses a relatively compact binary " "representation. If you need optimal size characteristics, you can " "efficiently :doc:`compress ` pickled data." msgstr "" @@ -226,9 +233,10 @@ msgstr "" "盡可能地縮小檔案大小,你可以\\ :doc:`壓縮 `\\ 封裝的資料。" #: ../../library/pickle.rst:122 +#, fuzzy msgid "" "The module :mod:`pickletools` contains tools for analyzing data streams " -"generated by :mod:`pickle`. :mod:`pickletools` source code has extensive " +"generated by :mod:`!pickle`. :mod:`pickletools` source code has extensive " "comments about opcodes used by pickle protocols." msgstr "" ":mod:`pickletools` 含有工具可分析 :mod:`pickle` 所產生的資料流。:mod:" @@ -305,11 +313,12 @@ msgstr "" # https://1fly2sky.wordpress.com/2016/04/05/%E6%8C%81%E4%B9%85%E5%B1%A4data- # persistence-layer/ #: ../../library/pickle.rst:156 +#, fuzzy msgid "" -"Serialization is a more primitive notion than persistence; although :mod:" -"`pickle` reads and writes file objects, it does not handle the issue of " +"Serialization is a more primitive notion than persistence; although :mod:`!" +"pickle` reads and writes file objects, it does not handle the issue of " "naming persistent objects, nor the (even more complicated) issue of " -"concurrent access to persistent objects. The :mod:`pickle` module can " +"concurrent access to persistent objects. The :mod:`!pickle` module can " "transform a complex object into a byte stream and it can transform the byte " "stream into an object with the same internal structure. Perhaps the most " "obvious thing to do with these byte streams is to write them onto a file, " @@ -343,7 +352,8 @@ msgstr "" "`Unpickler` 物件。" #: ../../library/pickle.rst:176 -msgid "The :mod:`pickle` module provides the following constants:" +#, fuzzy +msgid "The :mod:`!pickle` module provides the following constants:" msgstr ":mod:`pickle` 模組提供以下常數:" #: ../../library/pickle.rst:181 @@ -383,8 +393,9 @@ msgid "The default protocol is 5." msgstr "預設協定是 5。" #: ../../library/pickle.rst:207 +#, fuzzy msgid "" -"The :mod:`pickle` module provides the following functions to make the " +"The :mod:`!pickle` module provides the following functions to make the " "pickling process more convenient:" msgstr ":mod:`pickle` 模組提供下列函式來簡化封裝的過程:" @@ -473,7 +484,8 @@ msgstr "" "class:`Unpickler` 建構式所用的相同。" #: ../../library/pickle.rst:265 -msgid "The :mod:`pickle` module defines three exceptions:" +#, fuzzy +msgid "The :mod:`!pickle` module defines three exceptions:" msgstr ":mod:`pickle` 模組定義了以下三種例外:" #: ../../library/pickle.rst:269 @@ -515,8 +527,9 @@ msgstr "" "ImportError、或 IndexError),請注意。" #: ../../library/pickle.rst:290 +#, fuzzy msgid "" -"The :mod:`pickle` module exports three classes, :class:`Pickler`, :class:" +"The :mod:`!pickle` module exports three classes, :class:`Pickler`, :class:" "`Unpickler` and :class:`PickleBuffer`:" msgstr "" "引入模組 :mod:`pickle` 時會帶來三個類別::class:`Pickler`、:class:" @@ -1363,12 +1376,13 @@ msgid "Persistence of External Objects" msgstr "外部物件持久化" #: ../../library/pickle.rst:763 +#, fuzzy msgid "" -"For the benefit of object persistence, the :mod:`pickle` module supports the " -"notion of a reference to an object outside the pickled data stream. Such " -"objects are referenced by a persistent ID, which should be either a string " -"of alphanumeric characters (for protocol 0) [#]_ or just an arbitrary object " -"(for any newer protocol)." +"For the benefit of object persistence, the :mod:`!pickle` module supports " +"the notion of a reference to an object outside the pickled data stream. " +"Such objects are referenced by a persistent ID, which should be either a " +"string of alphanumeric characters (for protocol 0) [#]_ or just an arbitrary " +"object (for any newer protocol)." msgstr "" "為了方便物件持久化,:mod:`pickle` 模組支援對被封裝資料串流以外的物件參照。被" "參照的物件是透過一個持久化 ID 來參照的,這個 ID 應該要是字母數字字元" @@ -1376,8 +1390,9 @@ msgstr "" "定)。" #: ../../library/pickle.rst:769 +#, fuzzy msgid "" -"The resolution of such persistent IDs is not defined by the :mod:`pickle` " +"The resolution of such persistent IDs is not defined by the :mod:`!pickle` " "module; it will delegate this resolution to the user-defined methods on the " "pickler and unpickler, :meth:`~Pickler.persistent_id` and :meth:`~Unpickler." "persistent_load` respectively." @@ -1926,11 +1941,12 @@ msgid "Out-of-band Buffers" msgstr "帶外(Out-of-band)資料緩衝區" #: ../../library/pickle.rst:963 +#, fuzzy msgid "" -"In some contexts, the :mod:`pickle` module is used to transfer massive " +"In some contexts, the :mod:`!pickle` module is used to transfer massive " "amounts of data. Therefore, it can be important to minimize the number of " "memory copies, to preserve performance and resource consumption. However, " -"normal operation of the :mod:`pickle` module, as it transforms a graph-like " +"normal operation of the :mod:`!pickle` module, as it transforms a graph-like " "structure of objects into a sequential stream of bytes, intrinsically " "involves copying data to and from the pickle stream." msgstr "" @@ -1966,11 +1982,12 @@ msgstr "" "型資料(而非回傳如 :class:`bytes` 物件)。" #: ../../library/pickle.rst:983 +#, fuzzy msgid "" "A :class:`PickleBuffer` object *signals* that the underlying buffer is " "eligible for out-of-band data transfer. Those objects remain compatible " -"with normal usage of the :mod:`pickle` module. However, consumers can also " -"opt-in to tell :mod:`pickle` that they will handle those buffers by " +"with normal usage of the :mod:`!pickle` module. However, consumers can also " +"opt-in to tell :mod:`!pickle` that they will handle those buffers by " "themselves." msgstr "" "一個 :class:`PickleBuffer` 物件\\ *指示*\\ 了當下底層的緩衝區狀態適合進行帶外" @@ -2318,10 +2335,11 @@ msgid "Performance" msgstr "效能" #: ../../library/pickle.rst:1160 +#, fuzzy msgid "" "Recent versions of the pickle protocol (from protocol 2 and upwards) feature " "efficient binary encodings for several common features and built-in types. " -"Also, the :mod:`pickle` module has a transparent optimizer written in C." +"Also, the :mod:`!pickle` module has a transparent optimizer written in C." msgstr "" "較近期的 pickle 協定版本(從 2 版協定開始)為多種常見功能和內建型別提供了高效" "率的二進位編碼。此外,:mod:`pickle` 模組還具備一個透明化的、以 C 語言編寫的最" @@ -2389,7 +2407,7 @@ msgstr "命令列介面" #: ../../library/pickle.rst:1205 msgid "" -"The :mod:`pickle` module can be invoked as a script from the command line, " +"The :mod:`!pickle` module can be invoked as a script from the command line, " "it will display contents of the pickle files. However, when the pickle file " "that you want to examine comes from an untrusted source, ``-m pickletools`` " "is a safer option because it does not execute pickle bytecode, see :ref:" @@ -2430,7 +2448,8 @@ msgid "Module :mod:`shelve`" msgstr ":mod:`shelve` 模組" #: ../../library/pickle.rst:1233 -msgid "Indexed databases of objects; uses :mod:`pickle`." +#, fuzzy +msgid "Indexed databases of objects; uses :mod:`!pickle`." msgstr "索引式資料庫;使用 :mod:`pickle` 實作。" #: ../../library/pickle.rst:1235 diff --git a/library/pickletools.po b/library/pickletools.po index ba82112250..5adef0d3ee 100644 --- a/library/pickletools.po +++ b/library/pickletools.po @@ -8,7 +8,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-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,13 +28,14 @@ msgid "**Source code:** :source:`Lib/pickletools.py`" msgstr "**原始碼:**\\ :source:`Lib/pickletools.py`" #: ../../library/pickletools.rst:13 +#, fuzzy msgid "" "This module contains various constants relating to the intimate details of " "the :mod:`pickle` module, some lengthy comments about the implementation, " "and a few useful functions for analyzing pickled data. The contents of this " -"module are useful for Python core developers who are working on " -"the :mod:`pickle`; ordinary users of the :mod:`pickle` module probably won't " -"find the :mod:`pickletools` module relevant." +"module are useful for Python core developers who are working on the :mod:" +"`pickle`; ordinary users of the :mod:`pickle` module probably won't find " +"the :mod:`!pickletools` module relevant." msgstr "" "該模組包含與 :mod:`pickle` 模組的詳細資訊相關的各種常數、一些有關實作的冗長註" "釋以及一些用於分析已 pickle 資料的有用函式。該模組的內容對於有 :mod:`pickle` " diff --git a/library/platform.po b/library/platform.po index 24e80e0681..82f188b5de 100644 --- a/library/platform.po +++ b/library/platform.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-08 00:15+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2022-06-11 14:03+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -586,7 +586,7 @@ msgstr "命令列用法" #: ../../library/platform.rst:378 msgid "" -":mod:`platform` can also be invoked directly using the :option:`-m` switch " +":mod:`!platform` can also be invoked directly using the :option:`-m` switch " "of the interpreter::" msgstr "" diff --git a/library/poplib.po b/library/poplib.po index e15c5891d0..21fcfb55f4 100644 --- a/library/poplib.po +++ b/library/poplib.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 00:13+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -63,7 +63,7 @@ msgstr "" "availability`。" #: ../../library/poplib.rst:33 -msgid "The :mod:`poplib` module provides two classes:" +msgid "The :mod:`!poplib` module provides two classes:" msgstr "" #: ../../library/poplib.rst:38 @@ -125,7 +125,7 @@ msgid "The deprecated *keyfile* and *certfile* parameters have been removed." msgstr "" #: ../../library/poplib.rst:89 -msgid "One exception is defined as an attribute of the :mod:`poplib` module:" +msgid "One exception is defined as an attribute of the :mod:`!poplib` module:" msgstr "" #: ../../library/poplib.rst:94 diff --git a/library/posix.po b/library/posix.po index 89cb774b4d..aeb660847a 100644 --- a/library/posix.po +++ b/library/posix.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 00:13+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2023-01-24 00:05+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,16 +37,17 @@ msgid "Availability" msgstr "可用性" #: ../../library/posix.rst:18 +#, fuzzy msgid "" "**Do not import this module directly.** Instead, import the module :mod:" "`os`, which provides a *portable* version of this interface. On Unix, the :" -"mod:`os` module provides a superset of the :mod:`posix` interface. On non-" -"Unix operating systems the :mod:`posix` module is not available, but a " +"mod:`os` module provides a superset of the :mod:`!posix` interface. On non-" +"Unix operating systems the :mod:`!posix` module is not available, but a " "subset is always available through the :mod:`os` interface. Once :mod:`os` " -"is imported, there is *no* performance penalty in using it instead of :mod:" -"`posix`. In addition, :mod:`os` provides some additional functionality, " -"such as automatically calling :func:`~os.putenv` when an entry in ``os." -"environ`` is changed." +"is imported, there is *no* performance penalty in using it instead of :mod:`!" +"posix`. In addition, :mod:`os` provides some additional functionality, such " +"as automatically calling :func:`~os.putenv` when an entry in ``os.environ`` " +"is changed." msgstr "" "**不要直接引入此模組。**\\ 請改為引入 :mod:`os` 模組,它提供了此介面的\\ *可" "移植 (portable)* 版本。在 Unix 上,:mod:`os` 模組提供了 :mod:`posix` 介面的超" @@ -120,9 +121,10 @@ msgid "Notable Module Contents" msgstr "值得注意的模組內容" #: ../../library/posix.rst:69 +#, fuzzy msgid "" "In addition to many functions described in the :mod:`os` module " -"documentation, :mod:`posix` defines the following data item:" +"documentation, :mod:`!posix` defines the following data item:" msgstr "" "除了 :mod:`os` 模組說明文件中描述的許多函式外,:mod:`posix` 還定義了以下資料" "項目:" @@ -156,12 +158,13 @@ msgid "On Unix, keys and values are bytes." msgstr "在 Unix 上,鍵和值是位元組。" #: ../../library/posix.rst:90 +#, fuzzy msgid "" "The :mod:`os` module provides an alternate implementation of ``environ`` " "which updates the environment on modification. Note also that updating :data:" "`os.environ` will render this dictionary obsolete. Use of the :mod:`os` " -"module version of this is recommended over direct access to the :mod:`posix` " -"module." +"module version of this is recommended over direct access to the :mod:`!" +"posix` module." msgstr "" ":mod:`os` 模組提供了 ``environ`` 的替代實作,會在修改時更新環境。另請注意,更" "新 :data:`os.environ` 將使該字典變成過時的。建議使用 :mod:`os` 模組版本,而不" diff --git a/library/pprint.po b/library/pprint.po index 324d72d73a..c5a5f8e1ff 100644 --- a/library/pprint.po +++ b/library/pprint.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-13 00:14+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,8 +27,8 @@ msgstr "**原始碼:**\\ :source:`Lib/pprint.py`" #: ../../library/pprint.rst:14 msgid "" -"The :mod:`pprint` module provides a capability to \"pretty-print\" arbitrary " -"Python data structures in a form which can be used as input to the " +"The :mod:`!pprint` module provides a capability to \"pretty-print\" " +"arbitrary Python data structures in a form which can be used as input to the " "interpreter. If the formatted structures include objects which are not " "fundamental Python types, the representation may not be loadable. This may " "be the case if objects such as files, sockets or classes are included, as " diff --git a/library/pty.po b/library/pty.po index 36287eab34..598fd5aa62 100644 --- a/library/pty.po +++ b/library/pty.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 00:13+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2016-11-19 00:33+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/pty.py`" #: ../../library/pty.rst:15 msgid "" -"The :mod:`pty` module defines operations for handling the pseudo-terminal " +"The :mod:`!pty` module defines operations for handling the pseudo-terminal " "concept: starting another process and being able to write to and read from " "its controlling terminal programmatically." msgstr "" @@ -44,7 +44,8 @@ msgid "" msgstr "" #: ../../library/pty.rst:25 -msgid "The :mod:`pty` module defines the following functions:" +#, fuzzy +msgid "The :mod:`!pty` module defines the following functions:" msgstr ":mod:`pty` 模組定義了以下函式:" #: ../../library/pty.rst:30 diff --git a/library/py_compile.po b/library/py_compile.po index 993a79112b..7ab3b0d0e9 100644 --- a/library/py_compile.po +++ b/library/py_compile.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-09 00:03+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/py_compile.py`" #: ../../library/py_compile.rst:16 msgid "" -"The :mod:`py_compile` module provides a function to generate a byte-code " +"The :mod:`!py_compile` module provides a function to generate a byte-code " "file from a source file, and another function used when the module source " "file is invoked as a script." msgstr "" diff --git a/library/pyclbr.po b/library/pyclbr.po index d7edc9beae..f899c86a30 100644 --- a/library/pyclbr.po +++ b/library/pyclbr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-09 00:03+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2025-07-09 13:16+0800\n" "Last-Translator: Weilin Du <1372449351@qq.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,8 +28,9 @@ msgid "**Source code:** :source:`Lib/pyclbr.py`" msgstr "**原始碼:**\\ :source:`Lib/pyclbr.py`" #: ../../library/pyclbr.rst:13 +#, fuzzy msgid "" -"The :mod:`pyclbr` module provides limited information about the functions, " +"The :mod:`!pyclbr` module provides limited information about the functions, " "classes, and methods defined in a Python-coded module. The information is " "sufficient to implement a module browser. The information is extracted from " "the Python source code rather than by importing the module, so this module " @@ -37,8 +38,8 @@ msgid "" "use this module with modules not implemented in Python, including all " "standard and optional extension modules." msgstr "" -":mod:`pyclbr` 模組可以提供一個使用 Python 編寫的模組中定義的函式、類別和方法的" -"有限資訊。這些資訊足以實作一個模組瀏覽器。這些資訊是從 Python 原始碼中抽取" +":mod:`pyclbr` 模組可以提供一個使用 Python 編寫的模組中定義的函式、類別和方法" +"的有限資訊。這些資訊足以實作一個模組瀏覽器。這些資訊是從 Python 原始碼中抽取" "出來的,而不是透過引入模組,因此這個模組可以安全地與不信任的程式碼一起使用。" "此限制使得此模組無法與非 Python 實作的模組一起使用,包括所有標準與可選的擴充" "模組。" @@ -52,17 +53,18 @@ msgid "" "paths prepended to ``sys.path``, which is used to locate the module source " "code." msgstr "" -"回傳模組層級的類別名稱與類別描述器對應的字典。如果可能的話,會包含引入基底類別" -"的描述器。參數 *module* 是包含要讀取的模組名稱的字串;它可以是套件中的模組" -"名稱。如果給定,*path* 是以 ``sys.path`` 為前綴的目錄路徑序列,用來定位模組" -"原始碼。" +"回傳模組層級的類別名稱與類別描述器對應的字典。如果可能的話,會包含引入基底類" +"別的描述器。參數 *module* 是包含要讀取的模組名稱的字串;它可以是套件中的模組" +"名稱。如果給定,*path* 是以 ``sys.path`` 為前綴的目錄路徑序列,用來定位模組原" +"始碼。" #: ../../library/pyclbr.rst:32 msgid "" "This function is the original interface and is only kept for back " "compatibility. It returns a filtered version of the following." msgstr "" -"此函式為原始介面,僅保留用於向後相容性。它回傳的會是 readmodule_ex 回傳結果的篩選後版本。" +"此函式為原始介面,僅保留用於向後相容性。它回傳的會是 readmodule_ex 回傳結果的" +"篩選後版本。" #: ../../library/pyclbr.rst:38 msgid "" @@ -75,28 +77,28 @@ msgid "" "read is a package, the returned dictionary has a key ``'__path__'`` whose " "value is a list containing the package search path." msgstr "" -"回傳一個以字典為基礎的樹狀結構,包含在模組中以 ``def`` 或 ``class`` 陳述式定義的每" -"個函式和類別的函式或類別描述器。回傳的字典會將模組層級的函式和類別名稱對映" -"到它們的描述器。巢狀物件會輸入其父物件的子字典。與 readmodule 一樣," -"*module* 會指定要讀取的模組,而 *path* 則會預先加入 sys.path。如果要讀取的" -"模組是一個套件,回傳的字典有一個 key ``'__path__'``,其值是一個包含套件搜尋路" -"徑的串列。" +"回傳一個以字典為基礎的樹狀結構,包含在模組中以 ``def`` 或 ``class`` 陳述式定" +"義的每個函式和類別的函式或類別描述器。回傳的字典會將模組層級的函式和類別名稱" +"對映到它們的描述器。巢狀物件會輸入其父物件的子字典。與 readmodule 一樣," +"*module* 會指定要讀取的模組,而 *path* 則會預先加入 sys.path。如果要讀取的模" +"組是一個套件,回傳的字典有一個 key ``'__path__'``,其值是一個包含套件搜尋路徑" +"的串列。" #: ../../library/pyclbr.rst:48 msgid "" "Descriptors for nested definitions. They are accessed through the new " "children attribute. Each has a new parent attribute." msgstr "" -"巢狀定義(nested definitions)的描述器。這些描述器可透過新的子屬性" -"來存取。每個描述器都有一個新的父屬性。" +"巢狀定義(nested definitions)的描述器。這些描述器可透過新的子屬性來存取。每" +"個描述器都有一個新的父屬性。" #: ../../library/pyclbr.rst:52 msgid "" "The descriptors returned by these functions are instances of Function and " "Class classes. Users are not expected to create instances of these classes." msgstr "" -"這些函式所回傳的描述器是 Function 和 Class 類別的實例。使用者不需要建立這些" -"類別的實例。" +"這些函式所回傳的描述器是 Function 和 Class 類別的實例。使用者不需要建立這些類" +"別的實例。" #: ../../library/pyclbr.rst:60 msgid "Function Objects" @@ -154,8 +156,8 @@ msgid "" "statements. They have the same attributes as :class:`Functions ` " "and two more." msgstr "" -"Class :class:`!Class` 實例描述由 class 陳述式定義的類別。它們具有" -"與 :class:`Functions ` 相同的屬性,以及另外兩個屬性。" +"Class :class:`!Class` 實例描述由 class 陳述式定義的類別。它們具有與 :class:" +"`Functions ` 相同的屬性,以及另外兩個屬性。" #: ../../library/pyclbr.rst:125 msgid "Name of the file in which the class is defined." @@ -185,9 +187,9 @@ msgid "" "which are not discoverable by :func:`readmodule_ex` are listed as a string " "with the class name instead of as :class:`!Class` objects." msgstr "" -"描述被描述類別的直接基底類別的 :class:`!Class` 物件串列。被命名為超類別(superclasses" -")但無法被 :func:`readmodule_ex` 發現的類別會以類別名稱的字串形式列出,而不是 :class:`!" -"Class` 物件。" +"描述被描述類別的直接基底類別的 :class:`!Class` 物件串列。被命名為超類別" +"(superclasses)但無法被 :func:`readmodule_ex` 發現的類別會以類別名稱的字串形" +"式列出,而不是 :class:`!Class` 物件。" #: ../../library/pyclbr.rst:169 msgid "" @@ -195,5 +197,5 @@ msgid "" "be derived from the newer :attr:`children` dictionary, but remains for back-" "compatibility." msgstr "" -"一個 :class:`dictionary ` 方法名稱對應到行號。這可以從較新" -"的 :attr:`children` 字典衍生出來,但為了向後相容性而保留。" +"一個 :class:`dictionary ` 方法名稱對應到行號。這可以從較新的 :attr:" +"`children` 字典衍生出來,但為了向後相容性而保留。" diff --git a/library/pyexpat.po b/library/pyexpat.po index e77981aa3e..f856dcce05 100644 --- a/library/pyexpat.po +++ b/library/pyexpat.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-06 00:14+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,7 +29,7 @@ msgstr "如果你需要剖析不受信任或未經驗證的資料,請參閱 :r #: ../../library/pyexpat.rst:27 msgid "" -"The :mod:`xml.parsers.expat` module is a Python interface to the Expat non-" +"The :mod:`!xml.parsers.expat` module is a Python interface to the Expat non-" "validating XML parser. The module provides a single extension type, :class:" "`xmlparser`, that represents the current state of an XML parser. After an :" "class:`xmlparser` object has been created, various attributes of the object " @@ -63,7 +63,8 @@ msgid "The type of the return values from the :func:`ParserCreate` function." msgstr "" #: ../../library/pyexpat.rst:58 -msgid "The :mod:`xml.parsers.expat` module contains two functions:" +#, fuzzy +msgid "The :mod:`!xml.parsers.expat` module contains two functions:" msgstr ":mod:`xml.parsers.expat` 模組包含兩個函式:" #: ../../library/pyexpat.rst:63 @@ -977,7 +978,7 @@ msgstr "" msgid "" "An operation was requested that requires DTD support to be compiled in, but " "Expat was configured without DTD support. This should never be reported by " -"a standard build of the :mod:`xml.parsers.expat` module." +"a standard build of the :mod:`!xml.parsers.expat` module." msgstr "" #: ../../library/pyexpat.rst:912 diff --git a/library/queue.po b/library/queue.po index e3cb8bdd91..5089bb79cc 100644 --- a/library/queue.po +++ b/library/queue.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-07 00:14+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2022-09-27 00:12+0800\n" "Last-Translator: Allen Wu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,9 +30,10 @@ msgid "**Source code:** :source:`Lib/queue.py`" msgstr "**原始碼:**\\ :source:`Lib/queue.py`" #: ../../library/queue.rst:11 +#, fuzzy msgid "" -"The :mod:`queue` module implements multi-producer, multi-consumer queues. It " -"is especially useful in threaded programming when information must be " +"The :mod:`!queue` module implements multi-producer, multi-consumer queues. " +"It is especially useful in threaded programming when information must be " "exchanged safely between multiple threads. The :class:`Queue` class in this " "module implements all the required locking semantics." msgstr "" @@ -75,7 +76,8 @@ msgstr "" "別 :class:`SimpleQueue`,其特定的實作是以較少的功能為代價,來提供額外的保證。" #: ../../library/queue.rst:33 -msgid "The :mod:`queue` module defines the following classes and exceptions:" +#, fuzzy +msgid "The :mod:`!queue` module defines the following classes and exceptions:" msgstr ":mod:`queue` module 定義了以下的 class 和例外:" #: ../../library/queue.rst:37 diff --git a/library/random.po b/library/random.po index 79fa2f6ff0..03e5d64efe 100644 --- a/library/random.po +++ b/library/random.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-13 03:09+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2025-03-07 19:17+0800\n" "Last-Translator: Dr.XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -93,10 +93,11 @@ msgstr "" "(subclass)。有關詳細資訊,請參考該類別的文件。" #: ../../library/random.rst:40 +#, fuzzy msgid "" -"The :mod:`random` module also provides the :class:`SystemRandom` class which " -"uses the system function :func:`os.urandom` to generate random numbers from " -"sources provided by the operating system." +"The :mod:`!random` module also provides the :class:`SystemRandom` class " +"which uses the system function :func:`os.urandom` to generate random numbers " +"from sources provided by the operating system." msgstr "" ":mod:`random` module 也提供了 :class:`SystemRandom` class,使用系統函式 :" "func:`os.urandom` 從作業系統提供的來源產生隨機數。" @@ -665,9 +666,10 @@ msgid "Alternative Generator" msgstr "替代產生器" #: ../../library/random.rst:412 +#, fuzzy msgid "" "Class that implements the default pseudo-random number generator used by " -"the :mod:`random` module." +"the :mod:`!random` module." msgstr "實現 :mod:`random` 模組使用的預設偽隨機數產生器的 class。" #: ../../library/random.rst:415 diff --git a/library/re.po b/library/re.po index bbcadef1fa..eaef1de1f0 100644 --- a/library/re.po +++ b/library/re.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-02-07 00:19+0000\n" "PO-Revision-Date: 2023-09-16 14:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,12 +35,12 @@ msgstr "此模組提供類似於 Perl 中正規表示式的匹配操作。" #: ../../library/re.rst:17 msgid "" -"Both patterns and strings to be searched can be Unicode strings " -"(:class:`str`) as well as 8-bit strings (:class:`bytes`). However, Unicode " -"strings and 8-bit strings cannot be mixed: that is, you cannot match a " -"Unicode string with a bytes pattern or vice-versa; similarly, when asking " -"for a substitution, the replacement string must be of the same type as both " -"the pattern and the search string." +"Both patterns and strings to be searched can be Unicode strings (:class:" +"`str`) as well as 8-bit strings (:class:`bytes`). However, Unicode strings " +"and 8-bit strings cannot be mixed: that is, you cannot match a Unicode " +"string with a bytes pattern or vice-versa; similarly, when asking for a " +"substitution, the replacement string must be of the same type as both the " +"pattern and the search string." msgstr "" "被搜尋的模式 (pattern) 與字串可以是 Unicode 字串 (:class:`str`),也可以是 8-" "bit 字串 (:class:`bytes`)。然而,Unicode 字串和 8-bit 字串不能混用:也就是," @@ -62,9 +62,9 @@ msgid "" "even if it is a valid escape sequence for a regular expression." msgstr "" "正規表示式使用反斜線字元 (``'\\'``) 表示特別的形式,或是使用特殊字元而不觸發" -"它們的特殊意義。這與 Python 在字串文本 (literal) 中,為了相同目的使用同一個" -"字元的做法相衝突;舉例來說,為了匹配一個反斜線字面值,可能需要寫 ``'\\\\" -"\\\\'`` 當作模式字串,因為正規表示式必須是 ``\\\\``,而且每個反斜線在一個普通" +"它們的特殊意義。這與 Python 在字串文本 (literal) 中,為了相同目的使用同一個字" +"元的做法相衝突;舉例來說,為了匹配一個反斜線字面值,可能需要寫 ``'\\\\\\" +"\\'`` 當作模式字串,因為正規表示式必須是 ``\\\\``,而且每個反斜線在一個普通" "的 Python 字串文本中必須表示為 ``\\\\``。另外,請注意在 Python 的字串文本中使" "用反斜線的任何無效跳脫序列目前會產生一個 :exc:`SyntaxWarning`,而在未來這會變" "成一個 :exc:`SyntaxError`。儘管它對正規表示式是一個有效的跳脫序列,這種行為也" @@ -96,10 +96,11 @@ msgstr "" "要先編譯一個正規表示式物件,但是會缺少一些微調參數。" #: ../../library/re.rst:51 +#, fuzzy msgid "" "The third-party :pypi:`regex` module, which has an API compatible with the " -"standard library :mod:`re` module, but offers additional functionality and a " -"more thorough Unicode support." +"standard library :mod:`!re` module, but offers additional functionality and " +"a more thorough Unicode support." msgstr "" "第三方的 :pypi:`regex` 模組,有著和標準函式庫 :mod:`re` 模組相容的 API,但是" "提供額外的功能以及更完整的 Unicode 支援。" @@ -134,11 +135,11 @@ msgid "" msgstr "" "正規表示式可以被連接 (concatenated) 成新的正規表示式;如果 *A* 和 *B* 都是正" "規表示式,則 *AB* 也是一個正規表示式。一般來說,如果一個字串 *p* 與 *A* 匹" -"配,並且另一個字串 *q* 與 *B* 匹配,則字串 *pq* 會匹配 AB。或:這在以下情況下不成立:*A*或 *B* 包" -"含低優先順序的運算子;或 *A* 和 *B* 之間的邊界條件 (boundary conditions);或" -"是有編號群組 (numbered group) 的參照。因此,複雜的正規表示式" -"可以輕鬆地從此處提到的簡單原始正規表示式建立。關於正規表示式的理論和實作,請" -"參考 Friedl 書 [Frie09]_,或任何有關建構編譯器的書籍。" +"配,並且另一個字串 *q* 與 *B* 匹配,則字串 *pq* 會匹配 AB。或:這在以下情況下" +"不成立:*A*或 *B* 包含低優先順序的運算子;或 *A* 和 *B* 之間的邊界條件 " +"(boundary conditions);或是有編號群組 (numbered group) 的參照。因此,複雜的正" +"規表示式可以輕鬆地從此處提到的簡單原始正規表示式建立。關於正規表示式的理論和" +"實作,請參考 Friedl 書 [Frie09]_,或任何有關建構編譯器的書籍。" #: ../../library/re.rst:76 msgid "" @@ -146,8 +147,8 @@ msgid "" "further information and a gentler presentation, consult the :ref:`regex-" "howto`." msgstr "" -"一個簡短的正規表示式格式解釋如下。如需更多資訊或以較平易的方式了解,請參" -"閱 :ref:`regex-howto`。" +"一個簡短的正規表示式格式解釋如下。如需更多資訊或以較平易的方式了解,請參閱 :" +"ref:`regex-howto`。" #: ../../library/re.rst:79 msgid "" @@ -160,8 +161,8 @@ msgid "" msgstr "" "正規表示式可以包含特殊和一般字元。大多數一般字元,如 ``'A'``、``'a'`` 或 " "``'0'`` 是最簡單的正規表示式;它們只匹配它們自己。你可以連接一般字元,讓 " -"``last`` 匹配字串 ``'last'``。(在本節的其餘部分,我們會用通常沒有引號的 " -"``這種特殊樣式`` 來書寫正規表示式,而被匹配的字串會 ``'在單引號中'``。)" +"``last`` 匹配字串 ``'last'``。(在本節的其餘部分,我們會用通常沒有引號的 ``這" +"種特殊樣式`` 來書寫正規表示式,而被匹配的字串會 ``'在單引號中'``。)" #: ../../library/re.rst:86 msgid "" @@ -169,8 +170,8 @@ msgid "" "either stand for classes of ordinary characters, or affect how the regular " "expressions around them are interpreted." msgstr "" -"某些字元是特殊的,像 ``'|'`` 或 ``'('``。特殊字元會代表一般字元的類別,或是" -"會影響它們周圍正規表示式的解讀方法。" +"某些字元是特殊的,像 ``'|'`` 或 ``'('``。特殊字元會代表一般字元的類別,或是會" +"影響它們周圍正規表示式的解讀方法。" #: ../../library/re.rst:90 msgid "" @@ -182,9 +183,9 @@ msgid "" "``'a'`` characters." msgstr "" "重複運算子或量詞 (quantifiers)(``*``, ``+``, ``?``, ``{m,n}`` 等)不能直接嵌" -"套使用。這樣避免了和非貪婪修飾符號後綴 ``?`` 和其他實作中的修飾符號的模糊性。要在" -"一個重複正規表示式內添加第二個重複,可以使用括號。例如:正規表示式 " -"``(?:a{6})*`` 會匹配任何六的倍數個 ``a`` 字元。" +"套使用。這樣避免了和非貪婪修飾符號後綴 ``?`` 和其他實作中的修飾符號的模糊性。" +"要在一個重複正規表示式內添加第二個重複,可以使用括號。例如:正規表示式 ``(?:" +"a{6})*`` 會匹配任何六的倍數個 ``a`` 字元。" #: ../../library/re.rst:97 msgid "The special characters are:" @@ -200,9 +201,9 @@ msgid "" "If the :const:`DOTALL` flag has been specified, this matches any character " "including a newline. ``(?s:.)`` matches any character regardless of flags." msgstr "" -"(點) 在預設模式下,這會匹配除換行符號外的任何字元。如果指定" -"了 :const:`DOTALL` 旗標,這會匹配包含換行符號的任何字元。無論旗標為何,``(?" -"s:.)`` 都會匹配任何字元。" +"(點) 在預設模式下,這會匹配除換行符號外的任何字元。如果指定了 :const:" +"`DOTALL` 旗標,這會匹配包含換行符號的任何字元。無論旗標為何,``(?s:.)`` 都會" +"匹配任何字元。" #: ../../library/re.rst:108 msgid "``^``" @@ -213,8 +214,8 @@ msgid "" "(Caret.) Matches the start of the string, and in :const:`MULTILINE` mode " "also matches immediately after each newline." msgstr "" -"(插入符號) 會匹配字串的開頭,並且在 :const:`MULTILINE` 模式下,也會立即匹配" -"緊接在每個換行符號之後的位置。" +"(插入符號) 會匹配字串的開頭,並且在 :const:`MULTILINE` 模式下,也會立即匹" +"配緊接在每個換行符號之後的位置。" #: ../../library/re.rst:114 msgid "``$``" @@ -226,10 +227,10 @@ msgid "" "string, and in :const:`MULTILINE` mode also matches before a newline. " "``foo`` matches both 'foo' and 'foobar', while the regular expression " "``foo$`` matches only 'foo'. More interestingly, searching for ``foo.$`` in " -"``'foo1\\nfoo2\\n'`` matches 'foo2' normally, but 'foo1' " -"in :const:`MULTILINE` mode; searching for a single ``$`` in ``'foo\\n'`` " -"will find two (empty) matches: one just before the newline, and one at the " -"end of the string." +"``'foo1\\nfoo2\\n'`` matches 'foo2' normally, but 'foo1' in :const:" +"`MULTILINE` mode; searching for a single ``$`` in ``'foo\\n'`` will find two " +"(empty) matches: one just before the newline, and one at the end of the " +"string." msgstr "" "匹配字串的結尾或是字串結尾的換行符號之前,並且在 :const:`MULTILINE` 模式下會" "匹配換行符號之前的位置。``foo`` 會匹配 'foo' 和 'foobar',而正規表示式 " @@ -261,8 +262,8 @@ msgid "" "``ab+`` will match 'a' followed by any non-zero number of 'b's; it will not " "match just 'a'." msgstr "" -"使得到的正規表示式匹配前面正規表示式的 1 或多次的重複。``ab+`` 會匹配後" -"面跟著任何非零數量個 'b' 的 'a';它不會匹配 'a'。" +"使得到的正規表示式匹配前面正規表示式的 1 或多次的重複。``ab+`` 會匹配後面跟著" +"任何非零數量個 'b' 的 'a';它不會匹配 'a'。" #: ../../library/re.rst:139 msgid "``?``" @@ -293,9 +294,9 @@ msgstr "" "量詞 (quantifier) ``'*'``、``'+'`` 和 ``'?'`` 都是 :dfn:`greedy`\\ (貪婪" "的);它們會盡可能地匹配更多文字。有時候這種行為不是預期的;如果正規表示式 " "``<.*>`` 被用來匹配 ``' b '``,它會匹配整個字串,而不只是 ``''``。在" -"量詞後添加 ``?`` 會讓他以 :dfn:`non-greedy`\\ (非貪婪的)" -"或 :dfn:`minimal`\\ (最小的)方式進行匹配;盡可能匹配\\ *更少*\\ 的字元。使用" -"正規表示式 ``<.*?>`` 只會匹配到 ``''``。" +"量詞後添加 ``?`` 會讓他以 :dfn:`non-greedy`\\ (非貪婪的)或 :dfn:" +"`minimal`\\ (最小的)方式進行匹配;盡可能匹配\\ *更少*\\ 的字元。使用正規表" +"示式 ``<.*?>`` 只會匹配到 ``''``。" #: ../../library/re.rst:162 msgid "``*+``, ``++``, ``?+``" @@ -317,11 +318,11 @@ msgid "" "``x*+``, ``x++`` and ``x?+`` are equivalent to ``(?>x*)``, ``(?>x+)`` and " "``(?>x?)`` correspondingly." msgstr "" -"類似於量詞 ``'*'``、``'+'`` 和 ``'?'``,添加了 ``'+'`` 的量詞也會盡可能多次" -"的匹配。然而,不同於真正的貪婪量詞,這些量詞在接續的正規表示式匹配失敗時不允" -"許回溯 (back-tracking)。這些量詞被稱為 :dfn:`possessive` (佔有的)量詞。例" -"如,``a*a`` 會匹配 ``'aaaa'``,因為 ``a*`` 會匹配全部 4 個 ``'a'``,但是在遇" -"到最後的 ``'a'`` 時,此正規表示式會回溯,以讓 ``a*`` 最終可以總共匹配 3 個 " +"類似於量詞 ``'*'``、``'+'`` 和 ``'?'``,添加了 ``'+'`` 的量詞也會盡可能多次的" +"匹配。然而,不同於真正的貪婪量詞,這些量詞在接續的正規表示式匹配失敗時不允許" +"回溯 (back-tracking)。這些量詞被稱為 :dfn:`possessive` (佔有的)量詞。例如," +"``a*a`` 會匹配 ``'aaaa'``,因為 ``a*`` 會匹配全部 4 個 ``'a'``,但是在遇到最" +"後的 ``'a'`` 時,此正規表示式會回溯,以讓 ``a*`` 最終可以總共匹配 3 個 " "``'a'``,而第四個 ``'a'`` 會被最後的 ``'a'`` 匹配。然而,當 ``a*+a`` 被用來匹" "配 ``'aaaa'`` 時, ``a*+`` 會匹配全部 4 個 ``'a'``,但是當最終的 ``'a'`` 在尋" "找更多字元匹配失敗時,此正規表示式不能回溯並會因此匹配失敗。``x*+``、``x++`` " @@ -374,8 +375,9 @@ msgid "" "while ``a{3,5}?`` will only match 3 characters." msgstr "" "使得到的正規表示式重複匹配前面的正規表示式 *m* 到 *n* 次,嘗試盡可能\\ *更少" -"*\\ 次的匹配。這是上一個量詞的非貪婪版本。例如,對六個字元的字串 ``'aaaaaa'``," -"``a{3,5}`` 會匹配 5 個 ``'a'`` 字元,而 ``a{3,5}?`` 只會匹配 3 個字元。" +"*\\ 次的匹配。這是上一個量詞的非貪婪版本。例如,對六個字元的字串 " +"``'aaaaaa'``,``a{3,5}`` 會匹配 5 個 ``'a'`` 字元,而 ``a{3,5}?`` 只會匹配 3 " +"個字元。" #: ../../library/re.rst:205 msgid "``{m,n}+``" @@ -393,12 +395,12 @@ msgid "" "backtracking and then the final 2 ``'a'``\\ s are matched by the final " "``aa`` in the pattern. ``x{m,n}+`` is equivalent to ``(?>x{m,n})``." msgstr "" -"使得到的正規表示式重複匹配前面的正規表示式 *m* 到 *n* 次,並嘗試盡可能更多次的" -"匹配而\\ *不*\\ 建立任何回溯點。這是上述量詞的佔有版本。例如,對六個字元的字串 " -"``'aaaaaa'``,``a{3,5}+aa`` 嘗試匹配 5 個 ``'a'`` 字元,然後需要再 2 個 " +"使得到的正規表示式重複匹配前面的正規表示式 *m* 到 *n* 次,並嘗試盡可能更多次" +"的匹配而\\ *不*\\ 建立任何回溯點。這是上述量詞的佔有版本。例如,對六個字元的" +"字串 ``'aaaaaa'``,``a{3,5}+aa`` 嘗試匹配 5 個 ``'a'`` 字元,然後需要再 2 個 " "``'a'``,會需要比可用的字元更多所以失敗,而 ``a{3,5}aa`` 會捕捉到 5 個 " -"``'a'``,然後回溯成 4 個 ``'a'``,接著最後兩個 ``'a'`` 會被模式中最後的 ``aa`` 匹" -"配。``x{m,n}+`` 等同於 ``(?>x{m,n})``。" +"``'a'``,然後回溯成 4 個 ``'a'``,接著最後兩個 ``'a'`` 會被模式中最後的 " +"``aa`` 匹配。``x{m,n}+`` 等同於 ``(?>x{m,n})``。" #: ../../library/re.rst:222 msgid "``\\``" @@ -453,10 +455,10 @@ msgid "" "``-`` is escaped (e.g. ``[a\\-z]``) or if it's placed as the first or last " "character (e.g. ``[-a]`` or ``[a-]``), it will match a literal ``'-'``." msgstr "" -"可以透過給定兩個字元並且使用 ``'-'`` 分隔它們來表示一個範圍的字元,例如 " -"``[a-z]`` 會匹配任何 ASCII 小寫字母,``[0-5][0-9]`` 會匹配所有從 ``00`` 到 " -"``59`` 的兩位數字,而 ``[0-9A-Fa-f]`` 會匹配任何十六進位數字。如果 ``-`` 被跳" -"脫了(如: ``[a\\-z]``) 或是放在第一或最後一個位置(如: ``[-a]`` 或 " +"可以透過給定兩個字元並且使用 ``'-'`` 分隔它們來表示一個範圍的字元,例如 ``[a-" +"z]`` 會匹配任何 ASCII 小寫字母,``[0-5][0-9]`` 會匹配所有從 ``00`` 到 ``59`` " +"的兩位數字,而 ``[0-9A-Fa-f]`` 會匹配任何十六進位數字。如果 ``-`` 被跳脫了" +"(如: ``[a\\-z]``) 或是放在第一或最後一個位置(如: ``[-a]`` 或 " "``[a-]``),它將會匹配字面的 ``'-'``。" #: ../../library/re.rst:253 @@ -479,26 +481,26 @@ msgid "" "not group references. Special sequences which do not match a single " "character such as ``\\A`` and ``\\z`` are not allowed." msgstr "" -"反斜線可能用於跳脫集合內具有特殊意義的字元,像是 ``'-'``、``']'``、``'^'`` 和 ``'\\" -"\\'`` 本身,或是表示一個代表單一字元的特殊序列,像是 ``\\xa0`` 或 ``\\n`` 或" -"一個字元類別,如 ``\\w`` 或 ``\\S``\\(定義如下)。請注意,``\\b`` 代表單一" -"個 \"backspace\" 字元,而不是在集合外代表的字元邊界,且像是 ``\\1`` 的數值跳脫" -"總是代表八進位數字的跳脫,而不是群組的參照。不匹配單一字元的特殊序列是不被允許的,像是 " -"``\\A`` 和 ``\\Z``。" +"反斜線可能用於跳脫集合內具有特殊意義的字元,像是 ``'-'``、``']'``、``'^'`` " +"和 ``'\\\\'`` 本身,或是表示一個代表單一字元的特殊序列,像是 ``\\xa0`` 或 " +"``\\n`` 或一個字元類別,如 ``\\w`` 或 ``\\S``\\(定義如下)。請注意,``\\b`` " +"代表單一個 \"backspace\" 字元,而不是在集合外代表的字元邊界,且像是 ``\\1`` " +"的數值跳脫總是代表八進位數字的跳脫,而不是群組的參照。不匹配單一字元的特殊序" +"列是不被允許的,像是 ``\\A`` 和 ``\\Z``。" #: ../../library/re.rst:273 msgid "" -"Characters that are not within a range can be matched " -"by :dfn:`complementing` the set. If the first character of the set is " -"``'^'``, all the characters that are *not* in the set will be matched. For " -"example, ``[^5]`` will match any character except ``'5'``, and ``[^^]`` will " -"match any character except ``'^'``. ``^`` has no special meaning if it's " -"not the first character in the set." +"Characters that are not within a range can be matched by :dfn:" +"`complementing` the set. If the first character of the set is ``'^'``, all " +"the characters that are *not* in the set will be matched. For example, " +"``[^5]`` will match any character except ``'5'``, and ``[^^]`` will match " +"any character except ``'^'``. ``^`` has no special meaning if it's not the " +"first character in the set." msgstr "" -"不在範圍內的字元可以透過取集合的\\ :dfn:`補集 (complement) ` 匹配。如果集合中的第一個字元" -"是 ``'^'``,所有\\ *不*\\ 在集合內的字元都會被匹配。例如, ``[^5]`` 會匹配任" -"何除了 ``'5'`` 的字元,而 ``[^^]`` 會匹配任何除了 ``'^'`` 的字元。如果 ``^`` " -"不是集合中的第一個字元的話,沒有特殊意義。" +"不在範圍內的字元可以透過取集合的\\ :dfn:`補集 (complement) ` " +"匹配。如果集合中的第一個字元是 ``'^'``,所有\\ *不*\\ 在集合內的字元都會被匹" +"配。例如, ``[^5]`` 會匹配任何除了 ``'5'`` 的字元,而 ``[^^]`` 會匹配任何除" +"了 ``'^'`` 的字元。如果 ``^`` 不是集合中的第一個字元的話,沒有特殊意義。" #: ../../library/re.rst:280 msgid "" @@ -520,18 +522,18 @@ msgid "" "or containing literal character sequences ``'--'``, ``'&&'``, ``'~~'``, and " "``'||'``. To avoid a warning escape them with a backslash." msgstr "" -"未來可能會支援 `Unicode Technical Standard #18`_ 中的嵌套集合與集合操作" -"。這會改變語法,所以為了促進這個改變,暫時會在模糊的情況下引" -"發 :exc:`FutureWarning`。包含了以字面 ``'['`` 開頭,或是包含字面的字元序列 " -"``'--'``、``'&&'``、``'~~'`` 和 ``'||'`` 的集合。為了避免警告,請用反斜線跳脫" -"它們。" +"未來可能會支援 `Unicode Technical Standard #18`_ 中的嵌套集合與集合操作。這會" +"改變語法,所以為了促進這個改變,暫時會在模糊的情況下引發 :exc:" +"`FutureWarning`。包含了以字面 ``'['`` 開頭,或是包含字面的字元序列 ``'--'``、" +"``'&&'``、``'~~'`` 和 ``'||'`` 的集合。為了避免警告,請用反斜線跳脫它們。" #: ../../library/re.rst:300 msgid "" ":exc:`FutureWarning` is raised if a character set contains constructs that " "will change semantically in the future." msgstr "" -"如果一個字元集合包含了其語義未來會被改變的結構,:exc:`FutureWarning` 會被引發。" +"如果一個字元集合包含了其語義未來會被改變的結構,:exc:`FutureWarning` 會被引" +"發。" #: ../../library/re.rst:306 msgid "``|``" @@ -571,9 +573,9 @@ msgid "" "character class: ``[(]``, ``[)]``." msgstr "" "匹配括號中的任何正規表示式,並且表示一個群組的開始和結束;群組的內容可以在執" -"行匹配後取得,並且在後續的字串可以使用 ``\\number`` 特殊序列來匹配,如下所述。" -"要匹配字面的 ``'('`` 或 ``')'``,用 ``\\(`` 或 ``\\)``,或是將它們包圍在一個" -"字元類別中: ``[(``、``[)]``。" +"行匹配後取得,並且在後續的字串可以使用 ``\\number`` 特殊序列來匹配,如下所" +"述。要匹配字面的 ``'('`` 或 ``')'``,用 ``\\(`` 或 ``\\)``,或是將它們包圍在" +"一個字元類別中: ``[(``、``[)]``。" #: ../../library/re.rst:329 msgid "``(?...)``" @@ -640,8 +642,8 @@ msgid "" "be used first in the expression string." msgstr "" "(這些旗標在 :ref:`contents-of-module-re` 中說明。)如果你想將旗標當作正規表" -"示式的一部分,而不是傳遞一個 *flag* 引數給 :func:`re.compile` 函式的話,這會有" -"幫助。旗標應該首先在正規表示式字串中使用。" +"示式的一部分,而不是傳遞一個 *flag* 引數給 :func:`re.compile` 函式的話,這會" +"有幫助。旗標應該首先在正規表示式字串中使用。" #: ../../library/re.rst:356 msgid "This construction can only be used at the start of the expression." @@ -714,21 +716,21 @@ msgid "" "Attempts to match ``...`` as if it was a separate regular expression, and if " "successful, continues to match the rest of the pattern following it. If the " "subsequent pattern fails to match, the stack can only be unwound to a point " -"*before* the ``(?>...)`` because once exited, the expression, known as " -"an :dfn:`atomic group`, has thrown away all stack points within itself. " -"Thus, ``(?>.*).`` would never match anything because first the ``.*`` would " -"match all characters possible, then, having nothing left to match, the final " -"``.`` would fail to match. Since there are no stack points saved in the " -"Atomic Group, and there is no stack point before it, the entire expression " -"would thus fail to match." -msgstr "" -"嘗試將 ``...`` 視為獨立的正規表示式進行匹配,且若成功則會繼續匹配" -"後續的模式。如果後續模式匹配失敗,則回溯堆疊 (stack) 只能還原 (unwound) 到 " -"``(?>...)`` *之前*,因為一旦退出了,這個也叫做\\ :dfn:`原子群組` (atomic " -"group) 的正規表示式,已經丟棄了它自己的所有回溯點 (stack point)。因此,``(?" -">.*).`` 永遠不會匹配任何內容,因為 ``.*`` 會先盡可能匹配所有的字元,接著沒有任" -"何剩餘內容可以匹配,導致最終的 ``.`` 匹配失敗。因為原子群組中沒有儲存回溯點," -"而且群組之前也沒有回溯點,整個正規表示式都會匹配失敗。" +"*before* the ``(?>...)`` because once exited, the expression, known as an :" +"dfn:`atomic group`, has thrown away all stack points within itself. Thus, " +"``(?>.*).`` would never match anything because first the ``.*`` would match " +"all characters possible, then, having nothing left to match, the final ``.`` " +"would fail to match. Since there are no stack points saved in the Atomic " +"Group, and there is no stack point before it, the entire expression would " +"thus fail to match." +msgstr "" +"嘗試將 ``...`` 視為獨立的正規表示式進行匹配,且若成功則會繼續匹配後續的模式。" +"如果後續模式匹配失敗,則回溯堆疊 (stack) 只能還原 (unwound) 到 ``(?>...)`` *" +"之前*,因為一旦退出了,這個也叫做\\ :dfn:`原子群組` (atomic group) 的正規表示" +"式,已經丟棄了它自己的所有回溯點 (stack point)。因此,``(?>.*).`` 永遠不會匹" +"配任何內容,因為 ``.*`` 會先盡可能匹配所有的字元,接著沒有任何剩餘內容可以匹" +"配,導致最終的 ``.`` 匹配失敗。因為原子群組中沒有儲存回溯點,而且群組之前也沒" +"有回溯點,整個正規表示式都會匹配失敗。" #: ../../library/re.rst:416 msgid "``(?P...)``" @@ -854,9 +856,10 @@ msgid "" "assertion`. For example, ``Isaac (?!Asimov)`` will match ``'Isaac '`` only " "if it's *not* followed by ``'Asimov'``." msgstr "" -"如果字串接下來不匹配 ``...``,才會成功匹配。這是一個\\ :dfn:`負向預查斷言 (negative " -"lookahead assertion) `。例如,``Isaac (?!Asimov)`` " -"只在後面\\ *不*\\ 跟著 ``'Asimov'`` 時才會匹配 ``'Isaac '``。" +"如果字串接下來不匹配 ``...``,才會成功匹配。這是一個\\ :dfn:`負向預查斷言 " +"(negative lookahead assertion) `。例如," +"``Isaac (?!Asimov)`` 只在後面\\ *不*\\ 跟著 ``'Asimov'`` 時才會匹配 ``'Isaac " +"'``。" #: ../../library/re.rst:473 msgid "``(?<=...)``" @@ -872,16 +875,16 @@ msgid "" "length, meaning that ``abc`` or ``a|b`` are allowed, but ``a*`` and ``a{3,4}" "`` are not. Note that patterns which start with positive lookbehind " "assertions will not match at the beginning of the string being searched; you " -"will most likely want to use the :func:`search` function rather than " -"the :func:`match` function:" +"will most likely want to use the :func:`search` function rather than the :" +"func:`match` function:" msgstr "" -"如果目前位置前方的字串能夠匹配 ``...``,可以成功匹配。這叫做\\ :dfn:`正向回查斷言 (positive " -"lookbehind assertion) `。``(?<=abc)def`` 會在 ``'abcdef'`` 中找到一個匹配," -"因為回查會向後 3 個字元,並檢查是否能匹配包含的模式。這個包含的模式只" -"能匹配固定長度的字串,代表 ``abc`` 或 ``a|b`` 是被允許的,但是 ``a*`` 和 " -"``a{3,4}`` 不被允許。請注意,使用正向回查斷言開頭的模式不" -"會匹配被搜尋字串的開頭;你更可能想要使用 :func:`search` 函式而不" -"是 :func:`match` 函式:" +"如果目前位置前方的字串能夠匹配 ``...``,可以成功匹配。這叫做\\ :dfn:`正向回查" +"斷言 (positive lookbehind assertion) `。``(?" +"<=abc)def`` 會在 ``'abcdef'`` 中找到一個匹配,因為回查會向後 3 個字元,並檢查" +"是否能匹配包含的模式。這個包含的模式只能匹配固定長度的字串,代表 ``abc`` 或 " +"``a|b`` 是被允許的,但是 ``a*`` 和 ``a{3,4}`` 不被允許。請注意,使用正向回查" +"斷言開頭的模式不會匹配被搜尋字串的開頭;你更可能想要使用 :func:`search` 函式" +"而不是 :func:`match` 函式:" #: ../../library/re.rst:489 msgid "This example looks for a word following a hyphen:" @@ -903,9 +906,10 @@ msgid "" "strings of some fixed length. Patterns which start with negative lookbehind " "assertions may match at the beginning of the string being searched." msgstr "" -"如果目前位置前方的字串不能夠匹配 ``...``,可以成功匹配。這叫做\\ :dfn:`負向回查斷言 (negative " -"lookbehind assertion) `。類似於正向回查斷言,包含的模式只" -"能匹配固定長度的字串。使用負向回查斷言開頭的模式可以匹配被搜尋字串的開頭。" +"如果目前位置前方的字串不能夠匹配 ``...``,可以成功匹配。這叫做\\ :dfn:`負向回" +"查斷言 (negative lookbehind assertion) `。類似" +"於正向回查斷言,包含的模式只能匹配固定長度的字串。使用負向回查斷言開頭的模式" +"可以匹配被搜尋字串的開頭。" #: ../../library/re.rst:510 msgid "``(?(id/name)yes-pattern|no-pattern)``" @@ -921,10 +925,10 @@ msgid "" "``''``." msgstr "" "如果給定 *id* 或 *name* 的群組存在,會嘗試匹配 ``yes-pattern``,否則會匹配 " -"``no-pattern``。``no-pattern`` 是可選的並且可以省略。例如,``(<)?(\\w+@\\w+" -"(?:\\.\\w+)+)(?(1)>|$)`` 是一個不好的電子郵件匹配模式,它會匹配 " -"``''`` 和 ``'user@host.com'``,但不會匹配 " -"``''``。" +"``no-pattern``。``no-pattern`` 是可選的並且可以省略。例如,``(<)?" +"(\\w+@\\w+(?:\\.\\w+)+)(?(1)>|$)`` 是一個不好的電子郵件匹配模式,它會匹配 " +"``''`` 和 ``'user@host.com'``,但不會匹配 ``''``。" #: ../../library/re.rst:518 msgid "" @@ -961,11 +965,11 @@ msgid "" "escapes are treated as characters." msgstr "" "匹配相同數字群組中的內容。群組會從 1 開始編號。例如,``(.+) \\1`` 會匹配 " -"``'the the'`` 或 ``'55 55'``,但不會匹配 ``'thethe'``\\ (注意群組後的空格)。這" -"個特殊序列只能用來匹配前 99 個群組之一。如果 *number* 的第一位數是 0,或是 " -"*number* 有 3 個八進位位數,它就不會被解讀成匹配群組,而是解讀成八進位數值 " -"*number* 的字元。在一個字元類別中的 ``'['`` 和 ``']'``,所有數值的跳脫字元都" -"會被當作字元。" +"``'the the'`` 或 ``'55 55'``,但不會匹配 ``'thethe'``\\ (注意群組後的空" +"格)。這個特殊序列只能用來匹配前 99 個群組之一。如果 *number* 的第一位數是 " +"0,或是 *number* 有 3 個八進位位數,它就不會被解讀成匹配群組,而是解讀成八進" +"位數值 *number* 的字元。在一個字元類別中的 ``'['`` 和 ``']'``,所有數值的跳脫" +"字元都會被當作字元。" #: ../../library/re.rst:545 msgid "``\\A``" @@ -997,13 +1001,13 @@ msgstr "" #: ../../library/re.rst:559 msgid "" "The default word characters in Unicode (str) patterns are Unicode " -"alphanumerics and the underscore, but this can be changed by using " -"the :py:const:`~re.ASCII` flag. Word boundaries are determined by the " -"current locale if the :py:const:`~re.LOCALE` flag is used." +"alphanumerics and the underscore, but this can be changed by using the :py:" +"const:`~re.ASCII` flag. Word boundaries are determined by the current locale " +"if the :py:const:`~re.LOCALE` flag is used." msgstr "" -"預設的單字字元在 Unicode(字串)模式中,是 Unicode 字母數字 (alphanumerics) 和底線,但是這可" -"以透過使用 :py:const:`~re.ASCII` 旗標來改變。如果使用" -"了 :py:const:`~re.LOCALE` 旗標,單字的邊界會由目前的區域設定決定。" +"預設的單字字元在 Unicode(字串)模式中,是 Unicode 字母數字 (alphanumerics) " +"和底線,但是這可以透過使用 :py:const:`~re.ASCII` 旗標來改變。如果使用了 :py:" +"const:`~re.LOCALE` 旗標,單字的邊界會由目前的區域設定決定。" #: ../../library/re.rst:567 msgid "" @@ -1028,10 +1032,10 @@ msgid "" msgstr "" "匹配空字串,但是只有在空字串\\ *不*\\ 在單字的開頭或結尾時匹配。這表示 " "``r'at\\B'`` 會匹配 ``'athens'``、``'atom'``、``'attorney'``,但是不匹配 " -"``'at'``、``'at.'`` 或 ``'at!'``。``\\B`` 是 ``\\b`` 的相反,所以 Unicode" -"(字串)模式中的單字字元是 Unicode 字母、數字或底線,不過這可以透過使" -"用 :py:const:`~re.ASCII` 旗標來改變。如果使用了 :py:const:`~re.LOCALE` 旗標," -"單字的邊界會由目前的區域設定決定。" +"``'at'``、``'at.'`` 或 ``'at!'``。``\\B`` 是 ``\\b`` 的相反,所以 Unicode(字" +"串)模式中的單字字元是 Unicode 字母、數字或底線,不過這可以透過使用 :py:" +"const:`~re.ASCII` 旗標來改變。如果使用了 :py:const:`~re.LOCALE` 旗標,單字的" +"邊界會由目前的區域設定決定。" #: ../../library/re.rst:584 msgid "``\\B`` now matches empty input string." @@ -1088,10 +1092,10 @@ msgstr "``\\s``" #: ../../library/re.rst:615 msgid "" -"Matches Unicode whitespace characters (as defined " -"by :py:meth:`str.isspace`). This includes ``[ \\t\\n\\r\\f\\v]``, and also " -"many other characters, for example the non-breaking spaces mandated by " -"typography rules in many languages." +"Matches Unicode whitespace characters (as defined by :py:meth:`str." +"isspace`). This includes ``[ \\t\\n\\r\\f\\v]``, and also many other " +"characters, for example the non-breaking spaces mandated by typography rules " +"in many languages." msgstr "" "匹配 Unicode 空格字元(在 :py:meth:`str.isspace` 中定義)。包含 " "``[ \\t\\n\\r\\f\\v]``,還有許多其他的字元,例如許多語言的排版規則中要求的不" @@ -1133,8 +1137,8 @@ msgid "" "characters (as defined by :py:meth:`str.isalnum`), as well as the underscore " "(``_``)." msgstr "" -"匹配 Unicode 單字字元;這包含全部 Unicode 的字母數字字元" -"(在 :py:meth:`str.isalnum` 中定義),以及底線 (``_``)。" +"匹配 Unicode 單字字元;這包含全部 Unicode 的字母數字字元(在 :py:meth:`str." +"isalnum` 中定義),以及底線 (``_``)。" #: ../../library/re.rst:642 msgid "Matches ``[a-zA-Z0-9_]`` if the :py:const:`~re.ASCII` flag is used." @@ -1158,8 +1162,8 @@ msgstr "``\\W``" #: ../../library/re.rst:653 msgid "" "Matches any character which is not a word character. This is the opposite of " -"``\\w``. By default, matches non-underscore (``_``) characters for " -"which :py:meth:`str.isalnum` returns ``False``." +"``\\w``. By default, matches non-underscore (``_``) characters for which :py:" +"meth:`str.isalnum` returns ``False``." msgstr "" "匹配任何不是單字字元的字元。這是 ``\\w`` 的相反。預設情況下,會匹配任何不是底" "線 (``_``),並且 :py:meth:`str.isalnum` 會回傳 ``False`` 的字元。" @@ -1277,7 +1281,8 @@ msgid "" "Flag constants are now instances of :class:`RegexFlag`, which is a subclass " "of :class:`enum.IntFlag`." msgstr "" -"Flag 常數現在是 :class:`RegexFlag` 的實例,其為 :class:`enum.IntFlag` 的子類別。" +"Flag 常數現在是 :class:`RegexFlag` 的實例,其為 :class:`enum.IntFlag` 的子類" +"別。" #: ../../library/re.rst:742 msgid "" @@ -1295,9 +1300,9 @@ msgid "" "is only meaningful for Unicode (str) patterns, and is ignored for bytes " "patterns." msgstr "" -"使 ``\\w``、``\\W``、``\\b``、``\\B``、``\\d``、``\\D``、``\\s`` 和 " -"``\\S`` 執行僅限 ASCII 的匹配,而不是完整的 Unicode 匹配。這只對 Unicode" -"(字串)模式有意義,並且在位元組模式中會被忽略。" +"使 ``\\w``、``\\W``、``\\b``、``\\B``、``\\d``、``\\D``、``\\s`` 和 ``\\S`` " +"執行僅限 ASCII 的匹配,而不是完整的 Unicode 匹配。這只對 Unicode(字串)模式" +"有意義,並且在位元組模式中會被忽略。" #: ../../library/re.rst:753 msgid "Corresponds to the inline flag ``(?a)``." @@ -1307,13 +1312,12 @@ msgstr "對應到內嵌旗標 ``(?a)``。" msgid "" "The :py:const:`~re.U` flag still exists for backward compatibility, but is " "redundant in Python 3 since matches are Unicode by default for ``str`` " -"patterns, and Unicode matching isn't allowed for bytes " -"patterns. :py:const:`~re.UNICODE` and the inline flag ``(?u)`` are similarly " -"redundant." +"patterns, and Unicode matching isn't allowed for bytes patterns. :py:const:" +"`~re.UNICODE` and the inline flag ``(?u)`` are similarly redundant." msgstr "" -"為了向後相容,:py:const:`~re.U` 旗標仍然存在,但是在 Python 3 中是多餘的,因為" -"對於 ``str`` 模式,匹配預設是 Unicode,並且不允許位元組模式進行 Unicode 匹配。" -":py:const:`~re.UNICODE` 和內嵌旗標 ``(?u)`` 也是類似的冗餘。" +"為了向後相容,:py:const:`~re.U` 旗標仍然存在,但是在 Python 3 中是多餘的,因" +"為對於 ``str`` 模式,匹配預設是 Unicode,並且不允許位元組模式進行 Unicode 匹" +"配。:py:const:`~re.UNICODE` 和內嵌旗標 ``(?u)`` 也是類似的冗餘。" #: ../../library/re.rst:766 msgid "Display debug information about compiled expression." @@ -1332,9 +1336,9 @@ msgid "" "flag unless the :py:const:`~re.LOCALE` flag is also used." msgstr "" "執行不區分大小寫的匹配;像是 ``[A-Z]`` 這樣的表示式也會匹配小寫字母。完整的 " -"Unicode 匹配(例如 ``Ü`` 匹配 ``ü``)也能正常運作,除非使用了 :py:const:`~re.ASCII` 旗標" -"來停用非 ASCII 的匹配。除非也使用了 :py:const:`~re.LOCALE` 旗標,否則目前的區域設定不會改" -"變這個旗標的效果。" +"Unicode 匹配(例如 ``Ü`` 匹配 ``ü``)也能正常運作,除非使用了 :py:const:`~re." +"ASCII` 旗標來停用非 ASCII 的匹配。除非也使用了 :py:const:`~re.LOCALE` 旗標," +"否則目前的區域設定不會改變這個旗標的效果。" #: ../../library/re.rst:782 msgid "Corresponds to the inline flag ``(?i)``." @@ -1345,15 +1349,16 @@ msgid "" "Note that when the Unicode patterns ``[a-z]`` or ``[A-Z]`` are used in " "combination with the :const:`IGNORECASE` flag, they will match the 52 ASCII " "letters and 4 additional non-ASCII letters: 'İ' (U+0130, Latin capital " -"letter I with dot above), 'ı' (U+0131, Latin small letter dotless i), 'ſ' " -"(U+017F, Latin small letter long s) and 'K' (U+212A, Kelvin sign). If " +"letter I with dot above), 'ı' (U+0131, Latin small letter dotless i), " +"'ſ' (U+017F, Latin small letter long s) and 'K' (U+212A, Kelvin sign). If " "the :py:const:`~re.ASCII` flag is used, only letters 'a' to 'z' and 'A' to " "'Z' are matched." msgstr "" -"請注意,當 Unicode 模式 ``[a-z]`` 或 ``[A-Z]`` 與 :const:`IGNORECASE` 旗標結合使用時," -"它們會匹配 52 個 ASCII 字母和另外 4 個非 ASCII 字母:'İ' (U+0130,帶點的大寫拉丁字母 I)、" -"'ı' (U+0131,無點的小寫拉丁字母 i)、'ſ' (U+017F,拉丁小寫長 s)和 'K' (U+212A,開爾文符號)。" -"如果使用了 :py:const:`~re.ASCII` 旗標,則只會匹配字母 'a' 到 'z' 和 'A' 到 'Z'。" +"請注意,當 Unicode 模式 ``[a-z]`` 或 ``[A-Z]`` 與 :const:`IGNORECASE` 旗標結" +"合使用時,它們會匹配 52 個 ASCII 字母和另外 4 個非 ASCII 字母:'İ' (U+0130," +"帶點的大寫拉丁字母 I)、'ı' (U+0131,無點的小寫拉丁字母 i)、'ſ' (U+017F,拉" +"丁小寫長 s)和 'K' (U+212A,開爾文符號)。如果使用了 :py:const:`~re.ASCII` " +"旗標,則只會匹配字母 'a' 到 'z' 和 'A' 到 'Z'。" #: ../../library/re.rst:795 msgid "" @@ -1361,8 +1366,8 @@ msgid "" "dependent on the current locale. This flag can be used only with bytes " "patterns." msgstr "" -"使 ``\\w``、``\\W``、``\\b``、``\\B`` 和不區分大小寫的匹配依賴於目前的區域設定。" -"這個旗標只能用在位元組模式中。" +"使 ``\\w``、``\\W``、``\\b``、``\\B`` 和不區分大小寫的匹配依賴於目前的區域設" +"定。這個旗標只能用在位元組模式中。" #: ../../library/re.rst:799 msgid "Corresponds to the inline flag ``(?L)``." @@ -1376,16 +1381,17 @@ msgid "" "for Unicode (str) patterns and it is able to handle different locales and " "languages." msgstr "" -"不建議使用這個旗標;請考慮使用 Unicode 匹配。區域設定機制非常不可靠,因為它一次只" -"處理一種「文化」,並且只適用於 8 位元的區域設定。Unicode 匹配在 Unicode(字串)模式中預設是" -"啟用的,並且能夠處理不同的區域設定和語言。" +"不建議使用這個旗標;請考慮使用 Unicode 匹配。區域設定機制非常不可靠,因為它一" +"次只處理一種「文化」,並且只適用於 8 位元的區域設定。Unicode 匹配在 Unicode" +"(字串)模式中預設是啟用的,並且能夠處理不同的區域設定和語言。" #: ../../library/re.rst:810 msgid "" ":py:const:`~re.LOCALE` can be used only with bytes patterns and is not " "compatible with :py:const:`~re.ASCII`." msgstr "" -":py:const:`~re.LOCALE` 只能用在位元組模式中,並且與 :py:const:`~re.ASCII` 不相容。" +":py:const:`~re.LOCALE` 只能用在位元組模式中,並且與 :py:const:`~re.ASCII` 不" +"相容。" #: ../../library/re.rst:814 msgid "" @@ -1393,8 +1399,8 @@ msgid "" "longer depend on the locale at compile time. Only the locale at matching " "time affects the result of matching." msgstr "" -"使用 :py:const:`~re.LOCALE` 旗標的已編譯正規表示式物件不再依賴於編譯時的區域設定。" -"只有匹配時的區域設定會影響匹配的結果。" +"使用 :py:const:`~re.LOCALE` 旗標的已編譯正規表示式物件不再依賴於編譯時的區域" +"設定。只有匹配時的區域設定會影響匹配的結果。" #: ../../library/re.rst:823 msgid "" @@ -1406,10 +1412,10 @@ msgid "" "only at the end of the string and immediately before the newline (if any) at " "the end of the string." msgstr "" -"當指定時,模式字元 ``'^'`` 會在字串的開頭以及每一行的開頭(緊接在每個換行符號之後)" -"匹配;而模式字元 ``'$'`` 會在字串的結尾以及每一行的結尾(緊接在每個換行符號之前)" -"匹配。預設情況下,``'^'`` 只會在字串的開頭匹配,而 ``'$'`` 只會在字串的結尾以及字串結尾" -"(如果有的話)緊接在換行符號之前匹配。" +"當指定時,模式字元 ``'^'`` 會在字串的開頭以及每一行的開頭(緊接在每個換行符號" +"之後)匹配;而模式字元 ``'$'`` 會在字串的結尾以及每一行的結尾(緊接在每個換行" +"符號之前)匹配。預設情況下,``'^'`` 只會在字串的開頭匹配,而 ``'$'`` 只會在字" +"串的結尾以及字串結尾(如果有的話)緊接在換行符號之前匹配。" #: ../../library/re.rst:830 msgid "Corresponds to the inline flag ``(?m)``." @@ -1422,8 +1428,9 @@ msgid "" "will be conditionally ORed with other flags. Example of use as a default " "value::" msgstr "" -"表示沒有應用任何旗標,值為 ``0``。這個旗標可以用作函式關鍵字引數的預設值,或是作為" -"一個基底值,將會有條件地與其他旗標進行 OR 運算。作為預設值使用的範例: ::" +"表示沒有應用任何旗標,值為 ``0``。這個旗標可以用作函式關鍵字引數的預設值,或" +"是作為一個基底值,將會有條件地與其他旗標進行 OR 運算。作為預設值使用的範" +"例: ::" #: ../../library/re.rst:839 msgid "" @@ -1438,8 +1445,8 @@ msgid "" "Make the ``'.'`` special character match any character at all, including a " "newline; without this flag, ``'.'`` will match anything *except* a newline." msgstr "" -"使 ``'.'`` 特殊字元能夠匹配任何字元,包括換行符號;如果沒有這個旗標,``'.'`` 只會匹配" -"除了換行符號以外的任何字元。" +"使 ``'.'`` 特殊字元能夠匹配任何字元,包括換行符號;如果沒有這個旗標,``'.'`` " +"只會匹配除了換行符號以外的任何字元。" #: ../../library/re.rst:850 msgid "Corresponds to the inline flag ``(?s)``." @@ -1451,8 +1458,8 @@ msgid "" "This flag is therefore redundant with **no effect** and is only kept for " "backward compatibility." msgstr "" -"在 Python 3 中,Unicode 字元在 ``str`` 模式中預設會被匹配。因此這個旗標是多餘的," -"**沒有任何效果**,並且僅為了向後相容而保留。" +"在 Python 3 中,Unicode 字元在 ``str`` 模式中預設會被匹配。因此這個旗標是多餘" +"的,**沒有任何效果**,並且僅為了向後相容而保留。" #: ../../library/re.rst:861 msgid "" @@ -1471,18 +1478,17 @@ msgid "" "characters from the leftmost such ``#`` through the end of the line are " "ignored." msgstr "" -"這個旗標透過讓你在視覺上分隔模式的邏輯區塊並添加註解,使你能夠撰寫看起來更好且更易讀的正" -"規表示式。模式中的空白會被忽略,除非在字元類別中,或是前面有一個未跳脫的" -"反斜線,或是在像是 ``*?``、``(?:`` 或 ``(?P<...>`` 這樣的標記中。例如,``(? :``" -" 和 ``* ?`` 是不允許的。當一行包含一個不在字元類別中且前面沒有未跳脫反斜線的 ``#`` " -"時,從最左邊的這個 ``#`` 到行尾的所有字元都會被忽略。" +"這個旗標透過讓你在視覺上分隔模式的邏輯區塊並添加註解,使你能夠撰寫看起來更好" +"且更易讀的正規表示式。模式中的空白會被忽略,除非在字元類別中,或是前面有一個" +"未跳脫的反斜線,或是在像是 ``*?``、``(?:`` 或 ``(?P<...>`` 這樣的標記中。例" +"如,``(? :`` 和 ``* ?`` 是不允許的。當一行包含一個不在字元類別中且前面沒有未" +"跳脫反斜線的 ``#`` 時,從最左邊的這個 ``#`` 到行尾的所有字元都會被忽略。" #: ../../library/re.rst:878 msgid "" "This means that the two following regular expression objects that match a " "decimal number are functionally equal::" -msgstr "" -"這表示下面兩個匹配十進位數字的正規表示式物件在功能上是相等的: ::" +msgstr "這表示下面兩個匹配十進位數字的正規表示式物件在功能上是相等的: ::" #: ../../library/re.rst:881 msgid "" @@ -1507,12 +1513,11 @@ msgstr "函式" #: ../../library/re.rst:894 msgid "" "Compile a regular expression pattern into a :ref:`regular expression object " -"`, which can be used for matching using " -"its :func:`~Pattern.match`, :func:`~Pattern.search` and other methods, " -"described below." +"`, which can be used for matching using its :func:`~Pattern." +"match`, :func:`~Pattern.search` and other methods, described below." msgstr "" -"將正規表示式模式編譯成\\ :ref:`正規表示式物件 `,可以使用它" -"的 :func:`~Pattern.match`、:func:`~Pattern.search` 等方法來匹配,如下所述。" +"將正規表示式模式編譯成\\ :ref:`正規表示式物件 `,可以使用它的 :" +"func:`~Pattern.match`、:func:`~Pattern.search` 等方法來匹配,如下所述。" #: ../../library/re.rst:899 ../../library/re.rst:931 ../../library/re.rst:949 #: ../../library/re.rst:960 ../../library/re.rst:1006 ../../library/re.rst:1040 @@ -1557,10 +1562,10 @@ msgstr "" #: ../../library/re.rst:918 msgid "" -"The compiled versions of the most recent patterns passed " -"to :func:`re.compile` and the module-level matching functions are cached, so " -"programs that use only a few regular expressions at a time needn't worry " -"about compiling regular expressions." +"The compiled versions of the most recent patterns passed to :func:`re." +"compile` and the module-level matching functions are cached, so programs " +"that use only a few regular expressions at a time needn't worry about " +"compiling regular expressions." msgstr "" "傳遞給 :func:`re.compile` 之最新模式的編譯版本和模組層級匹配函式都會被快取," "因此一次僅使用幾個正規表示式的程式不必去擔心編譯正規表示式。" @@ -1568,14 +1573,14 @@ msgstr "" #: ../../library/re.rst:926 msgid "" "Scan through *string* looking for the first location where the regular " -"expression *pattern* produces a match, and return a " -"corresponding :class:`~re.Match`. Return ``None`` if no position in the " -"string matches the pattern; note that this is different from finding a zero-" -"length match at some point in the string." +"expression *pattern* produces a match, and return a corresponding :class:" +"`~re.Match`. Return ``None`` if no position in the string matches the " +"pattern; note that this is different from finding a zero-length match at " +"some point in the string." msgstr "" -"掃描 *string* 以尋找正規表示式 *pattern* 產生匹配的第一個位置,並回傳對應" -"的 :class:`~re.Match`。如果字串中沒有與模式匹配的位置則回傳 ``None``;請注" -"意,這與在字串中的某個點查找零長度匹配不同。" +"掃描 *string* 以尋找正規表示式 *pattern* 產生匹配的第一個位置,並回傳對應的 :" +"class:`~re.Match`。如果字串中沒有與模式匹配的位置則回傳 ``None``;請注意,這" +"與在字串中的某個點查找零長度匹配不同。" #: ../../library/re.rst:938 msgid "" @@ -1584,9 +1589,9 @@ msgid "" "``None`` if the string does not match the pattern; note that this is " "different from a zero-length match." msgstr "" -"如果 *string* 開頭的零個或多個字元與正規表示式 *pattern* 匹配,則回傳對應" -"的 :class:`~re.Match`。如果字串與模式不匹配,則回傳 ``None``;請注意,這與零" -"長度匹配不同。" +"如果 *string* 開頭的零個或多個字元與正規表示式 *pattern* 匹配,則回傳對應的 :" +"class:`~re.Match`。如果字串與模式不匹配,則回傳 ``None``;請注意,這與零長度" +"匹配不同。" #: ../../library/re.rst:943 msgid "" @@ -1610,9 +1615,8 @@ msgid "" "corresponding :class:`~re.Match`. Return ``None`` if the string does not " "match the pattern; note that this is different from a zero-length match." msgstr "" -"如果整個 *string* 與正規表示式 *pattern* 匹配,則回傳對應" -"的 :class:`~re.Match`。如果字串與模式不匹配,則回傳 ``None``;請注意,這與零" -"長度匹配不同。" +"如果整個 *string* 與正規表示式 *pattern* 匹配,則回傳對應的 :class:`~re." +"Match`。如果字串與模式不匹配,則回傳 ``None``;請注意,這與零長度匹配不同。" #: ../../library/re.rst:969 msgid "" @@ -1797,8 +1801,8 @@ msgid "" "...\n" ">>> re.sub('-{1,2}', dashrepl, 'pro----gram-files')\n" "'pro--gram files'\n" -">>> re.sub(r'\\sAND\\s', ' & ', 'Baked Beans And Spam', " -"flags=re.IGNORECASE)\n" +">>> re.sub(r'\\sAND\\s', ' & ', 'Baked Beans And Spam', flags=re." +"IGNORECASE)\n" "'Baked Beans & Spam'" msgstr "" ">>> def dashrepl(matchobj):\n" @@ -1807,8 +1811,8 @@ msgstr "" "...\n" ">>> re.sub('-{1,2}', dashrepl, 'pro----gram-files')\n" "'pro--gram files'\n" -">>> re.sub(r'\\sAND\\s', ' & ', 'Baked Beans And Spam', " -"flags=re.IGNORECASE)\n" +">>> re.sub(r'\\sAND\\s', ' & ', 'Baked Beans And Spam', flags=re." +"IGNORECASE)\n" "'Baked Beans & Spam'" #: ../../library/re.rst:1094 @@ -2027,8 +2031,8 @@ msgid "" ":py:class:`re.Pattern` supports ``[]`` to indicate a Unicode (str) or bytes " "pattern. See :ref:`types-genericalias`." msgstr "" -":py:class:`re.Pattern` 支援 ``[]`` 以表示 Unicode(字串)或位元組模式。請參閱 " -":ref:`types-genericalias`。" +":py:class:`re.Pattern` 支援 ``[]`` 以表示 Unicode(字串)或位元組模式。請參" +"閱 :ref:`types-genericalias`。" #: ../../library/re.rst:1250 msgid "" @@ -2038,8 +2042,9 @@ msgid "" "this is different from finding a zero-length match at some point in the " "string." msgstr "" -"掃描 *string* 以尋找此正規表示式產生匹配的第一個位置,並回傳對應的 " -":class:`~re.Match`。如果字串中沒有與模式匹配的位置則回傳 ``None``;請注意,這與在字串中的某個點查找零長度匹配不同。" +"掃描 *string* 以尋找此正規表示式產生匹配的第一個位置,並回傳對應的 :class:" +"`~re.Match`。如果字串中沒有與模式匹配的位置則回傳 ``None``;請注意,這與在字" +"串中的某個點查找零長度匹配不同。" #: ../../library/re.rst:1255 msgid "" @@ -2062,10 +2067,11 @@ msgid "" "compiled regular expression object, ``rx.search(string, 0, 50)`` is " "equivalent to ``rx.search(string[:50], 0)``. ::" msgstr "" -"可選的參數 *endpos* 限制了字串將被搜尋的範圍;就好像字串的長度為 *endpos* " -"個字元一樣,因此只有從 *pos* 到 ``endpos - 1`` 的字元會被搜尋以尋找匹配項。如果 " -"*endpos* 小於 *pos*,則不會找到匹配項;否則,如果 *rx* 是已編譯的正規表示式物件," -"則 ``rx.search(string, 0, 50)`` 等價於 ``rx.search(string[:50], 0)``。 ::" +"可選的參數 *endpos* 限制了字串將被搜尋的範圍;就好像字串的長度為 *endpos* 個" +"字元一樣,因此只有從 *pos* 到 ``endpos - 1`` 的字元會被搜尋以尋找匹配項。如" +"果 *endpos* 小於 *pos*,則不會找到匹配項;否則,如果 *rx* 是已編譯的正規表示" +"式物件,則 ``rx.search(string, 0, 50)`` 等價於 ``rx.search(string[:50], " +"0)``。 ::" #: ../../library/re.rst:1268 msgid "" @@ -2086,15 +2092,17 @@ msgid "" "the string does not match the pattern; note that this is different from a " "zero-length match." msgstr "" -"如果在 *string* 的\\ *開頭*\\ 處有零個或多個字元與此正規表示式匹配,則回傳對應的 " -":class:`~re.Match`。如果字串與模式不匹配,則回傳 ``None``;請注意,這與零長度匹配不同。" +"如果在 *string* 的\\ *開頭*\\ 處有零個或多個字元與此正規表示式匹配,則回傳對" +"應的 :class:`~re.Match`。如果字串與模式不匹配,則回傳 ``None``;請注意,這與" +"零長度匹配不同。" #: ../../library/re.rst:1281 ../../library/re.rst:1299 msgid "" -"The optional *pos* and *endpos* parameters have the same meaning as for " -"the :meth:`~Pattern.search` method. ::" +"The optional *pos* and *endpos* parameters have the same meaning as for the :" +"meth:`~Pattern.search` method. ::" msgstr "" -"可選的 *pos* 和 *endpos* 參數與 :meth:`~Pattern.search` 方法中的參數具有相同的意義。 ::" +"可選的 *pos* 和 *endpos* 參數與 :meth:`~Pattern.search` 方法中的參數具有相同" +"的意義。 ::" #: ../../library/re.rst:1284 msgid "" @@ -2107,13 +2115,14 @@ msgid "" msgstr "" ">>> pattern = re.compile(\"o\")\n" ">>> pattern.match(\"dog\") # 無匹配,因為 \"o\" 不在 \"dog\" 的開頭。\n" -">>> pattern.match(\"dog\", 1) # 匹配,因為 \"o\" 是 \"dog\" 的第二個字元。\n" +">>> pattern.match(\"dog\", 1) # 匹配,因為 \"o\" 是 \"dog\" 的第二個字" +"元。\n" "" #: ../../library/re.rst:1289 msgid "" -"If you want to locate a match anywhere in *string*, " -"use :meth:`~Pattern.search` instead (see also :ref:`search-vs-match`)." +"If you want to locate a match anywhere in *string*, use :meth:`~Pattern." +"search` instead (see also :ref:`search-vs-match`)." msgstr "" "如果你想在 *string* 中的任何位置找到匹配,請改用 :meth:`~Pattern.search`\\ " "(另請參閱 :ref:`search-vs-match`)。" @@ -2124,8 +2133,8 @@ msgid "" "corresponding :class:`~re.Match`. Return ``None`` if the string does not " "match the pattern; note that this is different from a zero-length match." msgstr "" -"如果整個 *string* 與此正規表示式匹配,則回傳對應的 :class:`~re.Match`。如果字串" -"與模式不匹配,則回傳 ``None``;請注意,這與零長度匹配不同。" +"如果整個 *string* 與此正規表示式匹配,則回傳對應的 :class:`~re.Match`。如果字" +"串與模式不匹配,則回傳 ``None``;請注意,這與零長度匹配不同。" #: ../../library/re.rst:1302 msgid "" @@ -2138,7 +2147,8 @@ msgid "" "" msgstr "" ">>> pattern = re.compile(\"o[gh]\")\n" -">>> pattern.fullmatch(\"dog\") # 無匹配,因為 \"o\" 不在 \"dog\" 的開頭。\n" +">>> pattern.fullmatch(\"dog\") # 無匹配,因為 \"o\" 不在 \"dog\" 的開" +"頭。\n" ">>> pattern.fullmatch(\"ogre\") # 無匹配,因為整個字串不匹配。\n" ">>> pattern.fullmatch(\"doggie\", 1, 3) # 在給定限制內匹配。\n" "" @@ -2153,8 +2163,8 @@ msgid "" "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -"類似於 :func:`findall` 函式,使用已編譯的模式,但也接受可選的 *pos* 和" -" *endpos* 參數,這些參數會像 :meth:`search` 一樣限制搜尋區域。" +"類似於 :func:`findall` 函式,使用已編譯的模式,但也接受可選的 *pos* 和 " +"*endpos* 參數,這些參數會像 :meth:`search` 一樣限制搜尋區域。" #: ../../library/re.rst:1325 msgid "" @@ -2162,8 +2172,8 @@ msgid "" "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -"類似於 :func:`finditer` 函式,使用已編譯的模式,但也接受可選的 *pos* 和 " -" *endpos* 參數,這些參數會像 :meth:`search` 一樣限制搜尋區域。" +"類似於 :func:`finditer` 函式,使用已編譯的模式,但也接受可選的 *pos* 和 " +"*endpos* 參數,這些參數會像 :meth:`search` 一樣限制搜尋區域。" #: ../../library/re.rst:1332 msgid "Identical to the :func:`sub` function, using the compiled pattern." @@ -2175,13 +2185,13 @@ msgstr "和 :func:`subn` 函式相同,使用已編譯的模式。" #: ../../library/re.rst:1342 msgid "" -"The regex matching flags. This is a combination of the flags given " -"to :func:`.compile`, any ``(?...)`` inline flags in the pattern, and " -"implicit flags such as :py:const:`~re.UNICODE` if the pattern is a Unicode " -"string." +"The regex matching flags. This is a combination of the flags given to :func:" +"`.compile`, any ``(?...)`` inline flags in the pattern, and implicit flags " +"such as :py:const:`~re.UNICODE` if the pattern is a Unicode string." msgstr "" -"正規表示式匹配旗標。這是傳遞給 :func:`.compile` 的旗標、模式中的任何 ``(?...)`` " -"內嵌旗標以及隱含旗標(例如如果模式是 Unicode 字串則為 :py:const:`~re.UNICODE`)的組合。" +"正規表示式匹配旗標。這是傳遞給 :func:`.compile` 的旗標、模式中的任何 " +"``(?...)`` 內嵌旗標以及隱含旗標(例如如果模式是 Unicode 字串則為 :py:const:" +"`~re.UNICODE`)的組合。" #: ../../library/re.rst:1349 msgid "The number of capturing groups in the pattern." @@ -2193,7 +2203,8 @@ msgid "" "group numbers. The dictionary is empty if no symbolic groups were used in " "the pattern." msgstr "" -"一個字典,將任何由 ``(?P)`` 定義的符號群組名稱對映到群組編號。如果模式中未使用符號群組,則字典為空。" +"一個字典,將任何由 ``(?P)`` 定義的符號群組名稱對映到群組編號。如果模式中" +"未使用符號群組,則字典為空。" #: ../../library/re.rst:1361 msgid "The pattern string from which the pattern object was compiled." @@ -2204,8 +2215,8 @@ msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Compiled " "regular expression objects are considered atomic." msgstr "" -"新增對 :func:`copy.copy` 和 :func:`copy.deepcopy` 的支援。已編譯的正規表示式物件" -"被視為不可分割的 (atomic)。" +"新增對 :func:`copy.copy` 和 :func:`copy.deepcopy` 的支援。已編譯的正規表示式" +"物件被視為不可分割的 (atomic)。" #: ../../library/re.rst:1372 msgid "Match Objects" @@ -2213,10 +2224,9 @@ msgstr "" #: ../../library/re.rst:1374 msgid "" -"Match objects always have a boolean value of ``True``. " -"Since :meth:`~Pattern.match` and :meth:`~Pattern.search` return ``None`` " -"when there is no match, you can test whether there was a match with a simple " -"``if`` statement::" +"Match objects always have a boolean value of ``True``. Since :meth:`~Pattern." +"match` and :meth:`~Pattern.search` return ``None`` when there is no match, " +"you can test whether there was a match with a simple ``if`` statement::" msgstr "" #: ../../library/re.rst:1379 @@ -2281,8 +2291,8 @@ msgstr "" msgid "" "If the regular expression uses the ``(?P...)`` syntax, the *groupN* " "arguments may also be strings identifying groups by their group name. If a " -"string argument is not used as a group name in the pattern, " -"an :exc:`IndexError` exception is raised." +"string argument is not used as a group name in the pattern, an :exc:" +"`IndexError` exception is raised." msgstr "" #: ../../library/re.rst:1433 @@ -2441,9 +2451,9 @@ msgstr "m.string[m.start(g):m.end(g)]" #: ../../library/re.rst:1524 msgid "" "Note that ``m.start(group)`` will equal ``m.end(group)`` if *group* matched " -"a null string. For example, after ``m = re.search('b(c?)', 'cba')``, " -"``m.start(0)`` is 1, ``m.end(0)`` is 2, ``m.start(1)`` and ``m.end(1)`` are " -"both 2, and ``m.start(2)`` raises an :exc:`IndexError` exception." +"a null string. For example, after ``m = re.search('b(c?)', 'cba')``, ``m." +"start(0)`` is 1, ``m.end(0)`` is 2, ``m.start(1)`` and ``m.end(1)`` are both " +"2, and ``m.start(2)`` raises an :exc:`IndexError` exception." msgstr "" #: ../../library/re.rst:1529 @@ -2471,17 +2481,16 @@ msgstr "" #: ../../library/re.rst:1546 msgid "" -"The value of *pos* which was passed to the :meth:`~Pattern.search` " -"or :meth:`~Pattern.match` method of a :ref:`regex object `. " -"This is the index into the string at which the RE engine started looking for " -"a match." +"The value of *pos* which was passed to the :meth:`~Pattern.search` or :meth:" +"`~Pattern.match` method of a :ref:`regex object `. This is the " +"index into the string at which the RE engine started looking for a match." msgstr "" #: ../../library/re.rst:1553 msgid "" -"The value of *endpos* which was passed to the :meth:`~Pattern.search` " -"or :meth:`~Pattern.match` method of a :ref:`regex object `. " -"This is the index into the string beyond which the RE engine will not go." +"The value of *endpos* which was passed to the :meth:`~Pattern.search` or :" +"meth:`~Pattern.match` method of a :ref:`regex object `. This is " +"the index into the string beyond which the RE engine will not go." msgstr "" #: ../../library/re.rst:1560 @@ -2501,9 +2510,8 @@ msgstr "" #: ../../library/re.rst:1575 msgid "" -"The :ref:`regular expression object ` " -"whose :meth:`~Pattern.match` or :meth:`~Pattern.search` method produced this " -"match instance." +"The :ref:`regular expression object ` whose :meth:`~Pattern." +"match` or :meth:`~Pattern.search` method produced this match instance." msgstr "" #: ../../library/re.rst:1581 @@ -2584,8 +2592,8 @@ msgstr "" #: ../../library/re.rst:1631 msgid "" -"To find out what card the pair consists of, one could use " -"the :meth:`~Match.group` method of the match object in the following manner::" +"To find out what card the pair consists of, one could use the :meth:`~Match." +"group` method of the match object in the following manner::" msgstr "" #: ../../library/re.rst:1634 @@ -2613,9 +2621,9 @@ msgstr "模擬 scanf()" #: ../../library/re.rst:1654 msgid "" "Python does not currently have an equivalent to :c:func:`!scanf`. Regular " -"expressions are generally more powerful, though also more verbose, " -"than :c:func:`!scanf` format strings. The table below offers some more-or-" -"less equivalent mappings between :c:func:`!scanf` format tokens and regular " +"expressions are generally more powerful, though also more verbose, than :c:" +"func:`!scanf` format strings. The table below offers some more-or-less " +"equivalent mappings between :c:func:`!scanf` format tokens and regular " "expressions." msgstr "" diff --git a/library/readline.po b/library/readline.po index 98d60030d0..1390e829cd 100644 --- a/library/readline.po +++ b/library/readline.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-15 00:15+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -23,7 +23,7 @@ msgstr ":mod:`!readline` --- GNU readline 介面" #: ../../library/readline.rst:12 msgid "" -"The :mod:`readline` module defines a number of functions to facilitate " +"The :mod:`!readline` module defines a number of functions to facilitate " "completion and reading/writing of history files from the Python interpreter. " "This module can be used directly, or via the :mod:`rlcompleter` module, " "which supports completion of Python identifiers at the interactive prompt. " @@ -65,7 +65,7 @@ msgstr "" #: ../../library/readline.rst:33 msgid "" "The underlying Readline library API may be implemented by the ``editline`` " -"(``libedit``) library instead of GNU readline. On macOS the :mod:`readline` " +"(``libedit``) library instead of GNU readline. On macOS the :mod:`!readline` " "module detects which library is being used at run time." msgstr "" @@ -297,8 +297,8 @@ msgid "" "function. This is typically operated by the Tab key, and can suggest and " "automatically complete a word being typed. By default, Readline is set up " "to be used by :mod:`rlcompleter` to complete Python identifiers for the " -"interactive interpreter. If the :mod:`readline` module is to be used with a " -"custom completer, a different set of word delimiters should be set." +"interactive interpreter. If the :mod:`!readline` module is to be used with " +"a custom completer, a different set of word delimiters should be set." msgstr "" #: ../../library/readline.rst:264 @@ -366,7 +366,7 @@ msgstr "範例" #: ../../library/readline.rst:327 msgid "" -"The following example demonstrates how to use the :mod:`readline` module's " +"The following example demonstrates how to use the :mod:`!readline` module's " "history reading and writing functions to automatically load and save a " "history file named :file:`.python_history` from the user's home directory. " "The code below would normally be executed automatically during interactive " diff --git a/library/runpy.po b/library/runpy.po index c03ca83488..b106ed0a20 100644 --- a/library/runpy.po +++ b/library/runpy.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2016-11-19 00:33+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/runpy.py`" #: ../../library/runpy.rst:13 msgid "" -"The :mod:`runpy` module is used to locate and run Python modules without " +"The :mod:`!runpy` module is used to locate and run Python modules without " "importing them first. Its main use is to implement the :option:`-m` command " "line switch that allows scripts to be located using the Python module " "namespace rather than the filesystem." @@ -43,13 +43,13 @@ msgstr "" #: ../../library/runpy.rst:22 msgid "" "Furthermore, any functions and classes defined by the executed code are not " -"guaranteed to work correctly after a :mod:`runpy` function has returned. If " +"guaranteed to work correctly after a :mod:`!runpy` function has returned. If " "that limitation is not acceptable for a given use case, :mod:`importlib` is " "likely to be a more suitable choice than this module." msgstr "" #: ../../library/runpy.rst:27 -msgid "The :mod:`runpy` module provides two functions:" +msgid "The :mod:`!runpy` module provides two functions:" msgstr "" #: ../../library/runpy.rst:35 diff --git a/library/sched.po b/library/sched.po index 0f131c8b9e..38dbc7b53a 100644 --- a/library/sched.po +++ b/library/sched.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2024-05-09 16:09+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,8 +27,9 @@ msgid "**Source code:** :source:`Lib/sched.py`" msgstr "**原始碼:**\\ :source:`Lib/sched.py`" #: ../../library/sched.rst:15 +#, fuzzy msgid "" -"The :mod:`sched` module defines a class which implements a general purpose " +"The :mod:`!sched` module defines a class which implements a general purpose " "event scheduler:" msgstr ":mod:`sched` 模組定義了一個有實作通用事件排程器的類別:" @@ -176,8 +177,8 @@ msgid "" "Remove the event from the queue. If *event* is not an event currently in the " "queue, this method will raise a :exc:`ValueError`." msgstr "" -"從佇列中刪除該事件。如果 *event* 不是目前佇列中的事件,此方法將引" -"發 :exc:`ValueError`。" +"從佇列中刪除該事件。如果 *event* 不是目前佇列中的事件,此方法將引發 :exc:" +"`ValueError`。" #: ../../library/sched.rst:113 msgid "Return ``True`` if the event queue is empty." diff --git a/library/secrets.po b/library/secrets.po index d06c17d686..c9f32567ea 100644 --- a/library/secrets.po +++ b/library/secrets.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-19 00:13+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2022-11-30 13:42+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,8 +28,9 @@ msgid "**Source code:** :source:`Lib/secrets.py`" msgstr "**原始碼:**\\ :source:`Lib/secrets.py`" #: ../../library/secrets.rst:20 +#, fuzzy msgid "" -"The :mod:`secrets` module is used for generating cryptographically strong " +"The :mod:`!secrets` module is used for generating cryptographically strong " "random numbers suitable for managing data such as passwords, account " "authentication, security tokens, and related secrets." msgstr "" @@ -37,8 +38,9 @@ msgstr "" "證、安全性權杖(security tokens)這類資料,以及管理其他相關的機密資料。" #: ../../library/secrets.rst:24 +#, fuzzy msgid "" -"In particular, :mod:`secrets` should be used in preference to the default " +"In particular, :mod:`!secrets` should be used in preference to the default " "pseudo-random number generator in the :mod:`random` module, which is " "designed for modelling and simulation, not security or cryptography." msgstr "" @@ -55,8 +57,9 @@ msgid "Random numbers" msgstr "亂數" #: ../../library/secrets.rst:36 +#, fuzzy msgid "" -"The :mod:`secrets` module provides access to the most secure source of " +"The :mod:`!secrets` module provides access to the most secure source of " "randomness that your operating system provides." msgstr ":mod:`secrets` 模組使你得以存取作業系統所提供安全性最高的亂數產生器。" @@ -66,8 +69,8 @@ msgid "" "provided by the operating system. See :class:`random.SystemRandom` for " "additional details." msgstr "" -"一個用來產生亂數的類別,用的是作業系統提供的最高品質來源。 請參" -"閱 :class:`random.SystemRandom` 以取得更多細節。" +"一個用來產生亂數的類別,用的是作業系統提供的最高品質來源。 請參閱 :class:" +"`random.SystemRandom` 以取得更多細節。" #: ../../library/secrets.rst:47 msgid "Return a randomly chosen element from a non-empty sequence." @@ -86,8 +89,9 @@ msgid "Generating tokens" msgstr "產生權杖(token)" #: ../../library/secrets.rst:61 +#, fuzzy msgid "" -"The :mod:`secrets` module provides functions for generating secure tokens, " +"The :mod:`!secrets` module provides functions for generating secure tokens, " "suitable for applications such as password resets, hard-to-guess URLs, and " "similar." msgstr "" @@ -152,13 +156,14 @@ msgid "How many bytes should tokens use?" msgstr "權杖應當使用多少個位元組?" #: ../../library/secrets.rst:104 +#, fuzzy msgid "" "To be secure against `brute-force attacks `_, tokens need to have sufficient randomness. " "Unfortunately, what is considered sufficient will necessarily increase as " "computers get more powerful and able to make more guesses in a shorter " "period. As of 2015, it is believed that 32 bytes (256 bits) of randomness " -"is sufficient for the typical use-case expected for the :mod:`secrets` " +"is sufficient for the typical use-case expected for the :mod:`!secrets` " "module." msgstr "" "為了在面對\\ `暴力攻擊 \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,7 +35,7 @@ msgstr "" #: ../../library/select.rst:20 msgid "" "The :mod:`selectors` module allows high-level and efficient I/O " -"multiplexing, built upon the :mod:`select` module primitives. Users are " +"multiplexing, built upon the :mod:`!select` module primitives. Users are " "encouraged to use the :mod:`selectors` module instead, unless they want " "precise control over the OS-level primitives used." msgstr "" diff --git a/library/shelve.po b/library/shelve.po index 5a44811a53..200d6a9daf 100644 --- a/library/shelve.po +++ b/library/shelve.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -93,7 +93,7 @@ msgstr "" #: ../../library/shelve.rst:64 msgid "" -"Because the :mod:`shelve` module is backed by :mod:`pickle`, it is insecure " +"Because the :mod:`!shelve` module is backed by :mod:`pickle`, it is insecure " "to load a shelf from an untrusted source. Like with pickle, loading a shelf " "can execute arbitrary code." msgstr "" @@ -148,7 +148,7 @@ msgstr "" #: ../../library/shelve.rst:109 msgid "" -"The :mod:`shelve` module does not support *concurrent* read/write access to " +"The :mod:`!shelve` module does not support *concurrent* read/write access to " "shelved objects. (Multiple simultaneous read accesses are safe.) When a " "program has a shelf open for writing, no other program should have it open " "for reading or writing. Unix file locking can be used to solve this, but " @@ -285,7 +285,8 @@ msgid "Module :mod:`pickle`" msgstr ":mod:`pickle` 模組" #: ../../library/shelve.rst:222 -msgid "Object serialization used by :mod:`shelve`." +#, fuzzy +msgid "Object serialization used by :mod:`!shelve`." msgstr ":mod:`shelve` 使用的物件序列化。" #: ../../library/shelve.rst:9 ../../library/shelve.rst:97 diff --git a/library/shlex.po b/library/shlex.po index 30aafe8cba..6ae3112d18 100644 --- a/library/shlex.po +++ b/library/shlex.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-01 22:24+0800\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -34,7 +34,8 @@ msgid "" msgstr "" #: ../../library/shlex.rst:21 -msgid "The :mod:`shlex` module defines the following functions:" +#, fuzzy +msgid "The :mod:`!shlex` module defines the following functions:" msgstr ":mod:`shlex` 模組定義了以下函式:" #: ../../library/shlex.rst:26 @@ -103,7 +104,8 @@ msgid "The quoting is compatible with UNIX shells and with :func:`split`:" msgstr "" #: ../../library/shlex.rst:101 -msgid "The :mod:`shlex` module defines the following class:" +#, fuzzy +msgid "The :mod:`!shlex` module defines the following class:" msgstr ":mod:`shlex` 模組定義了以下類別:" #: ../../library/shlex.rst:106 @@ -237,7 +239,7 @@ msgstr "" #: ../../library/shlex.rst:217 msgid "" -"This convenience is provided to encourage :mod:`shlex` users to generate " +"This convenience is provided to encourage :mod:`!shlex` users to generate " "error messages in the standard, parseable format understood by Emacs and " "other Unix tools." msgstr "" diff --git a/library/shutil.po b/library/shutil.po index 158145ee08..d8785c429c 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-12 00:14+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/shutil.py`" #: ../../library/shutil.rst:18 msgid "" -"The :mod:`shutil` module offers a number of high-level operations on files " +"The :mod:`!shutil` module offers a number of high-level operations on files " "and collections of files. In particular, functions are provided which " "support file copying and removal. For operations on individual files, see " "also the :mod:`os` module." @@ -877,7 +877,9 @@ msgstr "" msgid "" "*logger* must be an object compatible with :pep:`282`, usually an instance " "of :class:`logging.Logger`." -msgstr "*logger* 必須是與 :pep:`282` 相容的物件,通常是 :class:`logging.Logger` 的實例。" +msgstr "" +"*logger* 必須是與 :pep:`282` 相容的物件,通常是 :class:`logging.Logger` 的實" +"例。" #: ../../library/shutil.rst:652 msgid "The *verbose* argument is unused and deprecated." @@ -918,7 +920,8 @@ msgid "" msgstr "" #: ../../library/shutil.rst:677 ../../library/shutil.rst:794 -msgid "By default :mod:`shutil` provides these formats:" +#, fuzzy +msgid "By default :mod:`!shutil` provides these formats:" msgstr "預設情況下 :mod:`shutil` 提供這些格式:" #: ../../library/shutil.rst:679 diff --git a/library/signal.po b/library/signal.po index 3e5ac2df35..250db81f2d 100644 --- a/library/signal.po +++ b/library/signal.po @@ -6,7 +6,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-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -213,7 +213,8 @@ msgstr "" "手冊。" #: ../../library/signal.rst:111 -msgid "The variables defined in the :mod:`signal` module are:" +#, fuzzy +msgid "The variables defined in the :mod:`!signal` module are:" msgstr "在 :mod:`signal` 模組中定義的變數有:" #: ../../library/signal.rst:116 @@ -373,9 +374,9 @@ msgid "" msgstr "" "所有的訊號編號都是以符號定義的。例如,掛斷訊號被定義為 :const:`signal." "SIGHUP`;變數名稱與 C 程式中使用的名稱相同,可在 ```` 中找到。Unix " -"線上手冊 '``signal``' 列出了現有的訊號(在某些系統上是 :manpage:" -"`signal(2)`,在其他系統上是在 :manpage:`signal(7)` 中)。請注意,並非所有系統" -"都會定義同一套訊號名稱;只有那些由系統所定義的名稱才會由這個模組定義。" +"線上手冊 '``signal``' 列出了現有的訊號(在某些系統上是 :manpage:`signal(2)`," +"在其他系統上是在 :manpage:`signal(7)` 中)。請注意,並非所有系統都會定義同一" +"套訊號名稱;只有那些由系統所定義的名稱才會由這個模組定義。" #: ../../library/signal.rst:287 msgid "" @@ -444,7 +445,8 @@ msgstr "" "被取代。" #: ../../library/signal.rst:353 -msgid "The :mod:`signal` module defines one exception:" +#, fuzzy +msgid "The :mod:`!signal` module defines one exception:" msgstr ":mod:`signal` 模組定義了一個例外:" #: ../../library/signal.rst:357 @@ -465,7 +467,8 @@ msgid "" msgstr "此錯誤過去是 :exc:`IOError` 的子型別,現在是 :exc:`OSError` 的別名。" #: ../../library/signal.rst:367 -msgid "The :mod:`signal` module defines the following functions:" +#, fuzzy +msgid "The :mod:`!signal` module defines the following functions:" msgstr ":mod:`signal` 模組定義了下列函式:" #: ../../library/signal.rst:372 @@ -916,8 +919,9 @@ msgid "" "``siginfo_t`` structure, namely: ``si_signo``, ``si_code``, ``si_errno``, " "``si_pid``, ``si_uid``, ``si_status``, ``si_band``." msgstr "" -"回傳值是一個物件,代表 ``siginfo_t`` 結構所包含的資料,即 ``si_signo``、``si_code``、``si_errno``、" -"``si_pid``、``si_uid``、``si_status``、``si_band``。" +"回傳值是一個物件,代表 ``siginfo_t`` 結構所包含的資料,即 ``si_signo``、" +"``si_code``、``si_errno``、``si_pid``、``si_uid``、``si_status``、" +"``si_band``。" #: ../../library/signal.rst:675 msgid "See the man page :manpage:`sigwaitinfo(2)` for further information." diff --git a/library/site.po b/library/site.po index d9e0fa07b2..596c246ba0 100644 --- a/library/site.po +++ b/library/site.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-03 00:20+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -76,11 +76,11 @@ msgstr "" #: ../../library/site.rst:54 msgid "" -":mod:`site` is no longer responsible for updating :data:`sys.prefix` and :" +":mod:`!site` is no longer responsible for updating :data:`sys.prefix` and :" "data:`sys.exec_prefix` on :ref:`sys-path-init-virtual-environments`. This is " "now done during the :ref:`path initialization `. As a result, " "under :ref:`sys-path-init-virtual-environments`, :data:`sys.prefix` and :" -"data:`sys.exec_prefix` no longer depend on the :mod:`site` initialization, " +"data:`sys.exec_prefix` no longer depend on the :mod:`!site` initialization, " "and are therefore unaffected by :option:`-S`." msgstr "" @@ -318,7 +318,7 @@ msgstr "命令列介面" #: ../../library/site.rst:278 msgid "" -"The :mod:`site` module also provides a way to get the user directories from " +"The :mod:`!site` module also provides a way to get the user directories from " "the command line:" msgstr "" diff --git a/library/smtplib.po b/library/smtplib.po index 5cb1bddb9b..e24a1377ec 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-17 00:14+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/smtplib.py`" #: ../../library/smtplib.rst:17 msgid "" -"The :mod:`smtplib` module defines an SMTP client session object that can be " +"The :mod:`!smtplib` module defines an SMTP client session object that can be " "used to send mail to any internet machine with an SMTP or ESMTP listener " "daemon. For details of SMTP and ESMTP operation, consult :rfc:`821` (Simple " "Mail Transfer Protocol) and :rfc:`1869` (SMTP Service Extensions)." @@ -445,7 +445,7 @@ msgstr "" #: ../../library/smtplib.rst:339 msgid "" -"Each of the authentication methods supported by :mod:`smtplib` are tried in " +"Each of the authentication methods supported by :mod:`!smtplib` are tried in " "turn if they are advertised as supported by the server. See :meth:`auth` " "for a list of supported authentication methods. *initial_response_ok* is " "passed through to :meth:`auth`." @@ -522,7 +522,7 @@ msgid "" "call the :meth:`login` method, which will try each of the above mechanisms " "in turn, in the order listed. ``auth`` is exposed to facilitate the " "implementation of authentication methods not (or not yet) supported directly " -"by :mod:`smtplib`." +"by :mod:`!smtplib`." msgstr "" #: ../../library/smtplib.rst:398 diff --git a/library/socket.po b/library/socket.po index abb2d46f77..9714f69f65 100644 --- a/library/socket.po +++ b/library/socket.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-30 00:16+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2024-12-30 23:45+0800\n" "Last-Translator: Jay \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -95,10 +95,10 @@ msgid "" "operations is automatic, and buffer length is implicit on send operations." msgstr "" "Python 的介面是將 Unix 的系統呼叫和 socket 函式庫介面直接轉換成 Python 的物件" -"導向風格::func:`~socket.socket` 函式會回傳一個 :dfn:`socket 物件`,這個物件的方法實" -"作了各種 socket 系統呼叫。與 C 語言介面相比,參數型別較為高階:就像 Python 文" -"件操作中的 :meth:`read` 和 :meth:`write` 一樣,接收操作時會自動分配緩衝區,而" -"發送操作時的緩衝區長度則是隱含的。" +"導向風格::func:`~socket.socket` 函式會回傳一個 :dfn:`socket 物件`,這個物件" +"的方法實作了各種 socket 系統呼叫。與 C 語言介面相比,參數型別較為高階:就像 " +"Python 文件操作中的 :meth:`read` 和 :meth:`write` 一樣,接收操作時會自動分配" +"緩衝區,而發送操作時的緩衝區長度則是隱含的。" #: ../../library/socket.rst:35 msgid "Module :mod:`socketserver`" @@ -178,7 +178,7 @@ msgid "" "For :const:`AF_INET6` address family, a four-tuple ``(host, port, flowinfo, " "scope_id)`` is used, where *flowinfo* and *scope_id* represent the " "``sin6_flowinfo`` and ``sin6_scope_id`` members in :const:`struct " -"sockaddr_in6` in C. For :mod:`socket` module methods, *flowinfo* and " +"sockaddr_in6` in C. For :mod:`!socket` module methods, *flowinfo* and " "*scope_id* can be omitted just for backward compatibility. Note, however, " "omission of *scope_id* can cause problems in manipulating scoped IPv6 " "addresses." @@ -546,7 +546,7 @@ msgid "Module contents" msgstr "模組內容" #: ../../library/socket.rst:305 -msgid "The module :mod:`socket` exports the following elements." +msgid "The module :mod:`!socket` exports the following elements." msgstr "" #: ../../library/socket.rst:309 @@ -1192,7 +1192,7 @@ msgid "Other functions" msgstr "其他函式" #: ../../library/socket.rst:1031 -msgid "The :mod:`socket` module also offers various network-related services:" +msgid "The :mod:`!socket` module also offers various network-related services:" msgstr "" #: ../../library/socket.rst:1036 @@ -2721,7 +2721,7 @@ msgstr "" #: ../../library/socket.rst:2415 msgid "" -"There is a :mod:`socket` flag to set, in order to prevent this, :const:" +"There is a :mod:`!socket` flag to set, in order to prevent this, :const:" "`socket.SO_REUSEADDR`::" msgstr "" diff --git a/library/socketserver.po b/library/socketserver.po index a08e7f8e66..cf3b56f7a0 100644 --- a/library/socketserver.po +++ b/library/socketserver.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-20 17:54+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,10 +26,11 @@ msgid "**Source code:** :source:`Lib/socketserver.py`" msgstr "**原始碼:**\\ :source:`Lib/socketserver.py`" #: ../../library/socketserver.rst:11 +#, fuzzy msgid "" -"The :mod:`socketserver` module simplifies the task of writing network " +"The :mod:`!socketserver` module simplifies the task of writing network " "servers." -msgstr "" +msgstr ":mod:`!socketserver` --- 用於網路伺服器的框架" #: ../../includes/wasm-notavail.rst:3 msgid "Availability" diff --git a/library/ssl.po b/library/ssl.po index 3bf0816c93..a13c1abff2 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-30 00:16+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2024-08-28 00:43+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -234,9 +234,10 @@ msgid "" msgstr "一個可以幫忙建立出 :class:`SSLContext` 物件以用於一般目的的方便函式。" #: ../../library/ssl.rst:132 +#, fuzzy msgid "" "Return a new :class:`SSLContext` object with default settings for the given " -"*purpose*. The settings are chosen by the :mod:`ssl` module, and usually " +"*purpose*. The settings are chosen by the :mod:`!ssl` module, and usually " "represent a higher security level than when calling the :class:`SSLContext` " "constructor directly." msgstr "" @@ -2092,7 +2093,7 @@ msgstr "" #: ../../library/ssl.rst:1459 msgid "" -":func:`create_default_context` lets the :mod:`ssl` module choose security " +":func:`create_default_context` lets the :mod:`!ssl` module choose security " "settings for a given purpose." msgstr "" diff --git a/library/stat.po b/library/stat.po index 0034b006e3..0f70cb06be 100644 --- a/library/stat.po +++ b/library/stat.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 00:13+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2016-11-19 00:34+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/stat.py`" #: ../../library/stat.rst:14 msgid "" -"The :mod:`stat` module defines constants and functions for interpreting the " +"The :mod:`!stat` module defines constants and functions for interpreting the " "results of :func:`os.stat`, :func:`os.fstat` and :func:`os.lstat` (if they " "exist). For complete details about the :c:func:`stat`, :c:func:`!fstat` " "and :c:func:`!lstat` calls, consult the documentation for your system." @@ -38,8 +38,9 @@ msgid "The stat module is backed by a C implementation." msgstr "" #: ../../library/stat.rst:22 +#, fuzzy msgid "" -"The :mod:`stat` module defines the following functions to test for specific " +"The :mod:`!stat` module defines the following functions to test for specific " "file types:" msgstr ":mod:`stat` 模組定義了以下函式,用於測試特定檔案類型:" diff --git a/library/string.po b/library/string.po index 960731597d..8450125b65 100644 --- a/library/string.po +++ b/library/string.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-17 00:14+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2024-03-10 15:57+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -116,11 +116,12 @@ msgid "Custom String Formatting" msgstr "自訂字串格式" #: ../../library/string.rst:88 +#, fuzzy msgid "" "The built-in string class provides the ability to do complex variable " "substitutions and value formatting via the :meth:`~str.format` method " -"described in :pep:`3101`. The :class:`Formatter` class in the :mod:`string` " -"module allows you to create and customize your own string formatting " +"described in :pep:`3101`. The :class:`Formatter` class in the :mod:`!" +"string` module allows you to create and customize your own string formatting " "behaviors using the same implementation as the built-in :meth:`~str.format` " "method." msgstr "" @@ -1340,7 +1341,7 @@ msgstr "" #: ../../library/string.rst:843 msgid "" -"The :mod:`string` module provides a :class:`Template` class that implements " +"The :mod:`!string` module provides a :class:`Template` class that implements " "these rules. The methods of :class:`Template` are:" msgstr "" diff --git a/library/stringprep.po b/library/stringprep.po index 78c266b53a..12166ffcd2 100644 --- a/library/stringprep.po +++ b/library/stringprep.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-09 00:03+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2025-02-17 00:34+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -59,8 +59,9 @@ msgstr "" "``stringprep`` 配置文件的一個例子是 ``nameprep``,它被用於國際化網域名稱。" #: ../../library/stringprep.rst:29 +#, fuzzy msgid "" -"The module :mod:`stringprep` only exposes the tables from :rfc:`3454`. As " +"The module :mod:`!stringprep` only exposes the tables from :rfc:`3454`. As " "these tables would be very large to represent as dictionaries or lists, the " "module uses the Unicode character database internally. The module source " "code itself was generated using the ``mkstringprep.py`` utility." @@ -70,13 +71,14 @@ msgstr "" "使用 ``mkstringprep.py`` 工具來產生的。" #: ../../library/stringprep.rst:34 +#, fuzzy msgid "" "As a result, these tables are exposed as functions, not as data structures. " -"There are two kinds of tables in the RFC: sets and mappings. For a " -"set, :mod:`stringprep` provides the \"characteristic function\", i.e. a " -"function that returns ``True`` if the parameter is part of the set. For " -"mappings, it provides the mapping function: given the key, it returns the " -"associated value. Below is a list of all functions available in the module." +"There are two kinds of tables in the RFC: sets and mappings. For a set, :mod:" +"`!stringprep` provides the \"characteristic function\", i.e. a function that " +"returns ``True`` if the parameter is part of the set. For mappings, it " +"provides the mapping function: given the key, it returns the associated " +"value. Below is a list of all functions available in the module." msgstr "" "因此,這些表是以函式而非資料結構的形式呈現。RFC 中有兩種表:集合 (sets) 和對" "映 (mappings)。對於集合,:mod:`stringprep` 提供了「特徵函式 (characteristic " @@ -88,7 +90,8 @@ msgid "" "Determine whether *code* is in tableA.1 (Unassigned code points in Unicode " "3.2)." msgstr "" -"判斷 *code* 是否在 tableA.1(Unicode 3.2 中未指定的編碼位置 (code point))中。" +"判斷 *code* 是否在 tableA.1(Unicode 3.2 中未指定的編碼位置 (code point))" +"中。" #: ../../library/stringprep.rst:49 msgid "Determine whether *code* is in tableB.1 (Commonly mapped to nothing)." diff --git a/library/struct.po b/library/struct.po index bb5be9d795..93be1c6c68 100644 --- a/library/struct.po +++ b/library/struct.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-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -59,14 +59,15 @@ msgstr "" "alignment`。" #: ../../library/struct.rst:39 -msgid "" -"Several :mod:`struct` functions (and methods of :class:`Struct`) take a " -"*buffer* argument. This refers to objects that implement " -"the :ref:`bufferobjects` and provide either a readable or read-writable " -"buffer. The most common types used for that purpose are :class:`bytes` " -"and :class:`bytearray`, but many other types that can be viewed as an array " -"of bytes implement the buffer protocol, so that they can be read/filled " -"without additional copying from a :class:`bytes` object." +#, fuzzy +msgid "" +"Several :mod:`!struct` functions (and methods of :class:`Struct`) take a " +"*buffer* argument. This refers to objects that implement the :ref:" +"`bufferobjects` and provide either a readable or read-writable buffer. The " +"most common types used for that purpose are :class:`bytes` and :class:" +"`bytearray`, but many other types that can be viewed as an array of bytes " +"implement the buffer protocol, so that they can be read/filled without " +"additional copying from a :class:`bytes` object." msgstr "" "一些 :mod:`struct` 函式(和 :class:`Struct` 的方法)接受一個 *buffer* 引數。" "這是指實作\\ :ref:`bufferobjects` 並提供可讀或可讀寫緩衝區的物件。最常用於此" @@ -287,12 +288,12 @@ msgstr "Python 範例:" msgid "" "Native byte order is big-endian or little-endian, depending on the host " "system. For example, Intel x86, AMD64 (x86-64), and Apple M1 are little-" -"endian; IBM z and many legacy architectures are big-endian. " -"Use :data:`sys.byteorder` to check the endianness of your system." +"endian; IBM z and many legacy architectures are big-endian. Use :data:`sys." +"byteorder` to check the endianness of your system." msgstr "" "原生位元組順序是大端序或小端序,會取決於主機系統。例如,Intel x86、AMD64 " -"(x86-64)和 Apple M1 是小端序;IBM z 和許多舊架構是大端序。可使" -"用 :data:`sys.byteorder` 來檢查你系統的位元組順序。" +"(x86-64)和 Apple M1 是小端序;IBM z 和許多舊架構是大端序。可使用 :data:`sys." +"byteorder` 來檢查你系統的位元組順序。" #: ../../library/struct.rst:183 msgid "" @@ -304,8 +305,8 @@ msgstr "" #: ../../library/struct.rst:186 msgid "" -"Standard size depends only on the format character; see the table in " -"the :ref:`format-characters` section." +"Standard size depends only on the format character; see the table in the :" +"ref:`format-characters` section." msgstr "" "標準大小僅取決於格式字元;請參見\\ :ref:`format-characters`\\ 區塊中的表格。" @@ -709,8 +710,8 @@ msgid "" "codes, if the non-integer has a :meth:`~object.__index__` method then that " "method is called to convert the argument to an integer before packing." msgstr "" -"當嘗試使用任何整數轉換碼打包非整數時,如果非整數具" -"有 :meth:`~object.__index__` 方法,則會呼叫該方法在打包之前將引數轉換為整數。" +"當嘗試使用任何整數轉換碼打包非整數時,如果非整數具有 :meth:`~object." +"__index__` 方法,則會呼叫該方法在打包之前將引數轉換為整數。" #: ../../library/struct.rst:298 msgid "Added use of the :meth:`~object.__index__` method for non-integers." @@ -776,13 +777,13 @@ msgid "" "The ``'p'`` format character encodes a \"Pascal string\", meaning a short " "variable-length string stored in a *fixed number of bytes*, given by the " "count. The first byte stored is the length of the string, or 255, whichever " -"is smaller. The bytes of the string follow. If the string passed in " -"to :func:`pack` is too long (longer than the count minus 1), only the " -"leading ``count-1`` bytes of the string are stored. If the string is " -"shorter than ``count-1``, it is padded with null bytes so that exactly count " -"bytes in all are used. Note that for :func:`unpack`, the ``'p'`` format " -"character consumes ``count`` bytes, but that the string returned can never " -"contain more than 255 bytes." +"is smaller. The bytes of the string follow. If the string passed in to :" +"func:`pack` is too long (longer than the count minus 1), only the leading " +"``count-1`` bytes of the string are stored. If the string is shorter than " +"``count-1``, it is padded with null bytes so that exactly count bytes in all " +"are used. Note that for :func:`unpack`, the ``'p'`` format character " +"consumes ``count`` bytes, but that the string returned can never contain " +"more than 255 bytes." msgstr "" "``'p'`` 格式字元編碼一個「Pascal 字串」,意思是儲存在\\ *固定位元組數*\\ 中的" "短、長度可變字串,由計數指定。儲存的第一個位元組是字串的長度,或與 255 間取較" @@ -843,8 +844,8 @@ msgstr "格式之間的空白字元會被忽略;但是計數和其格式不能 msgid "" "When packing a value ``x`` using one of the integer formats (``'b'``, " "``'B'``, ``'h'``, ``'H'``, ``'i'``, ``'I'``, ``'l'``, ``'L'``, ``'q'``, " -"``'Q'``), if ``x`` is outside the valid range for that format " -"then :exc:`struct.error` is raised." +"``'Q'``), if ``x`` is outside the valid range for that format then :exc:" +"`struct.error` is raised." msgstr "" "當使用整數格式之一(``'b'``、``'B'``、``'h'``、``'H'``、``'i'``、``'I'``、" "``'l'``、``'L'``、``'q'``、``'Q'``)打包數值 ``x`` 時,如果 ``x`` 超出該格式" @@ -855,8 +856,8 @@ msgid "" "Previously, some of the integer formats wrapped out-of-range values and " "raised :exc:`DeprecationWarning` instead of :exc:`struct.error`." msgstr "" -"以前一些整數格式會環繞超出範圍的數值並引發 :exc:`DeprecationWarning` 而不" -"是 :exc:`struct.error`。" +"以前一些整數格式會環繞超出範圍的數值並引發 :exc:`DeprecationWarning` 而不是 :" +"exc:`struct.error`。" #: ../../library/struct.rst:386 msgid "" @@ -1042,8 +1043,9 @@ msgid "Applications" msgstr "應用" #: ../../library/struct.rst:482 +#, fuzzy msgid "" -"Two main applications for the :mod:`struct` module exist, data interchange " +"Two main applications for the :mod:`!struct` module exist, data interchange " "between Python and C code within an application or another application " "compiled using the same compiler (:ref:`native formats`), and data interchange between applications using agreed upon data " @@ -1209,7 +1211,8 @@ msgid "Classes" msgstr "類別" #: ../../library/struct.rst:574 -msgid "The :mod:`struct` module also defines the following type:" +#, fuzzy +msgid "The :mod:`!struct` module also defines the following type:" msgstr ":mod:`struct` 模組也定義了以下型別:" #: ../../library/struct.rst:579 @@ -1241,8 +1244,8 @@ msgid "" "Identical to the :func:`pack` function, using the compiled format. " "(``len(result)`` will equal :attr:`size`.)" msgstr "" -"與 :func:`pack` 函式相同,會使用編譯過的格式。(``len(result)`` 將等" -"於 :attr:`size`。)" +"與 :func:`pack` 函式相同,會使用編譯過的格式。(``len(result)`` 將等於 :attr:" +"`size`。)" #: ../../library/struct.rst:601 msgid "Identical to the :func:`pack_into` function, using the compiled format." @@ -1253,14 +1256,14 @@ msgid "" "Identical to the :func:`unpack` function, using the compiled format. The " "buffer's size in bytes must equal :attr:`size`." msgstr "" -"與 :func:`unpack` 函式相同,會使用編譯過的格式。緩衝區的位元組大小必須等" -"於 :attr:`size`。" +"與 :func:`unpack` 函式相同,會使用編譯過的格式。緩衝區的位元組大小必須等於 :" +"attr:`size`。" #: ../../library/struct.rst:612 msgid "" "Identical to the :func:`unpack_from` function, using the compiled format. " -"The buffer's size in bytes, starting at position *offset*, must be at " -"least :attr:`size`." +"The buffer's size in bytes, starting at position *offset*, must be at least :" +"attr:`size`." msgstr "" "與 :func:`unpack_from` 函式相同,會使用編譯過的格式。緩衝區從位置 *offset* 開" "始的位元組大小必須至少為 :attr:`size`。" diff --git a/library/subprocess.po b/library/subprocess.po index 512bf7267c..92ff13c1e6 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-02 00:15+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "**原始碼:**:source:`Lib/subprocess.py`" #: ../../library/subprocess.rst:14 msgid "" -"The :mod:`subprocess` module allows you to spawn new processes, connect to " +"The :mod:`!subprocess` module allows you to spawn new processes, connect to " "their input/output/error pipes, and obtain their return codes. This module " "intends to replace several older modules and functions::" msgstr "" @@ -42,7 +42,7 @@ msgstr "" #: ../../library/subprocess.rst:21 msgid "" -"Information about how the :mod:`subprocess` module can be used to replace " +"Information about how the :mod:`!subprocess` module can be used to replace " "these modules and functions can be found in the following sections." msgstr "" @@ -63,12 +63,13 @@ msgid "" "This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." msgstr "" -"此模組在\\ :ref:`行動平台 `\\ 或 :ref:`WebAssembly 平" -"台 `\\ 上不支援。" +"此模組在\\ :ref:`行動平台 `\\ 或 :ref:`WebAssembly 平台 " +"`\\ 上不支援。" #: ../../library/subprocess.rst:31 -msgid "Using the :mod:`subprocess` Module" -msgstr "" +#, fuzzy +msgid "Using the :mod:`!subprocess` Module" +msgstr "subprocess 模組" #: ../../library/subprocess.rst:33 msgid "" @@ -1389,7 +1390,7 @@ msgid "Windows Constants" msgstr "" #: ../../library/subprocess.rst:1044 -msgid "The :mod:`subprocess` module exposes the following constants." +msgid "The :mod:`!subprocess` module exposes the following constants." msgstr "" #: ../../library/subprocess.rst:1048 @@ -1655,7 +1656,7 @@ msgid "*encoding* and *errors* were added. See :func:`run` for details." msgstr "新增 *encoding* 與 *errors*。細節請見 :func:`run`。" #: ../../library/subprocess.rst:1334 -msgid "Replacing Older Functions with the :mod:`subprocess` Module" +msgid "Replacing Older Functions with the :mod:`!subprocess` Module" msgstr "" #: ../../library/subprocess.rst:1336 @@ -1682,7 +1683,7 @@ msgstr "" #: ../../library/subprocess.rst:1349 msgid "" "In the following examples, we assume that the relevant functions have " -"already been imported from the :mod:`subprocess` module." +"already been imported from the :mod:`!subprocess` module." msgstr "" #: ../../library/subprocess.rst:1354 @@ -1766,7 +1767,7 @@ msgstr "" msgid "" "The :func:`os.system` function ignores SIGINT and SIGQUIT signals while the " "command is running, but the caller must do this separately when using the :" -"mod:`subprocess` module." +"mod:`!subprocess` module." msgstr "" #: ../../library/subprocess.rst:1412 @@ -2058,8 +2059,9 @@ msgid "Disable use of ``posix_spawn()``" msgstr "停用 ``posix_spawn()``" #: ../../library/subprocess.rst:1594 +#, fuzzy msgid "" -"On Linux, :mod:`subprocess` defaults to using the ``vfork()`` system call " +"On Linux, :mod:`!subprocess` defaults to using the ``vfork()`` system call " "internally when it is safe to do so rather than ``fork()``. This greatly " "improves performance." msgstr "" diff --git a/library/symtable.po b/library/symtable.po index 9280f6b78f..c92ade5021 100644 --- a/library/symtable.po +++ b/library/symtable.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-02-07 00:19+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,10 +27,11 @@ msgid "**Source code:** :source:`Lib/symtable.py`" msgstr "**原始碼:**\\ :source:`Lib/symtable.py`" #: ../../library/symtable.rst:15 +#, fuzzy msgid "" "Symbol tables are generated by the compiler from AST just before bytecode is " "generated. The symbol table is responsible for calculating the scope of " -"every identifier in the code. :mod:`symtable` provides an interface to " +"every identifier in the code. :mod:`!symtable` provides an interface to " "examine these tables." msgstr "" "符號表 (symbol table) 是在生成位元組碼 (bytecode) 之前由編譯器從 AST 生成的。" @@ -112,8 +113,8 @@ msgstr "" #: ../../library/symtable.rst:88 msgid "" -"Return the type of the symbol table. Possible values are members of " -"the :class:`SymbolTableType` enumeration." +"Return the type of the symbol table. Possible values are members of the :" +"class:`SymbolTableType` enumeration." msgstr "回傳符號表的類型。可能的值為 :class:`SymbolTableType` 列舉的成員。" #: ../../library/symtable.rst:91 @@ -148,14 +149,14 @@ msgid "" "``'top'`` if the table is global (:meth:`get_type` returns ``'module'``). " "For type parameter scopes (which are used for generic classes, functions, " "and type aliases), it is the name of the underlying class, function, or type " -"alias. For type alias scopes, it is the name of the type alias. " -"For :class:`~typing.TypeVar` bound scopes, it is the name of the ``TypeVar``." +"alias. For type alias scopes, it is the name of the type alias. For :class:" +"`~typing.TypeVar` bound scopes, it is the name of the ``TypeVar``." msgstr "" "回傳表的名稱。如果表用於類別,則這是類別的名稱;如果表用於函式,則這是函式的" "名稱;如果表是全域的,則為 ``'top'`` (:meth:`get_type` 會回傳 " "``'module'``)。對於型別參數作用域(用於泛型類別、函式和型別別名),它是底層" -"類別、函式或型別別名的名稱。對於型別別名作用域,它是型別別名的名稱。對" -"於 :class:`~typing.TypeVar` 綁定作用域,它會是 ``TypeVar`` 的名稱。" +"類別、函式或型別別名的名稱。對於型別別名作用域,它是型別別名的名稱。對於 :" +"class:`~typing.TypeVar` 綁定作用域,它會是 ``TypeVar`` 的名稱。" #: ../../library/symtable.rst:118 msgid "Return the number of the first line in the block this table represents." @@ -179,8 +180,8 @@ msgstr "" #: ../../library/symtable.rst:135 msgid "" -"Return a view object containing the names of symbols in the table. See " -"the :ref:`documentation of view objects `." +"Return a view object containing the names of symbols in the table. See the :" +"ref:`documentation of view objects `." msgstr "" "回傳包含表中符號之名稱的視圖物件 (view object)。請參閱\\ :ref:`視圖物件的文" "件 `。" @@ -199,8 +200,8 @@ msgstr "回傳巢狀符號表的串列。" #: ../../library/symtable.rst:153 msgid "" -"A namespace for a function or method. This class inherits " -"from :class:`SymbolTable`." +"A namespace for a function or method. This class inherits from :class:" +"`SymbolTable`." msgstr "一個函式或方法的命名空間。該類別繼承自 :class:`SymbolTable`。" #: ../../library/symtable.rst:158 @@ -461,8 +462,10 @@ msgid "Command-Line Usage" msgstr "命令列用法" #: ../../library/symtable.rst:358 +#, fuzzy msgid "" -"The :mod:`symtable` module can be executed as a script from the command line." +"The :mod:`!symtable` module can be executed as a script from the command " +"line." msgstr ":mod:`symtable` 模組可以從命令列作為腳本執行。" #: ../../library/symtable.rst:360 diff --git a/library/sys.monitoring.po b/library/sys.monitoring.po index e81860cd52..8b71320d04 100644 --- a/library/sys.monitoring.po +++ b/library/sys.monitoring.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-05 00:16+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2025-11-07 17:51+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -21,8 +21,9 @@ msgid ":mod:`!sys.monitoring` --- Execution event monitoring" msgstr ":mod:`!sys.monitoring` --- 執行事件監控" #: ../../library/sys.monitoring.rst:13 +#, fuzzy msgid "" -":mod:`sys.monitoring` is a namespace within the :mod:`sys` module, not an " +":mod:`!sys.monitoring` is a namespace within the :mod:`sys` module, not an " "independent module, so there is no need to ``import sys.monitoring``, simply " "``import sys`` and then use ``sys.monitoring``." msgstr "" @@ -37,9 +38,10 @@ msgid "" msgstr "此命名空間提供對啟動和控制事件監控所需的函式和常數的存取。" #: ../../library/sys.monitoring.rst:22 +#, fuzzy msgid "" "As programs execute, events occur that might be of interest to tools that " -"monitor execution. The :mod:`sys.monitoring` namespace provides means to " +"monitor execution. The :mod:`!sys.monitoring` namespace provides means to " "receive callbacks when events of interest occur." msgstr "" "當程式執行時,會發生一些能被監控工具關注的事件。:mod:`sys.monitoring` 命名空" @@ -395,7 +397,8 @@ msgstr "其他事件" msgid "" "Other events are not necessarily tied to a specific location in the program " "and cannot be individually disabled via :data:`DISABLE`." -msgstr "其他事件不一定與程式中的特定位置相關聯,也不能透過 :data:`DISABLE` 單獨停用。" +msgstr "" +"其他事件不一定與程式中的特定位置相關聯,也不能透過 :data:`DISABLE` 單獨停用。" #: ../../library/sys.monitoring.rst:231 msgid "The other events that can be monitored are:" @@ -520,8 +523,8 @@ msgid "" "which are set in *event_set*. Raises a :exc:`ValueError` if *tool_id* is not " "in use." msgstr "" -"啟動 *event_set* 中針對 *code* 設定的所有\\ :ref:`區域事件 `。如果 *tool_id* 並未正在被" -"使用,則引發 :exc:`ValueError`。" +"啟動 *event_set* 中針對 *code* 設定的所有\\ :ref:`區域事件 `。如果 *tool_id* 並未正在被使用,則引發 :exc:`ValueError`。" #: ../../library/sys.monitoring.rst:305 msgid "Disabling events" @@ -540,8 +543,9 @@ msgid "" "function. This does not change which events are set, or any other code " "locations for the same event." msgstr "" -"可透過回呼函式回傳 :data:`sys.monitoring.DISABLE` 來停用特定程式碼位置的\\ :ref:`區域事件 `" -"。這不會改變被設定的事件,或相同事件的任何其他程式碼位置。" +"可透過回呼函式回傳 :data:`sys.monitoring.DISABLE` 來停用特定程式碼位置的\\ :" +"ref:`區域事件 `。這不會改變被設定的事件,或相同事件的" +"任何其他程式碼位置。" #: ../../library/sys.monitoring.rst:317 msgid "" @@ -560,8 +564,9 @@ msgid "" "interpreter in a non-specific location (that is, no traceback will be " "provided)." msgstr "" -"如果回呼是為一個\\ :ref:`全域事件 `\\ 回傳 :data:`DISABLE`,則直" -"譯器會在非特定位置引發 :exc:`ValueError`\\ (也就是不會提供回溯 (traceback))。" +"如果回呼是為一個\\ :ref:`全域事件 `\\ 回傳 :data:" +"`DISABLE`,則直譯器會在非特定位置引發 :exc:`ValueError`\\ (也就是不會提供回" +"溯 (traceback))。" #: ../../library/sys.monitoring.rst:329 msgid "" diff --git a/library/sys.po b/library/sys.po index 7136f8fcec..a0839693f1 100644 --- a/library/sys.po +++ b/library/sys.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-22 16:08+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2875,7 +2875,7 @@ msgid "" "The version number used to form registry keys on Windows platforms. This is " "stored as string resource 1000 in the Python DLL. The value is normally the " "major and minor versions of the running Python interpreter. It is provided " -"in the :mod:`sys` module for informational purposes; modifying this value " +"in the :mod:`!sys` module for informational purposes; modifying this value " "has no effect on the registry keys used by Python." msgstr "" diff --git a/library/sysconfig.po b/library/sysconfig.po index 01b34730e9..965c5d5547 100644 --- a/library/sysconfig.po +++ b/library/sysconfig.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-05 00:16+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,7 +28,7 @@ msgstr "**原始碼:**\\ :source:`Lib/sysconfig`" #: ../../library/sysconfig.rst:19 msgid "" -"The :mod:`sysconfig` module provides access to Python's configuration " +"The :mod:`!sysconfig` module provides access to Python's configuration " "information like the list of installation paths and the configuration " "variables relevant for the current platform." msgstr "" @@ -46,7 +46,7 @@ msgstr "" #: ../../library/sysconfig.rst:31 msgid "" -":mod:`sysconfig` puts all variables found in these files in a dictionary " +":mod:`!sysconfig` puts all variables found in these files in a dictionary " "that can be accessed using :func:`get_config_vars` or :func:`get_config_var`." msgstr "" @@ -109,8 +109,8 @@ msgstr "" #: ../../library/sysconfig.rst:70 msgid "" "Python uses an installation scheme that differs depending on the platform " -"and on the installation options. These schemes are stored in :mod:" -"`sysconfig` under unique identifiers based on the value returned by :const:" +"and on the installation options. These schemes are stored in :mod:`!" +"sysconfig` under unique identifiers based on the value returned by :const:" "`os.name`. The schemes are used by package installers to determine where to " "copy files to." msgstr "" @@ -473,14 +473,14 @@ msgstr "安裝路徑函式" #: ../../library/sysconfig.rst:261 msgid "" -":mod:`sysconfig` provides some functions to determine these installation " +":mod:`!sysconfig` provides some functions to determine these installation " "paths." msgstr "" #: ../../library/sysconfig.rst:265 msgid "" -"Return a tuple containing all schemes currently supported in :mod:" -"`sysconfig`." +"Return a tuple containing all schemes currently supported in :mod:`!" +"sysconfig`." msgstr "" #: ../../library/sysconfig.rst:271 @@ -510,7 +510,7 @@ msgstr "" #: ../../library/sysconfig.rst:287 msgid "" "The return value is a scheme name listed in :func:`get_scheme_names`. It can " -"be passed to :mod:`sysconfig` functions that take a *scheme* argument, such " +"be passed to :mod:`!sysconfig` functions that take a *scheme* argument, such " "as :func:`get_paths`." msgstr "" @@ -538,8 +538,8 @@ msgstr "" #: ../../library/sysconfig.rst:315 msgid "" -"Return a tuple containing all path names currently supported in :mod:" -"`sysconfig`." +"Return a tuple containing all path names currently supported in :mod:`!" +"sysconfig`." msgstr "" #: ../../library/sysconfig.rst:321 @@ -555,7 +555,7 @@ msgstr "" #: ../../library/sysconfig.rst:326 msgid "" -":mod:`sysconfig` stores installation paths corresponding to each path name, " +":mod:`!sysconfig` stores installation paths corresponding to each path name, " "for each platform, with variables to be expanded. For instance the *stdlib* " "path for the *nt* scheme is: ``{base}/Lib``." msgstr "" @@ -724,7 +724,7 @@ msgid "Command-line usage" msgstr "命令列用法" #: ../../library/sysconfig.rst:434 -msgid "You can use :mod:`sysconfig` as a script with Python's *-m* option:" +msgid "You can use :mod:`!sysconfig` as a script with Python's *-m* option:" msgstr "" #: ../../library/sysconfig.rst:436 diff --git a/library/tarfile.po b/library/tarfile.po index 3d7e0cb949..a7a71b6fd1 100644 --- a/library/tarfile.po +++ b/library/tarfile.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-10 16:45+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,15 +28,16 @@ msgid "**Source code:** :source:`Lib/tarfile.py`" msgstr "**原始碼:**\\ :source:`Lib/tarfile.py`" #: ../../library/tarfile.rst:14 +#, fuzzy msgid "" -"The :mod:`tarfile` module makes it possible to read and write tar archives, " +"The :mod:`!tarfile` module makes it possible to read and write tar archives, " "including those using gzip, bz2 and lzma compression. Use the :mod:`zipfile` " "module to read or write :file:`.zip` files, or the higher-level functions " "in :ref:`shutil `." msgstr "" -":mod:`tarfile` 模組用於讀取與寫入 tar 封存檔案,包括使用 gzip、bz2 和 lzma " -"壓縮的檔案。使用 :mod:`zipfile` 模組來讀取或寫入 :file:`.zip` 檔案,或使用 " -":ref:`shutil ` 中的更高階函式。" +":mod:`tarfile` 模組用於讀取與寫入 tar 封存檔案,包括使用 gzip、bz2 和 lzma 壓" +"縮的檔案。使用 :mod:`zipfile` 模組來讀取或寫入 :file:`.zip` 檔案,或使用 :" +"ref:`shutil ` 中的更高階函式。" #: ../../library/tarfile.rst:19 msgid "Some facts and figures:" @@ -47,8 +48,8 @@ msgid "" "reads and writes :mod:`gzip`, :mod:`bz2`, :mod:`compression.zstd`, and :mod:" "`lzma` compressed archives if the respective modules are available." msgstr "" -"若相對應的模組可用,則可讀取與寫入 :mod:`gzip`、:mod:`bz2`、:mod:`compression.zstd` 和 " -":mod:`lzma` 壓縮的封存檔。" +"若相對應的模組可用,則可讀取與寫入 :mod:`gzip`、:mod:`bz2`、:mod:" +"`compression.zstd` 和 :mod:`lzma` 壓縮的封存檔。" #: ../../library/tarfile.rst:27 msgid "" @@ -57,9 +58,9 @@ msgid "" "whoever provided Python to you). If you are the distributor, see :ref:" "`optional-module-requirements`." msgstr "" -"如果你的 CPython 副本中缺少這些\\ :term:`選用模組 (optional modules) `," -"請查閱你的發行者(即提供 Python 給你的人)的文件。如果你就是發行者,請參閱 " -":ref:`optional-module-requirements`。" +"如果你的 CPython 副本中缺少這些\\ :term:`選用模組 (optional modules) " +"`,請查閱你的發行者(即提供 Python 給你的人)的文件。如果你" +"就是發行者,請參閱 :ref:`optional-module-requirements`。" #: ../../library/tarfile.rst:32 msgid "read/write support for the POSIX.1-1988 (ustar) format." @@ -71,8 +72,8 @@ msgid "" "*longlink* extensions, read-only support for all variants of the *sparse* " "extension including restoration of sparse files." msgstr "" -"支援 GNU tar 格式的讀取與寫入,包括 *longname* 和 *longlink* 擴充功能,以及所有 *sparse* " -"擴充功能變體的唯讀支援,包括還原稀疏檔案 (sparse files)。" +"支援 GNU tar 格式的讀取與寫入,包括 *longname* 和 *longlink* 擴充功能,以及所" +"有 *sparse* 擴充功能變體的唯讀支援,包括還原稀疏檔案 (sparse files)。" #: ../../library/tarfile.rst:38 msgid "read/write support for the POSIX.1-2001 (pax) format." @@ -84,9 +85,9 @@ msgid "" "character devices and block devices and is able to acquire and restore file " "information like timestamp, access permissions and owner." msgstr "" -"處理目錄、一般檔案、硬連結 (hardlinks)、符號連結 (symbolic links)、fifos、字元裝置 " -"(character devices) 和區塊裝置 (block devices),並能夠取得與還原檔案資訊,如時間戳記" -"、存取權限和擁有者。" +"處理目錄、一般檔案、硬連結 (hardlinks)、符號連結 (symbolic links)、fifos、字" +"元裝置 (character devices) 和區塊裝置 (block devices),並能夠取得與還原檔案資" +"訊,如時間戳記、存取權限和擁有者。" #: ../../library/tarfile.rst:44 msgid "Added support for :mod:`lzma` compression." @@ -98,8 +99,9 @@ msgid "" "which makes it possible to either limit surprising/dangerous features, or to " "acknowledge that they are expected and the archive is fully trusted." msgstr "" -"解壓縮封存檔時會使用\\ :ref:`篩選器 (filter) `," -"你可以用它來限制一些意外或危險的功能,或是明確表示這些功能是你預期的,而且封存檔是完全可信任的。" +"解壓縮封存檔時會使用\\ :ref:`篩選器 (filter) `,你" +"可以用它來限制一些意外或危險的功能,或是明確表示這些功能是你預期的,而且封存" +"檔是完全可信任的。" #: ../../library/tarfile.rst:52 msgid "" @@ -108,8 +110,9 @@ msgid "" "outside of the destination. Previously, the filter strategy was equivalent " "to :func:`fully_trusted `." msgstr "" -"將預設解壓縮篩選器設為 :func:`data `,這會禁止一些危險的功能,例如指向絕對" -"路徑或目的地之外路徑的連結。在此之前,篩選器策略等同於 :func:`fully_trusted `。" +"將預設解壓縮篩選器設為 :func:`data `,這會禁止一些危險的功能,例" +"如指向絕對路徑或目的地之外路徑的連結。在此之前,篩選器策略等同於 :func:" +"`fully_trusted `。" #: ../../library/tarfile.rst:60 msgid "Added support for Zstandard compression using :mod:`compression.zstd`." @@ -121,8 +124,8 @@ msgid "" "information on :class:`TarFile` objects and the keyword arguments that are " "allowed, see :ref:`tarfile-objects`." msgstr "" -"回傳路徑名稱 *name* 的 :class:`TarFile` 物件。關於 :class:`TarFile` 物件與允許的" -"關鍵字引數的詳細資訊,請參閱 :ref:`tarfile-objects`。" +"回傳路徑名稱 *name* 的 :class:`TarFile` 物件。關於 :class:`TarFile` 物件與允" +"許的關鍵字引數的詳細資訊,請參閱 :ref:`tarfile-objects`。" #: ../../library/tarfile.rst:68 msgid "" @@ -197,7 +200,8 @@ msgid "" "Create a tarfile exclusively without compression. Raise a :exc:" "`FileExistsError` exception if it already exists." msgstr "" -"建立一個不壓縮的 tarfile(獨佔模式)。如果檔案已存在,則引發 :exc:`FileExistsError` 例外。" +"建立一個不壓縮的 tarfile(獨佔模式)。如果檔案已存在,則引發 :exc:" +"`FileExistsError` 例外。" #: ../../library/tarfile.rst:93 msgid "``'x:gz'``" @@ -208,7 +212,8 @@ msgid "" "Create a tarfile with gzip compression. Raise a :exc:`FileExistsError` " "exception if it already exists." msgstr "" -"建立一個使用 gzip 壓縮的 tar 檔案。如果檔案已存在則引發 :exc:`FileExistsError` 例外。" +"建立一個使用 gzip 壓縮的 tar 檔案。如果檔案已存在則引發 :exc:" +"`FileExistsError` 例外。" #: ../../library/tarfile.rst:97 msgid "``'x:bz2'``" @@ -218,7 +223,9 @@ msgstr "``'x:bz2'``" msgid "" "Create a tarfile with bzip2 compression. Raise a :exc:`FileExistsError` " "exception if it already exists." -msgstr "建立一個使用 bzip2 壓縮的 tar 檔案。如果檔案已存在,則引發 :exc:`FileExistsError` 例外。" +msgstr "" +"建立一個使用 bzip2 壓縮的 tar 檔案。如果檔案已存在,則引發 :exc:" +"`FileExistsError` 例外。" #: ../../library/tarfile.rst:101 msgid "``'x:xz'``" @@ -229,7 +236,8 @@ msgid "" "Create a tarfile with lzma compression. Raise a :exc:`FileExistsError` " "exception if it already exists." msgstr "" -"建立一個使用 lzma 壓縮的 tar 檔案。如果檔案已存在,則引發 :exc:`FileExistsError` 例外。" +"建立一個使用 lzma 壓縮的 tar 檔案。如果檔案已存在,則引發 :exc:" +"`FileExistsError` 例外。" #: ../../library/tarfile.rst:105 msgid "``'x:zst'``" @@ -240,8 +248,8 @@ msgid "" "Create a tarfile with Zstandard compression. Raise a :exc:`FileExistsError` " "exception if it already exists." msgstr "" -"建立一個使用 Zstandard 壓縮的 tar 檔案。如果檔案已存在,則引發 " -":exc:`FileExistsError` 例外。" +"建立一個使用 Zstandard 壓縮的 tar 檔案。如果檔案已存在,則引發 :exc:" +"`FileExistsError` 例外。" #: ../../library/tarfile.rst:109 msgid "``'a'`` or ``'a:'``" @@ -300,8 +308,8 @@ msgid "" "`ReadError` is raised. Use *mode* ``'r'`` to avoid this. If a compression " "method is not supported, :exc:`CompressionError` is raised." msgstr "" -"請注意 ``'a:gz'``、``'a:bz2'`` 或 ``'a:xz'`` 是不可能的。如果 *mode* " -"不適合開啟特定(壓縮)檔案以進行讀取,則會引發 :exc:`ReadError`。使用 *mode* ``'r'`` " +"請注意 ``'a:gz'``、``'a:bz2'`` 或 ``'a:xz'`` 是不可能的。如果 *mode* 不適合開" +"啟特定(壓縮)檔案以進行讀取,則會引發 :exc:`ReadError`。使用 *mode* ``'r'`` " "可避免此問題。如果不支援某個壓縮方法,則會引發 :exc:`CompressionError`。" #: ../../library/tarfile.rst:129 @@ -309,8 +317,8 @@ msgid "" "If *fileobj* is specified, it is used as an alternative to a :term:`file " "object` opened in binary mode for *name*. It is supposed to be at position 0." msgstr "" -"如果指定了 *fileobj*,則它會被用作 *name* 以二進位模式開啟的\\ :term:`檔案物件 ` " -"的替代方案。它應該位於位置 0。" +"如果指定了 *fileobj*,則它會被用作 *name* 以二進位模式開啟的\\ :term:`檔案物" +"件 ` 的替代方案。它應該位於位置 0。" #: ../../library/tarfile.rst:132 msgid "" @@ -318,8 +326,9 @@ msgid "" "bz2'``, :func:`tarfile.open` accepts the keyword argument *compresslevel* " "(default ``9``) to specify the compression level of the file." msgstr "" -"對於模式 ``'w:gz'``、``'x:gz'``、``'w|gz'``、``'w:bz2'``、``'x:bz2'``、``'w|bz2'``," -":func:`tarfile.open` 接受關鍵字引數 *compresslevel*\\ (預設為 ``9``)來指定檔案的壓縮等級。" +"對於模式 ``'w:gz'``、``'x:gz'``、``'w|gz'``、``'w:bz2'``、``'x:bz2'``、``'w|" +"bz2'``,:func:`tarfile.open` 接受關鍵字引數 *compresslevel*\\ (預設為 " +"``9``)來指定檔案的壓縮等級。" #: ../../library/tarfile.rst:136 msgid "" @@ -327,8 +336,8 @@ msgid "" "accepts the keyword argument *preset* to specify the compression level of " "the file." msgstr "" -"對於模式 ``'w:xz'``、``'x:xz'`` 和 ``'w|xz'``,:func:`tarfile.open` 接受關鍵字引數 " -"*preset* 來指定檔案的壓縮等級。" +"對於模式 ``'w:xz'``、``'x:xz'`` 和 ``'w|xz'``,:func:`tarfile.open` 接受關鍵" +"字引數 *preset* 來指定檔案的壓縮等級。" #: ../../library/tarfile.rst:139 msgid "" @@ -340,10 +349,11 @@ msgid "" "provide a :class:`~compression.zstd.ZstdDict`, a Zstandard dictionary used " "to improve compression of smaller amounts of data." msgstr "" -"對於模式 ``'w:zst'``、``'x:zst'`` 和 ``'w|zst'``,:func:`tarfile.open` 接受關鍵字引數 " -"*level* 來指定檔案的壓縮等級。也可以傳遞關鍵字引數 *options*,提供由 :class:`~compression.zstd." -"CompressionParameter` 描述的進階 Zstandard 壓縮參數。可以傳遞關鍵字引數 *zstd_dict* 以提供 " -":class:`~compression.zstd.ZstdDict`,這是一個用於改善較小資料量壓縮效果的 Zstandard 字典。" +"對於模式 ``'w:zst'``、``'x:zst'`` 和 ``'w|zst'``,:func:`tarfile.open` 接受關" +"鍵字引數 *level* 來指定檔案的壓縮等級。也可以傳遞關鍵字引數 *options*,提供" +"由 :class:`~compression.zstd.CompressionParameter` 描述的進階 Zstandard 壓縮" +"參數。可以傳遞關鍵字引數 *zstd_dict* 以提供 :class:`~compression.zstd." +"ZstdDict`,這是一個用於改善較小資料量壓縮效果的 Zstandard 字典。" #: ../../library/tarfile.rst:148 msgid "" @@ -358,12 +368,14 @@ msgid "" "However, such a :class:`TarFile` object is limited in that it does not allow " "random access, see :ref:`tar-examples`. The currently possible modes:" msgstr "" -"對於特殊用途,*mode* 有第二種格式:``'filemode|[compression]'``。:func:`tarfile.open` 會回傳一個 " -":class:`TarFile` 物件,該物件將其資料作為區塊串流處理。不會對檔案進行隨機尋找。如果提供了 *fileobj*,它可以" -"是任何具有 :meth:`~io.RawIOBase.read` 或 :meth:`~io.RawIOBase.write` 方法(取決於 " -"*mode*)且能處理位元組的物件。*bufsize* 指定區塊大小,預設為 ``20 * 512`` 位元組。此變體可與 " -"``sys.stdin.buffer``、socket :term:`檔案物件 ` 或磁帶裝置等結合使用。但是,這樣的 " -":class:`TarFile` 物件受到限制,因為它不允許隨機存取,請參閱 :ref:`tar-examples`。目前可能的模式:" +"對於特殊用途,*mode* 有第二種格式:``'filemode|[compression]'``。:func:" +"`tarfile.open` 會回傳一個 :class:`TarFile` 物件,該物件將其資料作為區塊串流處" +"理。不會對檔案進行隨機尋找。如果提供了 *fileobj*,它可以是任何具有 :meth:" +"`~io.RawIOBase.read` 或 :meth:`~io.RawIOBase.write` 方法(取決於 *mode*)且能" +"處理位元組的物件。*bufsize* 指定區塊大小,預設為 ``20 * 512`` 位元組。此變體" +"可與 ``sys.stdin.buffer``、socket :term:`檔案物件 ` 或磁帶裝置等" +"結合使用。但是,這樣的 :class:`TarFile` 物件受到限制,因為它不允許隨機存取," +"請參閱 :ref:`tar-examples`。目前可能的模式:" #: ../../library/tarfile.rst:162 msgid "Mode" @@ -483,35 +495,40 @@ msgid "" "Class for reading and writing tar archives. Do not use this class directly: " "use :func:`tarfile.open` instead. See :ref:`tarfile-objects`." msgstr "" -"用於讀取和寫入 tar 封存檔的類別。請勿直接使用此類別:請改用 :func:`tarfile.open`。請參閱 :ref:`tarfile-" -"objects`。" +"用於讀取和寫入 tar 封存檔的類別。請勿直接使用此類別:請改用 :func:`tarfile." +"open`。請參閱 :ref:`tarfile-objects`。" #: ../../library/tarfile.rst:219 +#, fuzzy msgid "" -"Return :const:`True` if *name* is a tar archive file, that the :mod:" -"`tarfile` module can read. *name* may be a :class:`str`, file, or file-like " +"Return :const:`True` if *name* is a tar archive file, that the :mod:`!" +"tarfile` module can read. *name* may be a :class:`str`, file, or file-like " "object." msgstr "" -"如果 *name* 是一個 :mod:`tarfile` 模組可以讀取的 tar 封存檔,則回傳 :const:`True`。*name* 可以是 " -":class:`str`、檔案或類檔案物件。" +"如果 *name* 是一個 :mod:`tarfile` 模組可以讀取的 tar 封存檔,則回傳 :const:" +"`True`。*name* 可以是 :class:`str`、檔案或類檔案物件。" #: ../../library/tarfile.rst:222 msgid "Support for file and file-like objects." msgstr "對檔案和類檔案物件的支援。" #: ../../library/tarfile.rst:226 -msgid "The :mod:`tarfile` module defines the following exceptions:" +#, fuzzy +msgid "The :mod:`!tarfile` module defines the following exceptions:" msgstr ":mod:`tarfile` 模組定義了以下例外:" #: ../../library/tarfile.rst:231 -msgid "Base class for all :mod:`tarfile` exceptions." +#, fuzzy +msgid "Base class for all :mod:`!tarfile` exceptions." msgstr "所有 :mod:`tarfile` 例外的基底類別。" #: ../../library/tarfile.rst:236 +#, fuzzy msgid "" -"Is raised when a tar archive is opened, that either cannot be handled by the" -" :mod:`tarfile` module or is somehow invalid." -msgstr "當開啟的 tar 封存檔無法被 :mod:`tarfile` 模組處理或以某種方式無效時引發。" +"Is raised when a tar archive is opened, that either cannot be handled by " +"the :mod:`!tarfile` module or is somehow invalid." +msgstr "" +"當開啟的 tar 封存檔無法被 :mod:`tarfile` 模組處理或以某種方式無效時引發。" #: ../../library/tarfile.rst:242 msgid "" @@ -530,8 +547,8 @@ msgid "" "Is raised for *non-fatal* errors when using :meth:`TarFile.extract`, but " "only if :attr:`TarFile.errorlevel`\\ ``== 2``." msgstr "" -"在使用 :meth:`TarFile.extract` 時針對\\ *非致命*\\ 錯誤引發,但僅限於 " -":attr:`TarFile.errorlevel`\\ ``== 2`` 時。" +"在使用 :meth:`TarFile.extract` 時針對\\ *非致命*\\ 錯誤引發,但僅限於 :attr:" +"`TarFile.errorlevel`\\ ``== 2`` 時。" #: ../../library/tarfile.rst:260 msgid "Is raised by :meth:`TarInfo.frombuf` if the buffer it gets is invalid." @@ -540,7 +557,8 @@ msgstr "如果 :meth:`TarInfo.frombuf` 得到的緩衝區無效,則引發此 #: ../../library/tarfile.rst:265 msgid "" "Base class for members :ref:`refused ` by filters." -msgstr "被篩選器\\ :ref:`拒絕 `\\ 的成員的基底類別。" +msgstr "" +"被篩選器\\ :ref:`拒絕 `\\ 的成員的基底類別。" #: ../../library/tarfile.rst:270 msgid "" @@ -577,8 +595,9 @@ msgid "" "The exception that was raised to reject the replacement member is available " "as :attr:`!BaseException.__context__`." msgstr "" -"當透過解壓縮另一個封存檔成員來模擬連結(硬連結或符號連結)時,如果該成員會被篩選器位置拒絕," -"則引發此例外。用於拒絕替代成員的例外可作為 :attr:`!BaseException.__context__` 取得。" +"當透過解壓縮另一個封存檔成員來模擬連結(硬連結或符號連結)時,如果該成員會被" +"篩選器位置拒絕,則引發此例外。用於拒絕替代成員的例外可作為 :attr:`!" +"BaseException.__context__` 取得。" #: ../../library/tarfile.rst:304 msgid "The following constants are available at the module level:" @@ -589,7 +608,8 @@ msgid "" "The default character encoding: ``'utf-8'`` on Windows, the value returned " "by :func:`sys.getfilesystemencoding` otherwise." msgstr "" -"預設字元編碼:在 Windows 上為 ``'utf-8'``,否則為 :func:`sys.getfilesystemencoding` 回傳的值。" +"預設字元編碼:在 Windows 上為 ``'utf-8'``,否則為 :func:`sys." +"getfilesystemencoding` 回傳的值。" #: ../../library/tarfile.rst:314 msgid "A regular file :attr:`~TarInfo.type`." @@ -636,12 +656,14 @@ msgid "A GNU tar sparse file :attr:`~TarInfo.type`." msgstr "一個 GNU tar 稀疏檔案 :attr:`~TarInfo.type`。" #: ../../library/tarfile.rst:357 +#, fuzzy msgid "" -"Each of the following constants defines a tar archive format that the :mod:" -"`tarfile` module is able to create. See section :ref:`tar-formats` for " +"Each of the following constants defines a tar archive format that the :mod:`!" +"tarfile` module is able to create. See section :ref:`tar-formats` for " "details." msgstr "" -"以下每個常數定義了 :mod:`tarfile` 模組能夠建立的 tar 封存檔格式。詳細資訊請參閱 :ref:`tar-formats` 一節。" +"以下每個常數定義了 :mod:`tarfile` 模組能夠建立的 tar 封存檔格式。詳細資訊請參" +"閱 :ref:`tar-formats` 一節。" #: ../../library/tarfile.rst:364 msgid "POSIX.1-1988 (ustar) format." @@ -665,7 +687,8 @@ msgstr "建立封存檔的預設格式。目前為 :const:`PAX_FORMAT`。" msgid "" "The default format for new archives was changed to :const:`PAX_FORMAT` from :" "const:`GNU_FORMAT`." -msgstr "新封存檔的預設格式已從 :const:`GNU_FORMAT` 變更為 :const:`PAX_FORMAT`。" +msgstr "" +"新封存檔的預設格式已從 :const:`GNU_FORMAT` 變更為 :const:`PAX_FORMAT`。" #: ../../library/tarfile.rst:388 msgid "Module :mod:`zipfile`" @@ -687,11 +710,11 @@ msgstr "標準 :mod:`shutil` 模組所提供的更高階封存功能的文件。 #: ../../library/tarfile.rst:395 msgid "" -"`GNU tar manual, Basic Tar Format " -"`_" +"`GNU tar manual, Basic Tar Format `_" msgstr "" -"`GNU tar 手冊,基本 Tar 格式 " -"`_" +"`GNU tar 手冊,基本 Tar 格式 `_" #: ../../library/tarfile.rst:396 msgid "Documentation for tar archive files, including GNU tar extensions." @@ -709,9 +732,10 @@ msgid "" "in a tar archive several times. Each archive member is represented by a :" "class:`TarInfo` object, see :ref:`tarinfo-objects` for details." msgstr "" -":class:`TarFile` 物件提供一個 tar 封存檔的介面。tar 封存檔是一個區塊序列。" -"一個封存檔成員(一個儲存的檔案)由一個標頭區塊和後續的資料區塊組成。可以在 tar 封存檔中多次" -"儲存一個檔案。每個封存檔成員由一個 :class:`TarInfo` 物件表示,詳細資訊請參閱 :ref:`tarinfo-objects`。" +":class:`TarFile` 物件提供一個 tar 封存檔的介面。tar 封存檔是一個區塊序列。一" +"個封存檔成員(一個儲存的檔案)由一個標頭區塊和後續的資料區塊組成。可以在 tar " +"封存檔中多次儲存一個檔案。每個封存檔成員由一個 :class:`TarInfo` 物件表示,詳" +"細資訊請參閱 :ref:`tarinfo-objects`。" #: ../../library/tarfile.rst:410 msgid "" @@ -721,9 +745,10 @@ msgid "" "for writing will not be finalized; only the internally used file object will " "be closed. See the :ref:`tar-examples` section for a use case." msgstr "" -":class:`TarFile` 物件可以在 :keyword:`with` 陳述式中用作情境管理器。當區塊完成時," -"它會自動關閉。請注意,如果發生例外,以寫入方式開啟的封存檔將不會被最終化 (finalized);只有內部使用的檔案" -"物件會被關閉。使用案例請參閱 :ref:`tar-examples` 一節。" +":class:`TarFile` 物件可以在 :keyword:`with` 陳述式中用作情境管理器。當區塊完" +"成時,它會自動關閉。請注意,如果發生例外,以寫入方式開啟的封存檔將不會被最終" +"化 (finalized);只有內部使用的檔案物件會被關閉。使用案例請參閱 :ref:`tar-" +"examples` 一節。" #: ../../library/tarfile.rst:416 msgid "Added support for the context management protocol." @@ -741,8 +766,9 @@ msgid "" "object`. It can be omitted if *fileobj* is given. In this case, the file " "object's :attr:`!name` attribute is used if it exists." msgstr "" -"*name* 是封存檔的路徑名稱。*name* 可以是\\ :term:`類路徑物件 `。如果提供了 " -"*fileobj* 則可以省略它。在這種情況下,如果檔案物件的 :attr:`!name` 屬性存在,則會使用該屬性。" +"*name* 是封存檔的路徑名稱。*name* 可以是\\ :term:`類路徑物件 `。如果提供了 *fileobj* 則可以省略它。在這種情況下,如果檔案物件的 :" +"attr:`!name` 屬性存在,則會使用該屬性。" #: ../../library/tarfile.rst:428 msgid "" @@ -751,8 +777,8 @@ msgid "" "existing one, or ``'x'`` to create a new file only if it does not already " "exist." msgstr "" -"*mode* 可以是 ``'r'`` 以從現有封存檔讀取、``'a'`` 以附加資料到現有檔案、``'w'`` 以建立新檔案覆蓋現有檔案,或 " -"``'x'`` 以僅在檔案不存在時建立新檔案。" +"*mode* 可以是 ``'r'`` 以從現有封存檔讀取、``'a'`` 以附加資料到現有檔案、" +"``'w'`` 以建立新檔案覆蓋現有檔案,或 ``'x'`` 以僅在檔案不存在時建立新檔案。" #: ../../library/tarfile.rst:432 msgid "" @@ -760,8 +786,8 @@ msgid "" "determined, *mode* is overridden by *fileobj*'s mode. *fileobj* will be used " "from position 0." msgstr "" -"如果提供了 *fileobj*,它會被用於讀取或寫入資料。如果可以確定,*mode* 會被 *fileobj* 的模式覆蓋。*fileobj* 將從位置" -" 0 開始使用。" +"如果提供了 *fileobj*,它會被用於讀取或寫入資料。如果可以確定,*mode* 會被 " +"*fileobj* 的模式覆蓋。*fileobj* 將從位置 0 開始使用。" #: ../../library/tarfile.rst:438 msgid "*fileobj* is not closed, when :class:`TarFile` is closed." @@ -774,9 +800,9 @@ msgid "" "that are defined at module level. When reading, format will be automatically " "detected, even if different formats are present in a single archive." msgstr "" -"*format* 控制寫入時的封存檔格式。它必須是在模組層級定義的常數 " -":const:`USTAR_FORMAT`、:const:`GNU_FORMAT` 或 :const:`PAX_FORMAT` " -"之一。讀取時,即使單一封存檔中存在不同格式,格式也會自動偵測。" +"*format* 控制寫入時的封存檔格式。它必須是在模組層級定義的常數 :const:" +"`USTAR_FORMAT`、:const:`GNU_FORMAT` 或 :const:`PAX_FORMAT` 之一。讀取時,即使" +"單一封存檔中存在不同格式,格式也會自動偵測。" #: ../../library/tarfile.rst:445 msgid "" @@ -790,8 +816,9 @@ msgid "" "archive. If it is :const:`True`, add the content of the target files to the " "archive. This has no effect on systems that do not support symbolic links." msgstr "" -"如果 *dereference* 為 :const:`False`,則將符號連結和硬連結新增到封存檔。如果為 " -":const:`True`,則將目標檔案的內容新增到封存檔。這在不支援符號連結的系統上沒有效果。" +"如果 *dereference* 為 :const:`False`,則將符號連結和硬連結新增到封存檔。如果" +"為 :const:`True`,則將目標檔案的內容新增到封存檔。這在不支援符號連結的系統上" +"沒有效果。" #: ../../library/tarfile.rst:452 msgid "" @@ -800,20 +827,25 @@ msgid "" "get as many members as possible. This is only useful for reading " "concatenated or damaged archives." msgstr "" -"如果 *ignore_zeros* 為 :const:`False`,則將空區塊視為封存檔的結尾。如果為 " -":const:`True`,則跳過空的(和無效的)區塊並嘗試取得盡可能多的成員。這僅對讀取串聯或損壞的封存檔有用。" +"如果 *ignore_zeros* 為 :const:`False`,則將空區塊視為封存檔的結尾。如果為 :" +"const:`True`,則跳過空的(和無效的)區塊並嘗試取得盡可能多的成員。這僅對讀取" +"串聯或損壞的封存檔有用。" #: ../../library/tarfile.rst:456 msgid "" "*debug* can be set from ``0`` (no debug messages) up to ``3`` (all debug " "messages). The messages are written to ``sys.stderr``." -msgstr "*debug* 可設定從 ``0``\\ (無偵錯訊息)到 ``3``\\ (所有偵錯訊息)。訊息會寫入 ``sys.stderr``。" +msgstr "" +"*debug* 可設定從 ``0``\\ (無偵錯訊息)到 ``3``\\ (所有偵錯訊息)。訊息會寫" +"入 ``sys.stderr``。" #: ../../library/tarfile.rst:459 msgid "" "*errorlevel* controls how extraction errors are handled, see :attr:`the " "corresponding attribute `." -msgstr "*errorlevel* 控制如何處理解壓縮錯誤,請參閱\\ :attr:`對應的屬性 `。" +msgstr "" +"*errorlevel* 控制如何處理解壓縮錯誤,請參閱\\ :attr:`對應的屬性 `。" #: ../../library/tarfile.rst:462 msgid "" @@ -822,22 +854,24 @@ msgid "" "to be handled. The default settings will work for most users. See section :" "ref:`tar-unicode` for in-depth information." msgstr "" -"*encoding* 和 *errors* 引數定義用於讀取或寫入封存檔的字元編碼以及如何處理轉換錯誤。" -"預設設定適用於大多數使用者。深入資訊請參閱 :ref:`tar-unicode` 一節。" +"*encoding* 和 *errors* 引數定義用於讀取或寫入封存檔的字元編碼以及如何處理轉換" +"錯誤。預設設定適用於大多數使用者。深入資訊請參閱 :ref:`tar-unicode` 一節。" #: ../../library/tarfile.rst:467 msgid "" "The *pax_headers* argument is an optional dictionary of strings which will " "be added as a pax global header if *format* is :const:`PAX_FORMAT`." msgstr "" -"*pax_headers* 引數是一個可選的字串字典,如果 *format* 為 :const:`PAX_FORMAT`,則會作為 pax " -"全域標頭新增。" +"*pax_headers* 引數是一個可選的字串字典,如果 *format* 為 :const:" +"`PAX_FORMAT`,則會作為 pax 全域標頭新增。" #: ../../library/tarfile.rst:470 msgid "" "If *stream* is set to :const:`True` then while reading the archive info " "about files in the archive are not cached, saving memory." -msgstr "如果 *stream* 設為 :const:`True`,則讀取封存檔時不會快取封存檔中關於檔案的資訊,從而節省記憶體。" +msgstr "" +"如果 *stream* 設為 :const:`True`,則讀取封存檔時不會快取封存檔中關於檔案的資" +"訊,從而節省記憶體。" #: ../../library/tarfile.rst:473 ../../library/tarfile.rst:796 msgid "Use ``'surrogateescape'`` as the default for the *errors* argument." @@ -858,7 +892,8 @@ msgid "" "Return a :class:`TarInfo` object for member *name*. If *name* can not be " "found in the archive, :exc:`KeyError` is raised." msgstr "" -"回傳成員 *name* 的 :class:`TarInfo` 物件。如果在封存檔中找不到 *name*,則引發 :exc:`KeyError`。" +"回傳成員 *name* 的 :class:`TarInfo` 物件。如果在封存檔中找不到 *name*,則引" +"發 :exc:`KeyError`。" #: ../../library/tarfile.rst:498 msgid "" @@ -868,15 +903,18 @@ msgstr "如果一個成員在封存檔中出現多次,則假定其最後一次 #: ../../library/tarfile.rst:504 msgid "" -"Return the members of the archive as a list of :class:`TarInfo` objects. The" -" list has the same order as the members in the archive." -msgstr "以 :class:`TarInfo` 物件串列的形式回傳封存檔的成員。串列的順序與封存檔中成員的順序相同。" +"Return the members of the archive as a list of :class:`TarInfo` objects. The " +"list has the same order as the members in the archive." +msgstr "" +"以 :class:`TarInfo` 物件串列的形式回傳封存檔的成員。串列的順序與封存檔中成員" +"的順序相同。" #: ../../library/tarfile.rst:510 msgid "" "Return the members as a list of their names. It has the same order as the " "list returned by :meth:`getmembers`." -msgstr "以名稱串列的形式回傳成員。其順序與 :meth:`getmembers` 回傳的串列順序相同。" +msgstr "" +"以名稱串列的形式回傳成員。其順序與 :meth:`getmembers` 回傳的串列順序相同。" #: ../../library/tarfile.rst:516 msgid "" @@ -885,9 +923,9 @@ msgid "" "similar to that of :program:`ls -l` is produced. If optional *members* is " "given, it must be a subset of the list returned by :meth:`getmembers`." msgstr "" -"將內容表印出到 ``sys.stdout``。如果 *verbose* 為 :const:`False`,則只印出成員的名稱。如果為 " -":const:`True`,則產生類似於 :program:`ls -l` 的輸出。如果提供了可選的 *members*,它必須是 " -":meth:`getmembers` 回傳串列的子集合。" +"將內容表印出到 ``sys.stdout``。如果 *verbose* 為 :const:`False`,則只印出成員" +"的名稱。如果為 :const:`True`,則產生類似於 :program:`ls -l` 的輸出。如果提供" +"了可選的 *members*,它必須是 :meth:`getmembers` 回傳串列的子集合。" #: ../../library/tarfile.rst:521 msgid "Added the *members* parameter." @@ -899,8 +937,8 @@ msgid "" "class:`TarFile` is opened for reading. Return :const:`None` if there is no " "more available." msgstr "" -"當 :class:`TarFile` 以讀取方式開啟時,以 :class:`TarInfo` " -"物件的形式回傳封存檔的下一個成員。如果沒有更多成員可用,則回傳 :const:`None`。" +"當 :class:`TarFile` 以讀取方式開啟時,以 :class:`TarInfo` 物件的形式回傳封存" +"檔的下一個成員。如果沒有更多成員可用,則回傳 :const:`None`。" #: ../../library/tarfile.rst:534 msgid "" @@ -913,10 +951,11 @@ msgid "" "directory's permissions do not allow writing, extracting files to it will " "fail." msgstr "" -"將所有成員從封存檔解壓縮到目前的工作目錄或目錄 *path*。如果提供了可選的 *members*," -"它必須是 :meth:`getmembers` 回傳串列的子集合。目錄資訊(如擁有者、修改時間和權限)" -"會在所有成員都被解壓縮後設定。這樣做是為了解決兩個問題:每次在目錄中建立檔案時,目錄的修改" -"時間都會被重設。而且,如果目錄的權限不允許寫入,則無法將檔案解壓縮到其中。" +"將所有成員從封存檔解壓縮到目前的工作目錄或目錄 *path*。如果提供了可選的 " +"*members*,它必須是 :meth:`getmembers` 回傳串列的子集合。目錄資訊(如擁有者、" +"修改時間和權限)會在所有成員都被解壓縮後設定。這樣做是為了解決兩個問題:每次" +"在目錄中建立檔案時,目錄的修改時間都會被重設。而且,如果目錄的權限不允許寫" +"入,則無法將檔案解壓縮到其中。" #: ../../library/tarfile.rst:542 msgid "" @@ -924,8 +963,8 @@ msgid "" "tarfile are used to set the owner/group for the extracted files. Otherwise, " "the named values from the tarfile are used." msgstr "" -"如果 *numeric_owner* 為 :const:`True`,則使用 tar 檔案中的 uid 和 gid " -"數字來設定解壓縮檔案的擁有者/群組。否則,使用 tar 檔案中的名稱值。" +"如果 *numeric_owner* 為 :const:`True`,則使用 tar 檔案中的 uid 和 gid 數字來" +"設定解壓縮檔案的擁有者/群組。否則,使用 tar 檔案中的名稱值。" #: ../../library/tarfile.rst:546 msgid "" @@ -935,9 +974,10 @@ msgid "" "required, or as ``filter='data'`` to support Python versions with a less " "secure default (3.13 and lower)." msgstr "" -"*filter* 引數指定在解壓縮之前如何修改或拒絕 ``members``。詳細資訊請參閱 :ref:`tarfile-extraction-" -"filter`。建議僅在需要特定 *tar* 功能時或作為 ``filter='data'`` 以支援預設安全性較低的 Python 版本(3.13 " -"及更低版本)時明確設定此項。" +"*filter* 引數指定在解壓縮之前如何修改或拒絕 ``members``。詳細資訊請參閱 :ref:" +"`tarfile-extraction-filter`。建議僅在需要特定 *tar* 功能時或作為 " +"``filter='data'`` 以支援預設安全性較低的 Python 版本(3.13 及更低版本)時明確" +"設定此項。" #: ../../library/tarfile.rst:555 msgid "Never extract archives from untrusted sources without prior inspection." @@ -950,8 +990,9 @@ msgid "" "unintended or insecure behavior. Read the :ref:`tarfile-extraction-filter` " "section for details." msgstr "" -"從 Python 3.14 開始,預設值(:func:`data `)將防止最危險的安全問題。但是,它不會防止\\ " -"*所有*\\ 意外或不安全的行為。詳細資訊請閱讀 :ref:`tarfile-extraction-filter` 一節。" +"從 Python 3.14 開始,預設值(:func:`data `)將防止最危險的安全問" +"題。但是,它不會防止\\ *所有*\\ 意外或不安全的行為。詳細資訊請閱讀 :ref:" +"`tarfile-extraction-filter` 一節。" #: ../../library/tarfile.rst:562 ../../library/tarfile.rst:599 msgid "Added the *numeric_owner* parameter." @@ -978,9 +1019,10 @@ msgid "" "different directory using *path*. *path* may be a :term:`path-like object`. " "File attributes (owner, mtime, mode) are set unless *set_attrs* is false." msgstr "" -"使用完整名稱將一個成員從封存檔解壓縮到目前的工作目錄。其檔案資訊會盡可能準確地解壓縮。*member* 可以是檔案名稱或 " -":class:`TarInfo` 物件。你可以使用 *path* 指定不同的目錄。*path* 可以是\\ :term:`類路徑物件 `。除非 *set_attrs* 為 false,否則會設定檔案屬性 (owner, mtime, mode)。" +"使用完整名稱將一個成員從封存檔解壓縮到目前的工作目錄。其檔案資訊會盡可能準確" +"地解壓縮。*member* 可以是檔案名稱或 :class:`TarInfo` 物件。你可以使用 *path* " +"指定不同的目錄。*path* 可以是\\ :term:`類路徑物件 `。除非 " +"*set_attrs* 為 false,否則會設定檔案屬性 (owner, mtime, mode)。" #: ../../library/tarfile.rst:583 msgid "" @@ -992,13 +1034,17 @@ msgstr "*numeric_owner* 和 *filter* 引數與 :meth:`extractall` 相同。" msgid "" "The :meth:`extract` method does not take care of several extraction issues. " "In most cases you should consider using the :meth:`extractall` method." -msgstr ":meth:`extract` 方法不處理多個解壓縮問題。在大多數情況下,你應該考慮使用 :meth:`extractall` 方法。" +msgstr "" +":meth:`extract` 方法不處理多個解壓縮問題。在大多數情況下,你應該考慮使用 :" +"meth:`extractall` 方法。" #: ../../library/tarfile.rst:593 msgid "" "Never extract archives from untrusted sources without prior inspection. See " "the warning for :meth:`extractall` for details." -msgstr "切勿在事先檢查之前從不受信任的來源解壓縮封存檔。詳細資訊請參閱 :meth:`extractall` 的警告。" +msgstr "" +"切勿在事先檢查之前從不受信任的來源解壓縮封存檔。詳細資訊請參閱 :meth:" +"`extractall` 的警告。" #: ../../library/tarfile.rst:596 msgid "Added the *set_attrs* parameter." @@ -1012,8 +1058,9 @@ msgid "" "existing members, :const:`None` is returned. If *member* does not appear in " "the archive, :exc:`KeyError` is raised." msgstr "" -"以檔案物件的形式從封存檔解壓縮一個成員。*member* 可以是檔案名稱或 :class:`TarInfo` 物件。如果 *member* " -"是一般檔案或連結,則回傳 :class:`io.BufferedReader` 物件。對於所有其他現有成員,回傳 :const:`None`。如果 " +"以檔案物件的形式從封存檔解壓縮一個成員。*member* 可以是檔案名稱或 :class:" +"`TarInfo` 物件。如果 *member* 是一般檔案或連結,則回傳 :class:`io." +"BufferedReader` 物件。對於所有其他現有成員,回傳 :const:`None`。如果 " "*member* 未出現在封存檔中,則引發 :exc:`KeyError`。" #: ../../library/tarfile.rst:617 @@ -1025,7 +1072,8 @@ msgid "" "The returned :class:`io.BufferedReader` object has the :attr:`!mode` " "attribute which is always equal to ``'rb'``." msgstr "" -"回傳的 :class:`io.BufferedReader` 物件具有 :attr:`!mode` 屬性,該屬性始終等於 ``'rb'``。" +"回傳的 :class:`io.BufferedReader` 物件具有 :attr:`!mode` 屬性,該屬性始終等" +"於 ``'rb'``。" #: ../../library/tarfile.rst:627 msgid "" @@ -1036,10 +1084,11 @@ msgid "" "`FilterError` exceptions. If ``2``, all *non-fatal* errors are raised as :" "exc:`TarError` exceptions as well." msgstr "" -"如果 *errorlevel* 為 ``0``,則使用 :meth:`TarFile.extract` 和 :meth:`TarFile.extractall` " -"時會忽略錯誤。然而,當 *debug* 大於 0 時,它們會在偵錯輸出中顯示為錯誤訊息。如果為 ``1``\\ (預設值)" -",所有\\ *致命*\\ 錯誤都會以 :exc:`OSError` 或 :exc:`FilterError` 例外的形式引發。如果為" -" ``2``,所有\\ *非致命*\\ 錯誤也會以 :exc:`TarError` 例外的形式引發。" +"如果 *errorlevel* 為 ``0``,則使用 :meth:`TarFile.extract` 和 :meth:`TarFile." +"extractall` 時會忽略錯誤。然而,當 *debug* 大於 0 時,它們會在偵錯輸出中顯示" +"為錯誤訊息。如果為 ``1``\\ (預設值),所有\\ *致命*\\ 錯誤都會以 :exc:" +"`OSError` 或 :exc:`FilterError` 例外的形式引發。如果為 ``2``,所有\\ *非致命" +"*\\ 錯誤也會以 :exc:`TarError` 例外的形式引發。" #: ../../library/tarfile.rst:635 msgid "" @@ -1053,8 +1102,8 @@ msgid "" "exc:`FilterError` for *fatal* errors and :exc:`ExtractError` for *non-fatal* " "ones." msgstr "" -"自訂的\\ :ref:`解壓縮篩選器 `\\ 應該對\\ *致命*\\ 錯誤引發 " -":exc:`FilterError`,對\\ *非致命*\\ 錯誤引發 :exc:`ExtractError`。" +"自訂的\\ :ref:`解壓縮篩選器 `\\ 應該對\\ *致命*\\ " +"錯誤引發 :exc:`FilterError`,對\\ *非致命*\\ 錯誤引發 :exc:`ExtractError`。" #: ../../library/tarfile.rst:642 msgid "" @@ -1068,8 +1117,8 @@ msgid "" "for the *filter* argument of :meth:`~TarFile.extract` and :meth:`~TarFile." "extractall`." msgstr "" -"用作 :meth:`~TarFile.extract` 和 :meth:`~TarFile.extractall` 的 *filter* " -"引數預設的\\ :ref:`解壓縮篩選器 `。" +"用作 :meth:`~TarFile.extract` 和 :meth:`~TarFile.extractall` 的 *filter* 引數" +"預設的\\ :ref:`解壓縮篩選器 `。" #: ../../library/tarfile.rst:653 msgid "" @@ -1084,8 +1133,8 @@ msgid "" "If ``extraction_filter`` is ``None`` (the default), extraction methods will " "use the :func:`data ` filter by default." msgstr "" -"如果 ``extraction_filter`` 為 ``None``\\ (預設值),解壓縮方法將預設使用 :func:`data " -"` 篩選器。" +"如果 ``extraction_filter`` 為 ``None``\\ (預設值),解壓縮方法將預設使用 :" +"func:`data ` 篩選器。" #: ../../library/tarfile.rst:660 msgid "" @@ -1096,10 +1145,10 @@ msgid "" "`. To set a global default this way, a filter function needs to be " "wrapped in :func:`staticmethod` to prevent injection of a ``self`` argument." msgstr "" -"此屬性可以在實例上設定或在子類別中覆寫。也可以在 ``TarFile`` 類別本身上設定它以設定全域預設值," -"儘管由於它會影響 *tarfile* 的所有使用,最佳做法是僅在頂層應用程式或 :mod:`site 組態 `\\ " -"中這樣做。要以這種方式設定全域預設值,需要將篩選器函式包裝在 :func:`staticmethod` 中以防止注入 " -"``self`` 引數。" +"此屬性可以在實例上設定或在子類別中覆寫。也可以在 ``TarFile`` 類別本身上設定它" +"以設定全域預設值,儘管由於它會影響 *tarfile* 的所有使用,最佳做法是僅在頂層應" +"用程式或 :mod:`site 組態 `\\ 中這樣做。要以這種方式設定全域預設值,需要" +"將篩選器函式包裝在 :func:`staticmethod` 中以防止注入 ``self`` 引數。" #: ../../library/tarfile.rst:670 msgid "" @@ -1108,9 +1157,9 @@ msgid "" "the destination. Previously, the default was equivalent to :func:" "`fully_trusted `." msgstr "" -"預設篩選器設為 :func:`data " -"`,這會禁止一些危險的功能,例如指向絕對路徑或目的地之外路徑的連結。在此之前,預設值等同於 " -":func:`fully_trusted `。" +"預設篩選器設為 :func:`data `,這會禁止一些危險的功能,例如指向絕" +"對路徑或目的地之外路徑的連結。在此之前,預設值等同於 :func:`fully_trusted " +"`。" #: ../../library/tarfile.rst:678 msgid "" @@ -1124,11 +1173,12 @@ msgid "" "`None` the :class:`TarInfo` object will be excluded from the archive. See :" "ref:`tar-examples` for an example." msgstr "" -"將檔案 *name* 新增到封存檔。*name* 可以是任何型別的檔案(目錄、FIFO、符號連結等)。如果提供了 " -"*arcname*,則為封存檔中的檔案指定替代名稱。預設情況下,目錄會遞迴新增。這可以透過將 *recursive* 設為 :const:`False`" -" 來避免。遞迴以排序順序新增條目。如果提供了 *filter*,它應該是一個接受 :class:`TarInfo` 物件引數並回傳變更後的 " -":class:`TarInfo` 物件的函式。如果它回傳 :const:`None`,則 :class:`TarInfo` " -"物件將從封存檔中排除。範例請參閱 :ref:`tar-examples`。" +"將檔案 *name* 新增到封存檔。*name* 可以是任何型別的檔案(目錄、FIFO、符號連結" +"等)。如果提供了 *arcname*,則為封存檔中的檔案指定替代名稱。預設情況下,目錄" +"會遞迴新增。這可以透過將 *recursive* 設為 :const:`False` 來避免。遞迴以排序順" +"序新增條目。如果提供了 *filter*,它應該是一個接受 :class:`TarInfo` 物件引數並" +"回傳變更後的 :class:`TarInfo` 物件的函式。如果它回傳 :const:`None`,則 :" +"class:`TarInfo` 物件將從封存檔中排除。範例請參閱 :ref:`tar-examples`。" #: ../../library/tarfile.rst:692 msgid "Recursion adds entries in sorted order." @@ -1142,9 +1192,10 @@ msgid "" "the archive. You can create :class:`TarInfo` objects directly, or by using :" "meth:`gettarinfo`." msgstr "" -"將 :class:`TarInfo` 物件 *tarinfo* 新增到封存檔。如果 *tarinfo* 表示一個非零大小的一般檔案," -"*fileobj* 引數應該是\\ :term:`二進位檔案 `,並從中讀取 ``tarinfo.size`` " -"位元組並新增到封存檔。你可以直接建立 :class:`TarInfo` 物件,或使用 :meth:`gettarinfo`。" +"將 :class:`TarInfo` 物件 *tarinfo* 新增到封存檔。如果 *tarinfo* 表示一個非零" +"大小的一般檔案,*fileobj* 引數應該是\\ :term:`二進位檔案 `,並從" +"中讀取 ``tarinfo.size`` 位元組並新增到封存檔。你可以直接建立 :class:" +"`TarInfo` 物件,或使用 :meth:`gettarinfo`。" #: ../../library/tarfile.rst:705 msgid "*fileobj* must be given for non-zero-sized regular files." @@ -1160,10 +1211,11 @@ msgid "" "from *fileobj*’s :attr:`~io.FileIO.name` attribute, or the *name* argument. " "The name should be a text string." msgstr "" -"從現有檔案的 :func:`os.stat` 或等效結果建立 :class:`TarInfo` 物件。檔案可以由 *name* " -"命名,或指定為具有檔案描述符的\\ :term:`檔案物件 ` *fileobj*。*name* 可以是\\ " -":term:`類路徑物件 `。如果提供了 *arcname*,則為封存檔中的檔案指定替代名稱,否則,名稱取自 " -"*fileobj* 的 :attr:`~io.FileIO.name` 屬性或 *name* 引數。名稱應該是文字字串。" +"從現有檔案的 :func:`os.stat` 或等效結果建立 :class:`TarInfo` 物件。檔案可以" +"由 *name* 命名,或指定為具有檔案描述符的\\ :term:`檔案物件 ` " +"*fileobj*。*name* 可以是\\ :term:`類路徑物件 `。如果提供了 " +"*arcname*,則為封存檔中的檔案指定替代名稱,否則,名稱取自 *fileobj* 的 :attr:" +"`~io.FileIO.name` 屬性或 *name* 引數。名稱應該是文字字串。" #: ../../library/tarfile.rst:719 msgid "" @@ -1174,16 +1226,18 @@ msgid "" "`~gzip.GzipFile`. The :attr:`~TarInfo.name` may also be modified, in which " "case *arcname* could be a dummy string." msgstr "" -"在使用 :meth:`addfile` 新增之前,你可以修改 :class:`TarInfo` " -"的某些屬性。如果檔案物件不是位於檔案開頭的普通檔案物件,則可能需要修改諸如 :attr:`~TarInfo.size` 之類的屬性。這種情況適用於 " -":class:`~gzip.GzipFile` 等物件。:attr:`~TarInfo.name` 也可以被修改,在這種情況下 *arcname* " -"可以是一個虛設字串 (dummy string)。" +"在使用 :meth:`addfile` 新增之前,你可以修改 :class:`TarInfo` 的某些屬性。如果" +"檔案物件不是位於檔案開頭的普通檔案物件,則可能需要修改諸如 :attr:`~TarInfo." +"size` 之類的屬性。這種情況適用於 :class:`~gzip.GzipFile` 等物件。:attr:" +"`~TarInfo.name` 也可以被修改,在這種情況下 *arcname* 可以是一個虛設字串 " +"(dummy string)。" #: ../../library/tarfile.rst:733 msgid "" "Close the :class:`TarFile`. In write mode, two finishing zero blocks are " "appended to the archive." -msgstr "關閉 :class:`TarFile`。在寫入模式下,會在封存檔末尾附加兩個結束零區塊。" +msgstr "" +"關閉 :class:`TarFile`。在寫入模式下,會在封存檔末尾附加兩個結束零區塊。" #: ../../library/tarfile.rst:740 msgid "A dictionary containing key-value pairs of pax global headers." @@ -1200,9 +1254,9 @@ msgid "" "permissions, owner etc.), it provides some useful methods to determine its " "type. It does *not* contain the file's data itself." msgstr "" -":class:`TarInfo` 物件表示 :class:`TarFile` 中的一個成員。除了儲存檔案的所有必要屬性" -"(如檔案型別、大小、時間、權限、擁有者等)之外,它還提供一些有用的方法來確定其型別。它\\ *不*\\ " -"包含檔案的資料本身。" +":class:`TarInfo` 物件表示 :class:`TarFile` 中的一個成員。除了儲存檔案的所有必" +"要屬性(如檔案型別、大小、時間、權限、擁有者等)之外,它還提供一些有用的方法" +"來確定其型別。它\\ *不*\\ 包含檔案的資料本身。" #: ../../library/tarfile.rst:754 msgid "" @@ -1210,9 +1264,8 @@ msgid "" "`~TarFile.getmember`, :meth:`~TarFile.getmembers` and :meth:`~TarFile." "gettarinfo`." msgstr "" -":class:`TarInfo` 物件由 :class:`TarFile` 的方法 " -":meth:`~TarFile.getmember`、:meth:`~TarFile.getmembers` 和 " -":meth:`~TarFile.gettarinfo` 回傳。" +":class:`TarInfo` 物件由 :class:`TarFile` 的方法 :meth:`~TarFile.getmember`、:" +"meth:`~TarFile.getmembers` 和 :meth:`~TarFile.gettarinfo` 回傳。" #: ../../library/tarfile.rst:758 msgid "" @@ -1222,9 +1275,10 @@ msgid "" "call the :meth:`~TarInfo.replace` method to create a modified copy in one " "step." msgstr "" -"修改由 :meth:`~TarFile.getmember` 或 :meth:`~TarFile.getmembers` " -"回傳的物件將影響封存檔上的所有後續操作。對於不希望出現這種情況的情況,你可以使用 :mod:`copy.copy() ` 或呼叫 " -":meth:`~TarInfo.replace` 方法來一步建立修改後的副本。" +"修改由 :meth:`~TarFile.getmember` 或 :meth:`~TarFile.getmembers` 回傳的物件將" +"影響封存檔上的所有後續操作。對於不希望出現這種情況的情況,你可以使用 :mod:" +"`copy.copy() ` 或呼叫 :meth:`~TarInfo.replace` 方法來一步建立修改後的副" +"本。" #: ../../library/tarfile.rst:764 msgid "" @@ -1232,15 +1286,16 @@ msgid "" "metadata is unused or unknown. Different :class:`TarInfo` methods handle " "``None`` differently:" msgstr "" -"可以將多個屬性設為 ``None`` 以表示一段中介資料 (metadata) 未被使用或未知。不同的 " -":class:`TarInfo` 方法會以不同的方式處理 ``None``:" +"可以將多個屬性設為 ``None`` 以表示一段中介資料 (metadata) 未被使用或未知。不" +"同的 :class:`TarInfo` 方法會以不同的方式處理 ``None``:" #: ../../library/tarfile.rst:768 msgid "" "The :meth:`~TarFile.extract` or :meth:`~TarFile.extractall` methods will " "ignore the corresponding metadata, leaving it set to a default." msgstr "" -":meth:`~TarFile.extract` 或 :meth:`~TarFile.extractall` 方法將忽略對應的中介資料,使其保持預設值。" +":meth:`~TarFile.extract` 或 :meth:`~TarFile.extractall` 方法將忽略對應的中介" +"資料,使其保持預設值。" #: ../../library/tarfile.rst:770 msgid ":meth:`~TarFile.addfile` will fail." @@ -1275,8 +1330,8 @@ msgid "" "Create a string buffer from a :class:`TarInfo` object. For information on " "the arguments see the constructor of the :class:`TarFile` class." msgstr "" -"從 :class:`TarInfo` 物件建立字串緩衝區。關於引數的資訊,請參" -"閱 :class:`TarFile` 類別的建構函式。" +"從 :class:`TarInfo` 物件建立字串緩衝區。關於引數的資訊,請參閱 :class:" +"`TarFile` 類別的建構函式。" #: ../../library/tarfile.rst:800 msgid "A ``TarInfo`` object has the following public data attributes:" @@ -1295,7 +1350,8 @@ msgid "" "Time of last modification in seconds since the :ref:`epoch `, as in :" "attr:`os.stat_result.st_mtime`." msgstr "" -"自\\ :ref:`epoch ` 以來的最後修改時間(以秒為單位),如 :attr:`os.stat_result.st_mtime`。" +"自\\ :ref:`epoch ` 以來的最後修改時間(以秒為單位),如 :attr:`os." +"stat_result.st_mtime`。" #: ../../library/tarfile.rst:823 ../../library/tarfile.rst:834 #: ../../library/tarfile.rst:866 ../../library/tarfile.rst:877 @@ -1319,18 +1375,19 @@ msgid "" "const:`GNUTYPE_SPARSE`. To determine the type of a :class:`TarInfo` object " "more conveniently, use the ``is*()`` methods below." msgstr "" -"檔案類型。*type* 通常是這些常數之一:" -":const:`REGTYPE`、:const:`AREGTYPE`、:const:`LNKTYPE`、:const:`SYMTYPE`、:const:`DIRTYPE`、" -":const:`FIFOTYPE`、:const:`CONTTYPE`、:const:`CHRTYPE`、:const:`BLKTYPE`、" -":const:`GNUTYPE_SPARSE`。要更方便地確定 :class:`TarInfo` 物件的類型,請使用下面的 ``is*()`` 方法。" +"檔案類型。*type* 通常是這些常數之一::const:`REGTYPE`、:const:`AREGTYPE`、:" +"const:`LNKTYPE`、:const:`SYMTYPE`、:const:`DIRTYPE`、:const:`FIFOTYPE`、:" +"const:`CONTTYPE`、:const:`CHRTYPE`、:const:`BLKTYPE`、:const:" +"`GNUTYPE_SPARSE`。要更方便地確定 :class:`TarInfo` 物件的類型,請使用下面的 " +"``is*()`` 方法。" #: ../../library/tarfile.rst:850 msgid "" "Name of the target file name, which is only present in :class:`TarInfo` " "objects of type :const:`LNKTYPE` and :const:`SYMTYPE`." msgstr "" -"目標檔案名稱的名稱,僅存在於型別為 :const:`LNKTYPE` 和 :const:`SYMTYPE` 的 :class:`TarInfo` " -"物件中。" +"目標檔案名稱的名稱,僅存在於型別為 :const:`LNKTYPE` 和 :const:`SYMTYPE` 的 :" +"class:`TarInfo` 物件中。" #: ../../library/tarfile.rst:853 msgid "" @@ -1338,8 +1395,8 @@ msgid "" "directory that contains the link. For hard links (``LNKTYPE``), the " "*linkname* is relative to the root of the archive." msgstr "" -"對於符號連結(``SYMTYPE``),*linkname* 相對於包含連結的目錄。對於硬連結(``LNKTYPE``),*linkname* " -"相對於封存檔的根。" +"對於符號連結(``SYMTYPE``),*linkname* 相對於包含連結的目錄。對於硬連結" +"(``LNKTYPE``),*linkname* 相對於封存檔的根。" #: ../../library/tarfile.rst:862 msgid "User ID of the user who originally stored this member." @@ -1392,8 +1449,8 @@ msgid "" "attributes changed. For example, to return a ``TarInfo`` with the group name " "set to ``'staff'``, use::" msgstr "" -"回傳具有給定屬性變更的 :class:`!TarInfo` 物件的\\ *新*\\ 副本。例如,要回傳群組名稱設為 ``'staff'`` 的 " -"``TarInfo``,請使用: ::" +"回傳具有給定屬性變更的 :class:`!TarInfo` 物件的\\ *新*\\ 副本。例如,要回傳群" +"組名稱設為 ``'staff'`` 的 ``TarInfo``,請使用: ::" #: ../../library/tarfile.rst:953 msgid "new_tarinfo = old_tarinfo.replace(gname='staff')" @@ -1405,8 +1462,8 @@ msgid "" "e. ``pax_headers`` and any custom attributes are shared with the original " "``TarInfo`` object." msgstr "" -"預設情況下,會進行深度複製。如果 *deep* 為 false,則複製為淺複製,即 ``pax_headers`` 和任何自訂屬性與原始 " -"``TarInfo`` 物件共用。" +"預設情況下,會進行深度複製。如果 *deep* 為 false,則複製為淺複製,即 " +"``pax_headers`` 和任何自訂屬性與原始 ``TarInfo`` 物件共用。" #: ../../library/tarfile.rst:959 msgid "A :class:`TarInfo` object also provides some convenient query methods:" @@ -1472,7 +1529,9 @@ msgid "" "In most cases, the full functionality is not needed. Therefore, *tarfile* " "supports extraction filters: a mechanism to limit functionality, and thus " "mitigate some of the security issues." -msgstr "在大多數情況下,不需要完整功能。因此,*tarfile* 支援解壓縮篩選器:一種限制功能的機制,從而減輕某些安全性問題。" +msgstr "" +"在大多數情況下,不需要完整功能。因此,*tarfile* 支援解壓縮篩選器:一種限制功" +"能的機制,從而減輕某些安全性問題。" #: ../../library/tarfile.rst:1028 msgid "" @@ -1541,8 +1600,8 @@ msgid "" "The default filter is set to :func:`data `. Previously, the " "default was equivalent to :func:`fully_trusted `." msgstr "" -"預設篩選器設為 :func:`data `。在此之前,預設等同" -"於 :func:`fully_trusted `。" +"預設篩選器設為 :func:`data `。在此之前,預設等同於 :func:" +"`fully_trusted `。" #: ../../library/tarfile.rst:1063 msgid "" @@ -1620,8 +1679,8 @@ msgid "" "foo`` on Windows). This raises :class:`~tarfile.AbsolutePathError`." msgstr "" ":ref:`拒絕 `\\ 解壓縮具有絕對路徑的檔案(在移除斜" -"線後名稱仍是絕對路徑的情況下,例如 Windows 上的 ``C:/foo``)。這會引" -"發 :class:`~tarfile.AbsolutePathError`。" +"線後名稱仍是絕對路徑的情況下,例如 Windows 上的 ``C:/foo``)。這會引發 :" +"class:`~tarfile.AbsolutePathError`。" #: ../../library/tarfile.rst:1103 msgid "" @@ -1630,16 +1689,16 @@ msgid "" "raises :class:`~tarfile.OutsideDestinationError`." msgstr "" ":ref:`拒絕 `\\ 解壓縮其絕對路徑(在跟隨符號連結" -"後)會位於目的地之外的檔案。這會引" -"發 :class:`~tarfile.OutsideDestinationError`。" +"後)會位於目的地之外的檔案。這會引發 :class:`~tarfile." +"OutsideDestinationError`。" #: ../../library/tarfile.rst:1106 msgid "" "Clear high mode bits (setuid, setgid, sticky) and group/other write bits (:" "const:`~stat.S_IWGRP` | :const:`~stat.S_IWOTH`)." msgstr "" -"清除高位模式位元 (setuid, setgid, sticky) 以及群組/其他人的寫入位元" -"(:const:`~stat.S_IWGRP` | :const:`~stat.S_IWOTH`)。" +"清除高位模式位元 (setuid, setgid, sticky) 以及群組/其他人的寫入位元(:const:" +"`~stat.S_IWGRP` | :const:`~stat.S_IWOTH`)。" #: ../../library/tarfile.rst:1109 ../../library/tarfile.rst:1148 msgid "Return the modified ``TarInfo`` member." @@ -1674,8 +1733,8 @@ msgid "" "This raises :class:`~tarfile.AbsoluteLinkError` or :class:`~tarfile." "LinkOutsideDestinationError`." msgstr "" -"這會引發 :class:`~tarfile.AbsoluteLinkError` 或 " -":class:`~tarfile.LinkOutsideDestinationError`。" +"這會引發 :class:`~tarfile.AbsoluteLinkError` 或 :class:`~tarfile." +"LinkOutsideDestinationError`。" #: ../../library/tarfile.rst:1128 msgid "" @@ -1688,8 +1747,8 @@ msgid "" ":ref:`Refuse ` to extract device files (including " "pipes). This raises :class:`~tarfile.SpecialFileError`." msgstr "" -":ref:`拒絕 `\\ 解壓縮裝置檔案(包括 pipe)。這會引發 " -":class:`~tarfile.SpecialFileError`。" +":ref:`拒絕 `\\ 解壓縮裝置檔案(包括 pipe)。這會引" +"發 :class:`~tarfile.SpecialFileError`。" #: ../../library/tarfile.rst:1135 msgid "For regular files, including hard links:" @@ -1700,35 +1759,40 @@ msgid "" "Set the owner read and write permissions (:const:`~stat.S_IRUSR` | :const:" "`~stat.S_IWUSR`)." msgstr "" -"設定擁有者的讀取和寫入權限(:const:`~stat.S_IRUSR` | :const:`~stat.S_IWUSR`)。" +"設定擁有者的讀取和寫入權限(:const:`~stat.S_IRUSR` | :const:`~stat." +"S_IWUSR`)。" #: ../../library/tarfile.rst:1139 msgid "" "Remove the group & other executable permission (:const:`~stat.S_IXGRP` | :" "const:`~stat.S_IXOTH`) if the owner doesn’t have it (:const:`~stat.S_IXUSR`)." msgstr "" -"如果擁有者沒有執行權限(:const:`~stat.S_IXUSR`),則移除群組和其他人的執行權限(:const:`~stat.S_IXGRP` | " -":const:`~stat.S_IXOTH`)。" +"如果擁有者沒有執行權限(:const:`~stat.S_IXUSR`),則移除群組和其他人的執行權" +"限(:const:`~stat.S_IXGRP` | :const:`~stat.S_IXOTH`)。" #: ../../library/tarfile.rst:1143 msgid "" "For other files (directories), set ``mode`` to ``None``, so that extraction " "methods skip applying permission bits." -msgstr "對於其他檔案(目錄),將 ``mode`` 設為 ``None``,讓解壓縮方法跳過套用權限位元。" +msgstr "" +"對於其他檔案(目錄),將 ``mode`` 設為 ``None``,讓解壓縮方法跳過套用權限位" +"元。" #: ../../library/tarfile.rst:1145 msgid "" "Set user and group info (``uid``, ``gid``, ``uname``, ``gname``) to " "``None``, so that extraction methods skip setting it." msgstr "" -"將使用者和群組資訊 (``uid``, ``gid``, ``uname``, ``gname``) 設為 ``None``,讓解壓縮方法跳過設定它們。" +"將使用者和群組資訊 (``uid``, ``gid``, ``uname``, ``gname``) 設為 ``None``,讓" +"解壓縮方法跳過設定它們。" #: ../../library/tarfile.rst:1150 msgid "" "Note that this filter does not block *all* dangerous archive features. See :" "ref:`tarfile-further-verification` for details." msgstr "" -"請注意,此篩選器並未阻擋\\ *所有*\\ 危險的封存檔功能。詳細資訊請參閱 :ref:`tarfile-further-verification`。" +"請注意,此篩選器並未阻擋\\ *所有*\\ 危險的封存檔功能。詳細資訊請參閱 :ref:" +"`tarfile-further-verification`。" #: ../../library/tarfile.rst:1155 msgid "Link targets are now normalized." @@ -1746,9 +1810,10 @@ msgid "" "the error will be logged and the member will be skipped, but extraction will " "continue." msgstr "" -"當篩選器拒絕解壓縮檔案時,它會引發適當的例外,該例外是 :class:`~tarfile.FilterError`" -" 的子類別。如果 :attr:`TarFile.errorlevel` 為 1 或更高,這將中止解壓縮。使用 " -"``errorlevel=0`` 時,錯誤將被記錄並跳過該成員,但解壓縮將繼續進行。" +"當篩選器拒絕解壓縮檔案時,它會引發適當的例外,該例外是 :class:`~tarfile." +"FilterError` 的子類別。如果 :attr:`TarFile.errorlevel` 為 1 或更高,這將中止" +"解壓縮。使用 ``errorlevel=0`` 時,錯誤將被記錄並跳過該成員,但解壓縮將繼續進" +"行。" #: ../../library/tarfile.rst:1173 msgid "Hints for further verification" @@ -1994,8 +2059,9 @@ msgid "Command-Line Interface" msgstr "命令列介面" #: ../../library/tarfile.rst:1288 +#, fuzzy msgid "" -"The :mod:`tarfile` module provides a simple command-line interface to " +"The :mod:`!tarfile` module provides a simple command-line interface to " "interact with tar archives." msgstr ":mod:`tarfile` 模組提供了簡單的命令列介面來與 tar 封存檔互動。" @@ -2023,8 +2089,7 @@ msgstr "$ python -m tarfile -c monty.tar life-of-brian_1979/" msgid "" "If you want to extract a tar archive into the current directory, use the :" "option:`-e` option:" -msgstr "" -"如果你要將 tar 封存檔解壓縮到目前目錄,請使用 :option:`-e` 選項:" +msgstr "如果你要將 tar 封存檔解壓縮到目前目錄,請使用 :option:`-e` 選項:" #: ../../library/tarfile.rst:1307 msgid "$ python -m tarfile -e monty.tar" @@ -2269,8 +2334,9 @@ msgid "Supported tar formats" msgstr "支援的 tar 格式" #: ../../library/tarfile.rst:1449 +#, fuzzy msgid "" -"There are three tar formats that can be created with the :mod:`tarfile` " +"There are three tar formats that can be created with the :mod:`!tarfile` " "module:" msgstr "使用 :mod:`tarfile` 模組可以建立三種 tar 格式:" @@ -2286,14 +2352,15 @@ msgstr "" "但廣受支援。" #: ../../library/tarfile.rst:1456 +#, fuzzy msgid "" "The GNU tar format (:const:`GNU_FORMAT`). It supports long filenames and " "linknames, files bigger than 8 GiB and sparse files. It is the de facto " -"standard on GNU/Linux systems. :mod:`tarfile` fully supports the GNU tar " +"standard on GNU/Linux systems. :mod:`!tarfile` fully supports the GNU tar " "extensions for long names, sparse file support is read-only." msgstr "" -"GNU tar 格式(:const:`GNU_FORMAT`)。它支援長檔名和長連結名稱、超過 8 GiB 的檔案以及" -"稀疏檔案。這是 GNU/Linux 系統上的實際標準。:mod:`tarfile` 完全支援 " +"GNU tar 格式(:const:`GNU_FORMAT`)。它支援長檔名和長連結名稱、超過 8 GiB 的" +"檔案以及稀疏檔案。這是 GNU/Linux 系統上的實際標準。:mod:`tarfile` 完全支援 " "GNU tar 對長名稱的擴充,但稀疏檔案僅有唯讀支援。" #: ../../library/tarfile.rst:1461 @@ -2321,9 +2388,9 @@ msgid "" "in a pax header is encoded in *UTF-8* for portability reasons." msgstr "" "它透過額外的標頭擴充既有的 *ustar* 格式,以儲存無法以其他方式儲存的資訊。pax " -"標頭有兩種類型:擴充標頭(Extended headers)只影響緊接在後的檔案標頭,全域標頭(global " -"headers)則對整個封存檔有效並影響所有後續檔案。為了可攜性,pax 標頭中的所有資料都使用 " -"*UTF-8* 編碼。" +"標頭有兩種類型:擴充標頭(Extended headers)只影響緊接在後的檔案標頭,全域標" +"頭(global headers)則對整個封存檔有效並影響所有後續檔案。為了可攜性,pax 標" +"頭中的所有資料都使用 *UTF-8* 編碼。" #: ../../library/tarfile.rst:1475 msgid "" @@ -2339,8 +2406,9 @@ msgid "" "archives have miscalculated header checksums in case of fields with non-" "ASCII characters." msgstr "" -"古老的 V7 格式。這是 Unix 第七版的第一個 tar 格式,只能儲存一般檔案和目錄。名稱不得超過 100 " -"個字元,且沒有使用者/群組名稱資訊。某些封存檔在欄位包含非 ASCII 字元時,標頭檢查碼會計算錯誤。" +"古老的 V7 格式。這是 Unix 第七版的第一個 tar 格式,只能儲存一般檔案和目錄。名" +"稱不得超過 100 個字元,且沒有使用者/群組名稱資訊。某些封存檔在欄位包含非 " +"ASCII 字元時,標頭檢查碼會計算錯誤。" #: ../../library/tarfile.rst:1483 msgid "" @@ -2375,11 +2443,13 @@ msgstr "" "編碼 *UTF-8* 來儲存非 ASCII 中介資料。" #: ../../library/tarfile.rst:1503 +#, fuzzy msgid "" -"The details of character conversion in :mod:`tarfile` are controlled by the " +"The details of character conversion in :mod:`!tarfile` are controlled by the " "*encoding* and *errors* keyword arguments of the :class:`TarFile` class." msgstr "" -":mod:`tarfile` 中字元轉換的細節由 :class:`TarFile` 類別的 *encoding* 和 *errors* 關鍵字引數控制。" +":mod:`tarfile` 中字元轉換的細節由 :class:`TarFile` 類別的 *encoding* 和 " +"*errors* 關鍵字引數控制。" #: ../../library/tarfile.rst:1506 msgid "" @@ -2389,10 +2459,10 @@ msgid "" "written, the metadata must be either decoded or encoded. If *encoding* is " "not set appropriately, this conversion may fail." msgstr "" -"*encoding* 定義封存檔中介資料所使用的字元編碼。預設值" -"為 :func:`sys.getfilesystemencoding`,若無法取得則使用 ``'ascii'`` 作為備用。" -"根據封存檔是讀取還是寫入,中介資料必須被解碼或編碼。如果 *encoding* 設定不" -"當,此轉換可能會失敗。" +"*encoding* 定義封存檔中介資料所使用的字元編碼。預設值為 :func:`sys." +"getfilesystemencoding`,若無法取得則使用 ``'ascii'`` 作為備用。根據封存檔是讀" +"取還是寫入,中介資料必須被解碼或編碼。如果 *encoding* 設定不當,此轉換可能會" +"失敗。" #: ../../library/tarfile.rst:1512 msgid "" diff --git a/library/tempfile.po b/library/tempfile.po index a2331434d8..b4b911d97c 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-07 00:14+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2022-06-12 15:17+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -675,7 +675,9 @@ msgid "Examples" msgstr "範例" #: ../../library/tempfile.rst:389 -msgid "Here are some examples of typical usage of the :mod:`tempfile` module::" +#, fuzzy +msgid "" +"Here are some examples of typical usage of the :mod:`!tempfile` module::" msgstr "以下是 :mod:`tempfile` module 的一些常見用法範例: ::" #: ../../library/tempfile.rst:391 diff --git a/library/termios.po b/library/termios.po index b8010cfc05..8ea99edcb2 100644 --- a/library/termios.po +++ b/library/termios.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 00:13+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -60,7 +60,7 @@ msgid "" "items with indices :const:`VMIN` and :const:`VTIME`, which are integers when " "these fields are defined). The interpretation of the flags and the speeds " "as well as the indexing in the *cc* array must be done using the symbolic " -"constants defined in the :mod:`termios` module." +"constants defined in the :mod:`!termios` module." msgstr "" #: ../../library/termios.rst:46 diff --git a/library/test.po b/library/test.po index 46e509511f..1c20b468a8 100644 --- a/library/test.po +++ b/library/test.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-09 00:15+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -23,7 +23,7 @@ msgstr ":mod:`!test` --- Python 的回歸測試 (regression tests) 套件" #: ../../library/test.rst:10 msgid "" -"The :mod:`test` package is meant for internal use by Python only. It is " +"The :mod:`!test` package is meant for internal use by Python only. It is " "documented for the benefit of the core developers of Python. Any use of this " "package outside of Python's standard library is discouraged as code " "mentioned here can change or be removed without notice between releases of " @@ -32,7 +32,7 @@ msgstr "" #: ../../library/test.rst:18 msgid "" -"The :mod:`test` package contains all regression tests for Python as well as " +"The :mod:`!test` package contains all regression tests for Python as well as " "the modules :mod:`test.support` and :mod:`test.regrtest`. :mod:`test." "support` is used to enhance your tests while :mod:`test.regrtest` drives the " "testing suite." @@ -40,8 +40,8 @@ msgstr "" #: ../../library/test.rst:23 msgid "" -"Each module in the :mod:`test` package whose name starts with ``test_`` is a " -"testing suite for a specific module or feature. All new tests should be " +"Each module in the :mod:`!test` package whose name starts with ``test_`` is " +"a testing suite for a specific module or feature. All new tests should be " "written using the :mod:`unittest` or :mod:`doctest` module. Some older " "tests are written using a \"traditional\" testing style that compares output " "printed to ``sys.stdout``; this style of test is considered deprecated." @@ -64,7 +64,8 @@ msgid "Tests embedded in documentation strings." msgstr "鑲嵌在文件字串中的測試。" #: ../../library/test.rst:42 -msgid "Writing Unit Tests for the :mod:`test` package" +#, fuzzy +msgid "Writing Unit Tests for the :mod:`!test` package" msgstr "撰寫 :mod:`test` 套件的單元測試" #: ../../library/test.rst:44 @@ -250,31 +251,31 @@ msgstr "使用命令列介面執行測試" #: ../../library/test.rst:165 msgid "" -"The :mod:`test` package can be run as a script to drive Python's regression " +"The :mod:`!test` package can be run as a script to drive Python's regression " "test suite, thanks to the :option:`-m` option: :program:`python -m test`. " "Under the hood, it uses :mod:`test.regrtest`; the call :program:`python -m " "test.regrtest` used in previous Python versions still works. Running the " "script by itself automatically starts running all regression tests in the :" -"mod:`test` package. It does this by finding all modules in the package whose " -"name starts with ``test_``, importing them, and executing the function :func:" -"`test_main` if present or loading the tests via unittest.TestLoader." -"loadTestsFromModule if ``test_main`` does not exist. The names of tests to " -"execute may also be passed to the script. Specifying a single regression " -"test (:program:`python -m test test_spam`) will minimize output and only " -"print whether the test passed or failed." +"mod:`!test` package. It does this by finding all modules in the package " +"whose name starts with ``test_``, importing them, and executing the " +"function :func:`test_main` if present or loading the tests via unittest." +"TestLoader.loadTestsFromModule if ``test_main`` does not exist. The names " +"of tests to execute may also be passed to the script. Specifying a single " +"regression test (:program:`python -m test test_spam`) will minimize output " +"and only print whether the test passed or failed." msgstr "" #: ../../library/test.rst:178 msgid "" -"Running :mod:`test` directly allows what resources are available for tests " +"Running :mod:`!test` directly allows what resources are available for tests " "to use to be set. You do this by using the ``-u`` command-line option. " "Specifying ``all`` as the value for the ``-u`` option enables all possible " "resources: :program:`python -m test -uall`. If all but one resource is " "desired (a more common case), a comma-separated list of resources that are " "not desired may be listed after ``all``. The command :program:`python -m " -"test -uall,-audio,-largefile` will run :mod:`test` with all resources except " -"the ``audio`` and ``largefile`` resources. For a list of all resources and " -"more command-line options, run :program:`python -m test -h`." +"test -uall,-audio,-largefile` will run :mod:`!test` with all resources " +"except the ``audio`` and ``largefile`` resources. For a list of all " +"resources and more command-line options, run :program:`python -m test -h`." msgstr "" #: ../../library/test.rst:189 diff --git a/library/textwrap.po b/library/textwrap.po index e9f526501d..6c425137d3 100644 --- a/library/textwrap.po +++ b/library/textwrap.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-31 00:16+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/textwrap.py`" #: ../../library/textwrap.rst:14 msgid "" -"The :mod:`textwrap` module provides some convenience functions, as well as :" +"The :mod:`!textwrap` module provides some convenience functions, as well as :" "class:`TextWrapper`, the class that does all the work. If you're just " "wrapping or filling one or two text strings, the convenience functions " "should be good enough; otherwise, you should use an instance of :class:" diff --git a/library/timeit.po b/library/timeit.po index c3534ed8b5..335c38ff7d 100644 --- a/library/timeit.po +++ b/library/timeit.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2023-05-20 13:21+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,8 +36,8 @@ msgid "" "execution times. See also Tim Peters' introduction to the \"Algorithms\" " "chapter in the second edition of *Python Cookbook*, published by O'Reilly." msgstr "" -"該模組提供了一種對少量 Python 程式碼進行計時的簡單方法。它有一個" -"\\ :ref:`timeit-command-line-interface`\\ 和一個\\ :ref:`可呼叫介面 `,它避免了許多測量執行時間的常見陷阱。另請參閱由 O'Reilly 出版的 " "*Python 錦囊妙計 (Python Cookbook)* 第二版中 Tim Peters 所寫的「演算法」章節" "的介紹。" @@ -107,11 +107,11 @@ msgstr "" #: ../../library/timeit.rst:52 msgid "" "Note however that :func:`.timeit` will automatically determine the number of " -"repetitions only when the command-line interface is used. In " -"the :ref:`timeit-examples` section you can find more advanced examples." +"repetitions only when the command-line interface is used. In the :ref:" +"`timeit-examples` section you can find more advanced examples." msgstr "" -"但請注意,僅當使用命令列介面時 :func:`.timeit` 才會自動確定重複次數。在" -"\\ :ref:`timeit-examples`\\ 章節中有更進階的範例。" +"但請注意,僅當使用命令列介面時 :func:`.timeit` 才會自動確定重複次數。在\\ :" +"ref:`timeit-examples`\\ 章節中有更進階的範例。" #: ../../library/timeit.rst:60 msgid "Python Interface" @@ -157,8 +157,8 @@ msgid "" "The default timer, which is always time.perf_counter(), returns float " "seconds. An alternative, time.perf_counter_ns, returns integer nanoseconds." msgstr "" -"預設計時器始終為 time.perf_counter(),會回傳浮點秒數。另一種方法是 " -"time.perf_counter_ns,會回傳整數奈秒。" +"預設計時器始終為 time.perf_counter(),會回傳浮點秒數。另一種方法是 time." +"perf_counter_ns,會回傳整數奈秒。" #: ../../library/timeit.rst:95 msgid ":func:`time.perf_counter` is now the default timer." @@ -186,9 +186,9 @@ msgstr "" #: ../../library/timeit.rst:111 msgid "" -"To measure the execution time of the first statement, use " -"the :meth:`.timeit` method. The :meth:`.repeat` and :meth:`.autorange` " -"methods are convenience methods to call :meth:`.timeit` multiple times." +"To measure the execution time of the first statement, use the :meth:`." +"timeit` method. The :meth:`.repeat` and :meth:`.autorange` methods are " +"convenience methods to call :meth:`.timeit` multiple times." msgstr "" "要測量第一個陳述式的執行時間,請使用 :meth:`.timeit` 方法。:meth:`.repeat` " "和 :meth:`.autorange` 方法是多次呼叫 :meth:`.timeit` 的便捷方法。" @@ -364,8 +364,8 @@ msgid "" "measure process time, not wallclock time, using :func:`time.process_time` " "instead of :func:`time.perf_counter`, which is the default" msgstr "" -"若要測量行程時間 (process time) 而非掛鐘時間 (wallclock time),請使" -"用 :func:`time.process_time` 而不是預設的 :func:`time.perf_counter`" +"若要測量行程時間 (process time) 而非掛鐘時間 (wallclock time),請使用 :func:" +"`time.process_time` 而不是預設的 :func:`time.perf_counter`" #: ../../library/timeit.rst:238 msgid "" @@ -406,15 +406,15 @@ msgstr "" msgid "" ":func:`default_timer` measurements can be affected by other programs running " "on the same machine, so the best thing to do when accurate timing is " -"necessary is to repeat the timing a few times and use the best time. " -"The :option:`-r` option is good for this; the default of 5 repetitions is " +"necessary is to repeat the timing a few times and use the best time. The :" +"option:`-r` option is good for this; the default of 5 repetitions is " "probably enough in most cases. You can use :func:`time.process_time` to " "measure CPU time." msgstr "" ":func:`default_timer` 測量可能會受到同一台機器上運行的其他程式的影響,因此," "當需要精確計時時,最好的做法是重複計時幾次並使用最佳時間。:option:`-r` 選項對" -"此很有用;在大多數情況下,預設的重複 5 次可能就足夠了。你可以使" -"用 :func:`time.process_time` 來測量 CPU 時間。" +"此很有用;在大多數情況下,預設的重複 5 次可能就足夠了。你可以使用 :func:" +"`time.process_time` 來測量 CPU 時間。" #: ../../library/timeit.rst:267 msgid "" @@ -442,15 +442,15 @@ msgid "" "$ python -m timeit -s \"text = 'sample string'; char = 'g'\" \"char in " "text\"\n" "5000000 loops, best of 5: 0.0877 usec per loop\n" -"$ python -m timeit -s \"text = 'sample string'; char = 'g'\" " -"\"text.find(char)\"\n" +"$ python -m timeit -s \"text = 'sample string'; char = 'g'\" \"text." +"find(char)\"\n" "1000000 loops, best of 5: 0.342 usec per loop" msgstr "" "$ python -m timeit -s \"text = 'sample string'; char = 'g'\" \"char in " "text\"\n" "5000000 loops, best of 5: 0.0877 usec per loop\n" -"$ python -m timeit -s \"text = 'sample string'; char = 'g'\" " -"\"text.find(char)\"\n" +"$ python -m timeit -s \"text = 'sample string'; char = 'g'\" \"text." +"find(char)\"\n" "1000000 loops, best of 5: 0.342 usec per loop" #: ../../library/timeit.rst:287 @@ -512,12 +512,11 @@ msgstr "" #: ../../library/timeit.rst:312 msgid "" "The following examples show how to time expressions that contain multiple " -"lines. Here we compare the cost of using :func:`hasattr` " -"vs. :keyword:`try`/:keyword:`except` to test for missing and present object " -"attributes:" +"lines. Here we compare the cost of using :func:`hasattr` vs. :keyword:`try`/:" +"keyword:`except` to test for missing and present object attributes:" msgstr "" -"以下範例展示如何對包含多行的運算式進行計時。這裡我們使用 :func:`hasattr` " -"與 :keyword:`try`/:keyword:`except` 來測試缺失和存在之物件屬性並比較其花費 " +"以下範例展示如何對包含多行的運算式進行計時。這裡我們使用 :func:`hasattr` 與 :" +"keyword:`try`/:keyword:`except` 來測試缺失和存在之物件屬性並比較其花費 " "(cost):" #: ../../library/timeit.rst:316 @@ -603,8 +602,9 @@ msgstr "" "0.08588060699912603" #: ../../library/timeit.rst:358 +#, fuzzy msgid "" -"To give the :mod:`timeit` module access to functions you define, you can " +"To give the :mod:`!timeit` module access to functions you define, you can " "pass a *setup* parameter which contains an import statement::" msgstr "" "要讓 :mod:`timeit` 模組存取你定義的函式,你可以傳遞一個包含 import 陳述式的 " diff --git a/library/tkinter.colorchooser.po b/library/tkinter.colorchooser.po index 3880f52bd3..f104d023df 100644 --- a/library/tkinter.colorchooser.po +++ b/library/tkinter.colorchooser.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-09 00:03+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2024-02-15 12:16+0800\n" "Last-Translator: Li-Hung Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,8 +26,9 @@ msgid "**Source code:** :source:`Lib/tkinter/colorchooser.py`" msgstr "**原始碼:**\\ :source:`Lib/tkinter/colorchooser.py`" #: ../../library/tkinter.colorchooser.rst:12 +#, fuzzy msgid "" -"The :mod:`tkinter.colorchooser` module provides the :class:`Chooser` class " +"The :mod:`!tkinter.colorchooser` module provides the :class:`Chooser` class " "as an interface to the native color picker dialog. ``Chooser`` implements a " "modal color choosing dialog window. The ``Chooser`` class inherits from the :" "class:`~tkinter.commondialog.Dialog` class." diff --git a/library/tkinter.dnd.po b/library/tkinter.dnd.po index 9e86c93f28..a6b382d030 100644 --- a/library/tkinter.dnd.po +++ b/library/tkinter.dnd.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-09 00:03+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2025-08-21 00:00+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,8 +31,9 @@ msgid "" msgstr "這是一個實驗性的功能,並將在被 Tk DND 取代時棄用。" #: ../../library/tkinter.dnd.rst:15 +#, fuzzy msgid "" -"The :mod:`tkinter.dnd` module provides drag-and-drop support for objects " +"The :mod:`!tkinter.dnd` module provides drag-and-drop support for objects " "within a single application, within the same window or between windows. To " "enable an object to be dragged, you must create an event binding for it that " "starts the drag-and-drop process. Typically, you bind a ButtonPress event to " @@ -42,10 +43,10 @@ msgid "" "your callback function)." msgstr "" ":mod:`tkinter.dnd` 模組為單一應用程式內、同一個視窗內或視窗之間的物件提供拖放" -"支援。要讓一個物件可以被拖動,你必須為它建立一個事件繫結來啟動拖放過程。你" -"通常會將一個 ButtonPress 事件繫結到你所寫的回呼函式(請參閱 :ref:`Bindings-" -"and-Events`)。該函式應該呼叫 :func:`dnd_start`,其中 'source' 是要被拖動的物" -"件,而 'event' 是觸發呼叫的事件(你的回呼函式的引數)。" +"支援。要讓一個物件可以被拖動,你必須為它建立一個事件繫結來啟動拖放過程。你通" +"常會將一個 ButtonPress 事件繫結到你所寫的回呼函式(請參閱 :ref:`Bindings-and-" +"Events`)。該函式應該呼叫 :func:`dnd_start`,其中 'source' 是要被拖動的物件," +"而 'event' 是觸發呼叫的事件(你的回呼函式的引數)。" #: ../../library/tkinter.dnd.rst:23 msgid "Selection of a target object occurs as follows:" diff --git a/library/tkinter.font.po b/library/tkinter.font.po index 7179e207b4..98aacc51e5 100644 --- a/library/tkinter.font.po +++ b/library/tkinter.font.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-22 16:55+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2024-02-15 23:09+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,9 +26,10 @@ msgid "**Source code:** :source:`Lib/tkinter/font.py`" msgstr "**原始碼:**\\ :source:`Lib/tkinter/font.py`" #: ../../library/tkinter.font.rst:12 +#, fuzzy msgid "" -"The :mod:`tkinter.font` module provides the :class:`Font` class for creating " -"and using named fonts." +"The :mod:`!tkinter.font` module provides the :class:`Font` class for " +"creating and using named fonts." msgstr "" ":mod:`tkinter.font` 模組提供類別 :class:`Font`,可以建立及使用已命名的字型。" diff --git a/library/tkinter.messagebox.po b/library/tkinter.messagebox.po index 902c5303b9..ba9e96c1b2 100644 --- a/library/tkinter.messagebox.po +++ b/library/tkinter.messagebox.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-09 00:03+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2024-02-22 15:59+0800\n" "Last-Translator: Li-Hung Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,8 +26,9 @@ msgid "**Source code:** :source:`Lib/tkinter/messagebox.py`" msgstr "**原始碼:**\\ :source:`Lib/tkinter/messagebox.py`" #: ../../library/tkinter.messagebox.rst:12 +#, fuzzy msgid "" -"The :mod:`tkinter.messagebox` module provides a template base class as well " +"The :mod:`!tkinter.messagebox` module provides a template base class as well " "as a variety of convenience methods for commonly used configurations. The " "message boxes are modal and will return a subset of (``True``, ``False``, " "``None``, :data:`OK`, :data:`CANCEL`, :data:`YES`, :data:`NO`) based on the " diff --git a/library/tkinter.po b/library/tkinter.po index 76e4d27fa8..0e9579275f 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-20 00:15+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2025-07-13 20:00+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,9 +28,10 @@ msgid "**Source code:** :source:`Lib/tkinter/__init__.py`" msgstr "**原始碼:**\\ :source:`Lib/tkinter/__init__.py`" #: ../../library/tkinter.rst:13 +#, fuzzy msgid "" -"The :mod:`tkinter` package (\"Tk interface\") is the standard Python " -"interface to the Tcl/Tk GUI toolkit. Both Tk and :mod:`tkinter` are " +"The :mod:`!tkinter` package (\"Tk interface\") is the standard Python " +"interface to the Tcl/Tk GUI toolkit. Both Tk and :mod:`!tkinter` are " "available on most Unix platforms, including macOS, as well as on Windows " "systems." msgstr "" @@ -39,11 +40,12 @@ msgstr "" "用。" #: ../../library/tkinter.rst:17 +#, fuzzy msgid "" "Running ``python -m tkinter`` from the command line should open a window " -"demonstrating a simple Tk interface, letting you know that :mod:`tkinter` is " -"properly installed on your system, and also showing what version of Tcl/Tk " -"is installed, so you can read the Tcl/Tk documentation specific to that " +"demonstrating a simple Tk interface, letting you know that :mod:`!tkinter` " +"is properly installed on your system, and also showing what version of Tcl/" +"Tk is installed, so you can read the Tcl/Tk documentation specific to that " "version." msgstr "" "從命令列執行 ``python -m tkinter`` 應該會開啟一個展示簡單 Tk 介面的視窗,讓你" @@ -267,9 +269,10 @@ msgstr "" "Cocoa、Windows 上的 GDI。" #: ../../library/tkinter.rst:110 +#, fuzzy msgid "" "When your Python application uses a class in Tkinter, e.g., to create a " -"widget, the :mod:`tkinter` module first assembles a Tcl/Tk command string. " +"widget, the :mod:`!tkinter` module first assembles a Tcl/Tk command string. " "It passes that Tcl command string to an internal :mod:`_tkinter` binary " "module, which then calls the Tcl interpreter to evaluate it. The Tcl " "interpreter will then call into the Tk and/or Ttk packages, which will in " @@ -285,9 +288,10 @@ msgid "Tkinter Modules" msgstr "Tkinter 模組" #: ../../library/tkinter.rst:120 +#, fuzzy msgid "" "Support for Tkinter is spread across several modules. Most applications will " -"need the main :mod:`tkinter` module, as well as the :mod:`tkinter.ttk` " +"need the main :mod:`!tkinter` module, as well as the :mod:`tkinter.ttk` " "module, which provides the modern themed widget set and API::" msgstr "" "對 Tkinter 的支援分散在數個模組中。大多數應用程式將需要主要的 :mod:`tkinter` " @@ -430,11 +434,11 @@ msgid "" "the tree-like relationship while *master* (or *container*)/*content* " "reflects the container structure." msgstr "" -"包含此元件的元件物件。對於 :class:`Tk`,:attr:`!master` 是 :const:`None`,因為它是主" -"視窗。*master* 和 *parent* 這兩個術語很相似,有時會作為引數名稱互換使用;然" -"而,呼叫 :meth:`winfo_parent` 會回傳元件名稱的字串,而 :attr:`!master` 則回傳" -"物件。*parent*/*child* 反映了樹狀關係,而 *master* (或 *container*)/*content* " -"反映了容器結構。" +"包含此元件的元件物件。對於 :class:`Tk`,:attr:`!master` 是 :const:`None`,因" +"為它是主視窗。*master* 和 *parent* 這兩個術語很相似,有時會作為引數名稱互換使" +"用;然而,呼叫 :meth:`winfo_parent` 會回傳元件名稱的字串,而 :attr:`!master` " +"則回傳物件。*parent*/*child* 反映了樹狀關係,而 *master* (或 *container*)/" +"*content* 反映了容器結構。" #: ../../library/tkinter.rst:189 msgid "" @@ -466,7 +470,8 @@ msgid "The modules that provide Tk support include:" msgstr "提供 Tk 支援的模組包括:" #: ../../library/tkinter.rst:207 -msgid ":mod:`tkinter`" +#, fuzzy +msgid ":mod:`!tkinter`" msgstr ":mod:`tkinter`" #: ../../library/tkinter.rst:208 @@ -534,9 +539,10 @@ msgid ":mod:`tkinter.ttk`" msgstr ":mod:`tkinter.ttk`" #: ../../library/tkinter.rst:232 +#, fuzzy msgid "" "Themed widget set introduced in Tk 8.5, providing modern alternatives for " -"many of the classic widgets in the main :mod:`tkinter` module." +"many of the classic widgets in the main :mod:`!tkinter` module." msgstr "" "在 Tk 8.5 中引入的主題式元件集,為主 :mod:`tkinter` 模組中的許多傳統元件提供" "了現代化的替代方案。" @@ -550,9 +556,10 @@ msgid ":mod:`_tkinter`" msgstr ":mod:`_tkinter`" #: ../../library/tkinter.rst:241 +#, fuzzy msgid "" "A binary module that contains the low-level interface to Tcl/Tk. It is " -"automatically imported by the main :mod:`tkinter` module, and should never " +"automatically imported by the main :mod:`!tkinter` module, and should never " "be used directly by application programmers. It is usually a shared library " "(or DLL), but might in some cases be statically linked with the Python " "interpreter." @@ -566,9 +573,10 @@ msgid ":mod:`idlelib`" msgstr ":mod:`idlelib`" #: ../../library/tkinter.rst:248 +#, fuzzy msgid "" "Python's Integrated Development and Learning Environment (IDLE). Based on :" -"mod:`tkinter`." +"mod:`!tkinter`." msgstr "Python 的整合開發與學習環境(IDLE)。基於 :mod:`tkinter`。" #: ../../library/tkinter.rst:251 @@ -576,10 +584,11 @@ msgid ":mod:`tkinter.constants`" msgstr ":mod:`tkinter.constants`" #: ../../library/tkinter.rst:252 +#, fuzzy msgid "" "Symbolic constants that can be used in place of strings when passing various " -"parameters to Tkinter calls. Automatically imported by the main :mod:" -"`tkinter` module." +"parameters to Tkinter calls. Automatically imported by the main :mod:`!" +"tkinter` module." msgstr "" "在將各種參數傳遞給 Tkinter 呼叫時,可用於替代字串的符號常數。由主 :mod:" "`tkinter` 模組自動引入。" @@ -589,8 +598,9 @@ msgid ":mod:`tkinter.dnd`" msgstr ":mod:`tkinter.dnd`" #: ../../library/tkinter.rst:257 +#, fuzzy msgid "" -"(experimental) Drag-and-drop support for :mod:`tkinter`. This will become " +"(experimental) Drag-and-drop support for :mod:`!tkinter`. This will become " "deprecated when it is replaced with the Tk DND." msgstr "" "(實驗性)對 :mod:`tkinter` 的拖放支援。當它被 Tk DND 取代時,將會被棄用。" @@ -1074,9 +1084,11 @@ msgid "Threading model" msgstr "執行緒模型" #: ../../library/tkinter.rst:507 +#, fuzzy msgid "" -"Python and Tcl/Tk have very different threading models, which :mod:`tkinter` " -"tries to bridge. If you use threads, you may need to be aware of this." +"Python and Tcl/Tk have very different threading models, which :mod:`!" +"tkinter` tries to bridge. If you use threads, you may need to be aware of " +"this." msgstr "" "Python 和 Tcl/Tk 有非常不同的執行緒模型,:mod:`tkinter` 試圖彌合這種差異。如" "果你使用執行緒,你可能需要意識到這一點。" @@ -1094,11 +1106,12 @@ msgstr "" "實例,但每個直譯器實例只能由建立它的那個執行緒使用。" #: ../../library/tkinter.rst:515 +#, fuzzy msgid "" -"Each :class:`Tk` object created by :mod:`tkinter` contains a Tcl " +"Each :class:`Tk` object created by :mod:`!tkinter` contains a Tcl " "interpreter. It also keeps track of which thread created that interpreter. " -"Calls to :mod:`tkinter` can be made from any Python thread. Internally, if a " -"call comes from a thread other than the one that created the :class:`Tk` " +"Calls to :mod:`!tkinter` can be made from any Python thread. Internally, if " +"a call comes from a thread other than the one that created the :class:`Tk` " "object, an event is posted to the interpreter's event queue, and when " "executed, the result is returned to the calling Python thread." msgstr "" @@ -1127,9 +1140,10 @@ msgstr "" "碼(包括事件處理常式)完全分離的執行緒中執行。" #: ../../library/tkinter.rst:531 +#, fuzzy msgid "" "If the Tcl interpreter is not running the event loop and processing events, " -"any :mod:`tkinter` calls made from threads other than the one running the " +"any :mod:`!tkinter` calls made from threads other than the one running the " "Tcl interpreter will fail." msgstr "" "如果 Tcl 直譯器沒有在執行事件迴圈和處理事件,那麼從執行 Tcl 直譯器的執行緒以" @@ -1140,9 +1154,10 @@ msgid "A number of special cases exist:" msgstr "存在一些特殊情況:" #: ../../library/tkinter.rst:537 +#, fuzzy msgid "" "Tcl/Tk libraries can be built so they are not thread-aware. In this case, :" -"mod:`tkinter` calls the library from the originating Python thread, even if " +"mod:`!tkinter` calls the library from the originating Python thread, even if " "this is different than the thread that created the Tcl interpreter. A global " "lock ensures only one call occurs at a time." msgstr "" @@ -1151,10 +1166,11 @@ msgstr "" "個全域鎖確保一次只發生一個呼叫。" #: ../../library/tkinter.rst:542 +#, fuzzy msgid "" -"While :mod:`tkinter` allows you to create more than one instance of a :class:" -"`Tk` object (with its own interpreter), all interpreters that are part of " -"the same thread share a common event queue, which gets ugly fast. In " +"While :mod:`!tkinter` allows you to create more than one instance of a :" +"class:`Tk` object (with its own interpreter), all interpreters that are part " +"of the same thread share a common event queue, which gets ugly fast. In " "practice, don't create more than one instance of :class:`Tk` at a time. " "Otherwise, it's best to create them in separate threads and ensure you're " "running a thread-aware Tcl/Tk build." @@ -1176,8 +1192,9 @@ msgstr "" "作,請注意這些可能性。" #: ../../library/tkinter.rst:553 +#, fuzzy msgid "" -"There are a few select :mod:`tkinter` functions that presently work only " +"There are a few select :mod:`!tkinter` functions that presently work only " "when called from the thread that created the Tcl interpreter." msgstr "" "目前有少數幾個 :mod:`tkinter` 函式只有在從建立 Tcl 直譯器的執行緒中呼叫時才能" @@ -1381,9 +1398,9 @@ msgid "" "works everything out to determine the exact placement coordinates for you." msgstr "" "packer 是 Tk 的佈局管理(geometry manager)機制之一。佈局管理器(geometry " -"manager)用於指定元件在其容器內的相對位置。與較為繁" -"瑣的 *placer*\\ (較不常用,我們在此不予介紹)相比,packer 採用定性的關係規範" -"——*上方*、*左方*、*填滿*\\ 等——並為你計算出確切的放置座標。" +"manager)用於指定元件在其容器內的相對位置。與較為繁瑣的 *placer*\\ (較不常" +"用,我們在此不予介紹)相比,packer 採用定性的關係規範——*上方*、*左方*、*填滿" +"*\\ 等——並為你計算出確切的放置座標。" #: ../../library/tkinter.rst:647 msgid "" @@ -1395,8 +1412,8 @@ msgid "" "adjusted to accommodate incremental changes to the configuration, once it is " "packed." msgstr "" -"任何 *master* 元件的大小由其內部的「content 元件」的大小決定。packer 用於控制 " -"content 元件在被 packed 的容器內部出現的位置。你可以將元件 pack 到框架中," +"任何 *master* 元件的大小由其內部的「content 元件」的大小決定。packer 用於控" +"制 content 元件在被 packed 的容器內部出現的位置。你可以將元件 pack 到框架中," "再將框架 pack 到其他框架中,以達到你想要的佈局。此外,一旦 packed,佈局會動態" "調整以適應設定的增量變更。" @@ -1513,12 +1530,13 @@ msgstr "" "會更新以反映新值。" #: ../../library/tkinter.rst:703 +#, fuzzy msgid "" -"Unfortunately, in the current implementation of :mod:`tkinter` it is not " +"Unfortunately, in the current implementation of :mod:`!tkinter` it is not " "possible to hand over an arbitrary Python variable to a widget through a " "``variable`` or ``textvariable`` option. The only kinds of variables for " "which this works are variables that are subclassed from a class called " -"Variable, defined in :mod:`tkinter`." +"Variable, defined in :mod:`!tkinter`." msgstr "" "不幸的是,在 :mod:`tkinter` 的目前實作中,無法透過 ``variable`` 或 " "``textvariable`` 選項將任意的 Python 變數傳遞給元件。唯一適用此功能的變數類型" @@ -1609,10 +1627,11 @@ msgid "The Window Manager" msgstr "視窗管理器" #: ../../library/tkinter.rst:753 +#, fuzzy msgid "" "In Tk, there is a utility command, ``wm``, for interacting with the window " "manager. Options to the ``wm`` command allow you to control things like " -"titles, placement, icon bitmaps, and the like. In :mod:`tkinter`, these " +"titles, placement, icon bitmaps, and the like. In :mod:`!tkinter`, these " "commands have been implemented as methods on the :class:`Wm` class. " "Toplevel widgets are subclassed from the :class:`Wm` class, and so can call " "the :class:`Wm` methods directly." @@ -1632,10 +1651,10 @@ msgid "" "to denote the fact that this function is part of the implementation, and not " "an interface to Tk functionality." msgstr "" -"要取得包含給定元件的頂層視窗,你通常可以直接參照該元件的 :attr:`master`。當然,如果該" -"元件被 packed 在一個框架內,:attr:`!master` 將不代表一個頂層視窗。要取得包含任意元件的" -"頂層視窗,你可以呼叫 :meth:`_root` 方法。此方法以底線開頭,表示此函式是實作的" -"一部分,而不是 Tk 功能的介面。" +"要取得包含給定元件的頂層視窗,你通常可以直接參照該元件的 :attr:`master`。當" +"然,如果該元件被 packed 在一個框架內,:attr:`!master` 將不代表一個頂層視窗。" +"要取得包含任意元件的頂層視窗,你可以呼叫 :meth:`_root` 方法。此方法以底線開" +"頭,表示此函式是實作的一部分,而不是 Tk 功能的介面。" #: ../../library/tkinter.rst:767 msgid "Here are some examples of typical usage::" @@ -2105,10 +2124,11 @@ msgid "Entry widget indexes (index, view index, etc.)" msgstr "Entry 元件索引(index、view index 等)" #: ../../library/tkinter.rst:936 +#, fuzzy msgid "" "Entry widgets have options that refer to character positions in the text " -"being displayed. You can use these :mod:`tkinter` functions to access these " -"special points in text widgets:" +"being displayed. You can use these :mod:`!tkinter` functions to access " +"these special points in text widgets:" msgstr "" "Entry 元件具有參照所顯示文字中字元位置的選項。你可以使用這些 :mod:`tkinter` " "函式來存取文字元件中的這些特殊點:" diff --git a/library/tkinter.scrolledtext.po b/library/tkinter.scrolledtext.po index 35df81f5b4..d30fc1b3ba 100644 --- a/library/tkinter.scrolledtext.po +++ b/library/tkinter.scrolledtext.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-09 00:03+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2016-11-19 00:35+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/tkinter/scrolledtext.py`" #: ../../library/tkinter.scrolledtext.rst:14 msgid "" -"The :mod:`tkinter.scrolledtext` module provides a class of the same name " +"The :mod:`!tkinter.scrolledtext` module provides a class of the same name " "which implements a basic text widget which has a vertical scroll bar " "configured to do the \"right thing.\" Using the :class:`ScrolledText` class " "is a lot easier than setting up a text widget and scroll bar directly." diff --git a/library/tkinter.ttk.po b/library/tkinter.ttk.po index 8f286505c8..e04659572c 100644 --- a/library/tkinter.ttk.po +++ b/library/tkinter.ttk.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/tkinter/ttk.py`" #: ../../library/tkinter.ttk.rst:15 msgid "" -"The :mod:`tkinter.ttk` module provides access to the Tk themed widget set, " +"The :mod:`!tkinter.ttk` module provides access to the Tk themed widget set, " "introduced in Tk 8.5. It provides additional benefits including anti-aliased " "font rendering under X11 and window transparency (requiring a composition " "window manager on X11)." @@ -35,7 +35,7 @@ msgstr "" #: ../../library/tkinter.ttk.rst:20 msgid "" -"The basic idea for :mod:`tkinter.ttk` is to separate, to the extent " +"The basic idea for :mod:`!tkinter.ttk` is to separate, to the extent " "possible, the code implementing a widget's behavior from the code " "implementing its appearance." msgstr "" @@ -76,9 +76,11 @@ msgstr "" #: ../../library/tkinter.ttk.rst:43 msgid "" -"That code causes several :mod:`tkinter.ttk` widgets " -"(:class:`Button`, :class:`Checkbutton`, :class:`Entry`, :class:`Frame`, :class:`Label`, :class:`LabelFrame`, :class:`Menubutton`, :class:`PanedWindow`, :class:`Radiobutton`, :class:`Scale` " -"and :class:`Scrollbar`) to automatically replace the Tk widgets." +"That code causes several :mod:`!tkinter.ttk` widgets (:class:`Button`, :" +"class:`Checkbutton`, :class:`Entry`, :class:`Frame`, :class:`Label`, :class:" +"`LabelFrame`, :class:`Menubutton`, :class:`PanedWindow`, :class:" +"`Radiobutton`, :class:`Scale` and :class:`Scrollbar`) to automatically " +"replace the Tk widgets." msgstr "" #: ../../library/tkinter.ttk.rst:49 @@ -93,8 +95,8 @@ msgstr "" #: ../../library/tkinter.ttk.rst:59 msgid "" -"`Converting existing applications to use Tile widgets `_" +"`Converting existing applications to use Tile widgets `_" msgstr "" #: ../../library/tkinter.ttk.rst:60 @@ -109,11 +111,13 @@ msgstr "" #: ../../library/tkinter.ttk.rst:67 msgid "" -"Ttk comes with 18 widgets, twelve of which already existed in " -"tkinter: :class:`Button`, :class:`Checkbutton`, :class:`Entry`, :class:`Frame`, :class:`Label`, :class:`LabelFrame`, :class:`Menubutton`, :class:`PanedWindow`, :class:`Radiobutton`, :class:`Scale`, :class:`Scrollbar`, " -"and :class:`Spinbox`. The other six are " -"new: :class:`Combobox`, :class:`Notebook`, :class:`Progressbar`, :class:`Separator`, :class:`Sizegrip` " -"and :class:`Treeview`. And all them are subclasses of :class:`Widget`." +"Ttk comes with 18 widgets, twelve of which already existed in tkinter: :" +"class:`Button`, :class:`Checkbutton`, :class:`Entry`, :class:`Frame`, :class:" +"`Label`, :class:`LabelFrame`, :class:`Menubutton`, :class:`PanedWindow`, :" +"class:`Radiobutton`, :class:`Scale`, :class:`Scrollbar`, and :class:" +"`Spinbox`. The other six are new: :class:`Combobox`, :class:`Notebook`, :" +"class:`Progressbar`, :class:`Separator`, :class:`Sizegrip` and :class:" +"`Treeview`. And all them are subclasses of :class:`Widget`." msgstr "" #: ../../library/tkinter.ttk.rst:75 @@ -532,10 +536,11 @@ msgstr "" #: ../../library/tkinter.ttk.rst:300 msgid "" -"Besides the methods inherited " -"from :class:`Widget`: :meth:`Widget.cget`, :meth:`Widget.configure`, :meth:`Widget.identify`, :meth:`Widget.instate` " -"and :meth:`Widget.state`, and the following inherited " -"from :class:`Entry`: :meth:`Entry.bbox`, :meth:`Entry.delete`, :meth:`Entry.icursor`, :meth:`Entry.index`, :meth:`Entry.insert`, :meth:`Entry.selection`, :meth:`Entry.xview`, " +"Besides the methods inherited from :class:`Widget`: :meth:`Widget.cget`, :" +"meth:`Widget.configure`, :meth:`Widget.identify`, :meth:`Widget.instate` " +"and :meth:`Widget.state`, and the following inherited from :class:`Entry`: :" +"meth:`Entry.bbox`, :meth:`Entry.delete`, :meth:`Entry.icursor`, :meth:`Entry." +"index`, :meth:`Entry.insert`, :meth:`Entry.selection`, :meth:`Entry.xview`, " "it has some other methods, described at :class:`ttk.Combobox`." msgstr "" @@ -663,11 +668,12 @@ msgstr "" #: ../../library/tkinter.ttk.rst:388 msgid "" -"Besides the methods inherited " -"from :class:`Widget`: :meth:`Widget.cget`, :meth:`Widget.configure`, :meth:`Widget.identify`, :meth:`Widget.instate` " -"and :meth:`Widget.state`, and the following inherited " -"from :class:`Entry`: :meth:`Entry.bbox`, :meth:`Entry.delete`, :meth:`Entry.icursor`, :meth:`Entry.index`, :meth:`Entry.insert`, :meth:`Entry.xview`, " -"it has some other methods, described at :class:`ttk.Spinbox`." +"Besides the methods inherited from :class:`Widget`: :meth:`Widget.cget`, :" +"meth:`Widget.configure`, :meth:`Widget.identify`, :meth:`Widget.instate` " +"and :meth:`Widget.state`, and the following inherited from :class:`Entry`: :" +"meth:`Entry.bbox`, :meth:`Entry.delete`, :meth:`Entry.icursor`, :meth:`Entry." +"index`, :meth:`Entry.insert`, :meth:`Entry.xview`, it has some other " +"methods, described at :class:`ttk.Spinbox`." msgstr "" #: ../../library/tkinter.ttk.rst:405 @@ -835,8 +841,8 @@ msgstr "" #: ../../library/tkinter.ttk.rst:523 msgid "" -"Specifies an image to display in the tab. See the option image described " -"in :class:`Widget`." +"Specifies an image to display in the tab. See the option image described in :" +"class:`Widget`." msgstr "" #: ../../library/tkinter.ttk.rst:526 @@ -848,8 +854,8 @@ msgstr "" #: ../../library/tkinter.ttk.rst:530 msgid "" "Specifies the index (0-based) of a character to underline in the text " -"string. The underlined character is used for mnemonic activation " -"if :meth:`Notebook.enable_traversal` is called." +"string. The underlined character is used for mnemonic activation if :meth:" +"`Notebook.enable_traversal` is called." msgstr "" #: ../../library/tkinter.ttk.rst:538 @@ -1105,9 +1111,9 @@ msgstr "ttk.Progressbar" #: ../../library/tkinter.ttk.rst:705 msgid "" -"Begin autoincrement mode: schedules a recurring timer event that " -"calls :meth:`Progressbar.step` every *interval* milliseconds. If omitted, " -"*interval* defaults to 50 milliseconds." +"Begin autoincrement mode: schedules a recurring timer event that calls :meth:" +"`Progressbar.step` every *interval* milliseconds. If omitted, *interval* " +"defaults to 50 milliseconds." msgstr "" #: ../../library/tkinter.ttk.rst:712 @@ -1120,8 +1126,8 @@ msgstr "" #: ../../library/tkinter.ttk.rst:719 msgid "" -"Stop autoincrement mode: cancels any recurring timer event initiated " -"by :meth:`Progressbar.start` for this progress bar." +"Stop autoincrement mode: cancels any recurring timer event initiated by :" +"meth:`Progressbar.start` for this progress bar." msgstr "" #: ../../library/tkinter.ttk.rst:724 @@ -1228,8 +1234,8 @@ msgstr "" #: ../../library/tkinter.ttk.rst:795 msgid "" "The Treeview widget supports horizontal and vertical scrolling, according to " -"the options described in `Scrollable Widget Options`_ and the " -"methods :meth:`Treeview.xview` and :meth:`Treeview.yview`." +"the options described in `Scrollable Widget Options`_ and the methods :meth:" +"`Treeview.xview` and :meth:`Treeview.yview`." msgstr "" #: ../../library/tkinter.ttk.rst:810 @@ -1902,8 +1908,8 @@ msgid "" "elements making up the widget and how they are arranged, along with dynamic " "and default settings for element options. By default the style name is the " "same as the widget's class name, but it may be overridden by the widget's " -"style option. If you don't know the class name of a widget, use the " -"method :meth:`Misc.winfo_class` (somewidget.winfo_class())." +"style option. If you don't know the class name of a widget, use the method :" +"meth:`Misc.winfo_class` (somewidget.winfo_class())." msgstr "" #: ../../library/tkinter.ttk.rst:1275 @@ -2310,9 +2316,9 @@ msgstr "" msgid "" "Each key in *settings* is a style and each value may contain the keys " "'configure', 'map', 'layout' and 'element create' and they are expected to " -"have the same format as specified by the " -"methods :meth:`Style.configure`, :meth:`Style.map`, :meth:`Style.layout` " -"and :meth:`Style.element_create` respectively." +"have the same format as specified by the methods :meth:`Style.configure`, :" +"meth:`Style.map`, :meth:`Style.layout` and :meth:`Style.element_create` " +"respectively." msgstr "" #: ../../library/tkinter.ttk.rst:1532 diff --git a/library/tokenize.po b/library/tokenize.po index 19da1be9e4..5f54352062 100644 --- a/library/tokenize.po +++ b/library/tokenize.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-01-20 00:13+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/tokenize.py`" #: ../../library/tokenize.rst:14 msgid "" -"The :mod:`tokenize` module provides a lexical scanner for Python source " +"The :mod:`!tokenize` module provides a lexical scanner for Python source " "code, implemented in Python. The scanner in this module returns comments as " "tokens as well, making it useful for implementing \"pretty-printers\", " "including colorizers for on-screen displays." @@ -35,18 +35,18 @@ msgstr "" #: ../../library/tokenize.rst:19 msgid "" -"To simplify token stream handling, all :ref:`operator ` " -"and :ref:`delimiter ` tokens and :data:`Ellipsis` are returned " -"using the generic :data:`~token.OP` token type. The exact type can be " -"determined by checking the ``exact_type`` property on the :term:`named " -"tuple` returned from :func:`tokenize.tokenize`." +"To simplify token stream handling, all :ref:`operator ` and :ref:" +"`delimiter ` tokens and :data:`Ellipsis` are returned using the " +"generic :data:`~token.OP` token type. The exact type can be determined by " +"checking the ``exact_type`` property on the :term:`named tuple` returned " +"from :func:`tokenize.tokenize`." msgstr "" #: ../../library/tokenize.rst:28 msgid "" "Note that the functions in this module are only designed to parse " -"syntactically valid Python code (code that does not raise when parsed " -"using :func:`ast.parse`). The behavior of the functions in this module is " +"syntactically valid Python code (code that does not raise when parsed using :" +"func:`ast.parse`). The behavior of the functions in this module is " "**undefined** when providing invalid Python code and it can change at any " "point." msgstr "" @@ -62,9 +62,9 @@ msgstr "" #: ../../library/tokenize.rst:41 msgid "" "The :func:`.tokenize` generator requires one argument, *readline*, which " -"must be a callable object which provides the same interface as " -"the :meth:`io.IOBase.readline` method of file objects. Each call to the " -"function should return one line of input as bytes." +"must be a callable object which provides the same interface as the :meth:`io." +"IOBase.readline` method of file objects. Each call to the function should " +"return one line of input as bytes." msgstr "" #: ../../library/tokenize.rst:46 @@ -113,14 +113,14 @@ msgstr "" #: ../../library/tokenize.rst:77 msgid "" -"The result is an iterator yielding named tuples, exactly " -"like :func:`.tokenize`. It does not yield an :data:`~token.ENCODING` token." +"The result is an iterator yielding named tuples, exactly like :func:`." +"tokenize`. It does not yield an :data:`~token.ENCODING` token." msgstr "" #: ../../library/tokenize.rst:80 msgid "" -"All constants from the :mod:`token` module are also exported " -"from :mod:`tokenize`." +"All constants from the :mod:`token` module are also exported from :mod:`!" +"tokenize`." msgstr "" #: ../../library/tokenize.rst:83 @@ -187,14 +187,14 @@ msgstr "" #: ../../library/tokenize.rst:125 msgid "" -"Use :func:`.open` to open Python source files: it " -"uses :func:`detect_encoding` to detect the file encoding." +"Use :func:`.open` to open Python source files: it uses :func:" +"`detect_encoding` to detect the file encoding." msgstr "" #: ../../library/tokenize.rst:131 msgid "" -"Open a file in read only mode using the encoding detected " -"by :func:`detect_encoding`." +"Open a file in read only mode using the encoding detected by :func:" +"`detect_encoding`." msgstr "" #: ../../library/tokenize.rst:138 @@ -231,7 +231,7 @@ msgstr "命令列用法" #: ../../library/tokenize.rst:157 msgid "" -"The :mod:`tokenize` module can be executed as a script from the command " +"The :mod:`!tokenize` module can be executed as a script from the command " "line. It is as simple as:" msgstr "" diff --git a/library/trace.po b/library/trace.po index 22e399f3d2..b095b2ad4d 100644 --- a/library/trace.po +++ b/library/trace.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2025-05-28 14:00+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,8 +28,9 @@ msgid "**Source code:** :source:`Lib/trace.py`" msgstr "**原始碼:**\\ :source:`Lib/trace.py`" #: ../../library/trace.rst:11 +#, fuzzy msgid "" -"The :mod:`trace` module allows you to trace program execution, generate " +"The :mod:`!trace` module allows you to trace program execution, generate " "annotated statement coverage listings, print caller/callee relationships and " "list functions executed during a program run. It can be used in another " "program or from the command line." @@ -53,8 +54,9 @@ msgid "Command-Line Usage" msgstr "命令列用法" #: ../../library/trace.rst:27 +#, fuzzy msgid "" -"The :mod:`trace` module can be invoked from the command line. It can be as " +"The :mod:`!trace` module can be invoked from the command line. It can be as " "simple as ::" msgstr ":mod:`trace` 模組可從命令列執行,用法可以非常簡單,如:::" @@ -88,9 +90,10 @@ msgid "Main options" msgstr "主要選項" #: ../../library/trace.rst:51 +#, fuzzy msgid "" -"At least one of the following options must be specified when invoking :mod:" -"`trace`. The :option:`--listfuncs <-l>` option is mutually exclusive with " +"At least one of the following options must be specified when invoking :mod:`!" +"trace`. The :option:`--listfuncs <-l>` option is mutually exclusive with " "the :option:`--trace <-t>` and :option:`--count <-c>` options. When :option:" "`--listfuncs <-l>` is provided, neither :option:`--count <-c>` nor :option:" "`--trace <-t>` are accepted, and vice versa." diff --git a/library/tracemalloc.po b/library/tracemalloc.po index b3d552c51e..22ac0ef47a 100644 --- a/library/tracemalloc.po +++ b/library/tracemalloc.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-01 22:24+0800\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -514,7 +514,7 @@ msgstr "另請參閱 :func:`stop`。" #: ../../library/tracemalloc.rst:309 msgid "" "Get the traceback where the Python object *obj* was allocated. Return a :" -"class:`Traceback` instance, or ``None`` if the :mod:`tracemalloc` module is " +"class:`Traceback` instance, or ``None`` if the :mod:`!tracemalloc` module is " "not tracing memory allocations or did not trace the allocation of the object." msgstr "" @@ -528,7 +528,7 @@ msgstr "" #: ../../library/tracemalloc.rst:321 msgid "" -"The :mod:`tracemalloc` module must be tracing memory allocations to get the " +"The :mod:`!tracemalloc` module must be tracing memory allocations to get the " "limit, otherwise an exception is raised." msgstr "" @@ -538,21 +538,22 @@ msgstr "" #: ../../library/tracemalloc.rst:329 msgid "" -"Get the current size and peak size of memory blocks traced by the :mod:" -"`tracemalloc` module as a tuple: ``(current: int, peak: int)``." +"Get the current size and peak size of memory blocks traced by the :mod:`!" +"tracemalloc` module as a tuple: ``(current: int, peak: int)``." msgstr "" #: ../../library/tracemalloc.rst:335 msgid "" -"Set the peak size of memory blocks traced by the :mod:`tracemalloc` module " +"Set the peak size of memory blocks traced by the :mod:`!tracemalloc` module " "to the current size." msgstr "" #: ../../library/tracemalloc.rst:338 +#, fuzzy msgid "" -"Do nothing if the :mod:`tracemalloc` module is not tracing memory " +"Do nothing if the :mod:`!tracemalloc` module is not tracing memory " "allocations." -msgstr "" +msgstr ":mod:`!tracemalloc` --- 追蹤記憶體配置" #: ../../library/tracemalloc.rst:341 msgid "" @@ -568,13 +569,13 @@ msgstr "另請參閱 :func:`get_traced_memory`。" #: ../../library/tracemalloc.rst:353 msgid "" -"Get the memory usage in bytes of the :mod:`tracemalloc` module used to store " -"traces of memory blocks. Return an :class:`int`." +"Get the memory usage in bytes of the :mod:`!tracemalloc` module used to " +"store traces of memory blocks. Return an :class:`int`." msgstr "" #: ../../library/tracemalloc.rst:360 msgid "" -"``True`` if the :mod:`tracemalloc` module is tracing Python memory " +"``True`` if the :mod:`!tracemalloc` module is tracing Python memory " "allocations, ``False`` otherwise." msgstr "" @@ -605,9 +606,9 @@ msgstr "" #: ../../library/tracemalloc.rst:380 msgid "" -"Storing more frames increases the memory and CPU overhead of the :mod:" -"`tracemalloc` module. Use the :func:`get_tracemalloc_memory` function to " -"measure how much memory is used by the :mod:`tracemalloc` module." +"Storing more frames increases the memory and CPU overhead of the :mod:`!" +"tracemalloc` module. Use the :func:`get_tracemalloc_memory` function to " +"measure how much memory is used by the :mod:`!tracemalloc` module." msgstr "" #: ../../library/tracemalloc.rst:384 @@ -650,8 +651,8 @@ msgstr "" #: ../../library/tracemalloc.rst:410 msgid "" -"The snapshot does not include memory blocks allocated before the :mod:" -"`tracemalloc` module started to trace memory allocations." +"The snapshot does not include memory blocks allocated before the :mod:`!" +"tracemalloc` module started to trace memory allocations." msgstr "" #: ../../library/tracemalloc.rst:413 @@ -662,7 +663,7 @@ msgstr "" #: ../../library/tracemalloc.rst:416 msgid "" -"The :mod:`tracemalloc` module must be tracing memory allocations to take a " +"The :mod:`!tracemalloc` module must be tracing memory allocations to take a " "snapshot, see the :func:`start` function." msgstr "" @@ -720,8 +721,8 @@ msgstr "" #: ../../library/tracemalloc.rst:459 msgid "" -"``Filter(False, tracemalloc.__file__)`` excludes traces of the :mod:" -"`tracemalloc` module" +"``Filter(False, tracemalloc.__file__)`` excludes traces of the :mod:`!" +"tracemalloc` module" msgstr "" #: ../../library/tracemalloc.rst:461 diff --git a/library/tty.po b/library/tty.po index 3b6313452a..6fc4580c3e 100644 --- a/library/tty.po +++ b/library/tty.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 00:13+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2025-06-28 20:38+0800\n" "Last-Translator: Weilin Du\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,8 +29,9 @@ msgid "**Source code:** :source:`Lib/tty.py`" msgstr "**原始碼:**\\ :source:`Lib/tty.py`" #: ../../library/tty.rst:15 +#, fuzzy msgid "" -"The :mod:`tty` module defines functions for putting the tty into cbreak and " +"The :mod:`!tty` module defines functions for putting the tty into cbreak and " "raw modes." msgstr ":mod:`tty` 模組定義了將 tty 放入 cbreak 和 raw 模式的函式。" @@ -44,7 +45,8 @@ msgid "" msgstr "因為它需要 :mod:`termios` 模組,所以只能在 Unix 上執行。" #: ../../library/tty.rst:22 -msgid "The :mod:`tty` module defines the following functions:" +#, fuzzy +msgid "The :mod:`!tty` module defines the following functions:" msgstr ":mod:`tty` 模組定義了以下函式:" #: ../../library/tty.rst:27 diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 441f5062a8..4c8f8f1e56 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-12 00:14+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2024-02-19 21:27+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,8 +27,9 @@ msgid "**Source code:** :source:`Lib/unittest/mock.py`" msgstr "**原始碼:**\\ :source:`Lib/unittest/mock.py`" #: ../../library/unittest.mock.rst:16 +#, fuzzy msgid "" -":mod:`unittest.mock` is a library for testing in Python. It allows you to " +":mod:`!unittest.mock` is a library for testing in Python. It allows you to " "replace parts of your system under test with mock objects and make " "assertions about how they have been used." msgstr "" @@ -36,8 +37,9 @@ msgstr "" "mock 物件在測試中替換部分系統,並判定它們是如何被使用的。" #: ../../library/unittest.mock.rst:20 +#, fuzzy msgid "" -":mod:`unittest.mock` provides a core :class:`Mock` class removing the need " +":mod:`!unittest.mock` provides a core :class:`Mock` class removing the need " "to create a host of stubs throughout your test suite. After performing an " "action, you can make assertions about which methods / attributes were used " "and arguments they were called with. You can also specify return values and " @@ -71,8 +73,9 @@ msgstr "" "replay(重播)」 模式。" #: ../../library/unittest.mock.rst:36 +#, fuzzy msgid "" -"There is a backport of :mod:`unittest.mock` for earlier versions of Python, " +"There is a backport of :mod:`!unittest.mock` for earlier versions of Python, " "available as :pypi:`mock` on PyPI." msgstr "" "對於早期版本的 Python,有一個 backport(向後移植的)\\ :mod:`unittest.mock` " @@ -803,8 +806,8 @@ msgid "" "unpacked as tuples to get at the individual arguments. See :ref:`calls as " "tuples `." msgstr "" -":attr:`mock_calls` 的成員都是 :data:`call` 物件。這些物件可以拆包為元組,以" -"取得各個引數。參見 :ref:`calls as tuples `。" +":attr:`mock_calls` 的成員都是 :data:`call` 物件。這些物件可以拆包為元組,以取" +"得各個引數。參見 :ref:`calls as tuples `。" #: ../../library/unittest.mock.rst:749 msgid "" @@ -3518,8 +3521,8 @@ msgid "" "__enter__` and :meth:`~object.__exit__` called)." msgstr "" "問題是,即使你 mock 了對 :func:`open` 的呼叫,它也是作為情境管理器使用的\\ *" -"回傳物件*\\ (且其 :meth:`~object.__enter__` 和 :meth:`~object.__exit__` 已" -"被呼叫)。" +"回傳物件*\\ (且其 :meth:`~object.__enter__` 和 :meth:`~object.__exit__` 已被" +"呼叫)。" #: ../../library/unittest.mock.rst:2584 msgid "" @@ -3634,8 +3637,9 @@ msgstr "" "果你不測試你的單元是如何「連接在一起」的,那麼測試還是有機會發現很多錯誤。" #: ../../library/unittest.mock.rst:2641 +#, fuzzy msgid "" -":mod:`unittest.mock` already provides a feature to help with this, called " +":mod:`!unittest.mock` already provides a feature to help with this, called " "speccing. If you use a class or instance as the :attr:`!spec` for a mock " "then you can only access attributes on the mock that exist on the real class:" msgstr "" diff --git a/library/unittest.po b/library/unittest.po index a001785610..96d5d156bc 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-23 00:16+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2022-10-16 06:03+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -38,8 +38,9 @@ msgstr "" "`assert 方法清單 `。)" #: ../../library/unittest.rst:19 +#, fuzzy msgid "" -"The :mod:`unittest` unit testing framework was originally inspired by JUnit " +"The :mod:`!unittest` unit testing framework was originally inspired by JUnit " "and has a similar flavor as major unit testing frameworks in other " "languages. It supports test automation, sharing of setup and shutdown code " "for tests, aggregation of tests into collections, and independence of the " @@ -50,8 +51,9 @@ msgstr "" "試,並且獨立各個測試報告框架。" #: ../../library/unittest.rst:25 +#, fuzzy msgid "" -"To achieve this, :mod:`unittest` supports some important concepts in an " +"To achieve this, :mod:`!unittest` supports some important concepts in an " "object-oriented way:" msgstr ":mod:`unittest` 用來作為實現支援一些重要的物件導向方法的概念:" @@ -75,10 +77,11 @@ msgid "test case" msgstr "test case(測試用例)" #: ../../library/unittest.rst:35 +#, fuzzy msgid "" "A :dfn:`test case` is the individual unit of testing. It checks for a " -"specific response to a particular set of inputs. :mod:`unittest` provides a " -"base class, :class:`TestCase`, which may be used to create new test cases." +"specific response to a particular set of inputs. :mod:`!unittest` provides " +"a base class, :class:`TestCase`, which may be used to create new test cases." msgstr "" "一個 :dfn:`test case` 是一個獨立的單元測試。這是用來確認一個特定設定的輸入的" "特殊回饋。 :mod:`unittest` 提供一個基礎類別,類別 :class:`TestCase`,可以用來" @@ -127,9 +130,10 @@ msgstr "" "web/20150315073817/http://www.xprogramming.com/testfram.htm>`_" #: ../../library/unittest.rst:55 +#, fuzzy msgid "" "Kent Beck's original paper on testing frameworks using the pattern shared " -"by :mod:`unittest`." +"by :mod:`!unittest`." msgstr "Kent Beck 的原始論文討論使用 :mod:`unittest` 這樣模式的測試框架。" #: ../../library/unittest.rst:58 @@ -190,10 +194,11 @@ msgid "Basic example" msgstr "簡單範例" #: ../../library/unittest.rst:84 +#, fuzzy msgid "" -"The :mod:`unittest` module provides a rich set of tools for constructing and " -"running tests. This section demonstrates that a small subset of the tools " -"suffice to meet the needs of most users." +"The :mod:`!unittest` module provides a rich set of tools for constructing " +"and running tests. This section demonstrates that a small subset of the " +"tools suffice to meet the needs of most users." msgstr "" ":mod:`unittest` 模組提供一系列豐富的工具用來建構與執行測試。本節將展示這一系" "列工具中一部份,它們已能滿足大部份使用者需求。" @@ -313,8 +318,9 @@ msgstr "" "OK" #: ../../library/unittest.rst:150 +#, fuzzy msgid "" -"The above examples show the most commonly used :mod:`unittest` features " +"The above examples show the most commonly used :mod:`!unittest` features " "which are sufficient to meet many everyday testing needs. The remainder of " "the documentation explores the full feature set from first principles." msgstr "" @@ -656,8 +662,8 @@ msgstr "" #: ../../library/unittest.rst:367 msgid "" "The basic building blocks of unit testing are :dfn:`test cases` --- single " -"scenarios that must be set up and checked for correctness. In :mod:" -"`unittest`, test cases are represented by :class:`unittest.TestCase` " +"scenarios that must be set up and checked for correctness. In :mod:`!" +"unittest`, test cases are represented by :class:`unittest.TestCase` " "instances. To make your own test cases you must write subclasses of :class:" "`TestCase` or use :class:`FunctionTestCase`." msgstr "" @@ -697,7 +703,7 @@ msgid "" "Note that in order to test something, we use one of the :ref:`assert\\* " "methods ` provided by the :class:`TestCase` base class. If " "the test fails, an exception will be raised with an explanatory message, " -"and :mod:`unittest` will identify the test case as a :dfn:`failure`. Any " +"and :mod:`!unittest` will identify the test case as a :dfn:`failure`. Any " "other exceptions will be treated as :dfn:`errors`." msgstr "" @@ -798,11 +804,11 @@ msgstr "" #: ../../library/unittest.rst:444 msgid "" "It is recommended that you use TestCase implementations to group tests " -"together according to the features they test. :mod:`unittest` provides a " -"mechanism for this: the :dfn:`test suite`, represented by :mod:`unittest`'s :" -"class:`TestSuite` class. In most cases, calling :func:`unittest.main` will " -"do the right thing and collect all the module's test cases for you and " -"execute them." +"together according to the features they test. :mod:`!unittest` provides a " +"mechanism for this: the :dfn:`test suite`, represented by :mod:`!" +"unittest`'s :class:`TestSuite` class. In most cases, calling :func:" +"`unittest.main` will do the right thing and collect all the module's test " +"cases for you and execute them." msgstr "" #: ../../library/unittest.rst:451 @@ -882,15 +888,15 @@ msgstr "" #: ../../library/unittest.rst:491 msgid "" "Some users will find that they have existing test code that they would like " -"to run from :mod:`unittest`, without converting every old test function to " +"to run from :mod:`!unittest`, without converting every old test function to " "a :class:`TestCase` subclass." msgstr "" #: ../../library/unittest.rst:495 msgid "" -"For this reason, :mod:`unittest` provides a :class:`FunctionTestCase` class. " -"This subclass of :class:`TestCase` can be used to wrap an existing test " -"function. Set-up and tear-down functions can also be provided." +"For this reason, :mod:`!unittest` provides a :class:`FunctionTestCase` " +"class. This subclass of :class:`TestCase` can be used to wrap an existing " +"test function. Set-up and tear-down functions can also be provided." msgstr "" #: ../../library/unittest.rst:499 @@ -928,7 +934,7 @@ msgstr "" #: ../../library/unittest.rst:515 msgid "" "Even though :class:`FunctionTestCase` can be used to quickly convert an " -"existing test base over to a :mod:`unittest`\\ -based system, this approach " +"existing test base over to a :mod:`!unittest`\\ -based system, this approach " "is not recommended. Taking the time to set up proper :class:`TestCase` " "subclasses will make future test refactorings infinitely easier." msgstr "" @@ -1236,7 +1242,7 @@ msgid "Classes and functions" msgstr "類別與函式" #: ../../library/unittest.rst:712 -msgid "This section describes in depth the API of :mod:`unittest`." +msgid "This section describes in depth the API of :mod:`!unittest`." msgstr "" #: ../../library/unittest.rst:718 @@ -1246,7 +1252,7 @@ msgstr "" #: ../../library/unittest.rst:722 msgid "" "Instances of the :class:`TestCase` class represent the logical test units in " -"the :mod:`unittest` universe. This class is intended to be used as a base " +"the :mod:`!unittest` universe. This class is intended to be used as a base " "class, with specific tests being implemented by concrete subclasses. This " "class implements the interface needed by the test runner to allow it to " "drive the tests, and methods that the test code can use to check for and " @@ -2642,7 +2648,7 @@ msgid "" "allows the test runner to drive the test, but does not provide the methods " "which test code can use to check and report errors. This is used to create " "test cases using legacy test code, allowing it to be integrated into a :mod:" -"`unittest`-based test framework." +"`!unittest`-based test framework." msgstr "" #: ../../library/unittest.rst:1736 @@ -2754,7 +2760,7 @@ msgstr "" msgid "" "The :class:`TestLoader` class is used to create test suites from classes and " "modules. Normally, there is no need to create an instance of this class; " -"the :mod:`unittest` module provides an instance that can be shared as :data:" +"the :mod:`!unittest` module provides an instance that can be shared as :data:" "`unittest.defaultTestLoader`. Using a subclass or instance, however, allows " "customization of some configurable properties." msgstr "" @@ -3038,7 +3044,7 @@ msgstr "" #: ../../library/unittest.rst:2051 msgid "" -"Testing frameworks built on top of :mod:`unittest` may want access to the :" +"Testing frameworks built on top of :mod:`!unittest` may want access to the :" "class:`TestResult` object generated by running a set of tests for reporting " "purposes; a :class:`TestResult` instance is returned by the :meth:`!" "TestRunner.run` method for this purpose." diff --git a/library/urllib.error.po b/library/urllib.error.po index eb4bc5a932..c5fce38206 100644 --- a/library/urllib.error.po +++ b/library/urllib.error.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-09 00:03+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2022-06-11 15:34+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,8 +30,9 @@ msgid "**Source code:** :source:`Lib/urllib/error.py`" msgstr "**原始碼:**\\ :source:`Lib/urllib/error.py`" #: ../../library/urllib.error.rst:14 +#, fuzzy msgid "" -"The :mod:`urllib.error` module defines the exception classes for exceptions " +"The :mod:`!urllib.error` module defines the exception classes for exceptions " "raised by :mod:`urllib.request`. The base exception class is :exc:" "`URLError`." msgstr "" @@ -39,8 +40,9 @@ msgstr "" "例外 (exception) 類別。基礎例外類別是 :exc:`URLError`。" #: ../../library/urllib.error.rst:17 +#, fuzzy msgid "" -"The following exceptions are raised by :mod:`urllib.error` as appropriate:" +"The following exceptions are raised by :mod:`!urllib.error` as appropriate:" msgstr "下列例外會被 :mod:`urllib.error` 適時引發:" #: ../../library/urllib.error.rst:21 diff --git a/library/urllib.parse.po b/library/urllib.parse.po index 0cab1b4fdc..4ce1b4c02e 100644 --- a/library/urllib.parse.po +++ b/library/urllib.parse.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-06 00:18+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -54,7 +54,7 @@ msgstr "" #: ../../library/urllib.parse.rst:38 msgid "" -"The :mod:`urllib.parse` module defines functions that fall into two broad " +"The :mod:`!urllib.parse` module defines functions that fall into two broad " "categories: URL parsing and URL quoting. These are covered in detail in the " "following sections." msgstr "" diff --git a/library/urllib.request.po b/library/urllib.request.po index c33e8dffe6..6e56707b57 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.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-02-07 00:19+0000\n" "PO-Revision-Date: 2022-04-21 17:59+0800\n" "Last-Translator: Jordan Su \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,9 +28,10 @@ msgid "**Source code:** :source:`Lib/urllib/request.py`" msgstr "**原始碼:**\\ :source:`Lib/urllib/request.py`" #: ../../library/urllib.request.rst:15 +#, fuzzy msgid "" -"The :mod:`urllib.request` module defines functions and classes which help in " -"opening URLs (mostly HTTP) in a complex world --- basic and digest " +"The :mod:`!urllib.request` module defines functions and classes which help " +"in opening URLs (mostly HTTP) in a complex world --- basic and digest " "authentication, redirections, cookies and more." msgstr "" ":mod:`urllib.request` module(模組)定義了一些函式與 class(類別)用以開啟 " @@ -42,8 +43,8 @@ msgid "" "The `Requests package `_ is " "recommended for a higher-level HTTP client interface." msgstr "" -"有關於更高階的 HTTP 用戶端介面,推薦使用 `Requests 套件 `_。" +"有關於更高階的 HTTP 用戶端介面,推薦使用 `Requests 套件 `_。" #: ../../library/urllib.request.rst:26 msgid "" @@ -66,7 +67,8 @@ msgstr "" "availability`。" #: ../../library/urllib.request.rst:34 -msgid "The :mod:`urllib.request` module defines the following functions:" +#, fuzzy +msgid "The :mod:`!urllib.request` module defines the following functions:" msgstr ":mod:`urllib.request` module 定義下列函式:" #: ../../library/urllib.request.rst:39 @@ -74,8 +76,8 @@ msgid "" "Open *url*, which can be either a string containing a valid, properly " "encoded URL, or a :class:`Request` object." msgstr "" -"打開 *url*,其值可以是一個包含有效且適當編碼 URL 的字串或是一" -"個 :class:`Request` 物件。" +"打開 *url*,其值可以是一個包含有效且適當編碼 URL 的字串或是一個 :class:" +"`Request` 物件。" #: ../../library/urllib.request.rst:42 msgid "" @@ -108,8 +110,8 @@ msgstr "" #: ../../library/urllib.request.rst:54 msgid "" "If *context* is specified, it must be a :class:`ssl.SSLContext` instance " -"describing the various SSL options. " -"See :class:`~http.client.HTTPSConnection` for more details." +"describing the various SSL options. See :class:`~http.client." +"HTTPSConnection` for more details." msgstr "" "若 *context* 有被指定時,它必須是一個 :class:`ssl.SSLContext` 的實例並描述著" "各種 SSL 選項。更多細節請見 :class:`~http.client.HTTPSConnection`。" @@ -117,35 +119,35 @@ msgstr "" #: ../../library/urllib.request.rst:58 msgid "" "This function always returns an object which can work as a :term:`context " -"manager` and has the properties *url*, *headers*, and *status*. " -"See :class:`urllib.response.addinfourl` for more detail on these properties." +"manager` and has the properties *url*, *headers*, and *status*. See :class:" +"`urllib.response.addinfourl` for more detail on these properties." msgstr "" "這個函式總是回傳一個可作為 :term:`context manager` 使用的物件,並有著特性 " -"(property) *url*、*headers* 與 *status*。欲知更多這些特性細節請參" -"見 :class:`urllib.response.addinfourl`。" +"(property) *url*、*headers* 與 *status*。欲知更多這些特性細節請參見 :class:" +"`urllib.response.addinfourl`。" #: ../../library/urllib.request.rst:62 msgid "" -"For HTTP and HTTPS URLs, this function returns " -"a :class:`http.client.HTTPResponse` object slightly modified. In addition to " -"the three new methods above, the msg attribute contains the same information " -"as the :attr:`~http.client.HTTPResponse.reason` attribute --- the reason " -"phrase returned by server --- instead of the response headers as it is " -"specified in the documentation for :class:`~http.client.HTTPResponse`." +"For HTTP and HTTPS URLs, this function returns a :class:`http.client." +"HTTPResponse` object slightly modified. In addition to the three new methods " +"above, the msg attribute contains the same information as the :attr:`~http." +"client.HTTPResponse.reason` attribute --- the reason phrase returned by " +"server --- instead of the response headers as it is specified in the " +"documentation for :class:`~http.client.HTTPResponse`." msgstr "" -"對於 HTTP 與 HTTPS 的 URLs,這個函式回傳一個稍有不同" -"的 :class:`http.client.HTTPResponse` 物件。除了上述提到的三個方法外,另有 " -"msg 屬性並有著與 :attr:`~http.client.HTTPResponse.reason` 相同的資訊 --- 由伺" -"服器回傳的原因敘述 (reason phrase),而不是" -"在 :class:`~http.client.HTTPResponse` 文件中提到的回應 headers。" +"對於 HTTP 與 HTTPS 的 URLs,這個函式回傳一個稍有不同的 :class:`http.client." +"HTTPResponse` 物件。除了上述提到的三個方法外,另有 msg 屬性並有著與 :attr:" +"`~http.client.HTTPResponse.reason` 相同的資訊 --- 由伺服器回傳的原因敘述 " +"(reason phrase),而不是在 :class:`~http.client.HTTPResponse` 文件中提到的回" +"應 headers。" #: ../../library/urllib.request.rst:70 msgid "" -"For FTP, file, and data URLs, this function returns " -"a :class:`urllib.response.addinfourl` object." +"For FTP, file, and data URLs, this function returns a :class:`urllib." +"response.addinfourl` object." msgstr "" -"對於 FTP、檔案及資料的 URLs,這個函式會回傳一" -"個 :class:`urllib.response.addinfourl` 物件。" +"對於 FTP、檔案及資料的 URLs,這個函式會回傳一個 :class:`urllib.response." +"addinfourl` 物件。" #: ../../library/urllib.request.rst:73 msgid "Raises :exc:`~urllib.error.URLError` on protocol errors." @@ -154,8 +156,8 @@ msgstr "當遇到協定上的錯誤時會引發 :exc:`~urllib.error.URLError`。 #: ../../library/urllib.request.rst:75 msgid "" "Note that ``None`` may be returned if no handler handles the request (though " -"the default installed global :class:`OpenerDirector` " -"uses :class:`UnknownHandler` to ensure this never happens)." +"the default installed global :class:`OpenerDirector` uses :class:" +"`UnknownHandler` to ensure this never happens)." msgstr "" "請注意若沒有 handler 處理請求時,``None`` 值將會被回傳。(即使有預設的全域類" "別 :class:`OpenerDirector` 使用 :class:`UnknownHandler` 來確保這種情況不會發" @@ -164,9 +166,9 @@ msgstr "" #: ../../library/urllib.request.rst:79 msgid "" "In addition, if proxy settings are detected (for example, when a ``*_proxy`` " -"environment variable like :envvar:`!http_proxy` is " -"set), :class:`ProxyHandler` is default installed and makes sure the requests " -"are handled through the proxy." +"environment variable like :envvar:`!http_proxy` is set), :class:" +"`ProxyHandler` is default installed and makes sure the requests are handled " +"through the proxy." msgstr "" "另外,若有偵測到代理服務的設定(例如當 ``*_proxy`` 環境變數像是::envvar:!" "http_proxy` 有被設置時),:class:`ProxyHandler` 會被預設使用以確保請求有透過" @@ -177,19 +179,19 @@ msgid "" "The legacy ``urllib.urlopen`` function from Python 2.6 and earlier has been " "discontinued; :func:`urllib.request.urlopen` corresponds to the old " "``urllib2.urlopen``. Proxy handling, which was done by passing a dictionary " -"parameter to ``urllib.urlopen``, can be obtained by " -"using :class:`ProxyHandler` objects." +"parameter to ``urllib.urlopen``, can be obtained by using :class:" +"`ProxyHandler` objects." msgstr "" -"Python 2.6 或更早版本的遺留函式 ``urllib.urlopen`` 已經不再被維護;新函" -"式 :func:`urllib.request.urlopen` 對應到舊函式 ``urllib2.urlopen``。有關代理" -"服務的處理,以往是透過傳遞 dictionary(字典)參數給 ``urllib.urlopen`` 來取得" -"的,現在則可以透過 :class:`ProxyHandler` 物件來取得。" +"Python 2.6 或更早版本的遺留函式 ``urllib.urlopen`` 已經不再被維護;新函式 :" +"func:`urllib.request.urlopen` 對應到舊函式 ``urllib2.urlopen``。有關代理服務" +"的處理,以往是透過傳遞 dictionary(字典)參數給 ``urllib.urlopen`` 來取得的," +"現在則可以透過 :class:`ProxyHandler` 物件來取得。" #: ../../library/urllib.request.rst:90 ../../library/urllib.request.rst:92 msgid "" -"The default opener raises an :ref:`auditing event ` " -"``urllib.Request`` with arguments ``fullurl``, ``data``, ``headers``, " -"``method`` taken from the request object." +"The default opener raises an :ref:`auditing event ` ``urllib." +"Request`` with arguments ``fullurl``, ``data``, ``headers``, ``method`` " +"taken from the request object." msgstr "" "預設的 opener 會觸發一個 :ref:`auditing event ` ``urllib.Request`` " "與其從請求物件中所獲得的引數 ``fullurl``、``data``、``headers``、``method``。" @@ -200,8 +202,8 @@ msgstr "新增 *cafile* 與 *capath*。" #: ../../library/urllib.request.rst:99 msgid "" -"HTTPS virtual hosts are now supported if possible (that is, " -"if :const:`ssl.HAS_SNI` is true)." +"HTTPS virtual hosts are now supported if possible (that is, if :const:`ssl." +"HAS_SNI` is true)." msgstr "" "HTTPS 虛擬主機 (virtual hosts) 現已支援,只要 :const:`ssl.HAS_SNI` 的值為 " "true。" @@ -220,13 +222,13 @@ msgstr "*context* 被新增。" #: ../../library/urllib.request.rst:110 msgid "" -"HTTPS connection now send an ALPN extension with protocol indicator ``http/" -"1.1`` when no *context* is given. Custom *context* should set ALPN protocols " -"with :meth:`~ssl.SSLContext.set_alpn_protocols`." +"HTTPS connection now send an ALPN extension with protocol indicator " +"``http/1.1`` when no *context* is given. Custom *context* should set ALPN " +"protocols with :meth:`~ssl.SSLContext.set_alpn_protocols`." msgstr "" -"當 *context* 沒有被指定時,HTTPS 連線現在會傳送一個帶有協定指示器 ``http/" -"1.1`` 的 ALPN 擴充 (extension)。自訂的 *context* 應該利" -"用 :meth:`~ssl.SSLContext.set_alpn_protocols` 來自行設定 ALPN 協定。" +"當 *context* 沒有被指定時,HTTPS 連線現在會傳送一個帶有協定指示器 " +"``http/1.1`` 的 ALPN 擴充 (extension)。自訂的 *context* 應該利用 :meth:`~ssl." +"SSLContext.set_alpn_protocols` 來自行設定 ALPN 協定。" #: ../../library/urllib.request.rst:115 msgid "" @@ -238,16 +240,15 @@ msgstr "" msgid "" "Install an :class:`OpenerDirector` instance as the default global opener. " "Installing an opener is only necessary if you want urlopen to use that " -"opener; otherwise, simply call :meth:`OpenerDirector.open` instead " -"of :func:`~urllib.request.urlopen`. The code does not check for a " -"real :class:`OpenerDirector`, and any class with the appropriate interface " -"will work." +"opener; otherwise, simply call :meth:`OpenerDirector.open` instead of :func:" +"`~urllib.request.urlopen`. The code does not check for a real :class:" +"`OpenerDirector`, and any class with the appropriate interface will work." msgstr "" "安裝一個 :class:`OpenerDirector` 實例作為預設的全域 opener。僅在當你想要讓 " -"urlopen 使用該 opener 時安裝一個 opener,否則的話應直接呼" -"叫 :meth:`OpenerDirector.open` 而非 :func:`~urllib.request.urlopen`。程式碼不" -"會檢查 class 是否真的為 :class:`OpenerDirector`,而是任何具有正確介面的 " -"class 都能適用。" +"urlopen 使用該 opener 時安裝一個 opener,否則的話應直接呼叫 :meth:" +"`OpenerDirector.open` 而非 :func:`~urllib.request.urlopen`。程式碼不會檢查 " +"class 是否真的為 :class:`OpenerDirector`,而是任何具有正確介面的 class 都能適" +"用。" #: ../../library/urllib.request.rst:132 msgid "" @@ -257,15 +258,19 @@ msgid "" "call the constructor without any parameters). Instances of the following " "classes will be in front of the *handler*\\s, unless the *handler*\\s " "contain them, instances of them or subclasses of them: :class:`ProxyHandler` " -"(if proxy settings are " -"detected), :class:`UnknownHandler`, :class:`HTTPHandler`, :class:`HTTPDefaultErrorHandler`, :class:`HTTPRedirectHandler`, :class:`FTPHandler`, :class:`FileHandler`, :class:`HTTPErrorProcessor`." +"(if proxy settings are detected), :class:`UnknownHandler`, :class:" +"`HTTPHandler`, :class:`HTTPDefaultErrorHandler`, :class:" +"`HTTPRedirectHandler`, :class:`FTPHandler`, :class:`FileHandler`, :class:" +"`HTTPErrorProcessor`." msgstr "" "回傳一個 :class:`OpenerDirector` 實例,以給定的順序把 handlers 串接起來。" "*handler*\\s 可以是 :class:`BaseHandler` 的實例,亦或是 :class:`BaseHandler` " "的 subclasses(這個情況下必須有不帶參數的建構函式能夠被呼叫)。以下 classes " "的實例順位會在 *handler*\\s 之前,除非 *handler*\\s 已經包含它們,是它們的實" "例,或是它們的 subclasses::class:`ProxyHandler`\\ (如果代理服務設定被偵測" -"到)、:class:`UnknownHandler`、:class:`HTTPHandler`、:class:`HTTPDefaultErrorHandler`、:class:`HTTPRedirectHandler`、:class:`FTPHandler`、:class:`FileHandler`、:class:`HTTPErrorProcessor`。" +"到)、:class:`UnknownHandler`、:class:`HTTPHandler`、:class:" +"`HTTPDefaultErrorHandler`、:class:`HTTPRedirectHandler`、:class:" +"`FTPHandler`、:class:`FileHandler`、:class:`HTTPErrorProcessor`。" #: ../../library/urllib.request.rst:142 msgid "" @@ -285,8 +290,8 @@ msgstr "" #: ../../library/urllib.request.rst:151 msgid "" -"Convert the given local path to a ``file:`` URL. This function " -"uses :func:`~urllib.parse.quote` function to encode the path." +"Convert the given local path to a ``file:`` URL. This function uses :func:" +"`~urllib.parse.quote` function to encode the path." msgstr "" #: ../../library/urllib.request.rst:154 @@ -331,8 +336,8 @@ msgstr "新增 *add_scheme* 參數。" #: ../../library/urllib.request.rst:180 msgid "" -"Convert the given ``file:`` URL to a local path. This function " -"uses :func:`~urllib.parse.unquote` to decode the URL." +"Convert the given ``file:`` URL to a local path. This function uses :func:" +"`~urllib.parse.unquote` to decode the URL." msgstr "" #: ../../library/urllib.request.rst:183 @@ -448,11 +453,11 @@ msgstr "" #: ../../library/urllib.request.rst:259 msgid "" -"For an HTTP POST request method, *data* should be a buffer in the " -"standard :mimetype:`application/x-www-form-urlencoded` format. " -"The :func:`urllib.parse.urlencode` function takes a mapping or sequence of 2-" -"tuples and returns an ASCII string in this format. It should be encoded to " -"bytes before being used as the *data* parameter." +"For an HTTP POST request method, *data* should be a buffer in the standard :" +"mimetype:`application/x-www-form-urlencoded` format. The :func:`urllib." +"parse.urlencode` function takes a mapping or sequence of 2-tuples and " +"returns an ASCII string in this format. It should be encoded to bytes before " +"being used as the *data* parameter." msgstr "" "對於一個 HTTP POST 請求方法,*data* 應為一個標準 :mimetype:`application/x-" "www-form-urlencoded` 格式的 buffer。:func:`urllib.parse.urlencode` 方法接受一" @@ -461,10 +466,10 @@ msgstr "" #: ../../library/urllib.request.rst:265 msgid "" -"*headers* should be a dictionary, and will be treated as " -"if :meth:`add_header` was called with each key and value as arguments. This " -"is often used to \"spoof\" the ``User-Agent`` header value, which is used by " -"a browser to identify itself -- some HTTP servers only allow requests coming " +"*headers* should be a dictionary, and will be treated as if :meth:" +"`add_header` was called with each key and value as arguments. This is often " +"used to \"spoof\" the ``User-Agent`` header value, which is used by a " +"browser to identify itself -- some HTTP servers only allow requests coming " "from common browsers as opposed to scripts. For example, Mozilla Firefox may " "identify itself as ``\"Mozilla/5.0 (X11; U; Linux i686) Gecko/20071127 " "Firefox/2.0.0.11\"``, while :mod:`urllib`'s default user agent string is " @@ -475,9 +480,10 @@ msgstr "" "叫 :meth:`add_header`。經常用於「偽裝」 ``User-Agent`` header 的值,這個 " "header 是用來讓一個瀏覽器向伺服器表明自己的身分 --- 有些 HTTP 伺服器僅允許來" "自普通瀏覽器的請求,而不接受來自程式腳本的請求。例如,Mozilla Firefox 會將 " -"header 的值設為 ``\"Mozilla/5.0 (X11; U; Linux i686) Gecko/20071127 Firefox/" -"2.0.0.11\"``,而 :mod:`urllib` 的值則是 ``\"Python-urllib/2.6\"``\\ (在 " -"Python 2.6 上)。所有 header 的鍵都會以 camel case(駝峰式大小寫)來傳送。" +"header 的值設為 ``\"Mozilla/5.0 (X11; U; Linux i686) Gecko/20071127 " +"Firefox/2.0.0.11\"``,而 :mod:`urllib` 的值則是 ``\"Python-urllib/2.6\"``\\ " +"(在 Python 2.6 上)。所有 header 的鍵都會以 camel case(駝峰式大小寫)來傳" +"送。" #: ../../library/urllib.request.rst:276 msgid "" @@ -500,16 +506,16 @@ msgstr "" #: ../../library/urllib.request.rst:284 msgid "" "*origin_req_host* should be the request-host of the origin transaction, as " -"defined by :rfc:`2965`. It defaults to " -"``http.cookiejar.request_host(self)``. This is the host name or IP address " -"of the original request that was initiated by the user. For example, if the " -"request is for an image in an HTML document, this should be the request-host " -"of the request for the page containing the image." +"defined by :rfc:`2965`. It defaults to ``http.cookiejar." +"request_host(self)``. This is the host name or IP address of the original " +"request that was initiated by the user. For example, if the request is for " +"an image in an HTML document, this should be the request-host of the request " +"for the page containing the image." msgstr "" -"*origin_req_host* 應為原始傳輸互動的請求主機 (request-host),如同" -"在 :rfc:`2965` 中的定義。預設值為 ``http.cookiejar.request_host(self)``。這是" -"使用者發起的原始請求的主機名稱或是 IP 位址。例如當請求是要求一個 HTML 文件中" -"的一個影像,則這個屬性應為請求包含影像頁面的請求主機。" +"*origin_req_host* 應為原始傳輸互動的請求主機 (request-host),如同在 :rfc:" +"`2965` 中的定義。預設值為 ``http.cookiejar.request_host(self)``。這是使用者發" +"起的原始請求的主機名稱或是 IP 位址。例如當請求是要求一個 HTML 文件中的一個影" +"像,則這個屬性應為請求包含影像頁面的請求主機。" #: ../../library/urllib.request.rst:292 msgid "" @@ -527,11 +533,11 @@ msgstr "" #: ../../library/urllib.request.rst:299 msgid "" "*method* should be a string that indicates the HTTP request method that will " -"be used (e.g. ``'HEAD'``). If provided, its value is stored in " -"the :attr:`~Request.method` attribute and is used by :meth:`get_method`. The " -"default is ``'GET'`` if *data* is ``None`` or ``'POST'`` otherwise. " -"Subclasses may indicate a different default method by setting " -"the :attr:`~Request.method` attribute in the class itself." +"be used (e.g. ``'HEAD'``). If provided, its value is stored in the :attr:" +"`~Request.method` attribute and is used by :meth:`get_method`. The default " +"is ``'GET'`` if *data* is ``None`` or ``'POST'`` otherwise. Subclasses may " +"indicate a different default method by setting the :attr:`~Request.method` " +"attribute in the class itself." msgstr "" "*method* 應為一個標示 HTTP 請求方法的字串(例如:``'HEAD'``)。如果有提供值," "則會被存在 :attr:`~Request.method` 屬性中且被 :meth:`get_method` 所使用。當 " @@ -650,9 +656,9 @@ msgstr "" msgid "" "This is a mixin class that helps with HTTP authentication, both to the " "remote host and to a proxy. *password_mgr*, if given, should be something " -"that is compatible with :class:`HTTPPasswordMgr`; refer to " -"section :ref:`http-password-mgr` for information on the interface that must " -"be supported. If *passwd_mgr* also provides ``is_authenticated`` and " +"that is compatible with :class:`HTTPPasswordMgr`; refer to section :ref:" +"`http-password-mgr` for information on the interface that must be " +"supported. If *passwd_mgr* also provides ``is_authenticated`` and " "``update_authenticated`` methods (see :ref:`http-password-mgr-with-prior-" "auth`), then the handler will use the ``is_authenticated`` result for a " "given URI to determine whether or not to send authentication credentials " @@ -690,9 +696,8 @@ msgstr "" msgid "" "This is a mixin class that helps with HTTP authentication, both to the " "remote host and to a proxy. *password_mgr*, if given, should be something " -"that is compatible with :class:`HTTPPasswordMgr`; refer to " -"section :ref:`http-password-mgr` for information on the interface that must " -"be supported." +"that is compatible with :class:`HTTPPasswordMgr`; refer to section :ref:" +"`http-password-mgr` for information on the interface that must be supported." msgstr "" #: ../../library/urllib.request.rst:446 @@ -772,9 +777,9 @@ msgstr "" #: ../../library/urllib.request.rst:535 msgid "" -"Request.full_url is a property with setter, getter and a deleter. " -"Getting :attr:`~Request.full_url` returns the original request URL with the " -"fragment, if it was present." +"Request.full_url is a property with setter, getter and a deleter. Getting :" +"attr:`~Request.full_url` returns the original request URL with the fragment, " +"if it was present." msgstr "" #: ../../library/urllib.request.rst:541 @@ -809,8 +814,8 @@ msgstr "" #: ../../library/urllib.request.rst:567 msgid "" -"boolean, indicates whether the request is unverifiable as defined " -"by :rfc:`2965`." +"boolean, indicates whether the request is unverifiable as defined by :rfc:" +"`2965`." msgstr "" #: ../../library/urllib.request.rst:572 @@ -832,10 +837,10 @@ msgstr "" #: ../../library/urllib.request.rst:589 msgid "" -"Return a string indicating the HTTP request method. " -"If :attr:`Request.method` is not ``None``, return its value, otherwise " -"return ``'GET'`` if :attr:`Request.data` is ``None``, or ``'POST'`` if it's " -"not. This is only meaningful for HTTP requests." +"Return a string indicating the HTTP request method. If :attr:`Request." +"method` is not ``None``, return its value, otherwise return ``'GET'`` if :" +"attr:`Request.data` is ``None``, or ``'POST'`` if it's not. This is only " +"meaningful for HTTP requests." msgstr "" #: ../../library/urllib.request.rst:594 @@ -916,10 +921,10 @@ msgid "" "*handler* should be an instance of :class:`BaseHandler`. The following " "methods are searched, and added to the possible chains (note that HTTP " "errors are a special case). Note that, in the following, *protocol* should " -"be replaced with the actual protocol to handle, for " -"example :meth:`http_response` would be the HTTP protocol response handler. " -"Also *type* should be replaced with the actual HTTP code, for " -"example :meth:`http_error_404` would handle HTTP 404 errors." +"be replaced with the actual protocol to handle, for example :meth:" +"`http_response` would be the HTTP protocol response handler. Also *type* " +"should be replaced with the actual HTTP code, for example :meth:" +"`http_error_404` would handle HTTP 404 errors." msgstr "" #: ../../library/urllib.request.rst:679 @@ -1013,27 +1018,25 @@ msgstr "" #: ../../library/urllib.request.rst:737 msgid "" "Handlers with a method named like :meth:`!_open` are called to " -"handle the request. This stage ends when a handler either returns a non-" -"\\ :const:`None` value (ie. a response), or raises an exception " -"(usually :exc:`~urllib.error.URLError`). Exceptions are allowed to " -"propagate." +"handle the request. This stage ends when a handler either returns a non-\\ :" +"const:`None` value (ie. a response), or raises an exception (usually :exc:" +"`~urllib.error.URLError`). Exceptions are allowed to propagate." msgstr "" #: ../../library/urllib.request.rst:742 msgid "" -"In fact, the above algorithm is first tried for methods " -"named :meth:`~BaseHandler.default_open`. If all such methods " -"return :const:`None`, the algorithm is repeated for methods named " -"like :meth:`!_open`. If all such methods return :const:`None`, " -"the algorithm is repeated for methods " +"In fact, the above algorithm is first tried for methods named :meth:" +"`~BaseHandler.default_open`. If all such methods return :const:`None`, the " +"algorithm is repeated for methods named like :meth:`!_open`. If " +"all such methods return :const:`None`, the algorithm is repeated for methods " "named :meth:`~BaseHandler.unknown_open`." msgstr "" #: ../../library/urllib.request.rst:748 msgid "" "Note that the implementation of these methods may involve calls of the " -"parent :class:`OpenerDirector` instance's :meth:`~OpenerDirector.open` " -"and :meth:`~OpenerDirector.error` methods." +"parent :class:`OpenerDirector` instance's :meth:`~OpenerDirector.open` and :" +"meth:`~OpenerDirector.error` methods." msgstr "" #: ../../library/urllib.request.rst:752 @@ -1070,8 +1073,8 @@ msgstr "" #: ../../library/urllib.request.rst:780 msgid "" "The convention has been adopted that subclasses defining :meth:`!" -"_request` or :meth:`!_response` methods are " -"named :class:`!\\*Processor`; all others are named :class:`!\\*Handler`." +"_request` or :meth:`!_response` methods are named :class:" +"`!\\*Processor`; all others are named :class:`!\\*Handler`." msgstr "" #: ../../library/urllib.request.rst:787 @@ -1088,13 +1091,12 @@ msgstr "" #: ../../library/urllib.request.rst:796 msgid "" -"This method, if implemented, will be called by the " -"parent :class:`OpenerDirector`. It should return a file-like object as " -"described in the return value of the :meth:`~OpenerDirector.open` method " -"of :class:`OpenerDirector`, or ``None``. It should " -"raise :exc:`~urllib.error.URLError`, unless a truly exceptional thing " -"happens (for example, :exc:`MemoryError` should not be mapped " -"to :exc:`~urllib.error.URLError`)." +"This method, if implemented, will be called by the parent :class:" +"`OpenerDirector`. It should return a file-like object as described in the " +"return value of the :meth:`~OpenerDirector.open` method of :class:" +"`OpenerDirector`, or ``None``. It should raise :exc:`~urllib.error." +"URLError`, unless a truly exceptional thing happens (for example, :exc:" +"`MemoryError` should not be mapped to :exc:`~urllib.error.URLError`)." msgstr "" #: ../../library/urllib.request.rst:803 @@ -1109,9 +1111,9 @@ msgstr "" #: ../../library/urllib.request.rst:813 msgid "" -"This method, if defined, will be called by the " -"parent :class:`OpenerDirector`. Return values should be the same as " -"for :meth:`~BaseHandler.default_open`." +"This method, if defined, will be called by the parent :class:" +"`OpenerDirector`. Return values should be the same as for :meth:" +"`~BaseHandler.default_open`." msgstr "" #: ../../library/urllib.request.rst:819 @@ -1123,18 +1125,18 @@ msgstr "" #: ../../library/urllib.request.rst:823 msgid "" -"This method, if implemented, will be called by " -"the :attr:`parent` :class:`OpenerDirector`. Return values should be the " -"same as for :meth:`default_open`." +"This method, if implemented, will be called by the :attr:`parent` :class:" +"`OpenerDirector`. Return values should be the same as for :meth:" +"`default_open`." msgstr "" #: ../../library/urllib.request.rst:830 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "override it if they intend to provide a catch-all for otherwise unhandled " -"HTTP errors. It will be called automatically by " -"the :class:`OpenerDirector` getting the error, and should not normally be " -"called in other circumstances." +"HTTP errors. It will be called automatically by the :class:" +"`OpenerDirector` getting the error, and should not normally be called in " +"other circumstances." msgstr "" #: ../../library/urllib.request.rst:835 @@ -1164,8 +1166,8 @@ msgstr "HTTP 錯誤的標頭,為一個對映物件。" #: ../../library/urllib.request.rst:843 msgid "" -"Return values and exceptions raised should be the same as those " -"of :func:`urlopen`." +"Return values and exceptions raised should be the same as those of :func:" +"`urlopen`." msgstr "" #: ../../library/urllib.request.rst:850 @@ -1181,8 +1183,8 @@ msgstr "" #: ../../library/urllib.request.rst:856 msgid "" -"Arguments, return values and exceptions raised should be the same as " -"for :meth:`~BaseHandler.http_error_default`." +"Arguments, return values and exceptions raised should be the same as for :" +"meth:`~BaseHandler.http_error_default`." msgstr "" #: ../../library/urllib.request.rst:864 @@ -1193,9 +1195,9 @@ msgstr "" #: ../../library/urllib.request.rst:867 msgid "" -"This method, if defined, will be called by the " -"parent :class:`OpenerDirector`. *req* will be a :class:`Request` object. The " -"return value should be a :class:`Request` object." +"This method, if defined, will be called by the parent :class:" +"`OpenerDirector`. *req* will be a :class:`Request` object. The return value " +"should be a :class:`Request` object." msgstr "" #: ../../library/urllib.request.rst:876 @@ -1206,11 +1208,11 @@ msgstr "" #: ../../library/urllib.request.rst:879 msgid "" -"This method, if defined, will be called by the " -"parent :class:`OpenerDirector`. *req* will be a :class:`Request` object. " -"*response* will be an object implementing the same interface as the return " -"value of :func:`urlopen`. The return value should implement the same " -"interface as the return value of :func:`urlopen`." +"This method, if defined, will be called by the parent :class:" +"`OpenerDirector`. *req* will be a :class:`Request` object. *response* will " +"be an object implementing the same interface as the return value of :func:" +"`urlopen`. The return value should implement the same interface as the " +"return value of :func:`urlopen`." msgstr "" #: ../../library/urllib.request.rst:889 @@ -1237,19 +1239,18 @@ msgid "" "called by the default implementations of the :meth:`!http_error_30\\*` " "methods when a redirection is received from the server. If a redirection " "should take place, return a new :class:`Request` to allow :meth:`!" -"http_error_30\\*` to perform the redirect to *newurl*. Otherwise, " -"raise :exc:`~urllib.error.HTTPError` if no other handler should try to " -"handle this URL, or return ``None`` if you can't but another handler might." +"http_error_30\\*` to perform the redirect to *newurl*. Otherwise, raise :" +"exc:`~urllib.error.HTTPError` if no other handler should try to handle this " +"URL, or return ``None`` if you can't but another handler might." msgstr "" #: ../../library/urllib.request.rst:914 msgid "" -"The default implementation of this method does not strictly " -"follow :rfc:`2616`, which says that 301 and 302 responses to ``POST`` " -"requests must not be automatically redirected without confirmation by the " -"user. In reality, browsers do allow automatic redirection of these " -"responses, changing the POST to a ``GET``, and the default implementation " -"reproduces this behavior." +"The default implementation of this method does not strictly follow :rfc:" +"`2616`, which says that 301 and 302 responses to ``POST`` requests must not " +"be automatically redirected without confirmation by the user. In reality, " +"browsers do allow automatic redirection of these responses, changing the " +"POST to a ``GET``, and the default implementation reproduces this behavior." msgstr "" #: ../../library/urllib.request.rst:923 @@ -1314,8 +1315,8 @@ msgstr "HTTPPasswordMgr 物件" #: ../../library/urllib.request.rst:986 msgid "" -"These methods are available on :class:`HTTPPasswordMgr` " -"and :class:`HTTPPasswordMgrWithDefaultRealm` objects." +"These methods are available on :class:`HTTPPasswordMgr` and :class:" +"`HTTPPasswordMgrWithDefaultRealm` objects." msgstr "" #: ../../library/urllib.request.rst:992 @@ -1351,10 +1352,10 @@ msgstr "" #: ../../library/urllib.request.rst:1019 msgid "" -"*realm*, *uri*, *user*, *passwd* are as " -"for :meth:`HTTPPasswordMgr.add_password`. *is_authenticated* sets the " -"initial value of the ``is_authenticated`` flag for the given URI or list of " -"URIs. If *is_authenticated* is specified as ``True``, *realm* is ignored." +"*realm*, *uri*, *user*, *passwd* are as for :meth:`HTTPPasswordMgr." +"add_password`. *is_authenticated* sets the initial value of the " +"``is_authenticated`` flag for the given URI or list of URIs. If " +"*is_authenticated* is specified as ``True``, *realm* is ignored." msgstr "" #: ../../library/urllib.request.rst:1027 @@ -1380,8 +1381,8 @@ msgid "" "Handle an authentication request by getting a user/password pair, and re-" "trying the request. *authreq* should be the name of the header where the " "information about the realm is included in the request, *host* specifies the " -"URL and path to authenticate for, *req* should be the " -"(failed) :class:`Request` object, and *headers* should be the error headers." +"URL and path to authenticate for, *req* should be the (failed) :class:" +"`Request` object, and *headers* should be the error headers." msgstr "" #: ../../library/urllib.request.rst:1057 @@ -1431,8 +1432,8 @@ msgstr "HTTPHandler 物件" #: ../../library/urllib.request.rst:1129 msgid "" -"Send an HTTP request, which can be either GET or POST, depending on " -"``req.data``." +"Send an HTTP request, which can be either GET or POST, depending on ``req." +"data``." msgstr "" #: ../../library/urllib.request.rst:1136 @@ -1441,8 +1442,8 @@ msgstr "HTTPSHandler 物件" #: ../../library/urllib.request.rst:1141 msgid "" -"Send an HTTPS request, which can be either GET or POST, depending on " -"``req.data``." +"Send an HTTPS request, which can be either GET or POST, depending on ``req." +"data``." msgstr "" #: ../../library/urllib.request.rst:1148 @@ -1523,8 +1524,8 @@ msgstr "" msgid "" "For non-200 error codes, this simply passes the job on to the :meth:`!" "http_error_\\` handler methods, via :meth:`OpenerDirector.error`. " -"Eventually, :class:`HTTPDefaultErrorHandler` will raise " -"an :exc:`~urllib.error.HTTPError` if no other handler handles the error." +"Eventually, :class:`HTTPDefaultErrorHandler` will raise an :exc:`~urllib." +"error.HTTPError` if no other handler handles the error." msgstr "" #: ../../library/urllib.request.rst:1237 @@ -1619,8 +1620,8 @@ msgstr "" #: ../../library/urllib.request.rst:1281 msgid "" -"It is also possible to achieve the same result without using " -"the :term:`context manager` approach::" +"It is also possible to achieve the same result without using the :term:" +"`context manager` approach::" msgstr "" #: ../../library/urllib.request.rst:1284 @@ -1736,11 +1737,11 @@ msgstr "" #: ../../library/urllib.request.rst:1339 msgid "" -":func:`build_opener` provides many handlers by default, including " -"a :class:`ProxyHandler`. By default, :class:`ProxyHandler` uses the " -"environment variables named ``_proxy``, where ```` is the " -"URL scheme involved. For example, the :envvar:`!http_proxy` environment " -"variable is read to obtain the HTTP proxy's URL." +":func:`build_opener` provides many handlers by default, including a :class:" +"`ProxyHandler`. By default, :class:`ProxyHandler` uses the environment " +"variables named ``_proxy``, where ```` is the URL scheme " +"involved. For example, the :envvar:`!http_proxy` environment variable is " +"read to obtain the HTTP proxy's URL." msgstr "" #: ../../library/urllib.request.rst:1345 @@ -1752,8 +1753,8 @@ msgstr "" #: ../../library/urllib.request.rst:1349 msgid "" -"proxy_handler = urllib.request.ProxyHandler({'http': 'http://" -"www.example.com:3128/'})\n" +"proxy_handler = urllib.request.ProxyHandler({'http': 'http://www.example." +"com:3128/'})\n" "proxy_auth_handler = urllib.request.ProxyBasicAuthHandler()\n" "proxy_auth_handler.add_password('realm', 'host', 'username', 'password')\n" "\n" @@ -1762,8 +1763,8 @@ msgid "" "with opener.open('http://www.example.com/login.html') as f:\n" " print(f.read().decode('utf-8'))" msgstr "" -"proxy_handler = urllib.request.ProxyHandler({'http': 'http://" -"www.example.com:3128/'})\n" +"proxy_handler = urllib.request.ProxyHandler({'http': 'http://www.example." +"com:3128/'})\n" "proxy_auth_handler = urllib.request.ProxyBasicAuthHandler()\n" "proxy_auth_handler.add_password('realm', 'host', 'username', 'password')\n" "\n" @@ -1820,10 +1821,9 @@ msgstr "" #: ../../library/urllib.request.rst:1380 msgid "" -"Also, remember that a few standard headers (:mailheader:`Content-" -"Length`, :mailheader:`Content-Type` and :mailheader:`Host`) are added when " -"the :class:`Request` is passed to :func:`urlopen` " -"(or :meth:`OpenerDirector.open`)." +"Also, remember that a few standard headers (:mailheader:`Content-Length`, :" +"mailheader:`Content-Type` and :mailheader:`Host`) are added when the :class:" +"`Request` is passed to :func:`urlopen` (or :meth:`OpenerDirector.open`)." msgstr "" #: ../../library/urllib.request.rst:1387 @@ -1887,16 +1887,16 @@ msgstr "" msgid "" ">>> import urllib.request\n" ">>> proxies = {'http': 'http://proxy.example.com:8080/'}\n" -">>> opener = " -"urllib.request.build_opener(urllib.request.ProxyHandler(proxies))\n" +">>> opener = urllib.request.build_opener(urllib.request." +"ProxyHandler(proxies))\n" ">>> with opener.open(\"http://www.python.org\") as f:\n" "... f.read().decode('utf-8')\n" "..." msgstr "" ">>> import urllib.request\n" ">>> proxies = {'http': 'http://proxy.example.com:8080/'}\n" -">>> opener = " -"urllib.request.build_opener(urllib.request.ProxyHandler(proxies))\n" +">>> opener = urllib.request.build_opener(urllib.request." +"ProxyHandler(proxies))\n" ">>> with opener.open(\"http://www.python.org\") as f:\n" "... f.read().decode('utf-8')\n" "..." @@ -1937,9 +1937,9 @@ msgid "" "Copy a network object denoted by a URL to a local file. If the URL points to " "a local file, the object will not be copied unless filename is supplied. " "Return a tuple ``(filename, headers)`` where *filename* is the local file " -"name under which the object can be found, and *headers* is whatever " -"the :meth:`!info` method of the object returned by :func:`urlopen` returned " -"(for a remote object). Exceptions are the same as for :func:`urlopen`." +"name under which the object can be found, and *headers* is whatever the :" +"meth:`!info` method of the object returned by :func:`urlopen` returned (for " +"a remote object). Exceptions are the same as for :func:`urlopen`." msgstr "" #: ../../library/urllib.request.rst:1444 @@ -1961,14 +1961,14 @@ msgstr "" #: ../../library/urllib.request.rst:1455 msgid "" ">>> import urllib.request\n" -">>> local_filename, headers = urllib.request.urlretrieve('http://" -"python.org/')\n" +">>> local_filename, headers = urllib.request.urlretrieve('http://python." +"org/')\n" ">>> html = open(local_filename)\n" ">>> html.close()" msgstr "" ">>> import urllib.request\n" -">>> local_filename, headers = urllib.request.urlretrieve('http://" -"python.org/')\n" +">>> local_filename, headers = urllib.request.urlretrieve('http://python." +"org/')\n" ">>> html = open(local_filename)\n" ">>> html.close()" @@ -1976,9 +1976,9 @@ msgstr "" msgid "" "If the *url* uses the :file:`http:` scheme identifier, the optional *data* " "argument may be given to specify a ``POST`` request (normally the request " -"type is ``GET``). The *data* argument must be a bytes object in " -"standard :mimetype:`application/x-www-form-urlencoded` format; see " -"the :func:`urllib.parse.urlencode` function." +"type is ``GET``). The *data* argument must be a bytes object in standard :" +"mimetype:`application/x-www-form-urlencoded` format; see the :func:`urllib." +"parse.urlencode` function." msgstr "" #: ../../library/urllib.request.rst:1466 @@ -2016,7 +2016,8 @@ msgid "" msgstr "" #: ../../library/urllib.request.rst:1489 -msgid ":mod:`urllib.request` Restrictions" +#, fuzzy +msgid ":mod:`!urllib.request` Restrictions" msgstr ":mod:`urllib.request` 限制" #: ../../library/urllib.request.rst:1495 @@ -2060,9 +2061,9 @@ msgid "" "The data returned by :func:`urlopen` or :func:`urlretrieve` is the raw data " "returned by the server. This may be binary data (such as an image), plain " "text or (for example) HTML. The HTTP protocol provides type information in " -"the reply header, which can be inspected by looking at " -"the :mailheader:`Content-Type` header. If the returned data is HTML, you " -"can use the module :mod:`html.parser` to parse it." +"the reply header, which can be inspected by looking at the :mailheader:" +"`Content-Type` header. If the returned data is HTML, you can use the " +"module :mod:`html.parser` to parse it." msgstr "" #: ../../library/urllib.request.rst:1527 @@ -2090,9 +2091,9 @@ msgstr "" msgid "" "The :mod:`urllib.response` module defines functions and classes which define " "a minimal file-like interface, including ``read()`` and ``readline()``. " -"Functions defined by this module are used internally by " -"the :mod:`urllib.request` module. The typical response object is " -"a :class:`urllib.response.addinfourl` instance:" +"Functions defined by this module are used internally by the :mod:`!urllib." +"request` module. The typical response object is a :class:`urllib.response." +"addinfourl` instance:" msgstr "" #: ../../library/urllib.request.rst:1557 @@ -2103,8 +2104,8 @@ msgstr "" #: ../../library/urllib.request.rst:1561 msgid "" -"Returns the headers of the response in the form of " -"an :class:`~email.message.EmailMessage` instance." +"Returns the headers of the response in the form of an :class:`~email.message." +"EmailMessage` instance." msgstr "" #: ../../library/urllib.request.rst:1567 diff --git a/library/uuid.po b/library/uuid.po index a5f92c45ce..f6e83514ab 100644 --- a/library/uuid.po +++ b/library/uuid.po @@ -6,7 +6,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-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,15 +30,15 @@ msgid "" "This module provides immutable :class:`UUID` objects (the :class:`UUID` " "class) and :ref:`functions ` for generating UUIDs " "corresponding to a specific UUID version as specified in :rfc:`9562` (which " -"supersedes :rfc:`4122`), for example, :func:`uuid1` for UUID version " -"1, :func:`uuid3` for UUID version 3, and so on. Note that UUID version 2 is " +"supersedes :rfc:`4122`), for example, :func:`uuid1` for UUID version 1, :" +"func:`uuid3` for UUID version 3, and so on. Note that UUID version 2 is " "deliberately omitted as it is outside the scope of the RFC." msgstr "" #: ../../library/uuid.rst:19 msgid "" -"If all you want is a unique ID, you should probably call :func:`uuid1` " -"or :func:`uuid4`. Note that :func:`uuid1` may compromise privacy since it " +"If all you want is a unique ID, you should probably call :func:`uuid1` or :" +"func:`uuid4`. Note that :func:`uuid1` may compromise privacy since it " "creates a UUID containing the computer's network address. :func:`uuid4` " "creates a random UUID." msgstr "" @@ -128,9 +128,9 @@ msgstr "" #: ../../library/uuid.rst:73 msgid "" -"Comparison of UUID objects are made by way of comparing " -"their :attr:`UUID.int` attributes. Comparison with a non-UUID object raises " -"a :exc:`TypeError`." +"Comparison of UUID objects are made by way of comparing their :attr:`UUID." +"int` attributes. Comparison with a non-UUID object raises a :exc:" +"`TypeError`." msgstr "" "UUID 物件之間的比較是透過比較它們的 :attr:`UUID.int` 屬性。與非 UUID 的物件進" "行比較會引發 :exc:`TypeError`。" @@ -221,18 +221,17 @@ msgstr "UUID 以 :rfc:`9562` 中指定的 URN 形式表示。" #: ../../library/uuid.rst:150 msgid "" "The UUID variant, which determines the internal layout of the UUID. This " -"will be one of the " -"constants :const:`RESERVED_NCS`, :const:`RFC_4122`, :const:`RESERVED_MICROSOFT`, " -"or :const:`RESERVED_FUTURE`." +"will be one of the constants :const:`RESERVED_NCS`, :const:`RFC_4122`, :" +"const:`RESERVED_MICROSOFT`, or :const:`RESERVED_FUTURE`." msgstr "" -"UUID 的變體,決定 UUID 內部的佈局 (layout)," -"是 :const:`RESERVED_NCS`、:const:`RFC_4122`、:const:`RESERVED_MICROSOFT` " -"或 :const:`RESERVED_FUTURE` 其中一個常數。" +"UUID 的變體,決定 UUID 內部的佈局 (layout),是 :const:`RESERVED_NCS`、:const:" +"`RFC_4122`、:const:`RESERVED_MICROSOFT` 或 :const:`RESERVED_FUTURE` 其中一個" +"常數。" #: ../../library/uuid.rst:157 msgid "" -"The UUID version number (1 through 8, meaningful only when the variant " -"is :const:`RFC_4122`)." +"The UUID version number (1 through 8, meaningful only when the variant is :" +"const:`RFC_4122`)." msgstr "UUID 的版本號(1 到 8,只有當變體是 :const:`RFC_4122` 時才有意義)。" #: ../../library/uuid.rst:160 @@ -246,7 +245,8 @@ msgid "" msgstr ":class:`SafeUUID` 的列舉,表示平台是否以多行程安全的方式產生 UUID。" #: ../../library/uuid.rst:171 -msgid "The :mod:`uuid` module defines the following functions:" +#, fuzzy +msgid "The :mod:`!uuid` module defines the following functions:" msgstr ":mod:`uuid` 模組定義了以下函式:" #: ../../library/uuid.rst:176 @@ -304,14 +304,14 @@ msgid "" "UUID) and a name (which is a :class:`bytes` object or a string that will be " "encoded using UTF-8) according to :rfc:`RFC 9562, §5.3 <9562#section-5.3>`." msgstr "" -"根據 :rfc:`RFC 9562, §5.3 <9562#section-5.3>`," -"基於命名空間識別碼 (namespace identifier)(一個 UUID)和名稱(一" -"個 :class:`bytes` 物件或使用 UTF-8 編碼的字串)的 MD5 hash 來生成 UUID。" +"根據 :rfc:`RFC 9562, §5.3 <9562#section-5.3>`,基於命名空間識別碼 (namespace " +"identifier)(一個 UUID)和名稱(一個 :class:`bytes` 物件或使用 UTF-8 編碼的字" +"串)的 MD5 hash 來生成 UUID。" #: ../../library/uuid.rst:217 msgid "" -"Generate a random UUID in a cryptographically-secure method according " -"to :rfc:`RFC 9562, §5.4 <9562#section-5.4>`." +"Generate a random UUID in a cryptographically-secure method according to :" +"rfc:`RFC 9562, §5.4 <9562#section-5.4>`." msgstr "" #: ../../library/uuid.rst:223 @@ -321,14 +321,14 @@ msgid "" "be encoded using UTF-8) according to :rfc:`RFC 9562, §5.5 " "<9562#section-5.5>`." msgstr "" -"根據 :rfc:`RFC 9562, §5.5 <9562#section-5.5>`," -"基於命名空間識別碼(一個 UUID)和名稱(一個 :class:`bytes` 物件或使用 UTF-8 " -"編碼的字串)的 SHA-1 hash 來生成 UUID。" +"根據 :rfc:`RFC 9562, §5.5 <9562#section-5.5>`,基於命名空間識別碼(一個 " +"UUID)和名稱(一個 :class:`bytes` 物件或使用 UTF-8 編碼的字串)的 SHA-1 hash " +"來生成 UUID。" #: ../../library/uuid.rst:231 msgid "" -"Generate a UUID from a sequence number and the current time according " -"to :rfc:`RFC 9562, §5.6 <9562#section-5.6>`." +"Generate a UUID from a sequence number and the current time according to :" +"rfc:`RFC 9562, §5.6 <9562#section-5.6>`." msgstr "" #: ../../library/uuid.rst:234 @@ -370,8 +370,9 @@ msgid "" msgstr "" #: ../../library/uuid.rst:276 +#, fuzzy msgid "" -"The :mod:`uuid` module defines the following namespace identifiers for use " +"The :mod:`!uuid` module defines the following namespace identifiers for use " "with :func:`uuid3` or :func:`uuid5`." msgstr "" ":mod:`uuid` 模組為 :func:`uuid3` 或 :func:`uuid5` 定義了以下的命名空間識別" @@ -401,8 +402,9 @@ msgstr "" "當指定這個命名空間時,*name* 字串是以 DER 或文字輸出格式表示的 X.500 DN。" #: ../../library/uuid.rst:301 +#, fuzzy msgid "" -"The :mod:`uuid` module defines the following constants for the possible " +"The :mod:`!uuid` module defines the following constants for the possible " "values of the :attr:`~UUID.variant` attribute:" msgstr ":mod:`uuid` 模組為 :attr:`~UUID.variant` 屬性的可能值定義了以下常數:" @@ -413,8 +415,8 @@ msgstr "保留供 NCS 相容性使用。" #: ../../library/uuid.rst:312 msgid "" "Specifies the UUID layout given in :rfc:`4122`. This constant is kept for " -"backward compatibility even though :rfc:`4122` has been superseded " -"by :rfc:`9562`." +"backward compatibility even though :rfc:`4122` has been superseded by :rfc:" +"`9562`." msgstr "" #: ../../library/uuid.rst:319 @@ -426,7 +428,8 @@ msgid "Reserved for future definition." msgstr "保留供未來定義使用。" #: ../../library/uuid.rst:327 -msgid "The :mod:`uuid` module defines the special Nil and Max UUID values:" +#, fuzzy +msgid "The :mod:`!uuid` module defines the special Nil and Max UUID values:" msgstr ":mod:`uuid` 模組定義了特殊的 Nil 和 Max UUID 值:" #: ../../library/uuid.rst:332 @@ -460,8 +463,9 @@ msgid "Command-Line Usage" msgstr "命令列的用法" #: ../../library/uuid.rst:360 +#, fuzzy msgid "" -"The :mod:`uuid` module can be executed as a script from the command line." +"The :mod:`!uuid` module can be executed as a script from the command line." msgstr ":mod:`uuid` 模組可以在命令列下作為腳本來執行。" #: ../../library/uuid.rst:362 @@ -482,8 +486,8 @@ msgstr "顯示幫助訊息並退出。" #: ../../library/uuid.rst:377 msgid "" -"Specify the function name to use to generate the uuid. By " -"default :func:`uuid4` is used." +"Specify the function name to use to generate the uuid. By default :func:" +"`uuid4` is used." msgstr "指定要用來生成 UUID 的函式名稱。預設使用 :func:`uuid4`。" #: ../../library/uuid.rst:380 @@ -498,13 +502,13 @@ msgid "" "functions." msgstr "" "該命名空間是一個 ``UUID`` 或 ``@ns``,其中 ``ns`` 是指知名預定義 UUID 的命名" -"空間名稱,例如 ``@dns``、``@url``、``@oid`` 和 ``@x500``。 只" -"有 :func:`uuid3` / :func:`uuid5` 函式會需要。" +"空間名稱,例如 ``@dns``、``@url``、``@oid`` 和 ``@x500``。 只有 :func:" +"`uuid3` / :func:`uuid5` 函式會需要。" #: ../../library/uuid.rst:393 msgid "" -"The name used as part of generating the uuid. Only required " -"for :func:`uuid3` / :func:`uuid5` functions." +"The name used as part of generating the uuid. Only required for :func:" +"`uuid3` / :func:`uuid5` functions." msgstr "用於生成 uuid 的名稱。只有 :func:`uuid3` / :func:`uuid5` 函式會需要。" #: ../../library/uuid.rst:399 @@ -516,7 +520,8 @@ msgid "Example" msgstr "範例" #: ../../library/uuid.rst:409 -msgid "Here are some examples of typical usage of the :mod:`uuid` module::" +#, fuzzy +msgid "Here are some examples of typical usage of the :mod:`!uuid` module::" msgstr "以下是一些 :mod:`uuid` 模組的典型使用範例: ::" #: ../../library/uuid.rst:411 @@ -644,8 +649,9 @@ msgid "Command-Line Example" msgstr "命令列的範例" #: ../../library/uuid.rst:476 +#, fuzzy msgid "" -"Here are some examples of typical usage of the :mod:`uuid` command-line " +"Here are some examples of typical usage of the :mod:`!uuid` command-line " "interface:" msgstr "以下是一些 :mod:`uuid` 命令列介面的典型使用範例:" diff --git a/library/warnings.po b/library/warnings.po index 22b7156f29..818c41d1a3 100644 --- a/library/warnings.po +++ b/library/warnings.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-19 00:16+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2025-07-14 13:00+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -458,11 +458,12 @@ msgid "Describing Warning Filters" msgstr "描述警告過濾器" #: ../../library/warnings.rst:203 +#, fuzzy msgid "" "The warnings filter is initialized by :option:`-W` options passed to the " "Python interpreter command line and the :envvar:`PYTHONWARNINGS` environment " "variable. The interpreter saves the arguments for all supplied entries " -"without interpretation in :data:`sys.warnoptions`; the :mod:`warnings` " +"without interpretation in :data:`sys.warnoptions`; the :mod:`!warnings` " "module parses these when it is first imported (invalid options are ignored, " "after printing a message to :data:`sys.stderr`)." msgstr "" @@ -977,9 +978,9 @@ msgid "" "which case *category* will be ignored." msgstr "" "這是一個 :func:`warn` 功能的低階介面,明確傳入訊息、類別、檔名和行號,以及可" -"選的其他引數。*message* 必" -"須是字串,*category* 必須是 :exc:`Warning` 的子類別,或者 *message* 可以是 :" -"exc:`Warning` 的實例,在這種情況下 *category* 將被忽略。" +"選的其他引數。*message* 必須是字串,*category* 必須是 :exc:`Warning` 的子類" +"別,或者 *message* 可以是 :exc:`Warning` 的實例,在這種情況下 *category* 將被" +"忽略。" #: ../../library/warnings.rst:485 msgid "" @@ -1158,8 +1159,8 @@ msgid "" "get_overloads`." msgstr "" "傳遞給裝飾器的棄用訊息會儲存在被裝飾物件的 ``__deprecated__`` 屬性中。如果應" -"用於重載,裝飾器必須在 :deco:`~typing.overload` 裝飾器之後,這樣屬" -"性才會存在於 :func:`typing.get_overloads` 回傳的重載上。" +"用於重載,裝飾器必須在 :deco:`~typing.overload` 裝飾器之後,這樣屬性才會存在" +"於 :func:`typing.get_overloads` 回傳的重載上。" #: ../../library/warnings.rst:600 msgid "See :pep:`702`." @@ -1187,10 +1188,12 @@ msgstr "" "性。" #: ../../library/warnings.rst:618 +#, fuzzy msgid "" "The *module* argument takes a module that will be used instead of the module " -"returned when you import :mod:`warnings` whose filter will be protected. " -"This argument exists primarily for testing the :mod:`warnings` module itself." +"returned when you import :mod:`!warnings` whose filter will be protected. " +"This argument exists primarily for testing the :mod:`!warnings` module " +"itself." msgstr "" "*module* 引數接受一個模組,用以取代預設的 :mod:`warnings` 模組,而該(被傳" "入)模組的過濾器將會受到保護。此引數主要用於測試 :mod:`warnings` 模組本身。" @@ -1232,7 +1235,7 @@ msgstr "" #: ../../library/warnings.rst:655 msgid "" "If the :data:`~sys.flags.context_aware_warnings` flag is false, then :class:" -"`catch_warnings` will modify the global attributes of the :mod:`warnings` " +"`catch_warnings` will modify the global attributes of the :mod:`!warnings` " "module. This is not safe if used within a concurrent program (using " "multiple threads or using asyncio coroutines). For example, if two or more " "threads use the :class:`catch_warnings` class at the same time, the behavior " @@ -1291,8 +1294,8 @@ msgid "" "versions of Python acted as if the flag was always set to false." msgstr "" "新增了 :data:`sys.flags.context_aware_warnings` 旗標,以及在該旗標為 true 時" -"用於 :class:`catch_warnings` 的情境變數。先前 Python 版本的行為就像該" -"旗標始終設置為 false 一樣。" +"用於 :class:`catch_warnings` 的情境變數。先前 Python 版本的行為就像該旗標始終" +"設置為 false 一樣。" #: ../../library/warnings.rst:9 msgid "warnings" diff --git a/library/wave.po b/library/wave.po index 1a284d038b..6c93793630 100644 --- a/library/wave.po +++ b/library/wave.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,10 +26,11 @@ msgid "**Source code:** :source:`Lib/wave.py`" msgstr "**原始碼:**\\ :source:`Lib/wave.py`" #: ../../library/wave.rst:14 +#, fuzzy msgid "" -"The :mod:`wave` module provides a convenient interface to the Waveform Audio " -"\"WAVE\" (or \"WAV\") file format. Only uncompressed PCM encoded wave files " -"are supported." +"The :mod:`!wave` module provides a convenient interface to the Waveform " +"Audio \"WAVE\" (or \"WAV\") file format. Only uncompressed PCM encoded wave " +"files are supported." msgstr "" ":mod:`wave` 模組為波形音訊檔案格式「WAVE」(或稱「WAV」)提供了便捷的介面。僅" "支援未壓縮的 PCM 編碼波形檔。" @@ -43,7 +44,8 @@ msgstr "" "``KSDATAFORMAT_SUBTYPE_PCM``。" #: ../../library/wave.rst:23 -msgid "The :mod:`wave` module defines the following function and exception:" +#, fuzzy +msgid "The :mod:`!wave` module defines the following function and exception:" msgstr ":mod:`wave` 模組定義了以下的函式和例外:" #: ../../library/wave.rst:28 @@ -98,8 +100,8 @@ msgstr "" #: ../../library/wave.rst:48 msgid "" "The :func:`.open` function may be used in a :keyword:`with` statement. When " -"the :keyword:`!with` block completes, the :meth:`Wave_read.close` " -"or :meth:`Wave_write.close` method is called." +"the :keyword:`!with` block completes, the :meth:`Wave_read.close` or :meth:" +"`Wave_write.close` method is called." msgstr "" ":func:`.open` 函式可以在 :keyword:`with` 陳述式中使用。當 :keyword:`!with` 區" "塊完成時,會呼叫 :meth:`Wave_read.close` 或是 :meth:`Wave_write.close` 方法。" @@ -128,8 +130,9 @@ msgid "" msgstr "由 :func:`.open` 回傳的 Wave_read 物件具有以下方法:" #: ../../library/wave.rst:75 +#, fuzzy msgid "" -"Close the stream if it was opened by :mod:`wave`, and make the instance " +"Close the stream if it was opened by :mod:`!wave`, and make the instance " "unusable. This is called automatically on object collection." msgstr "關閉 :mod:`wave` 開啟的串流並使該實例無法使用。當物件回收時自動呼叫。" @@ -235,33 +238,33 @@ msgid "" "For seekable output streams, the ``wave`` header will automatically be " "updated to reflect the number of frames actually written. For unseekable " "streams, the *nframes* value must be accurate when the first frame data is " -"written. An accurate *nframes* value can be achieved either by " -"calling :meth:`setnframes` or :meth:`setparams` with the number of frames " -"that will be written before :meth:`close` is called and then " -"using :meth:`writeframesraw` to write the frame data, or by " -"calling :meth:`writeframes` with all of the frame data to be written. In " -"the latter case :meth:`writeframes` will calculate the number of frames in " -"the data and set *nframes* accordingly before writing the frame data." +"written. An accurate *nframes* value can be achieved either by calling :" +"meth:`setnframes` or :meth:`setparams` with the number of frames that will " +"be written before :meth:`close` is called and then using :meth:" +"`writeframesraw` to write the frame data, or by calling :meth:`writeframes` " +"with all of the frame data to be written. In the latter case :meth:" +"`writeframes` will calculate the number of frames in the data and set " +"*nframes* accordingly before writing the frame data." msgstr "" "對於可搜尋 (seekable) 的輸出串流,``wave`` 標頭將自動更新,以反映實際寫入的幀" "數。對於不可搜尋的串流,當寫入第一個幀資料時,*nframes* 的值必須是準確的。要" -"取得準確的 *nframes* 值,可以透過呼叫 :meth:`setnframes` " -"或 :meth:`setparams` 方法,並在呼叫 :meth:`close` 之前設定將寫入的幀數量,然" -"後使用 :meth:`writeframesraw` 方法寫入幀資料;或者透過呼" -"叫 :meth:`writeframes` 方法一次性寫入所有的幀資料。在後一種情況" -"下,:meth:`writeframes` 方法將計算資料中的幀數量,並在寫入幀資料之前相應地設" -"定 *nframes* 的值。" +"取得準確的 *nframes* 值,可以透過呼叫 :meth:`setnframes` 或 :meth:" +"`setparams` 方法,並在呼叫 :meth:`close` 之前設定將寫入的幀數量,然後使用 :" +"meth:`writeframesraw` 方法寫入幀資料;或者透過呼叫 :meth:`writeframes` 方法一" +"次性寫入所有的幀資料。在後一種情況下,:meth:`writeframes` 方法將計算資料中的" +"幀數量,並在寫入幀資料之前相應地設定 *nframes* 的值。" #: ../../library/wave.rst:187 msgid "Wave_write objects have the following methods:" msgstr "Wave_write 物件具有以下方法:" #: ../../library/wave.rst:191 +#, fuzzy msgid "" -"Make sure *nframes* is correct, and close the file if it was opened " -"by :mod:`wave`. This method is called upon object collection. It will " -"raise an exception if the output stream is not seekable and *nframes* does " -"not match the number of frames actually written." +"Make sure *nframes* is correct, and close the file if it was opened by :mod:" +"`!wave`. This method is called upon object collection. It will raise an " +"exception if the output stream is not seekable and *nframes* does not match " +"the number of frames actually written." msgstr "" "確保 *nframes* 正確,如果該檔案是由 :mod:`wave` 開啟的,則關閉該檔案。此方法" "在物件回收時被呼叫。如果輸出串流不可搜尋且 *nframes* 不符合實際寫入的幀數,則" @@ -309,11 +312,11 @@ msgstr "" #: ../../library/wave.rst:238 msgid "" -"Return current position in the file, with the same disclaimer for " -"the :meth:`Wave_read.tell` and :meth:`Wave_read.setpos` methods." +"Return current position in the file, with the same disclaimer for the :meth:" +"`Wave_read.tell` and :meth:`Wave_read.setpos` methods." msgstr "" -"回傳檔案中的指標位置,其指標位置含意與 :meth:`Wave_read.tell` " -"和 :meth:`Wave_read.setpos` 是一致的。" +"回傳檔案中的指標位置,其指標位置含意與 :meth:`Wave_read.tell` 和 :meth:" +"`Wave_read.setpos` 是一致的。" #: ../../library/wave.rst:244 msgid "Write audio frames, without correcting *nframes*." @@ -335,9 +338,9 @@ msgstr "" #: ../../library/wave.rst:260 msgid "" -"Note that it is invalid to set any parameters after " -"calling :meth:`writeframes` or :meth:`writeframesraw`, and any attempt to do " -"so will raise :exc:`wave.Error`." +"Note that it is invalid to set any parameters after calling :meth:" +"`writeframes` or :meth:`writeframesraw`, and any attempt to do so will " +"raise :exc:`wave.Error`." msgstr "" "注意在呼叫 :meth:`writeframes` 或 :meth:`writeframesraw` 之後設置任何參數都是" "無效的,任何嘗試這樣做的操作都會引發 :exc:`wave.Error`。" diff --git a/library/webbrowser.po b/library/webbrowser.po index 28c5ec9bcb..be768aab49 100644 --- a/library/webbrowser.po +++ b/library/webbrowser.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-18 00:15+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2024-09-24 18:27+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,8 +28,9 @@ msgid "**Source code:** :source:`Lib/webbrowser.py`" msgstr "**原始碼:**\\ :source:`Lib/webbrowser.py`" #: ../../library/webbrowser.rst:14 +#, fuzzy msgid "" -"The :mod:`webbrowser` module provides a high-level interface to allow " +"The :mod:`!webbrowser` module provides a high-level interface to allow " "displaying web-based documents to users. Under most circumstances, simply " "calling the :func:`.open` function from this module will do the right thing." msgstr "" @@ -84,12 +85,13 @@ msgstr "" "Unix 上不可用,控制行程將啟動新的瀏覽器並等待。" #: ../../library/webbrowser.rst:45 +#, fuzzy msgid "" "On iOS, the :envvar:`BROWSER` environment variable, as well as any arguments " "controlling autoraise, browser preference, and new tab/window creation will " "be ignored. Web pages will *always* be opened in the user's preferred " "browser, in a new tab, with the browser being brought to the foreground. The " -"use of the :mod:`webbrowser` module on iOS requires the :mod:`ctypes` " +"use of the :mod:`!webbrowser` module on iOS requires the :mod:`ctypes` " "module. If :mod:`ctypes` isn't available, calls to :func:`.open` will fail." msgstr "" "在 iOS 上,:envvar:`BROWSER` 環境變數以及控制自動引發 (autoraise)、瀏覽器設定" diff --git a/library/winreg.po b/library/winreg.po index c1ac16bed1..c74c8d02c9 100644 --- a/library/winreg.po +++ b/library/winreg.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-10 16:45+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -702,7 +702,7 @@ msgstr "常數" #: ../../library/winreg.rst:541 msgid "" -"The following constants are defined for use in many :mod:`winreg` functions." +"The following constants are defined for use in many :mod:`!winreg` functions." msgstr "" #: ../../library/winreg.rst:546 diff --git a/library/winsound.po b/library/winsound.po index 0918bed675..73180ab5f7 100644 --- a/library/winsound.po +++ b/library/winsound.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-10 16:45+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2025-05-19 23:00+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -23,8 +23,9 @@ msgid ":mod:`!winsound` --- Sound-playing interface for Windows" msgstr ":mod:`!winsound` --- Windows 的音效播放介面" #: ../../library/winsound.rst:13 +#, fuzzy msgid "" -"The :mod:`winsound` module provides access to the basic sound-playing " +"The :mod:`!winsound` module provides access to the basic sound-playing " "machinery provided by Windows platforms. It includes functions and several " "constants." msgstr "" diff --git a/library/wsgiref.po b/library/wsgiref.po index e10942f56a..9d5b525714 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-06 00:18+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2023-12-09 21:29+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,7 +28,7 @@ msgstr "**原始碼:**\\ :source:`Lib/wsgiref`" #: ../../library/wsgiref.rst:16 msgid "" -":mod:`wsgiref` is a reference implementation and is not recommended for " +":mod:`!wsgiref` is a reference implementation and is not recommended for " "production. The module only implements basic security checks." msgstr "" @@ -55,8 +55,9 @@ msgstr "" "節。" #: ../../library/wsgiref.rst:29 +#, fuzzy msgid "" -":mod:`wsgiref` is a reference implementation of the WSGI specification that " +":mod:`!wsgiref` is a reference implementation of the WSGI specification that " "can be used to add WSGI support to a web server or framework. It provides " "utilities for manipulating WSGI environment variables and response headers, " "base classes for implementing WSGI servers, a demo HTTP server that serves " diff --git a/library/xml.dom.minidom.po b/library/xml.dom.minidom.po index c826ec5f0a..96448070f1 100644 --- a/library/xml.dom.minidom.po +++ b/library/xml.dom.minidom.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-07-07 10:49+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/xml/dom/minidom.py`" #: ../../library/xml.dom.minidom.rst:15 msgid "" -":mod:`xml.dom.minidom` is a minimal implementation of the Document Object " +":mod:`!xml.dom.minidom` is a minimal implementation of the Document Object " "Model interface, with an API similar to that in other languages. It is " "intended to be simpler than the full DOM and also significantly smaller. " "Users who are not already proficient with the DOM should consider using the :" @@ -43,7 +43,7 @@ msgstr "如果你需要剖析不受信任或未經驗證的資料,請參閱 :r #: ../../library/xml.dom.minidom.rst:28 msgid "" "DOM applications typically start by parsing some XML into a DOM. With :mod:" -"`xml.dom.minidom`, this is done through the parse functions::" +"`!xml.dom.minidom`, this is done through the parse functions::" msgstr "" #: ../../library/xml.dom.minidom.rst:31 @@ -84,8 +84,7 @@ msgstr "" msgid "" "If you have XML in a string, you can use the :func:`parseString` function " "instead:" -msgstr "" -"如果你有一個字串中的 XML,你可以使用 :func:`parseString` 函式來代替:" +msgstr "如果你有一個字串中的 XML,你可以使用 :func:`parseString` 函式來代替:" #: ../../library/xml.dom.minidom.rst:57 msgid "" @@ -116,7 +115,7 @@ msgid "" "You can also create a :class:`Document` by calling a method on a \"DOM " "Implementation\" object. You can get this object either by calling the :" "func:`getDOMImplementation` function in the :mod:`xml.dom` package or the :" -"mod:`xml.dom.minidom` module. Once you have a :class:`Document`, you can " +"mod:`!xml.dom.minidom` module. Once you have a :class:`Document`, you can " "add child nodes to it to populate the DOM::" msgstr "" @@ -161,7 +160,7 @@ msgstr "" msgid "" "When you are finished with a DOM tree, you may optionally call the :meth:" "`unlink` method to encourage early cleanup of the now-unneeded objects. :" -"meth:`unlink` is an :mod:`xml.dom.minidom`\\ -specific extension to the DOM " +"meth:`unlink` is an :mod:`!xml.dom.minidom`\\ -specific extension to the DOM " "API that renders the node and its descendants essentially useless. " "Otherwise, Python's garbage collector will eventually take care of the " "objects in the tree." @@ -176,7 +175,9 @@ msgstr "" "REC-DOM-Level-1/>`_" #: ../../library/xml.dom.minidom.rst:104 -msgid "The W3C recommendation for the DOM supported by :mod:`xml.dom.minidom`." +#, fuzzy +msgid "" +"The W3C recommendation for the DOM supported by :mod:`!xml.dom.minidom`." msgstr "W3C 對 :mod:`xml.dom.minidom` DOM 支援 的建議。" #: ../../library/xml.dom.minidom.rst:110 @@ -187,7 +188,7 @@ msgstr "DOM 物件" msgid "" "The definition of the DOM API for Python is given as part of the :mod:`xml." "dom` module documentation. This section lists the differences between the " -"API and :mod:`xml.dom.minidom`." +"API and :mod:`!xml.dom.minidom`." msgstr "" #: ../../library/xml.dom.minidom.rst:119 @@ -444,7 +445,7 @@ msgstr "minidom 和 DOM 標準" #: ../../library/xml.dom.minidom.rst:217 msgid "" -"The :mod:`xml.dom.minidom` module is essentially a DOM 1.0-compatible DOM " +"The :mod:`!xml.dom.minidom` module is essentially a DOM 1.0-compatible DOM " "with some DOM 2 features (primarily namespace features)." msgstr "" @@ -486,7 +487,7 @@ msgstr "" #: ../../library/xml.dom.minidom.rst:240 msgid "" -"The type ``DOMString`` maps to Python strings. :mod:`xml.dom.minidom` " +"The type ``DOMString`` maps to Python strings. :mod:`!xml.dom.minidom` " "supports either bytes or strings, but will normally produce strings. Values " "of type ``DOMString`` may also be ``None`` where allowed to have the IDL " "``null`` value by the DOM specification from the W3C." @@ -501,9 +502,9 @@ msgstr "" #: ../../library/xml.dom.minidom.rst:248 msgid "" -"``DOMException`` is currently not supported in :mod:`xml.dom.minidom`. " -"Instead, :mod:`xml.dom.minidom` uses standard Python exceptions such as :exc:" -"`TypeError` and :exc:`AttributeError`." +"``DOMException`` is currently not supported in :mod:`!xml.dom.minidom`. " +"Instead, :mod:`!xml.dom.minidom` uses standard Python exceptions such as :" +"exc:`TypeError` and :exc:`AttributeError`." msgstr "" #: ../../library/xml.dom.minidom.rst:252 @@ -517,7 +518,7 @@ msgstr "" #: ../../library/xml.dom.minidom.rst:258 msgid "" -"The following interfaces have no implementation in :mod:`xml.dom.minidom`:" +"The following interfaces have no implementation in :mod:`!xml.dom.minidom`:" msgstr "" #: ../../library/xml.dom.minidom.rst:260 diff --git a/library/xml.dom.po b/library/xml.dom.po index c314615086..4d45d57f16 100644 --- a/library/xml.dom.po +++ b/library/xml.dom.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -127,7 +127,7 @@ msgid "Module Contents" msgstr "模組內容" #: ../../library/xml.dom.rst:83 -msgid "The :mod:`xml.dom` contains the following functions:" +msgid "The :mod:`!xml.dom` contains the following functions:" msgstr "" #: ../../library/xml.dom.rst:88 @@ -190,7 +190,7 @@ msgstr "" #: ../../library/xml.dom.rst:138 msgid "" -"In addition, :mod:`xml.dom` contains a base :class:`Node` class and the DOM " +"In addition, :mod:`!xml.dom` contains a base :class:`Node` class and the DOM " "exception classes. The :class:`Node` class provided by this module does not " "implement any of the methods or attributes defined by the DOM specification; " "concrete DOM implementations must provide those. The :class:`Node` class " diff --git a/library/xml.dom.pulldom.po b/library/xml.dom.pulldom.po index 1b0a8c2c5a..6604dab4d7 100644 --- a/library/xml.dom.pulldom.po +++ b/library/xml.dom.pulldom.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-07-07 10:49+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,7 +28,7 @@ msgstr "**原始碼:**\\ :source:`Lib/xml/dom/pulldom.py`" #: ../../library/xml.dom.pulldom.rst:13 msgid "" -"The :mod:`xml.dom.pulldom` module provides a \"pull parser\" which can also " +"The :mod:`!xml.dom.pulldom` module provides a \"pull parser\" which can also " "be asked to produce DOM-accessible fragments of the document where " "necessary. The basic concept involves pulling \"events\" from a stream of " "incoming XML and processing them. In contrast to SAX which also employs an " @@ -230,6 +230,6 @@ msgstr "" " # 以下陳述式只會印出 '

'\n" " print(node.toxml())\n" " doc.expandNode(node)\n" -" # 以下陳述式會印出包含所有子節點的節點 '

Some " -"text

and more

'\n" +" # 以下陳述式會印出包含所有子節點的節點 '

Some text

and more

'\n" " print(node.toxml())" diff --git a/library/xml.etree.elementtree.po b/library/xml.etree.elementtree.po index 8400b9e011..57b7994251 100644 --- a/library/xml.etree.elementtree.po +++ b/library/xml.etree.elementtree.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-07-07 10:49+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,10 +26,11 @@ msgid "**Source code:** :source:`Lib/xml/etree/ElementTree.py`" msgstr "**原始碼:**\\ :source:`Lib/xml/etree/ElementTree.py`" #: ../../library/xml.etree.elementtree.rst:13 +#, fuzzy msgid "" -"The :mod:`xml.etree.ElementTree` module implements a simple and efficient " +"The :mod:`!xml.etree.ElementTree` module implements a simple and efficient " "API for parsing and creating XML data." -msgstr "" +msgstr ":mod:`!xml.etree.cElementTree` 模組已被棄用。" #: ../../library/xml.etree.elementtree.rst:16 msgid "This module will use a fast implementation whenever available." @@ -51,7 +52,7 @@ msgstr "教學" #: ../../library/xml.etree.elementtree.rst:31 msgid "" -"This is a short tutorial for using :mod:`xml.etree.ElementTree` (``ET`` in " +"This is a short tutorial for using :mod:`!xml.etree.ElementTree` (``ET`` in " "short). The goal is to demonstrate some of the building blocks and basic " "concepts of the module." msgstr "" @@ -1288,7 +1289,7 @@ msgstr "" #: ../../library/xml.etree.elementtree.rst:794 msgid "" "To process this file, load it as usual, and pass the root element to the :" -"mod:`xml.etree.ElementTree` module:" +"mod:`!xml.etree.ElementTree` module:" msgstr "" #: ../../library/xml.etree.elementtree.rst:796 diff --git a/library/xml.sax.handler.po b/library/xml.sax.handler.po index 5cf0a00d3b..49ebaa1c7d 100644 --- a/library/xml.sax.handler.po +++ b/library/xml.sax.handler.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-22 16:55+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2016-11-19 00:36+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,7 +32,7 @@ msgid "" "only need to implement those interfaces whose events they are interested in; " "they can implement the interfaces in a single object or in multiple objects. " "Handler implementations should inherit from the base classes provided in the " -"module :mod:`xml.sax.handler`, so that all methods get default " +"module :mod:`!xml.sax.handler`, so that all methods get default " "implementations." msgstr "" @@ -75,7 +75,7 @@ msgstr "" #: ../../library/xml.sax.handler.rst:56 msgid "" -"In addition to these classes, :mod:`xml.sax.handler` provides symbolic " +"In addition to these classes, :mod:`!xml.sax.handler` provides symbolic " "constants for the feature and property names." msgstr "" diff --git a/library/xml.sax.po b/library/xml.sax.po index 1df680f2aa..2f7b201d60 100644 --- a/library/xml.sax.po +++ b/library/xml.sax.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-07-07 10:49+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2016-11-19 00:36+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,7 +28,7 @@ msgstr "**原始碼:**\\ :source:`Lib/xml/sax/__init__.py`" #: ../../library/xml.sax.rst:15 msgid "" -"The :mod:`xml.sax` package provides a number of modules which implement the " +"The :mod:`!xml.sax` package provides a number of modules which implement the " "Simple API for XML (SAX) interface for Python. The package itself provides " "the SAX exceptions and the convenience functions which will be most used by " "users of the SAX API." @@ -115,13 +115,13 @@ msgid "" "interfaces are defined in the module :mod:`xml.sax.xmlreader`. The handler " "interfaces are defined in :mod:`xml.sax.handler`. For convenience, :class:" "`~xml.sax.xmlreader.InputSource` (which is often instantiated directly) and " -"the handler classes are also available from :mod:`xml.sax`. These " +"the handler classes are also available from :mod:`!xml.sax`. These " "interfaces are described below." msgstr "" #: ../../library/xml.sax.rst:94 msgid "" -"In addition to these classes, :mod:`xml.sax` provides the following " +"In addition to these classes, :mod:`!xml.sax` provides the following " "exception classes." msgstr "" diff --git a/library/xml.sax.utils.po b/library/xml.sax.utils.po index 192c9a5eec..645ae97821 100644 --- a/library/xml.sax.utils.po +++ b/library/xml.sax.utils.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-18 00:15+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2025-07-10 23:59+0800\n" "Last-Translator: Weilin Du <1372449351@qq.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,8 +28,9 @@ msgid "**Source code:** :source:`Lib/xml/sax/saxutils.py`" msgstr "**原始碼:**\\ :source:`Lib/xml/sax/saxutils.py`" #: ../../library/xml.sax.utils.rst:14 +#, fuzzy msgid "" -"The module :mod:`xml.sax.saxutils` contains a number of classes and " +"The module :mod:`!xml.sax.saxutils` contains a number of classes and " "functions that are commonly useful when creating SAX applications, either in " "direct use, or as base classes." msgstr "" diff --git a/library/xmlrpc.client.po b/library/xmlrpc.client.po index c9194b1450..a31eed7be0 100644 --- a/library/xmlrpc.client.po +++ b/library/xmlrpc.client.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-25 00:15+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,14 +36,14 @@ msgstr "" #: ../../library/xmlrpc.client.rst:26 msgid "" -"The :mod:`xmlrpc.client` module is not secure against maliciously " +"The :mod:`!xmlrpc.client` module is not secure against maliciously " "constructed data. If you need to parse untrusted or unauthenticated data, " "see :ref:`xml-security`." msgstr "" #: ../../library/xmlrpc.client.rst:32 msgid "" -"For HTTPS URIs, :mod:`xmlrpc.client` now performs all the necessary " +"For HTTPS URIs, :mod:`!xmlrpc.client` now performs all the necessary " "certificate and hostname checks by default." msgstr "" diff --git a/library/xmlrpc.server.po b/library/xmlrpc.server.po index dd98b45ae4..344719271b 100644 --- a/library/xmlrpc.server.po +++ b/library/xmlrpc.server.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-07-07 10:49+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,8 +26,9 @@ msgid "**Source code:** :source:`Lib/xmlrpc/server.py`" msgstr "**原始碼:**\\ :source:`Lib/xmlrpc/server.py`" #: ../../library/xmlrpc.server.rst:14 +#, fuzzy msgid "" -"The :mod:`xmlrpc.server` module provides a basic server framework for XML-" +"The :mod:`!xmlrpc.server` module provides a basic server framework for XML-" "RPC servers written in Python. Servers can either be free standing, using :" "class:`SimpleXMLRPCServer`, or embedded in a CGI environment, using :class:" "`CGIXMLRPCRequestHandler`." @@ -37,8 +38,9 @@ msgstr "" "CGI 環境中(使用 :class:`CGIXMLRPCRequestHandler`)。" #: ../../library/xmlrpc.server.rst:22 +#, fuzzy msgid "" -"The :mod:`xmlrpc.server` module is not secure against maliciously " +"The :mod:`!xmlrpc.server` module is not secure against maliciously " "constructed data. If you need to parse untrusted or unauthenticated data, " "see :ref:`xml-security`." msgstr "" @@ -79,14 +81,14 @@ msgstr "" "建立一個新的伺服器實例。此類別提供了可被 XML-RPC 協定呼叫之函式的註冊方法。" "*requestHandler* 參數應該是請求處理器實例的工廠(factory);它預設為 :class:" "`SimpleXMLRPCRequestHandler`。*addr* 和 *requestHandler* 參數會傳遞給 :class:" -"`socketserver.TCPServer` 建構函式。如果 *logRequests* 為 true(預設值),請求會" -"被記錄;將此參數設定為 false 將關閉記錄。*allow_none* 和 *encoding* 參數會傳" -"遞給 :mod:`xmlrpc.client` 並控制從伺服器回傳的 XML-RPC 回應。*bind_and_" -"activate* 參數控制建構函式是否立即呼叫 :meth:`server_bind` 和 :meth:`server_" -"activate`;它預設為 true。將其設定為 false 允許程式碼在位址被綁定之前操作 " -"*allow_reuse_address* 類別變數。*use_builtin_types* 參數會傳遞給 :func:" -"`~xmlrpc.client.loads` 函式,並控制在接收到日期/時間值或二進位資料時要處理哪" -"些型別;它預設為 false。" +"`socketserver.TCPServer` 建構函式。如果 *logRequests* 為 true(預設值),請求" +"會被記錄;將此參數設定為 false 將關閉記錄。*allow_none* 和 *encoding* 參數會" +"傳遞給 :mod:`xmlrpc.client` 並控制從伺服器回傳的 XML-RPC 回應。" +"*bind_and_activate* 參數控制建構函式是否立即呼叫 :meth:`server_bind` 和 :" +"meth:`server_activate`;它預設為 true。將其設定為 false 允許程式碼在位址被綁" +"定之前操作 *allow_reuse_address* 類別變數。*use_builtin_types* 參數會傳遞給 :" +"func:`~xmlrpc.client.loads` 函式,並控制在接收到日期/時間值或二進位資料時要處" +"理哪些型別;它預設為 false。" #: ../../library/xmlrpc.server.rst:48 ../../library/xmlrpc.server.rst:62 #: ../../library/xmlrpc.server.rst:374 @@ -103,9 +105,9 @@ msgid "" "binary data are received; it defaults to false." msgstr "" "建立一個新的實例以在 CGI 環境中處理 XML-RPC 請求。*allow_none* 和 *encoding* " -"參數會傳遞給 :mod:`xmlrpc.client` 並控制從伺服器回傳的 XML-RPC 回應。*use_" -"builtin_types* 參數會傳遞給 :func:`~xmlrpc.client.loads` 函式,並控制在接收到" -"日期/時間值或二進位資料時要處理哪些型別;它預設為 false。" +"參數會傳遞給 :mod:`xmlrpc.client` 並控制從伺服器回傳的 XML-RPC 回應。" +"*use_builtin_types* 參數會傳遞給 :func:`~xmlrpc.client.loads` 函式,並控制在" +"接收到日期/時間值或二進位資料時要處理哪些型別;它預設為 false。" #: ../../library/xmlrpc.server.rst:68 msgid "" @@ -113,8 +115,8 @@ msgid "" "``POST`` requests and modifies logging so that the *logRequests* parameter " "to the :class:`SimpleXMLRPCServer` constructor parameter is honored." msgstr "" -"建立一個新的請求處理器實例。此請求處理器支援 ``POST`` 請求,並修改日誌記錄功能以" -"遵守 :class:`SimpleXMLRPCServer` 建構函式的 *logRequests* 參數。" +"建立一個新的請求處理器實例。此請求處理器支援 ``POST`` 請求,並修改日誌記錄功" +"能以遵守 :class:`SimpleXMLRPCServer` 建構函式的 *logRequests* 參數。" #: ../../library/xmlrpc.server.rst:76 msgid "SimpleXMLRPCServer Objects" @@ -126,8 +128,8 @@ msgid "" "TCPServer` and provides a means of creating simple, stand alone XML-RPC " "servers." msgstr "" -":class:`SimpleXMLRPCServer` 類別是基於 :class:`socketserver.TCPServer` 的,並提供" -"了建立簡單、獨立 XML-RPC 伺服器的方式。" +":class:`SimpleXMLRPCServer` 類別是基於 :class:`socketserver.TCPServer` 的,並" +"提供了建立簡單、獨立 XML-RPC 伺服器的方式。" #: ../../library/xmlrpc.server.rst:85 ../../library/xmlrpc.server.rst:299 msgid "" @@ -284,7 +286,8 @@ msgstr "" " return x + y\n" " server.register_function(adder_function, 'add')\n" "\n" -" # 註冊一個實例;該實例的所有方法都會被發布為 XML-RPC 方法(在此例中僅 'mul')。\n" +" # 註冊一個實例;該實例的所有方法都會被發布為 XML-RPC 方法(在此例中僅 " +"'mul')。\n" " class MyFuncs:\n" " def mul(self, x, y):\n" " return x * y\n" @@ -327,8 +330,8 @@ msgid "" ":meth:`register_function` can also be used as a decorator. The previous " "server example can register functions in a decorator way::" msgstr "" -":meth:`register_function` 也可以用作裝飾器。前述的伺服器範例可以用裝飾器方式註" -"冊函式: ::" +":meth:`register_function` 也可以用作裝飾器。前述的伺服器範例可以用裝飾器方式" +"註冊函式: ::" #: ../../library/xmlrpc.server.rst:198 msgid "" @@ -391,8 +394,8 @@ msgid "" "The following example included in the :file:`Lib/xmlrpc/server.py` module " "shows a server allowing dotted names and registering a multicall function." msgstr "" -"以下包含在 :file:`Lib/xmlrpc/server.py` 模組中的範例展示了一個允許點分隔名稱並" -"註冊多重呼叫函式的伺服器。" +"以下包含在 :file:`Lib/xmlrpc/server.py` 模組中的範例展示了一個允許點分隔名稱" +"並註冊多重呼叫函式的伺服器。" #: ../../library/xmlrpc.server.rst:231 msgid "" @@ -400,8 +403,8 @@ msgid "" "module's global variables and may allow intruders to execute arbitrary code " "on your machine. Only use this example only within a secure, closed network." msgstr "" -"啟用 *allow_dotted_names* 選項來允許入侵者存取你模組的全域變數,並可能允許入侵" -"者在你的機器上執行任意程式碼。請在安全、封閉的網路中才使用此範例。" +"啟用 *allow_dotted_names* 選項來允許入侵者存取你模組的全域變數,並可能允許入" +"侵者在你的機器上執行任意程式碼。請在安全、封閉的網路中才使用此範例。" #: ../../library/xmlrpc.server.rst:237 msgid "" @@ -519,8 +522,8 @@ msgid "" "The :class:`CGIXMLRPCRequestHandler` class can be used to handle XML-RPC " "requests sent to Python CGI scripts." msgstr "" -":class:`CGIXMLRPCRequestHandler` 類別可用於處理發送到 Python CGI 指令稿的 XML-" -"RPC 請求。" +":class:`CGIXMLRPCRequestHandler` 類別可用於處理發送到 Python CGI 指令稿的 " +"XML-RPC 請求。" #: ../../library/xmlrpc.server.rst:314 msgid "" @@ -536,12 +539,12 @@ msgid "" "the parameters from the request, and the return value is passed back to " "the client." msgstr "" -"註冊一個物件,用於公開尚未使用 :meth:`register_function` 註冊的方法名稱。如" -"果實例包含 :meth:`_dispatch` 方法,它會以請求的方法名稱和來自請求的參數來被" -"呼叫;回傳值會作為結果回傳給用戶端。如果實例沒有 :meth:`_dispatch` 方法,則" -"會搜尋與請求方法名稱匹配的屬性;如果請求的方法名稱包含句點,方法名稱的每個組" -"成部分會被單獨搜尋,從而執行簡單的階層式搜尋。從此搜尋中找到的值會以來自請求" -"的參數被呼叫,並將回傳值傳回給用戶端。" +"註冊一個物件,用於公開尚未使用 :meth:`register_function` 註冊的方法名稱。如果" +"實例包含 :meth:`_dispatch` 方法,它會以請求的方法名稱和來自請求的參數來被呼" +"叫;回傳值會作為結果回傳給用戶端。如果實例沒有 :meth:`_dispatch` 方法,則會搜" +"尋與請求方法名稱匹配的屬性;如果請求的方法名稱包含句點,方法名稱的每個組成部" +"分會被單獨搜尋,從而執行簡單的階層式搜尋。從此搜尋中找到的值會以來自請求的參" +"數被呼叫,並將回傳值傳回給用戶端。" #: ../../library/xmlrpc.server.rst:328 msgid "" @@ -605,9 +608,9 @@ msgid "" "class:`DocXMLRPCServer`, or embedded in a CGI environment, using :class:" "`DocCGIXMLRPCRequestHandler`." msgstr "" -"這些類別擴充了上述類別,來為 HTTP GET 請求於回應中提供 HTML 文件。伺服器可以是獨立" -"執行的(使用 :class:`DocXMLRPCServer`),或嵌入在 CGI 環境中(使用 :class:" -"`DocCGIXMLRPCRequestHandler`)。" +"這些類別擴充了上述類別,來為 HTTP GET 請求於回應中提供 HTML 文件。伺服器可以" +"是獨立執行的(使用 :class:`DocXMLRPCServer`),或嵌入在 CGI 環境中(使用 :" +"class:`DocCGIXMLRPCRequestHandler`)。" #: ../../library/xmlrpc.server.rst:370 msgid "" @@ -630,8 +633,8 @@ msgid "" "parameter is honored." msgstr "" "建立一個新的請求處理器實例。此請求處理器支援 XML-RPC POST 請求、文件 GET 請" -"求,並修改日誌記錄功能以遵守 :class:`DocXMLRPCServer` 建構函式的 *logRequests* 參" -"數。" +"求,並修改日誌記錄功能以遵守 :class:`DocXMLRPCServer` 建構函式的 " +"*logRequests* 參數。" #: ../../library/xmlrpc.server.rst:394 msgid "DocXMLRPCServer Objects" @@ -647,8 +650,9 @@ msgid "" "documentation." msgstr "" ":class:`DocXMLRPCServer` 類別衍生自 :class:`SimpleXMLRPCServer`,並提供了建立" -"自我記錄 (self-documenting) 的獨立 XML-RPC 伺服器的方式。HTTP POST 請求會被作為 XML-RPC 方法呼叫來" -"處理。HTTP GET 請求會透過產生 pydoc 風格的 HTML 文件來處理。這允許伺服器提供自己的網頁文件。" +"自我記錄 (self-documenting) 的獨立 XML-RPC 伺服器的方式。HTTP POST 請求會被作" +"為 XML-RPC 方法呼叫來處理。HTTP GET 請求會透過產生 pydoc 風格的 HTML 文件來處" +"理。這允許伺服器提供自己的網頁文件。" #: ../../library/xmlrpc.server.rst:405 ../../library/xmlrpc.server.rst:433 msgid "" @@ -662,8 +666,8 @@ msgid "" "Set the name used in the generated HTML documentation. This name will appear " "at the top of the generated documentation inside a \"h1\" element." msgstr "" -"設定在產生的 HTML 文件中使用的名稱。此名稱將顯示在產生的文件頂部的 \"h1\" 元素" -"內。" +"設定在產生的 HTML 文件中使用的名稱。此名稱將顯示在產生的文件頂部的 \"h1\" 元" +"素內。" #: ../../library/xmlrpc.server.rst:417 ../../library/xmlrpc.server.rst:445 msgid "" @@ -671,8 +675,8 @@ msgid "" "description will appear as a paragraph, below the server name, in the " "documentation." msgstr "" -"設定在產生的 HTML 文件中使用的描述。此描述將作為一個段落顯示在文件中伺服器名稱的" -"下方。" +"設定在產生的 HTML 文件中使用的描述。此描述將作為一個段落顯示在文件中伺服器名" +"稱的下方。" #: ../../library/xmlrpc.server.rst:422 msgid "DocCGIXMLRPCRequestHandler" @@ -688,5 +692,5 @@ msgid "" msgstr "" ":class:`DocCGIXMLRPCRequestHandler` 類別衍生自 :class:" "`CGIXMLRPCRequestHandler`,並提供了建立自我記錄的 XML-RPC CGI 指令稿的方法。" -"HTTP POST 請求會被作為 XML-RPC 方法呼叫來處理。HTTP GET 請求會透過產生 pydoc 風" -"格的 HTML 文件來處理。這允許伺服器提供自己的網頁文件。" +"HTTP POST 請求會被作為 XML-RPC 方法呼叫來處理。HTTP GET 請求會透過產生 pydoc " +"風格的 HTML 文件來處理。這允許伺服器提供自己的網頁文件。" diff --git a/library/zipapp.po b/library/zipapp.po index 8f95f56180..3a483a3f97 100644 --- a/library/zipapp.po +++ b/library/zipapp.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-01 22:24+0800\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2025-07-13 16:00+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -128,9 +128,10 @@ msgid "" "a package/module in the archive, and \"fn\" is a callable in the given " "module. The ``__main__.py`` file will execute that callable." msgstr "" -"在封存檔案中寫入一個執行 *mainfn* 的 ``__main__.py`` 檔案。*mainfn* 引數應為" -" \"pkg.mod:fn\" 的形式,其中 \"pkg.mod\" 是封存檔案中的一個套件/模組,而 \"fn\" 是" -"給定模組中的一個可呼叫物件。``__main__.py`` 檔案將會執行該可呼叫物件。" +"在封存檔案中寫入一個執行 *mainfn* 的 ``__main__.py`` 檔案。*mainfn* 引數應為 " +"\"pkg.mod:fn\" 的形式,其中 \"pkg.mod\" 是封存檔案中的一個套件/模組,而 " +"\"fn\" 是給定模組中的一個可呼叫物件。``__main__.py`` 檔案將會執行該可呼叫物" +"件。" #: ../../library/zipapp.rst:80 msgid ":option:`--main` cannot be specified when copying an archive." @@ -231,8 +232,8 @@ msgid "" "the target will be a file with the same name as the source, with a ``.pyz`` " "extension added." msgstr "" -"如果省略了 target(或為 ``None``),則 source 必須是一個目錄,而 target 將" -"是一個與 source 同名的檔案,並加上 ``.pyz`` 副檔名。" +"如果省略了 target(或為 ``None``),則 source 必須是一個目錄,而 target 將是" +"一個與 source 同名的檔案,並加上 ``.pyz`` 副檔名。" #: ../../library/zipapp.rst:137 msgid "" @@ -395,10 +396,10 @@ msgid "" "errors, but production code should do so. Also, this method will only work " "if the archive fits in memory::" msgstr "" -"要原地 (in place) 更新檔案,請使用 :class:`~io.BytesIO` 物件在記憶體中進行替換,然後再覆" -"寫來源檔案。請注意,原地覆寫檔案存在風險,錯誤可能導致原始檔案遺失。這段程式" -"碼沒有防範此類錯誤,但生產環境的程式碼應作此類防護。此外,此方法只有在封存檔" -"案能容納於記憶體中時才有效: ::" +"要原地 (in place) 更新檔案,請使用 :class:`~io.BytesIO` 物件在記憶體中進行替" +"換,然後再覆寫來源檔案。請注意,原地覆寫檔案存在風險,錯誤可能導致原始檔案遺" +"失。這段程式碼沒有防範此類錯誤,但生產環境的程式碼應作此類防護。此外,此方法" +"只有在封存檔案能容納於記憶體中時才有效: ::" #: ../../library/zipapp.rst:225 msgid "" @@ -475,8 +476,9 @@ msgid "Creating Standalone Applications with zipapp" msgstr "使用 zipapp 建立獨立應用程式" #: ../../library/zipapp.rst:261 +#, fuzzy msgid "" -"Using the :mod:`zipapp` module, it is possible to create self-contained " +"Using the :mod:`!zipapp` module, it is possible to create self-contained " "Python programs, which can be distributed to end users who only need to have " "a suitable version of Python installed on their system. The key to doing " "this is to bundle all of the application's dependencies into the archive, " diff --git a/library/zipfile.po b/library/zipfile.po index dbf77d9e43..889d3cea9f 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-30 00:16+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2025-06-26 20:00+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -46,9 +46,9 @@ msgid "" "cannot create an encrypted file. Decryption is extremely slow as it is " "implemented in native Python rather than C." msgstr "" -"本模組不處理多組件 (multipart) ZIP 檔案。它可以處理使用 ZIP64 擴充(即大於 4 GiB 的 " -"ZIP 檔案)的 ZIP 檔案。它支援解密 ZIP 封存檔案中的加密檔案,但目前無法建立加" -"密檔案。解密速度極慢,因為它是在原生 Python 中實作,而不是 C。" +"本模組不處理多組件 (multipart) ZIP 檔案。它可以處理使用 ZIP64 擴充(即大於 4 " +"GiB 的 ZIP 檔案)的 ZIP 檔案。它支援解密 ZIP 封存檔案中的加密檔案,但目前無法" +"建立加密檔案。解密速度極慢,因為它是在原生 Python 中實作,而不是 C。" #: ../../library/zipfile.rst:29 msgid "" @@ -100,10 +100,11 @@ msgid "Class for creating ZIP archives containing Python libraries." msgstr "用於建立包含 Python 函式庫的 ZIP 封存檔案的類別。" #: ../../library/zipfile.rst:83 +#, fuzzy msgid "" "Class used to represent information about a member of an archive. Instances " "of this class are returned by the :meth:`.getinfo` and :meth:`.infolist` " -"methods of :class:`ZipFile` objects. Most users of the :mod:`zipfile` " +"methods of :class:`ZipFile` objects. Most users of the :mod:`!zipfile` " "module will not need to create these, but only use those created by this " "module. *filename* should be the full name of the archive member, and " "*date_time* should be a tuple containing six fields which describe the time " @@ -273,10 +274,11 @@ msgstr "" "發 :exc:`RuntimeError`。預設為 :const:`ZIP_STORED`。" #: ../../library/zipfile.rst:210 +#, fuzzy msgid "" "If *allowZip64* is ``True`` (the default) zipfile will create ZIP files that " "use the ZIP64 extensions when the zipfile is larger than 4 GiB. If it is " -"``false`` :mod:`zipfile` will raise an exception when the ZIP file would " +"``false`` :mod:`!zipfile` will raise an exception when the ZIP file would " "require ZIP64 extensions." msgstr "" "如果 *allowZip64* 為 ``True``\\ (預設值),當 zipfile 大於 4 GiB 時," @@ -358,8 +360,8 @@ msgid "" "*metadata_encoding* is an instance-wide setting for the ZipFile. It is not " "possible to set this on a per-member basis." msgstr "" -"*metadata_encoding* 是 ZipFile 的一個實例範圍設定。無法以每個成員為基礎來" -"設定此項。" +"*metadata_encoding* 是 ZipFile 的一個實例範圍設定。無法以每個成員為基礎來設定" +"此項。" #: ../../library/zipfile.rst:253 msgid "" @@ -1382,8 +1384,9 @@ msgid "Command-line interface" msgstr "命令列介面" #: ../../library/zipfile.rst:960 +#, fuzzy msgid "" -"The :mod:`zipfile` module provides a simple command-line interface to " +"The :mod:`!zipfile` module provides a simple command-line interface to " "interact with ZIP archives." msgstr "" ":mod:`zipfile` 模組提供了一個簡單的命令列介面,用以與 ZIP 封存檔案互動。" diff --git a/library/zipimport.po b/library/zipimport.po index 28c18c861b..36f36cece8 100644 --- a/library/zipimport.po +++ b/library/zipimport.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-01 00:19+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2025-06-29 00:00+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,10 +28,11 @@ msgid "**Source code:** :source:`Lib/zipimport.py`" msgstr "**原始碼:**\\ :source:`Lib/zipimport.py`" #: ../../library/zipimport.rst:13 +#, fuzzy msgid "" "This module adds the ability to import Python modules (:file:`\\*.py`, :file:" "`\\*.pyc`) and packages from ZIP-format archives. It is usually not needed " -"to use the :mod:`zipimport` module explicitly; it is automatically used by " +"to use the :mod:`!zipimport` module explicitly; it is automatically used by " "the built-in :keyword:`import` mechanism for :data:`sys.path` items that are " "paths to ZIP archives." msgstr "" @@ -271,9 +272,10 @@ msgid "Examples" msgstr "範例" #: ../../library/zipimport.rst:186 +#, fuzzy msgid "" "Here is an example that imports a module from a ZIP archive - note that the :" -"mod:`zipimport` module is not explicitly used." +"mod:`!zipimport` module is not explicitly used." msgstr "" "這是一個從 ZIP 封存檔案引入模組的範例——請注意,:mod:`zipimport` 模組並未被明" "確使用。" diff --git a/library/zoneinfo.po b/library/zoneinfo.po index e9f6f15c1c..f22298a7ed 100644 --- a/library/zoneinfo.po +++ b/library/zoneinfo.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-29 00:16+0000\n" +"POT-Creation-Date: 2026-02-07 00:19+0000\n" "PO-Revision-Date: 2025-06-21 20:00+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,10 +26,11 @@ msgid "**Source code:** :source:`Lib/zoneinfo`" msgstr "**原始碼:**\\ :source:`Lib/zoneinfo`" #: ../../library/zoneinfo.rst:16 +#, fuzzy msgid "" -"The :mod:`zoneinfo` module provides a concrete time zone implementation to " +"The :mod:`!zoneinfo` module provides a concrete time zone implementation to " "support the IANA time zone database as originally specified in :pep:`615`. " -"By default, :mod:`zoneinfo` uses the system's time zone data if available; " +"By default, :mod:`!zoneinfo` uses the system's time zone data if available; " "if no system time zone data is available, the library will fall back to " "using the first-party :pypi:`tzdata` package available on PyPI." msgstr ""