From 1078dfa1af92d40e16217d645d13c10724bc76cd Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Tue, 20 Aug 2024 00:05:21 +0000
Subject: [PATCH 01/16] sync with cpython 8edfa0b0
---
library/struct.po | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/library/struct.po b/library/struct.po
index 99b24f210d..d2d01b2376 100644
--- a/library/struct.po
+++ b/library/struct.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-05-09 00:03+0000\n"
+"POT-Creation-Date: 2024-08-20 00:04+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-"
@@ -606,8 +606,7 @@ msgstr "新增 ``'e'`` 格式的支援。"
#: ../../library/struct.rst:278
msgid ""
"The ``'?'`` conversion code corresponds to the :c:expr:`_Bool` type defined "
-"by C99. If this type is not available, it is simulated using a :c:expr:"
-"`char`. In standard mode, it is always represented by one byte."
+"by C standards since C99. In standard mode, it is represented by one byte."
msgstr ""
#: ../../library/struct.rst:283
From d8d44260a38e8d03ccc23a00620ac7d1cf19f03b Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Mon, 26 Aug 2024 00:05:13 +0000
Subject: [PATCH 02/16] sync with cpython ffa282cc
---
deprecations/index.po | 139 ++++++++---------
deprecations/pending-removal-in-3.16.po | 6 +-
deprecations/pending-removal-in-future.po | 134 ++++++++--------
library/stdtypes.po | 5 +-
library/traceback.po | 176 +++++++++++-----------
whatsnew/3.12.po | 141 ++++++++---------
6 files changed, 306 insertions(+), 295 deletions(-)
diff --git a/deprecations/index.po b/deprecations/index.po
index e0f777fd23..32cf4def29 100644
--- a/deprecations/index.po
+++ b/deprecations/index.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-31 00:03+0000\n"
+"POT-Creation-Date: 2024-08-26 00:03+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -590,6 +590,11 @@ msgstr ""
"``'w'`` 型別 (``Py_UCS4``)。"
#: ../../deprecations/pending-removal-in-3.16.rst:8
+#, fuzzy
+msgid ":mod:`builtins`: ``~bool``, bitwise inversion on bool."
+msgstr "``~bool``,對 bool 進行位元反轉。"
+
+#: ../../deprecations/pending-removal-in-3.16.rst:11
msgid ""
":mod:`symtable`: Deprecate :meth:`symtable.Class.get_methods` due to the "
"lack of interest. (Contributed by Bénédikt Tran in :gh:`119698`.)"
@@ -623,14 +628,10 @@ msgid ":mod:`builtins`:"
msgstr ":mod:`builtins`:"
#: ../../deprecations/pending-removal-in-future.rst:14
-msgid "``~bool``, bitwise inversion on bool."
-msgstr "``~bool``,對 bool 進行位元反轉。"
-
-#: ../../deprecations/pending-removal-in-future.rst:15
msgid "``bool(NotImplemented)``."
msgstr "``bool(NotImplemented)``。"
-#: ../../deprecations/pending-removal-in-future.rst:16
+#: ../../deprecations/pending-removal-in-future.rst:15
msgid ""
"Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature "
"is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single "
@@ -639,7 +640,7 @@ msgstr ""
"產生器:``throw(type, exc, tb)`` 和 ``athrow(type, exc, tb)`` 簽名已被棄用:"
"請改用 ``throw(exc)`` 和 ``athrow(exc)``,為單引數簽名。"
-#: ../../deprecations/pending-removal-in-future.rst:19
+#: ../../deprecations/pending-removal-in-future.rst:18
msgid ""
"Currently Python accepts numeric literals immediately followed by keywords, "
"for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and "
@@ -657,7 +658,7 @@ msgstr ""
"`in`、:keyword:`is` 和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版"
"本中,它將被更改為語法錯誤。(:gh:`87999`)"
-#: ../../deprecations/pending-removal-in-future.rst:27
+#: ../../deprecations/pending-removal-in-future.rst:26
msgid ""
"Support for ``__index__()`` and ``__int__()`` method returning non-int type: "
"these methods will be required to return an instance of a strict subclass "
@@ -666,7 +667,7 @@ msgstr ""
"``__index__()`` 和 ``__int__()`` 方法回傳非 int 型別的支援:這些方法將需要回"
"傳 :class:`int` 的嚴格子類別實例。"
-#: ../../deprecations/pending-removal-in-future.rst:30
+#: ../../deprecations/pending-removal-in-future.rst:29
msgid ""
"Support for ``__float__()`` method returning a strict subclass of :class:"
"`float`: these methods will be required to return an instance of :class:"
@@ -675,7 +676,7 @@ msgstr ""
"回傳 :class:`float` 嚴格子類別 ``__float__()`` 方法的支援:這些方法將需要回"
"傳 :class:`float` 的實例。"
-#: ../../deprecations/pending-removal-in-future.rst:33
+#: ../../deprecations/pending-removal-in-future.rst:32
msgid ""
"Support for ``__complex__()`` method returning a strict subclass of :class:"
"`complex`: these methods will be required to return an instance of :class:"
@@ -684,11 +685,11 @@ msgstr ""
"回傳 :class:`complex` 嚴格子類別 ``__complex__()`` 方法的支援:這些方法將需要"
"回傳 :class:`complex` 的實例。"
-#: ../../deprecations/pending-removal-in-future.rst:36
+#: ../../deprecations/pending-removal-in-future.rst:35
msgid "Delegation of ``int()`` to ``__trunc__()`` method."
msgstr "將 ``int()`` 委派給 ``__trunc__()`` 方法。"
-#: ../../deprecations/pending-removal-in-future.rst:37
+#: ../../deprecations/pending-removal-in-future.rst:36
msgid ""
"Passing a complex number as the *real* or *imag* argument in the :func:"
"`complex` constructor is now deprecated; it should only be passed as a "
@@ -698,7 +699,7 @@ msgstr ""
"在 :func:`complex` 建構子中將複數作為 *real* 或 *imag* 引數傳遞現在已被棄用;"
"它應該只作為單個位置引數傳遞。 (由 Serhiy Storchaka 於 :gh:`109218` 貢獻。)"
-#: ../../deprecations/pending-removal-in-future.rst:42
+#: ../../deprecations/pending-removal-in-future.rst:41
msgid ""
":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants "
"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar."
@@ -708,18 +709,18 @@ msgstr ""
"被 :data:`calendar.JANUARY` 和 :data:`calendar.FEBRUARY` 取代。 (由 Prince "
"Roshan 於 :gh:`103636` 貢獻。)"
-#: ../../deprecations/pending-removal-in-future.rst:47
+#: ../../deprecations/pending-removal-in-future.rst:46
msgid ""
":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method "
"instead."
msgstr ""
":attr:`codeobject.co_lnotab`:請改用 :meth:`codeobject.co_lines` 方法。"
-#: ../../deprecations/pending-removal-in-future.rst:50
+#: ../../deprecations/pending-removal-in-future.rst:49
msgid ":mod:`datetime`:"
msgstr ":mod:`datetime`:"
-#: ../../deprecations/pending-removal-in-future.rst:52
+#: ../../deprecations/pending-removal-in-future.rst:51
msgid ""
":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime."
"UTC)``."
@@ -727,7 +728,7 @@ msgstr ""
":meth:`~datetime.datetime.utcnow`:請改用 ``datetime.datetime."
"now(tz=datetime.UTC)``。"
-#: ../../deprecations/pending-removal-in-future.rst:54
+#: ../../deprecations/pending-removal-in-future.rst:53
msgid ""
":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime."
"fromtimestamp(timestamp, tz=datetime.UTC)``."
@@ -735,19 +736,19 @@ msgstr ""
":meth:`~datetime.datetime.utcfromtimestamp`:請改用 ``datetime.datetime."
"fromtimestamp(timestamp, tz=datetime.UTC)``。"
-#: ../../deprecations/pending-removal-in-future.rst:57
+#: ../../deprecations/pending-removal-in-future.rst:56
msgid ":mod:`gettext`: Plural value must be an integer."
msgstr ":mod:`gettext`:複數值必須是整數。"
-#: ../../deprecations/pending-removal-in-future.rst:59
+#: ../../deprecations/pending-removal-in-future.rst:58
msgid ":mod:`importlib`:"
msgstr ":mod:`importlib`:"
-#: ../../deprecations/pending-removal-in-future.rst:61
+#: ../../deprecations/pending-removal-in-future.rst:60
msgid "``load_module()`` method: use ``exec_module()`` instead."
msgstr "``load_module()`` method:請改用 ``exec_module()``。"
-#: ../../deprecations/pending-removal-in-future.rst:62
+#: ../../deprecations/pending-removal-in-future.rst:61
msgid ""
":func:`~importlib.util.cache_from_source` *debug_override* parameter is "
"deprecated: use the *optimization* parameter instead."
@@ -755,31 +756,31 @@ msgstr ""
":func:`~importlib.util.cache_from_source` *debug_override* 參數已被棄用:請改"
"用 *optimization* 參數。"
-#: ../../deprecations/pending-removal-in-future.rst:65
+#: ../../deprecations/pending-removal-in-future.rst:64
msgid ":mod:`importlib.metadata`:"
msgstr ":mod:`importlib.metadata`:"
-#: ../../deprecations/pending-removal-in-future.rst:67
+#: ../../deprecations/pending-removal-in-future.rst:66
msgid "``EntryPoints`` tuple interface."
msgstr "``EntryPoints`` 元組介面。"
-#: ../../deprecations/pending-removal-in-future.rst:68
+#: ../../deprecations/pending-removal-in-future.rst:67
msgid "Implicit ``None`` on return values."
msgstr "回傳值上的隱式 ``None``。"
-#: ../../deprecations/pending-removal-in-future.rst:70
+#: ../../deprecations/pending-removal-in-future.rst:69
msgid ""
":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use "
"BytesIO and binary mode instead."
msgstr ""
":mod:`mailbox`:已棄用 StringIO 輸入和文本模式,請改用 BytesIO 和二進位模式。"
-#: ../../deprecations/pending-removal-in-future.rst:73
+#: ../../deprecations/pending-removal-in-future.rst:72
msgid ""
":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process."
msgstr ":mod:`os`:在多執行緒行程中呼叫 :func:`os.register_at_fork`。"
-#: ../../deprecations/pending-removal-in-future.rst:75
+#: ../../deprecations/pending-removal-in-future.rst:74
msgid ""
":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is "
"deprecated, use an exception instance."
@@ -787,7 +788,7 @@ msgstr ""
":class:`!pydoc.ErrorDuringImport`:*exc_info* 參數的元組值已被棄用,請用例外"
"實例。"
-#: ../../deprecations/pending-removal-in-future.rst:78
+#: ../../deprecations/pending-removal-in-future.rst:77
msgid ""
":mod:`re`: More strict rules are now applied for numerical group references "
"and group names in regular expressions. Only sequence of ASCII digits is "
@@ -799,12 +800,12 @@ msgstr ""
"有 ASCII 數碼序列被接受作為數值參照。位元組模式和替換字串中的群組名稱現在只能"
"包含 ASCII 字母、數碼和底線。(由 Serhiy Storchaka 於 :gh:`91760` 貢獻。)"
-#: ../../deprecations/pending-removal-in-future.rst:85
+#: ../../deprecations/pending-removal-in-future.rst:84
msgid ""
":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules."
msgstr ":mod:`!sre_compile`、:mod:`!sre_constants` 和 :mod:`!sre_parse` 模組。"
-#: ../../deprecations/pending-removal-in-future.rst:87
+#: ../../deprecations/pending-removal-in-future.rst:86
msgid ""
":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in "
"Python 3.12; use the *onexc* parameter instead."
@@ -812,15 +813,15 @@ msgstr ""
":mod:`shutil`::func:`~shutil.rmtree` 的 *onerror* 參數在 Python 3.12 中已被"
"棄用;請改用 *onexc* 參數。"
-#: ../../deprecations/pending-removal-in-future.rst:90
+#: ../../deprecations/pending-removal-in-future.rst:89
msgid ":mod:`ssl` options and protocols:"
msgstr ":mod:`ssl` 選項和協定:"
-#: ../../deprecations/pending-removal-in-future.rst:92
+#: ../../deprecations/pending-removal-in-future.rst:91
msgid ":class:`ssl.SSLContext` without protocol argument is deprecated."
msgstr "不帶協定引數的 :class:`ssl.SSLContext` 已被棄用。"
-#: ../../deprecations/pending-removal-in-future.rst:93
+#: ../../deprecations/pending-removal-in-future.rst:92
msgid ""
":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:"
"`!selected_npn_protocol` are deprecated: use ALPN instead."
@@ -828,58 +829,58 @@ msgstr ""
":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` 和 :meth:"
"`!selected_npn_protocol` 已被棄用:請改用 ALPN。"
-#: ../../deprecations/pending-removal-in-future.rst:96
+#: ../../deprecations/pending-removal-in-future.rst:95
msgid "``ssl.OP_NO_SSL*`` options"
msgstr "``ssl.OP_NO_SSL*`` 選項"
-#: ../../deprecations/pending-removal-in-future.rst:97
+#: ../../deprecations/pending-removal-in-future.rst:96
msgid "``ssl.OP_NO_TLS*`` options"
msgstr "``ssl.OP_NO_TLS*`` 選項"
-#: ../../deprecations/pending-removal-in-future.rst:98
+#: ../../deprecations/pending-removal-in-future.rst:97
msgid "``ssl.PROTOCOL_SSLv3``"
msgstr "``ssl.PROTOCOL_SSLv3``"
-#: ../../deprecations/pending-removal-in-future.rst:99
+#: ../../deprecations/pending-removal-in-future.rst:98
msgid "``ssl.PROTOCOL_TLS``"
msgstr "``ssl.PROTOCOL_TLS``"
-#: ../../deprecations/pending-removal-in-future.rst:100
+#: ../../deprecations/pending-removal-in-future.rst:99
msgid "``ssl.PROTOCOL_TLSv1``"
msgstr "``ssl.PROTOCOL_TLSv1``"
-#: ../../deprecations/pending-removal-in-future.rst:101
+#: ../../deprecations/pending-removal-in-future.rst:100
msgid "``ssl.PROTOCOL_TLSv1_1``"
msgstr "``ssl.PROTOCOL_TLSv1_1``"
-#: ../../deprecations/pending-removal-in-future.rst:102
+#: ../../deprecations/pending-removal-in-future.rst:101
msgid "``ssl.PROTOCOL_TLSv1_2``"
msgstr "``ssl.PROTOCOL_TLSv1_2``"
-#: ../../deprecations/pending-removal-in-future.rst:103
+#: ../../deprecations/pending-removal-in-future.rst:102
msgid "``ssl.TLSVersion.SSLv3``"
msgstr "``ssl.TLSVersion.SSLv3``"
-#: ../../deprecations/pending-removal-in-future.rst:104
+#: ../../deprecations/pending-removal-in-future.rst:103
msgid "``ssl.TLSVersion.TLSv1``"
msgstr "``ssl.TLSVersion.TLSv1``"
-#: ../../deprecations/pending-removal-in-future.rst:105
+#: ../../deprecations/pending-removal-in-future.rst:104
msgid "``ssl.TLSVersion.TLSv1_1``"
msgstr "``ssl.TLSVersion.TLSv1_1``"
-#: ../../deprecations/pending-removal-in-future.rst:107
+#: ../../deprecations/pending-removal-in-future.rst:106
msgid ""
":func:`sysconfig.is_python_build` *check_home* parameter is deprecated and "
"ignored."
msgstr ""
":func:`sysconfig.is_python_build` 的 *check_home* 參數已被棄用並被忽略。"
-#: ../../deprecations/pending-removal-in-future.rst:110
+#: ../../deprecations/pending-removal-in-future.rst:109
msgid ":mod:`threading` methods:"
msgstr ":mod:`threading` 方法:"
-#: ../../deprecations/pending-removal-in-future.rst:112
+#: ../../deprecations/pending-removal-in-future.rst:111
msgid ""
":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition."
"notify_all`."
@@ -887,11 +888,11 @@ msgstr ""
":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition."
"notify_all`。"
-#: ../../deprecations/pending-removal-in-future.rst:113
+#: ../../deprecations/pending-removal-in-future.rst:112
msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`."
msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set`。"
-#: ../../deprecations/pending-removal-in-future.rst:114
+#: ../../deprecations/pending-removal-in-future.rst:113
msgid ""
":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :"
"attr:`threading.Thread.daemon` attribute."
@@ -899,7 +900,7 @@ msgstr ""
":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請"
"用 :attr:`threading.Thread.daemon` 屬性。"
-#: ../../deprecations/pending-removal-in-future.rst:116
+#: ../../deprecations/pending-removal-in-future.rst:115
msgid ""
":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :"
"attr:`threading.Thread.name` attribute."
@@ -907,20 +908,20 @@ msgstr ""
":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :"
"attr:`threading.Thread.name` 屬性。"
-#: ../../deprecations/pending-removal-in-future.rst:118
+#: ../../deprecations/pending-removal-in-future.rst:117
msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`."
msgstr ""
":meth:`!threading.currentThread`:請用 :meth:`threading.current_thread`。"
-#: ../../deprecations/pending-removal-in-future.rst:119
+#: ../../deprecations/pending-removal-in-future.rst:118
msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`."
msgstr ":meth:`!threading.activeCount`:請用 :meth:`threading.active_count`。"
-#: ../../deprecations/pending-removal-in-future.rst:121
+#: ../../deprecations/pending-removal-in-future.rst:120
msgid ":class:`typing.Text` (:gh:`92332`)."
msgstr ":class:`typing.Text` (:gh:`92332`)。"
-#: ../../deprecations/pending-removal-in-future.rst:123
+#: ../../deprecations/pending-removal-in-future.rst:122
msgid ""
":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a "
"value that is not ``None`` from a test case."
@@ -928,58 +929,58 @@ msgstr ""
":class:`unittest.IsolatedAsyncioTestCase`:從測試案例中回傳非 ``None`` 的值已"
"被棄用。"
-#: ../../deprecations/pending-removal-in-future.rst:126
+#: ../../deprecations/pending-removal-in-future.rst:125
msgid ""
":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` "
"instead"
msgstr ""
":mod:`urllib.parse` 已棄用函式:請改用 :func:`~urllib.parse.urlparse`。"
-#: ../../deprecations/pending-removal-in-future.rst:128
+#: ../../deprecations/pending-removal-in-future.rst:127
msgid "``splitattr()``"
msgstr "``splitattr()``"
-#: ../../deprecations/pending-removal-in-future.rst:129
+#: ../../deprecations/pending-removal-in-future.rst:128
msgid "``splithost()``"
msgstr "``splithost()``"
-#: ../../deprecations/pending-removal-in-future.rst:130
+#: ../../deprecations/pending-removal-in-future.rst:129
msgid "``splitnport()``"
msgstr "``splitnport()``"
-#: ../../deprecations/pending-removal-in-future.rst:131
+#: ../../deprecations/pending-removal-in-future.rst:130
msgid "``splitpasswd()``"
msgstr "``splitpasswd()``"
-#: ../../deprecations/pending-removal-in-future.rst:132
+#: ../../deprecations/pending-removal-in-future.rst:131
msgid "``splitport()``"
msgstr "``splitport()``"
-#: ../../deprecations/pending-removal-in-future.rst:133
+#: ../../deprecations/pending-removal-in-future.rst:132
msgid "``splitquery()``"
msgstr "``splitquery()``"
-#: ../../deprecations/pending-removal-in-future.rst:134
+#: ../../deprecations/pending-removal-in-future.rst:133
msgid "``splittag()``"
msgstr "``splittag()``"
-#: ../../deprecations/pending-removal-in-future.rst:135
+#: ../../deprecations/pending-removal-in-future.rst:134
msgid "``splittype()``"
msgstr "``splittype()``"
-#: ../../deprecations/pending-removal-in-future.rst:136
+#: ../../deprecations/pending-removal-in-future.rst:135
msgid "``splituser()``"
msgstr "``splituser()``"
-#: ../../deprecations/pending-removal-in-future.rst:137
+#: ../../deprecations/pending-removal-in-future.rst:136
msgid "``splitvalue()``"
msgstr "``splitvalue()``"
-#: ../../deprecations/pending-removal-in-future.rst:138
+#: ../../deprecations/pending-removal-in-future.rst:137
msgid "``to_bytes()``"
msgstr "``to_bytes()``"
-#: ../../deprecations/pending-removal-in-future.rst:140
+#: ../../deprecations/pending-removal-in-future.rst:139
msgid ""
":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:"
"`~urllib.request.FancyURLopener` style of invoking requests is deprecated. "
@@ -989,13 +990,13 @@ msgstr ""
"class:`~urllib.request.FancyURLopener` 風格已被棄用。請改用更新的 :func:"
"`~urllib.request.urlopen` 函式和方法。"
-#: ../../deprecations/pending-removal-in-future.rst:144
+#: ../../deprecations/pending-removal-in-future.rst:143
msgid ""
":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial "
"writes."
msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分寫入。"
-#: ../../deprecations/pending-removal-in-future.rst:147
+#: ../../deprecations/pending-removal-in-future.rst:146
msgid ""
":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml."
"etree.ElementTree.Element` is deprecated. In a future release it will always "
@@ -1006,7 +1007,7 @@ msgstr ""
"Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 "
"``len(elem)`` 或 ``elem is not None`` 測試。"
-#: ../../deprecations/pending-removal-in-future.rst:152
+#: ../../deprecations/pending-removal-in-future.rst:151
msgid ""
":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:"
"`~zipimport.zipimporter.exec_module` instead."
diff --git a/deprecations/pending-removal-in-3.16.po b/deprecations/pending-removal-in-3.16.po
index a77fad9e91..fba64fac4d 100644
--- a/deprecations/pending-removal-in-3.16.po
+++ b/deprecations/pending-removal-in-3.16.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-28 00:03+0000\n"
+"POT-Creation-Date: 2024-08-26 00:03+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -28,6 +28,10 @@ msgstr ""
"``'w'`` 型別 (``Py_UCS4``)。"
#: ../../deprecations/pending-removal-in-3.16.rst:8
+msgid ":mod:`builtins`: ``~bool``, bitwise inversion on bool."
+msgstr ""
+
+#: ../../deprecations/pending-removal-in-3.16.rst:11
msgid ""
":mod:`symtable`: Deprecate :meth:`symtable.Class.get_methods` due to the "
"lack of interest. (Contributed by Bénédikt Tran in :gh:`119698`.)"
diff --git a/deprecations/pending-removal-in-future.po b/deprecations/pending-removal-in-future.po
index 11a43f5e49..161cea158c 100644
--- a/deprecations/pending-removal-in-future.po
+++ b/deprecations/pending-removal-in-future.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-28 00:03+0000\n"
+"POT-Creation-Date: 2024-08-26 00:03+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -42,21 +42,17 @@ msgid ":mod:`builtins`:"
msgstr ""
#: ../../deprecations/pending-removal-in-future.rst:14
-msgid "``~bool``, bitwise inversion on bool."
-msgstr ""
-
-#: ../../deprecations/pending-removal-in-future.rst:15
msgid "``bool(NotImplemented)``."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:16
+#: ../../deprecations/pending-removal-in-future.rst:15
msgid ""
"Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature "
"is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single "
"argument signature."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:19
+#: ../../deprecations/pending-removal-in-future.rst:18
msgid ""
"Currently Python accepts numeric literals immediately followed by keywords, "
"for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and "
@@ -68,32 +64,32 @@ msgid ""
"syntax error. (:gh:`87999`)"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:27
+#: ../../deprecations/pending-removal-in-future.rst:26
msgid ""
"Support for ``__index__()`` and ``__int__()`` method returning non-int type: "
"these methods will be required to return an instance of a strict subclass "
"of :class:`int`."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:30
+#: ../../deprecations/pending-removal-in-future.rst:29
msgid ""
"Support for ``__float__()`` method returning a strict subclass of :class:"
"`float`: these methods will be required to return an instance of :class:"
"`float`."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:33
+#: ../../deprecations/pending-removal-in-future.rst:32
msgid ""
"Support for ``__complex__()`` method returning a strict subclass of :class:"
"`complex`: these methods will be required to return an instance of :class:"
"`complex`."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:36
+#: ../../deprecations/pending-removal-in-future.rst:35
msgid "Delegation of ``int()`` to ``__trunc__()`` method."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:37
+#: ../../deprecations/pending-removal-in-future.rst:36
msgid ""
"Passing a complex number as the *real* or *imag* argument in the :func:"
"`complex` constructor is now deprecated; it should only be passed as a "
@@ -101,83 +97,83 @@ msgid ""
"`109218`.)"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:42
+#: ../../deprecations/pending-removal-in-future.rst:41
msgid ""
":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants "
"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar."
"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:47
+#: ../../deprecations/pending-removal-in-future.rst:46
msgid ""
":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method "
"instead."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:50
+#: ../../deprecations/pending-removal-in-future.rst:49
msgid ":mod:`datetime`:"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:52
+#: ../../deprecations/pending-removal-in-future.rst:51
msgid ""
":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime."
"UTC)``."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:54
+#: ../../deprecations/pending-removal-in-future.rst:53
msgid ""
":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime."
"fromtimestamp(timestamp, tz=datetime.UTC)``."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:57
+#: ../../deprecations/pending-removal-in-future.rst:56
msgid ":mod:`gettext`: Plural value must be an integer."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:59
+#: ../../deprecations/pending-removal-in-future.rst:58
msgid ":mod:`importlib`:"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:61
+#: ../../deprecations/pending-removal-in-future.rst:60
msgid "``load_module()`` method: use ``exec_module()`` instead."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:62
+#: ../../deprecations/pending-removal-in-future.rst:61
msgid ""
":func:`~importlib.util.cache_from_source` *debug_override* parameter is "
"deprecated: use the *optimization* parameter instead."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:65
+#: ../../deprecations/pending-removal-in-future.rst:64
msgid ":mod:`importlib.metadata`:"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:67
+#: ../../deprecations/pending-removal-in-future.rst:66
msgid "``EntryPoints`` tuple interface."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:68
+#: ../../deprecations/pending-removal-in-future.rst:67
msgid "Implicit ``None`` on return values."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:70
+#: ../../deprecations/pending-removal-in-future.rst:69
msgid ""
":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use "
"BytesIO and binary mode instead."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:73
+#: ../../deprecations/pending-removal-in-future.rst:72
msgid ""
":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:75
+#: ../../deprecations/pending-removal-in-future.rst:74
msgid ""
":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is "
"deprecated, use an exception instance."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:78
+#: ../../deprecations/pending-removal-in-future.rst:77
msgid ""
":mod:`re`: More strict rules are now applied for numerical group references "
"and group names in regular expressions. Only sequence of ASCII digits is "
@@ -186,185 +182,185 @@ msgid ""
"underscore. (Contributed by Serhiy Storchaka in :gh:`91760`.)"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:85
+#: ../../deprecations/pending-removal-in-future.rst:84
msgid ""
":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:87
+#: ../../deprecations/pending-removal-in-future.rst:86
msgid ""
":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in "
"Python 3.12; use the *onexc* parameter instead."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:90
+#: ../../deprecations/pending-removal-in-future.rst:89
msgid ":mod:`ssl` options and protocols:"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:92
+#: ../../deprecations/pending-removal-in-future.rst:91
msgid ":class:`ssl.SSLContext` without protocol argument is deprecated."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:93
+#: ../../deprecations/pending-removal-in-future.rst:92
msgid ""
":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:"
"`!selected_npn_protocol` are deprecated: use ALPN instead."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:96
+#: ../../deprecations/pending-removal-in-future.rst:95
msgid "``ssl.OP_NO_SSL*`` options"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:97
+#: ../../deprecations/pending-removal-in-future.rst:96
msgid "``ssl.OP_NO_TLS*`` options"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:98
+#: ../../deprecations/pending-removal-in-future.rst:97
msgid "``ssl.PROTOCOL_SSLv3``"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:99
+#: ../../deprecations/pending-removal-in-future.rst:98
msgid "``ssl.PROTOCOL_TLS``"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:100
+#: ../../deprecations/pending-removal-in-future.rst:99
msgid "``ssl.PROTOCOL_TLSv1``"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:101
+#: ../../deprecations/pending-removal-in-future.rst:100
msgid "``ssl.PROTOCOL_TLSv1_1``"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:102
+#: ../../deprecations/pending-removal-in-future.rst:101
msgid "``ssl.PROTOCOL_TLSv1_2``"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:103
+#: ../../deprecations/pending-removal-in-future.rst:102
msgid "``ssl.TLSVersion.SSLv3``"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:104
+#: ../../deprecations/pending-removal-in-future.rst:103
msgid "``ssl.TLSVersion.TLSv1``"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:105
+#: ../../deprecations/pending-removal-in-future.rst:104
msgid "``ssl.TLSVersion.TLSv1_1``"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:107
+#: ../../deprecations/pending-removal-in-future.rst:106
msgid ""
":func:`sysconfig.is_python_build` *check_home* parameter is deprecated and "
"ignored."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:110
+#: ../../deprecations/pending-removal-in-future.rst:109
msgid ":mod:`threading` methods:"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:112
+#: ../../deprecations/pending-removal-in-future.rst:111
msgid ""
":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition."
"notify_all`."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:113
+#: ../../deprecations/pending-removal-in-future.rst:112
msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:114
+#: ../../deprecations/pending-removal-in-future.rst:113
msgid ""
":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :"
"attr:`threading.Thread.daemon` attribute."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:116
+#: ../../deprecations/pending-removal-in-future.rst:115
msgid ""
":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :"
"attr:`threading.Thread.name` attribute."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:118
+#: ../../deprecations/pending-removal-in-future.rst:117
msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:119
+#: ../../deprecations/pending-removal-in-future.rst:118
msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:121
+#: ../../deprecations/pending-removal-in-future.rst:120
msgid ":class:`typing.Text` (:gh:`92332`)."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:123
+#: ../../deprecations/pending-removal-in-future.rst:122
msgid ""
":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a "
"value that is not ``None`` from a test case."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:126
+#: ../../deprecations/pending-removal-in-future.rst:125
msgid ""
":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` "
"instead"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:128
+#: ../../deprecations/pending-removal-in-future.rst:127
msgid "``splitattr()``"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:129
+#: ../../deprecations/pending-removal-in-future.rst:128
msgid "``splithost()``"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:130
+#: ../../deprecations/pending-removal-in-future.rst:129
msgid "``splitnport()``"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:131
+#: ../../deprecations/pending-removal-in-future.rst:130
msgid "``splitpasswd()``"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:132
+#: ../../deprecations/pending-removal-in-future.rst:131
msgid "``splitport()``"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:133
+#: ../../deprecations/pending-removal-in-future.rst:132
msgid "``splitquery()``"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:134
+#: ../../deprecations/pending-removal-in-future.rst:133
msgid "``splittag()``"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:135
+#: ../../deprecations/pending-removal-in-future.rst:134
msgid "``splittype()``"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:136
+#: ../../deprecations/pending-removal-in-future.rst:135
msgid "``splituser()``"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:137
+#: ../../deprecations/pending-removal-in-future.rst:136
msgid "``splitvalue()``"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:138
+#: ../../deprecations/pending-removal-in-future.rst:137
msgid "``to_bytes()``"
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:140
+#: ../../deprecations/pending-removal-in-future.rst:139
msgid ""
":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:"
"`~urllib.request.FancyURLopener` style of invoking requests is deprecated. "
"Use newer :func:`~urllib.request.urlopen` functions and methods."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:144
+#: ../../deprecations/pending-removal-in-future.rst:143
msgid ""
":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial "
"writes."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:147
+#: ../../deprecations/pending-removal-in-future.rst:146
msgid ""
":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml."
"etree.ElementTree.Element` is deprecated. In a future release it will always "
@@ -372,7 +368,7 @@ msgid ""
"instead."
msgstr ""
-#: ../../deprecations/pending-removal-in-future.rst:152
+#: ../../deprecations/pending-removal-in-future.rst:151
msgid ""
":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:"
"`~zipimport.zipimporter.exec_module` instead."
diff --git a/library/stdtypes.po b/library/stdtypes.po
index 4580a76e60..da60a2e25b 100644
--- a/library/stdtypes.po
+++ b/library/stdtypes.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-08 00:03+0000\n"
+"POT-Creation-Date: 2024-08-26 00:03+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-"
@@ -1229,9 +1229,10 @@ msgstr ""
"用邏輯運算子 ``and``、``or`` 和 ``!=`` 而不是 ``&``、``|`` 和 ``^``。"
#: ../../library/stdtypes.rst:834
+#, fuzzy
msgid ""
"The use of the bitwise inversion operator ``~`` is deprecated and will raise "
-"an error in Python 3.14."
+"an error in Python 3.16."
msgstr "位元反轉運算子 ``~`` 的使用已被棄用並且將在 Python 3.14 中引發錯誤。"
#: ../../library/stdtypes.rst:837
diff --git a/library/traceback.po b/library/traceback.po
index 0d1cf22ee5..999a0dc8e2 100644
--- a/library/traceback.po
+++ b/library/traceback.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-05-09 00:03+0000\n"
+"POT-Creation-Date: 2024-08-26 00:03+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-"
@@ -76,42 +76,50 @@ msgid ""
"output."
msgstr ""
-#: ../../library/traceback.rst:45 ../../library/traceback.rst:110
+#: ../../library/traceback.rst:47
+msgid ""
+"The meaning of the *limit* parameter is different than the meaning of :const:"
+"`sys.tracebacklimit`. A negative *limit* value corresponds to a positive "
+"value of :const:`!sys.tracebacklimit`, whereas the behaviour of a positive "
+"*limit* value cannot be achieved with :const:`!sys.tracebacklimit`."
+msgstr ""
+
+#: ../../library/traceback.rst:53 ../../library/traceback.rst:118
msgid "Added negative *limit* support."
msgstr "新增負數 *limit* 的支援。"
-#: ../../library/traceback.rst:52
+#: ../../library/traceback.rst:60
msgid ""
"Print exception information and stack trace entries from :ref:`traceback "
"object ` *tb* to *file*. This differs from :func:"
"`print_tb` in the following ways:"
msgstr ""
-#: ../../library/traceback.rst:57
+#: ../../library/traceback.rst:65
msgid ""
"if *tb* is not ``None``, it prints a header ``Traceback (most recent call "
"last):``"
msgstr ""
-#: ../../library/traceback.rst:60
+#: ../../library/traceback.rst:68
msgid "it prints the exception type and *value* after the stack trace"
msgstr ""
-#: ../../library/traceback.rst:64
+#: ../../library/traceback.rst:72
msgid ""
"if *type(value)* is :exc:`SyntaxError` and *value* has the appropriate "
"format, it prints the line where the syntax error occurred with a caret "
"indicating the approximate position of the error."
msgstr ""
-#: ../../library/traceback.rst:68
+#: ../../library/traceback.rst:76
msgid ""
"Since Python 3.10, instead of passing *value* and *tb*, an exception object "
"can be passed as the first argument. If *value* and *tb* are provided, the "
"first argument is ignored in order to provide backwards compatibility."
msgstr ""
-#: ../../library/traceback.rst:72
+#: ../../library/traceback.rst:80
msgid ""
"The optional *limit* argument has the same meaning as for :func:`print_tb`. "
"If *chain* is true (the default), then chained exceptions (the :attr:"
@@ -120,29 +128,29 @@ msgid ""
"when printing an unhandled exception."
msgstr ""
-#: ../../library/traceback.rst:79 ../../library/traceback.rst:176
+#: ../../library/traceback.rst:87 ../../library/traceback.rst:184
msgid "The *etype* argument is ignored and inferred from the type of *value*."
msgstr ""
-#: ../../library/traceback.rst:82 ../../library/traceback.rst:159
+#: ../../library/traceback.rst:90 ../../library/traceback.rst:167
msgid ""
"The *etype* parameter has been renamed to *exc* and is now positional-only."
msgstr ""
-#: ../../library/traceback.rst:89
+#: ../../library/traceback.rst:97
msgid ""
"This is a shorthand for ``print_exception(sys.exception(), limit, file, "
"chain)``."
msgstr ""
-#: ../../library/traceback.rst:95
+#: ../../library/traceback.rst:103
msgid ""
"This is a shorthand for ``print_exception(sys.last_exc, limit, file, "
"chain)``. In general it will work only after an exception has reached an "
"interactive prompt (see :data:`sys.last_exc`)."
msgstr ""
-#: ../../library/traceback.rst:102
+#: ../../library/traceback.rst:110
msgid ""
"Print up to *limit* stack trace entries (starting from the invocation point) "
"if *limit* is positive. Otherwise, print the last ``abs(limit)`` entries. "
@@ -152,7 +160,7 @@ msgid ""
"for :func:`print_tb`."
msgstr ""
-#: ../../library/traceback.rst:116
+#: ../../library/traceback.rst:124
msgid ""
"Return a :class:`StackSummary` object representing a list of \"pre-"
"processed\" stack trace entries extracted from the :ref:`traceback object "
@@ -165,7 +173,7 @@ msgid ""
"for a stack trace."
msgstr ""
-#: ../../library/traceback.rst:129
+#: ../../library/traceback.rst:137
msgid ""
"Extract the raw traceback from the current :ref:`stack frame `. The return value has the same format as for :func:`extract_tb`. "
@@ -173,7 +181,7 @@ msgid ""
"`print_stack`."
msgstr ""
-#: ../../library/traceback.rst:137
+#: ../../library/traceback.rst:145
msgid ""
"Given a list of tuples or :class:`FrameSummary` objects as returned by :func:"
"`extract_tb` or :func:`extract_stack`, return a list of strings ready for "
@@ -183,7 +191,7 @@ msgid ""
"text line is not ``None``."
msgstr ""
-#: ../../library/traceback.rst:147
+#: ../../library/traceback.rst:155
msgid ""
"Format the exception part of a traceback using an exception value such as "
"given by :data:`sys.last_value`. The return value is a list of strings, "
@@ -194,20 +202,20 @@ msgid ""
"contains the exception's :attr:`notes `."
msgstr ""
-#: ../../library/traceback.rst:155
+#: ../../library/traceback.rst:163
msgid ""
"Since Python 3.10, instead of passing *value*, an exception object can be "
"passed as the first argument. If *value* is provided, the first argument is "
"ignored in order to provide backwards compatibility."
msgstr ""
-#: ../../library/traceback.rst:163
+#: ../../library/traceback.rst:171
msgid ""
"The returned list now includes any :attr:`notes ` "
"attached to the exception."
msgstr ""
-#: ../../library/traceback.rst:170
+#: ../../library/traceback.rst:178
msgid ""
"Format a stack trace and the exception information. The arguments have the "
"same meaning as the corresponding arguments to :func:`print_exception`. The "
@@ -216,68 +224,68 @@ msgid ""
"printed, exactly the same text is printed as does :func:`print_exception`."
msgstr ""
-#: ../../library/traceback.rst:179
+#: ../../library/traceback.rst:187
msgid ""
"This function's behavior and signature were modified to match :func:"
"`print_exception`."
msgstr ""
-#: ../../library/traceback.rst:186
+#: ../../library/traceback.rst:194
msgid ""
"This is like ``print_exc(limit)`` but returns a string instead of printing "
"to a file."
msgstr ""
-#: ../../library/traceback.rst:192
+#: ../../library/traceback.rst:200
msgid "A shorthand for ``format_list(extract_tb(tb, limit))``."
msgstr "``format_list(extract_tb(tb, limit))`` 的簡寫。"
-#: ../../library/traceback.rst:197
+#: ../../library/traceback.rst:205
msgid "A shorthand for ``format_list(extract_stack(f, limit))``."
msgstr "``format_list(extract_stack(f, limit))`` 的簡寫。"
-#: ../../library/traceback.rst:201
+#: ../../library/traceback.rst:209
msgid ""
"Clears the local variables of all the stack frames in a :ref:`traceback "
"` *tb* by calling the :meth:`~frame.clear` method of "
"each :ref:`frame object `."
msgstr ""
-#: ../../library/traceback.rst:210
+#: ../../library/traceback.rst:218
msgid ""
"Walk a stack following :attr:`f.f_back ` from the given frame, "
"yielding the frame and line number for each frame. If *f* is ``None``, the "
"current stack is used. This helper is used with :meth:`StackSummary.extract`."
msgstr ""
-#: ../../library/traceback.rst:219
+#: ../../library/traceback.rst:227
msgid ""
"Walk a traceback following :attr:`~traceback.tb_next` yielding the frame and "
"line number for each frame. This helper is used with :meth:`StackSummary."
"extract`."
msgstr ""
-#: ../../library/traceback.rst:225
+#: ../../library/traceback.rst:233
msgid "The module also defines the following classes:"
msgstr ""
-#: ../../library/traceback.rst:228
+#: ../../library/traceback.rst:236
msgid ":class:`!TracebackException` Objects"
msgstr ":class:`!TracebackException` 物件"
-#: ../../library/traceback.rst:232
+#: ../../library/traceback.rst:240
msgid ""
":class:`!TracebackException` objects are created from actual exceptions to "
"capture data for later printing in a lightweight fashion."
msgstr ""
-#: ../../library/traceback.rst:237 ../../library/traceback.rst:336
+#: ../../library/traceback.rst:245 ../../library/traceback.rst:344
msgid ""
"Capture an exception for later rendering. *limit*, *lookup_lines* and "
"*capture_locals* are as for the :class:`StackSummary` class."
msgstr ""
-#: ../../library/traceback.rst:240
+#: ../../library/traceback.rst:248
msgid ""
"If *compact* is true, only data that is required by :class:`!"
"TracebackException`'s :meth:`format` method is saved in the class "
@@ -285,12 +293,12 @@ msgid ""
"if :attr:`__cause__` is ``None`` and :attr:`__suppress_context__` is false."
msgstr ""
-#: ../../library/traceback.rst:246 ../../library/traceback.rst:339
+#: ../../library/traceback.rst:254 ../../library/traceback.rst:347
msgid ""
"Note that when locals are captured, they are also shown in the traceback."
msgstr ""
-#: ../../library/traceback.rst:248
+#: ../../library/traceback.rst:256
msgid ""
"*max_group_width* and *max_group_depth* control the formatting of exception "
"groups (see :exc:`BaseExceptionGroup`). The depth refers to the nesting "
@@ -299,118 +307,118 @@ msgid ""
"limit is exceeded."
msgstr ""
-#: ../../library/traceback.rst:254
+#: ../../library/traceback.rst:262
msgid "Added the *compact* parameter."
msgstr "新增 *compact* 參數。"
-#: ../../library/traceback.rst:257
+#: ../../library/traceback.rst:265
msgid "Added the *max_group_width* and *max_group_depth* parameters."
msgstr "新增 *max_group_width* 和 *max_group_depth* 參數。"
-#: ../../library/traceback.rst:262
+#: ../../library/traceback.rst:270
msgid ""
"A :class:`!TracebackException` of the original :attr:`~BaseException."
"__cause__`."
msgstr ""
-#: ../../library/traceback.rst:267
+#: ../../library/traceback.rst:275
msgid ""
"A :class:`!TracebackException` of the original :attr:`~BaseException."
"__context__`."
msgstr ""
-#: ../../library/traceback.rst:272
+#: ../../library/traceback.rst:280
msgid ""
"If ``self`` represents an :exc:`ExceptionGroup`, this field holds a list of :"
"class:`!TracebackException` instances representing the nested exceptions. "
"Otherwise it is ``None``."
msgstr ""
-#: ../../library/traceback.rst:280
+#: ../../library/traceback.rst:288
msgid ""
"The :attr:`~BaseException.__suppress_context__` value from the original "
"exception."
msgstr ""
-#: ../../library/traceback.rst:285
+#: ../../library/traceback.rst:293
msgid ""
"The :attr:`~BaseException.__notes__` value from the original exception, or "
"``None`` if the exception does not have any notes. If it is not ``None`` is "
"it formatted in the traceback after the exception string."
msgstr ""
-#: ../../library/traceback.rst:294
+#: ../../library/traceback.rst:302
msgid "A :class:`StackSummary` representing the traceback."
msgstr ""
-#: ../../library/traceback.rst:298
+#: ../../library/traceback.rst:306
msgid "The class of the original traceback."
msgstr ""
-#: ../../library/traceback.rst:302
+#: ../../library/traceback.rst:310
msgid "For syntax errors - the file name where the error occurred."
msgstr ""
-#: ../../library/traceback.rst:306
+#: ../../library/traceback.rst:314
msgid "For syntax errors - the line number where the error occurred."
msgstr ""
-#: ../../library/traceback.rst:310
+#: ../../library/traceback.rst:318
msgid ""
"For syntax errors - the end line number where the error occurred. Can be "
"``None`` if not present."
msgstr ""
-#: ../../library/traceback.rst:317
+#: ../../library/traceback.rst:325
msgid "For syntax errors - the text where the error occurred."
msgstr ""
-#: ../../library/traceback.rst:321
+#: ../../library/traceback.rst:329
msgid "For syntax errors - the offset into the text where the error occurred."
msgstr ""
-#: ../../library/traceback.rst:325
+#: ../../library/traceback.rst:333
msgid ""
"For syntax errors - the end offset into the text where the error occurred. "
"Can be ``None`` if not present."
msgstr ""
-#: ../../library/traceback.rst:332
+#: ../../library/traceback.rst:340
msgid "For syntax errors - the compiler error message."
msgstr ""
-#: ../../library/traceback.rst:343
+#: ../../library/traceback.rst:351
msgid ""
"Print to *file* (default ``sys.stderr``) the exception information returned "
"by :meth:`format`."
msgstr ""
-#: ../../library/traceback.rst:350
+#: ../../library/traceback.rst:358
msgid "Format the exception."
msgstr ""
-#: ../../library/traceback.rst:352
+#: ../../library/traceback.rst:360
msgid ""
"If *chain* is not ``True``, :attr:`__cause__` and :attr:`__context__` will "
"not be formatted."
msgstr ""
-#: ../../library/traceback.rst:355
+#: ../../library/traceback.rst:363
msgid ""
"The return value is a generator of strings, each ending in a newline and "
"some containing internal newlines. :func:`~traceback.print_exception` is a "
"wrapper around this method which just prints the lines to a file."
msgstr ""
-#: ../../library/traceback.rst:361
+#: ../../library/traceback.rst:369
msgid "Format the exception part of the traceback."
msgstr ""
-#: ../../library/traceback.rst:363
+#: ../../library/traceback.rst:371
msgid "The return value is a generator of strings, each ending in a newline."
msgstr ""
-#: ../../library/traceback.rst:365
+#: ../../library/traceback.rst:373
msgid ""
"The generator emits the exception's message followed by its notes (if it has "
"any). The exception message is normally a single string; however, for :exc:"
@@ -418,28 +426,28 @@ msgid ""
"display detailed information about where the syntax error occurred."
msgstr ""
-#: ../../library/traceback.rst:371
+#: ../../library/traceback.rst:379
msgid ""
"The exception's :attr:`notes ` are now included in "
"the output."
msgstr ""
-#: ../../library/traceback.rst:378
+#: ../../library/traceback.rst:386
msgid ":class:`!StackSummary` Objects"
msgstr ":class:`!StackSummary` 物件"
-#: ../../library/traceback.rst:382
+#: ../../library/traceback.rst:390
msgid ""
":class:`!StackSummary` objects represent a call stack ready for formatting."
msgstr ""
-#: ../../library/traceback.rst:388
+#: ../../library/traceback.rst:396
msgid ""
"Construct a :class:`!StackSummary` object from a frame generator (such as is "
"returned by :func:`~traceback.walk_stack` or :func:`~traceback.walk_tb`)."
msgstr ""
-#: ../../library/traceback.rst:392
+#: ../../library/traceback.rst:400
msgid ""
"If *limit* is supplied, only this many frames are taken from *frame_gen*. If "
"*lookup_lines* is ``False``, the returned :class:`FrameSummary` objects will "
@@ -449,20 +457,20 @@ msgid ""
"class:`!FrameSummary` are captured as object representations."
msgstr ""
-#: ../../library/traceback.rst:400
+#: ../../library/traceback.rst:408
msgid ""
"Exceptions raised from :func:`repr` on a local variable (when "
"*capture_locals* is ``True``) are no longer propagated to the caller."
msgstr ""
-#: ../../library/traceback.rst:406
+#: ../../library/traceback.rst:414
msgid ""
"Construct a :class:`!StackSummary` object from a supplied list of :class:"
"`FrameSummary` objects or old-style list of tuples. Each tuple should be a "
"4-tuple with *filename*, *lineno*, *name*, *line* as the elements."
msgstr ""
-#: ../../library/traceback.rst:413
+#: ../../library/traceback.rst:421
msgid ""
"Returns a list of strings ready for printing. Each string in the resulting "
"list corresponds to a single :ref:`frame ` from the stack. "
@@ -470,18 +478,18 @@ msgid ""
"well, for those items with source text lines."
msgstr ""
-#: ../../library/traceback.rst:419
+#: ../../library/traceback.rst:427
msgid ""
"For long sequences of the same frame and line, the first few repetitions are "
"shown, followed by a summary line stating the exact number of further "
"repetitions."
msgstr ""
-#: ../../library/traceback.rst:423
+#: ../../library/traceback.rst:431
msgid "Long sequences of repeated frames are now abbreviated."
msgstr ""
-#: ../../library/traceback.rst:428
+#: ../../library/traceback.rst:436
msgid ""
"Returns a string for printing one of the :ref:`frames ` "
"involved in the stack. This method is called for each :class:`FrameSummary` "
@@ -489,17 +497,17 @@ msgid ""
"the frame is omitted from the output."
msgstr ""
-#: ../../library/traceback.rst:438
+#: ../../library/traceback.rst:446
msgid ":class:`!FrameSummary` Objects"
msgstr ":class:`!FrameSummary` 物件"
-#: ../../library/traceback.rst:442
+#: ../../library/traceback.rst:450
msgid ""
"A :class:`!FrameSummary` object represents a single :ref:`frame ` in a :ref:`traceback `."
msgstr ""
-#: ../../library/traceback.rst:447
+#: ../../library/traceback.rst:455
msgid ""
"Represents a single :ref:`frame ` in the :ref:`traceback "
"` or stack that is being formatted or printed. It may "
@@ -513,38 +521,38 @@ msgid ""
"display."
msgstr ""
-#: ../../library/traceback.rst:458
+#: ../../library/traceback.rst:466
msgid ":class:`!FrameSummary` instances have the following attributes:"
msgstr ""
-#: ../../library/traceback.rst:462
+#: ../../library/traceback.rst:470
msgid ""
"The filename of the source code for this frame. Equivalent to accessing :"
"attr:`f.f_code.co_filename ` on a :ref:`frame object "
"` *f*."
msgstr ""
-#: ../../library/traceback.rst:468
+#: ../../library/traceback.rst:476
msgid "The line number of the source code for this frame."
msgstr ""
-#: ../../library/traceback.rst:472
+#: ../../library/traceback.rst:480
msgid ""
"Equivalent to accessing :attr:`f.f_code.co_name ` on a :"
"ref:`frame object ` *f*."
msgstr ""
-#: ../../library/traceback.rst:477
+#: ../../library/traceback.rst:485
msgid ""
"A string representing the source code for this frame, with leading and "
"trailing whitespace stripped. If the source is not available, it is ``None``."
msgstr ""
-#: ../../library/traceback.rst:484
+#: ../../library/traceback.rst:492
msgid "Traceback Examples"
msgstr ""
-#: ../../library/traceback.rst:486
+#: ../../library/traceback.rst:494
msgid ""
"This simple example implements a basic read-eval-print loop, similar to (but "
"less useful than) the standard Python interactive interpreter loop. For a "
@@ -552,23 +560,23 @@ msgid ""
"`code` module. ::"
msgstr ""
-#: ../../library/traceback.rst:508
+#: ../../library/traceback.rst:516
msgid ""
"The following example demonstrates the different ways to print and format "
"the exception and traceback:"
msgstr ""
-#: ../../library/traceback.rst:543
+#: ../../library/traceback.rst:551
msgid "The output for the example would look similar to this:"
msgstr ""
-#: ../../library/traceback.rst:585
+#: ../../library/traceback.rst:593
msgid ""
"The following example shows the different ways to print and format the "
"stack::"
msgstr ""
-#: ../../library/traceback.rst:611
+#: ../../library/traceback.rst:619
msgid "This last example demonstrates the final few formatting functions:"
msgstr ""
@@ -580,10 +588,10 @@ msgstr "object(物件)"
msgid "traceback"
msgstr "traceback"
-#: ../../library/traceback.rst:62
+#: ../../library/traceback.rst:70
msgid "^ (caret)"
msgstr "^ (插入符號)"
-#: ../../library/traceback.rst:62
+#: ../../library/traceback.rst:70
msgid "marker"
msgstr "marker(標記)"
diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po
index 1f15c8c518..dd572bf66c 100644
--- a/whatsnew/3.12.po
+++ b/whatsnew/3.12.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-07 00:03+0000\n"
+"POT-Creation-Date: 2024-08-26 00:03+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-"
@@ -1649,7 +1649,7 @@ msgstr ""
"和 Guido van Rossum 於 :gh:`100160` 貢獻。)"
#: ../../whatsnew/3.12.rst:1193
-#: ../../deprecations/pending-removal-in-future.rst:42
+#: ../../deprecations/pending-removal-in-future.rst:41
msgid ""
":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants "
"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar."
@@ -1892,7 +1892,7 @@ msgstr ""
#: ../../whatsnew/3.12.rst:1332
msgid ""
"The bitwise inversion operator (``~``) on bool is deprecated. It will throw "
-"an error in Python 3.14. Use ``not`` for logical negation of bools instead. "
+"an error in Python 3.16. Use ``not`` for logical negation of bools instead. "
"In the rare case that you really need the bitwise inversion of the "
"underlying ``int``, convert to int explicitly: ``~int(x)``. (Contributed by "
"Tim Hoffmann in :gh:`103487`.)"
@@ -2380,6 +2380,11 @@ msgstr ""
"``'w'`` 型別 (``Py_UCS4``)。"
#: ../../deprecations/pending-removal-in-3.16.rst:8
+#, fuzzy
+msgid ":mod:`builtins`: ``~bool``, bitwise inversion on bool."
+msgstr "``~bool``,對 bool 進行位元反轉。"
+
+#: ../../deprecations/pending-removal-in-3.16.rst:11
msgid ""
":mod:`symtable`: Deprecate :meth:`symtable.Class.get_methods` due to the "
"lack of interest. (Contributed by Bénédikt Tran in :gh:`119698`.)"
@@ -2413,14 +2418,10 @@ msgid ":mod:`builtins`:"
msgstr ":mod:`builtins`:"
#: ../../deprecations/pending-removal-in-future.rst:14
-msgid "``~bool``, bitwise inversion on bool."
-msgstr "``~bool``,對 bool 進行位元反轉。"
-
-#: ../../deprecations/pending-removal-in-future.rst:15
msgid "``bool(NotImplemented)``."
msgstr "``bool(NotImplemented)``。"
-#: ../../deprecations/pending-removal-in-future.rst:16
+#: ../../deprecations/pending-removal-in-future.rst:15
msgid ""
"Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature "
"is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single "
@@ -2429,7 +2430,7 @@ msgstr ""
"產生器:``throw(type, exc, tb)`` 和 ``athrow(type, exc, tb)`` 簽名已被棄用:"
"請改用 ``throw(exc)`` 和 ``athrow(exc)``,為單引數簽名。"
-#: ../../deprecations/pending-removal-in-future.rst:19
+#: ../../deprecations/pending-removal-in-future.rst:18
msgid ""
"Currently Python accepts numeric literals immediately followed by keywords, "
"for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and "
@@ -2447,7 +2448,7 @@ msgstr ""
"`in`、:keyword:`is` 和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版"
"本中,它將被更改為語法錯誤。(:gh:`87999`)"
-#: ../../deprecations/pending-removal-in-future.rst:27
+#: ../../deprecations/pending-removal-in-future.rst:26
msgid ""
"Support for ``__index__()`` and ``__int__()`` method returning non-int type: "
"these methods will be required to return an instance of a strict subclass "
@@ -2456,7 +2457,7 @@ msgstr ""
"``__index__()`` 和 ``__int__()`` 方法回傳非 int 型別的支援:這些方法將需要回"
"傳 :class:`int` 的嚴格子類別實例。"
-#: ../../deprecations/pending-removal-in-future.rst:30
+#: ../../deprecations/pending-removal-in-future.rst:29
msgid ""
"Support for ``__float__()`` method returning a strict subclass of :class:"
"`float`: these methods will be required to return an instance of :class:"
@@ -2465,7 +2466,7 @@ msgstr ""
"回傳 :class:`float` 嚴格子類別 ``__float__()`` 方法的支援:這些方法將需要回"
"傳 :class:`float` 的實例。"
-#: ../../deprecations/pending-removal-in-future.rst:33
+#: ../../deprecations/pending-removal-in-future.rst:32
msgid ""
"Support for ``__complex__()`` method returning a strict subclass of :class:"
"`complex`: these methods will be required to return an instance of :class:"
@@ -2474,11 +2475,11 @@ msgstr ""
"回傳 :class:`complex` 嚴格子類別 ``__complex__()`` 方法的支援:這些方法將需要"
"回傳 :class:`complex` 的實例。"
-#: ../../deprecations/pending-removal-in-future.rst:36
+#: ../../deprecations/pending-removal-in-future.rst:35
msgid "Delegation of ``int()`` to ``__trunc__()`` method."
msgstr "將 ``int()`` 委派給 ``__trunc__()`` 方法。"
-#: ../../deprecations/pending-removal-in-future.rst:37
+#: ../../deprecations/pending-removal-in-future.rst:36
msgid ""
"Passing a complex number as the *real* or *imag* argument in the :func:"
"`complex` constructor is now deprecated; it should only be passed as a "
@@ -2488,18 +2489,18 @@ msgstr ""
"在 :func:`complex` 建構子中將複數作為 *real* 或 *imag* 引數傳遞現在已被棄用;"
"它應該只作為單個位置引數傳遞。 (由 Serhiy Storchaka 於 :gh:`109218` 貢獻。)"
-#: ../../deprecations/pending-removal-in-future.rst:47
+#: ../../deprecations/pending-removal-in-future.rst:46
msgid ""
":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method "
"instead."
msgstr ""
":attr:`codeobject.co_lnotab`:請改用 :meth:`codeobject.co_lines` 方法。"
-#: ../../deprecations/pending-removal-in-future.rst:50
+#: ../../deprecations/pending-removal-in-future.rst:49
msgid ":mod:`datetime`:"
msgstr ":mod:`datetime`:"
-#: ../../deprecations/pending-removal-in-future.rst:52
+#: ../../deprecations/pending-removal-in-future.rst:51
msgid ""
":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime."
"UTC)``."
@@ -2507,7 +2508,7 @@ msgstr ""
":meth:`~datetime.datetime.utcnow`:請改用 ``datetime.datetime."
"now(tz=datetime.UTC)``。"
-#: ../../deprecations/pending-removal-in-future.rst:54
+#: ../../deprecations/pending-removal-in-future.rst:53
msgid ""
":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime."
"fromtimestamp(timestamp, tz=datetime.UTC)``."
@@ -2515,19 +2516,19 @@ msgstr ""
":meth:`~datetime.datetime.utcfromtimestamp`:請改用 ``datetime.datetime."
"fromtimestamp(timestamp, tz=datetime.UTC)``。"
-#: ../../deprecations/pending-removal-in-future.rst:57
+#: ../../deprecations/pending-removal-in-future.rst:56
msgid ":mod:`gettext`: Plural value must be an integer."
msgstr ":mod:`gettext`:複數值必須是整數。"
-#: ../../deprecations/pending-removal-in-future.rst:59
+#: ../../deprecations/pending-removal-in-future.rst:58
msgid ":mod:`importlib`:"
msgstr ":mod:`importlib`:"
-#: ../../deprecations/pending-removal-in-future.rst:61
+#: ../../deprecations/pending-removal-in-future.rst:60
msgid "``load_module()`` method: use ``exec_module()`` instead."
msgstr "``load_module()`` method:請改用 ``exec_module()``。"
-#: ../../deprecations/pending-removal-in-future.rst:62
+#: ../../deprecations/pending-removal-in-future.rst:61
msgid ""
":func:`~importlib.util.cache_from_source` *debug_override* parameter is "
"deprecated: use the *optimization* parameter instead."
@@ -2535,31 +2536,31 @@ msgstr ""
":func:`~importlib.util.cache_from_source` *debug_override* 參數已被棄用:請改"
"用 *optimization* 參數。"
-#: ../../deprecations/pending-removal-in-future.rst:65
+#: ../../deprecations/pending-removal-in-future.rst:64
msgid ":mod:`importlib.metadata`:"
msgstr ":mod:`importlib.metadata`:"
-#: ../../deprecations/pending-removal-in-future.rst:67
+#: ../../deprecations/pending-removal-in-future.rst:66
msgid "``EntryPoints`` tuple interface."
msgstr "``EntryPoints`` 元組介面。"
-#: ../../deprecations/pending-removal-in-future.rst:68
+#: ../../deprecations/pending-removal-in-future.rst:67
msgid "Implicit ``None`` on return values."
msgstr "回傳值上的隱式 ``None``。"
-#: ../../deprecations/pending-removal-in-future.rst:70
+#: ../../deprecations/pending-removal-in-future.rst:69
msgid ""
":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use "
"BytesIO and binary mode instead."
msgstr ""
":mod:`mailbox`:已棄用 StringIO 輸入和文本模式,請改用 BytesIO 和二進位模式。"
-#: ../../deprecations/pending-removal-in-future.rst:73
+#: ../../deprecations/pending-removal-in-future.rst:72
msgid ""
":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process."
msgstr ":mod:`os`:在多執行緒行程中呼叫 :func:`os.register_at_fork`。"
-#: ../../deprecations/pending-removal-in-future.rst:75
+#: ../../deprecations/pending-removal-in-future.rst:74
msgid ""
":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is "
"deprecated, use an exception instance."
@@ -2567,7 +2568,7 @@ msgstr ""
":class:`!pydoc.ErrorDuringImport`:*exc_info* 參數的元組值已被棄用,請用例外"
"實例。"
-#: ../../deprecations/pending-removal-in-future.rst:78
+#: ../../deprecations/pending-removal-in-future.rst:77
msgid ""
":mod:`re`: More strict rules are now applied for numerical group references "
"and group names in regular expressions. Only sequence of ASCII digits is "
@@ -2579,12 +2580,12 @@ msgstr ""
"有 ASCII 數碼序列被接受作為數值參照。位元組模式和替換字串中的群組名稱現在只能"
"包含 ASCII 字母、數碼和底線。(由 Serhiy Storchaka 於 :gh:`91760` 貢獻。)"
-#: ../../deprecations/pending-removal-in-future.rst:85
+#: ../../deprecations/pending-removal-in-future.rst:84
msgid ""
":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules."
msgstr ":mod:`!sre_compile`、:mod:`!sre_constants` 和 :mod:`!sre_parse` 模組。"
-#: ../../deprecations/pending-removal-in-future.rst:87
+#: ../../deprecations/pending-removal-in-future.rst:86
msgid ""
":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in "
"Python 3.12; use the *onexc* parameter instead."
@@ -2592,15 +2593,15 @@ msgstr ""
":mod:`shutil`::func:`~shutil.rmtree` 的 *onerror* 參數在 Python 3.12 中已被"
"棄用;請改用 *onexc* 參數。"
-#: ../../deprecations/pending-removal-in-future.rst:90
+#: ../../deprecations/pending-removal-in-future.rst:89
msgid ":mod:`ssl` options and protocols:"
msgstr ":mod:`ssl` 選項和協定:"
-#: ../../deprecations/pending-removal-in-future.rst:92
+#: ../../deprecations/pending-removal-in-future.rst:91
msgid ":class:`ssl.SSLContext` without protocol argument is deprecated."
msgstr "不帶協定引數的 :class:`ssl.SSLContext` 已被棄用。"
-#: ../../deprecations/pending-removal-in-future.rst:93
+#: ../../deprecations/pending-removal-in-future.rst:92
msgid ""
":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:"
"`!selected_npn_protocol` are deprecated: use ALPN instead."
@@ -2608,58 +2609,58 @@ msgstr ""
":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` 和 :meth:"
"`!selected_npn_protocol` 已被棄用:請改用 ALPN。"
-#: ../../deprecations/pending-removal-in-future.rst:96
+#: ../../deprecations/pending-removal-in-future.rst:95
msgid "``ssl.OP_NO_SSL*`` options"
msgstr "``ssl.OP_NO_SSL*`` 選項"
-#: ../../deprecations/pending-removal-in-future.rst:97
+#: ../../deprecations/pending-removal-in-future.rst:96
msgid "``ssl.OP_NO_TLS*`` options"
msgstr "``ssl.OP_NO_TLS*`` 選項"
-#: ../../deprecations/pending-removal-in-future.rst:98
+#: ../../deprecations/pending-removal-in-future.rst:97
msgid "``ssl.PROTOCOL_SSLv3``"
msgstr "``ssl.PROTOCOL_SSLv3``"
-#: ../../deprecations/pending-removal-in-future.rst:99
+#: ../../deprecations/pending-removal-in-future.rst:98
msgid "``ssl.PROTOCOL_TLS``"
msgstr "``ssl.PROTOCOL_TLS``"
-#: ../../deprecations/pending-removal-in-future.rst:100
+#: ../../deprecations/pending-removal-in-future.rst:99
msgid "``ssl.PROTOCOL_TLSv1``"
msgstr "``ssl.PROTOCOL_TLSv1``"
-#: ../../deprecations/pending-removal-in-future.rst:101
+#: ../../deprecations/pending-removal-in-future.rst:100
msgid "``ssl.PROTOCOL_TLSv1_1``"
msgstr "``ssl.PROTOCOL_TLSv1_1``"
-#: ../../deprecations/pending-removal-in-future.rst:102
+#: ../../deprecations/pending-removal-in-future.rst:101
msgid "``ssl.PROTOCOL_TLSv1_2``"
msgstr "``ssl.PROTOCOL_TLSv1_2``"
-#: ../../deprecations/pending-removal-in-future.rst:103
+#: ../../deprecations/pending-removal-in-future.rst:102
msgid "``ssl.TLSVersion.SSLv3``"
msgstr "``ssl.TLSVersion.SSLv3``"
-#: ../../deprecations/pending-removal-in-future.rst:104
+#: ../../deprecations/pending-removal-in-future.rst:103
msgid "``ssl.TLSVersion.TLSv1``"
msgstr "``ssl.TLSVersion.TLSv1``"
-#: ../../deprecations/pending-removal-in-future.rst:105
+#: ../../deprecations/pending-removal-in-future.rst:104
msgid "``ssl.TLSVersion.TLSv1_1``"
msgstr "``ssl.TLSVersion.TLSv1_1``"
-#: ../../deprecations/pending-removal-in-future.rst:107
+#: ../../deprecations/pending-removal-in-future.rst:106
msgid ""
":func:`sysconfig.is_python_build` *check_home* parameter is deprecated and "
"ignored."
msgstr ""
":func:`sysconfig.is_python_build` 的 *check_home* 參數已被棄用並被忽略。"
-#: ../../deprecations/pending-removal-in-future.rst:110
+#: ../../deprecations/pending-removal-in-future.rst:109
msgid ":mod:`threading` methods:"
msgstr ":mod:`threading` 方法:"
-#: ../../deprecations/pending-removal-in-future.rst:112
+#: ../../deprecations/pending-removal-in-future.rst:111
msgid ""
":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition."
"notify_all`."
@@ -2667,11 +2668,11 @@ msgstr ""
":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition."
"notify_all`。"
-#: ../../deprecations/pending-removal-in-future.rst:113
+#: ../../deprecations/pending-removal-in-future.rst:112
msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`."
msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set`。"
-#: ../../deprecations/pending-removal-in-future.rst:114
+#: ../../deprecations/pending-removal-in-future.rst:113
msgid ""
":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :"
"attr:`threading.Thread.daemon` attribute."
@@ -2679,7 +2680,7 @@ msgstr ""
":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請"
"用 :attr:`threading.Thread.daemon` 屬性。"
-#: ../../deprecations/pending-removal-in-future.rst:116
+#: ../../deprecations/pending-removal-in-future.rst:115
msgid ""
":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :"
"attr:`threading.Thread.name` attribute."
@@ -2687,20 +2688,20 @@ msgstr ""
":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :"
"attr:`threading.Thread.name` 屬性。"
-#: ../../deprecations/pending-removal-in-future.rst:118
+#: ../../deprecations/pending-removal-in-future.rst:117
msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`."
msgstr ""
":meth:`!threading.currentThread`:請用 :meth:`threading.current_thread`。"
-#: ../../deprecations/pending-removal-in-future.rst:119
+#: ../../deprecations/pending-removal-in-future.rst:118
msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`."
msgstr ":meth:`!threading.activeCount`:請用 :meth:`threading.active_count`。"
-#: ../../deprecations/pending-removal-in-future.rst:121
+#: ../../deprecations/pending-removal-in-future.rst:120
msgid ":class:`typing.Text` (:gh:`92332`)."
msgstr ":class:`typing.Text` (:gh:`92332`)。"
-#: ../../deprecations/pending-removal-in-future.rst:123
+#: ../../deprecations/pending-removal-in-future.rst:122
msgid ""
":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a "
"value that is not ``None`` from a test case."
@@ -2708,58 +2709,58 @@ msgstr ""
":class:`unittest.IsolatedAsyncioTestCase`:從測試案例中回傳非 ``None`` 的值已"
"被棄用。"
-#: ../../deprecations/pending-removal-in-future.rst:126
+#: ../../deprecations/pending-removal-in-future.rst:125
msgid ""
":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` "
"instead"
msgstr ""
":mod:`urllib.parse` 已棄用函式:請改用 :func:`~urllib.parse.urlparse`。"
-#: ../../deprecations/pending-removal-in-future.rst:128
+#: ../../deprecations/pending-removal-in-future.rst:127
msgid "``splitattr()``"
msgstr "``splitattr()``"
-#: ../../deprecations/pending-removal-in-future.rst:129
+#: ../../deprecations/pending-removal-in-future.rst:128
msgid "``splithost()``"
msgstr "``splithost()``"
-#: ../../deprecations/pending-removal-in-future.rst:130
+#: ../../deprecations/pending-removal-in-future.rst:129
msgid "``splitnport()``"
msgstr "``splitnport()``"
-#: ../../deprecations/pending-removal-in-future.rst:131
+#: ../../deprecations/pending-removal-in-future.rst:130
msgid "``splitpasswd()``"
msgstr "``splitpasswd()``"
-#: ../../deprecations/pending-removal-in-future.rst:132
+#: ../../deprecations/pending-removal-in-future.rst:131
msgid "``splitport()``"
msgstr "``splitport()``"
-#: ../../deprecations/pending-removal-in-future.rst:133
+#: ../../deprecations/pending-removal-in-future.rst:132
msgid "``splitquery()``"
msgstr "``splitquery()``"
-#: ../../deprecations/pending-removal-in-future.rst:134
+#: ../../deprecations/pending-removal-in-future.rst:133
msgid "``splittag()``"
msgstr "``splittag()``"
-#: ../../deprecations/pending-removal-in-future.rst:135
+#: ../../deprecations/pending-removal-in-future.rst:134
msgid "``splittype()``"
msgstr "``splittype()``"
-#: ../../deprecations/pending-removal-in-future.rst:136
+#: ../../deprecations/pending-removal-in-future.rst:135
msgid "``splituser()``"
msgstr "``splituser()``"
-#: ../../deprecations/pending-removal-in-future.rst:137
+#: ../../deprecations/pending-removal-in-future.rst:136
msgid "``splitvalue()``"
msgstr "``splitvalue()``"
-#: ../../deprecations/pending-removal-in-future.rst:138
+#: ../../deprecations/pending-removal-in-future.rst:137
msgid "``to_bytes()``"
msgstr "``to_bytes()``"
-#: ../../deprecations/pending-removal-in-future.rst:140
+#: ../../deprecations/pending-removal-in-future.rst:139
msgid ""
":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:"
"`~urllib.request.FancyURLopener` style of invoking requests is deprecated. "
@@ -2769,13 +2770,13 @@ msgstr ""
"class:`~urllib.request.FancyURLopener` 風格已被棄用。請改用更新的 :func:"
"`~urllib.request.urlopen` 函式和方法。"
-#: ../../deprecations/pending-removal-in-future.rst:144
+#: ../../deprecations/pending-removal-in-future.rst:143
msgid ""
":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial "
"writes."
msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分寫入。"
-#: ../../deprecations/pending-removal-in-future.rst:147
+#: ../../deprecations/pending-removal-in-future.rst:146
msgid ""
":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml."
"etree.ElementTree.Element` is deprecated. In a future release it will always "
@@ -2786,7 +2787,7 @@ msgstr ""
"Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 "
"``len(elem)`` 或 ``elem is not None`` 測試。"
-#: ../../deprecations/pending-removal-in-future.rst:152
+#: ../../deprecations/pending-removal-in-future.rst:151
msgid ""
":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:"
"`~zipimport.zipimporter.exec_module` instead."
From 6cc637500d977a231806854f3d32af722853487a Mon Sep 17 00:00:00 2001
From: Matt Wang
Date: Tue, 27 Aug 2024 01:07:45 +0800
Subject: [PATCH 03/16] fix: resolve fuzzy entries
---
deprecations/index.po | 3 +-
deprecations/pending-removal-in-3.16.po | 2 +-
deprecations/pending-removal-in-future.po | 146 +++++++++++++++-------
library/stdtypes.po | 6 +-
whatsnew/3.12.po | 3 +-
5 files changed, 105 insertions(+), 55 deletions(-)
diff --git a/deprecations/index.po b/deprecations/index.po
index 32cf4def29..38992175f9 100644
--- a/deprecations/index.po
+++ b/deprecations/index.po
@@ -590,9 +590,8 @@ msgstr ""
"``'w'`` 型別 (``Py_UCS4``)。"
#: ../../deprecations/pending-removal-in-3.16.rst:8
-#, fuzzy
msgid ":mod:`builtins`: ``~bool``, bitwise inversion on bool."
-msgstr "``~bool``,對 bool 進行位元反轉。"
+msgstr ":mod:`builtins`:``~bool``,對 bool 進行位元反轉。"
#: ../../deprecations/pending-removal-in-3.16.rst:11
msgid ""
diff --git a/deprecations/pending-removal-in-3.16.po b/deprecations/pending-removal-in-3.16.po
index fba64fac4d..3e33cc33de 100644
--- a/deprecations/pending-removal-in-3.16.po
+++ b/deprecations/pending-removal-in-3.16.po
@@ -29,7 +29,7 @@ msgstr ""
#: ../../deprecations/pending-removal-in-3.16.rst:8
msgid ":mod:`builtins`: ``~bool``, bitwise inversion on bool."
-msgstr ""
+msgstr ":mod:`builtins`:``~bool``,對 bool 進行位元反轉。"
#: ../../deprecations/pending-removal-in-3.16.rst:11
msgid ""
diff --git a/deprecations/pending-removal-in-future.po b/deprecations/pending-removal-in-future.po
index 161cea158c..9398a92dc7 100644
--- a/deprecations/pending-removal-in-future.po
+++ b/deprecations/pending-removal-in-future.po
@@ -1,9 +1,7 @@
-# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2024, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR , YEAR.
#
-#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
@@ -18,32 +16,33 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
#: ../../deprecations/pending-removal-in-future.rst:2
+#: ../../deprecations/c-api-pending-removal-in-future.rst:2
msgid "Pending Removal in Future Versions"
-msgstr ""
+msgstr "未來版本中的待移除項目"
#: ../../deprecations/pending-removal-in-future.rst:4
msgid ""
"The following APIs will be removed in the future, although there is "
"currently no date scheduled for their removal."
-msgstr ""
+msgstr "以下 API 將在未來被移除,雖然目前尚未安排移除日期。"
#: ../../deprecations/pending-removal-in-future.rst:7
msgid ""
":mod:`argparse`: Nesting argument groups and nesting mutually exclusive "
"groups are deprecated."
-msgstr ""
+msgstr ":mod:`argparse`:已棄用巢狀引數群組和巢狀互斥群組。"
#: ../../deprecations/pending-removal-in-future.rst:10
msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)"
-msgstr ""
+msgstr ":mod:`array` 的 ``'u'`` 格式碼 (:gh:`57281`)"
#: ../../deprecations/pending-removal-in-future.rst:12
msgid ":mod:`builtins`:"
-msgstr ""
+msgstr ":mod:`builtins`:"
#: ../../deprecations/pending-removal-in-future.rst:14
msgid "``bool(NotImplemented)``."
-msgstr ""
+msgstr "``bool(NotImplemented)``。"
#: ../../deprecations/pending-removal-in-future.rst:15
msgid ""
@@ -51,6 +50,8 @@ msgid ""
"is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single "
"argument signature."
msgstr ""
+"產生器:``throw(type, exc, tb)`` 和 ``athrow(type, exc, tb)`` 簽名已被棄用:"
+"請改用 ``throw(exc)`` 和 ``athrow(exc)``,為單引數簽名。"
#: ../../deprecations/pending-removal-in-future.rst:18
msgid ""
@@ -63,6 +64,12 @@ msgid ""
"keyword:`is` and :keyword:`or`. In a future release it will be changed to a "
"syntax error. (:gh:`87999`)"
msgstr ""
+"目前 Python 接受數值字面值後面立即接關鍵字,例如 ``0in x``、``1or x``、``0if "
+"1else 2``。它讓表達式模糊且容易混淆,如 ``[0x1for x in y]``\\ (可以解釋為 "
+"``[0x1 for x in y]`` 或 ``[0x1f or x in y]``)。如果數值字面值後立即接 :"
+"keyword:`and`、:keyword:`else`、:keyword:`for`、:keyword:`if`、:keyword:"
+"`in`、:keyword:`is` 和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版"
+"本中,它將被更改為語法錯誤。(:gh:`87999`)"
#: ../../deprecations/pending-removal-in-future.rst:26
msgid ""
@@ -70,6 +77,8 @@ msgid ""
"these methods will be required to return an instance of a strict subclass "
"of :class:`int`."
msgstr ""
+"``__index__()`` 和 ``__int__()`` 方法回傳非 int 型別的支援:這些方法將需要回"
+"傳 :class:`int` 的嚴格子類別實例。"
#: ../../deprecations/pending-removal-in-future.rst:29
msgid ""
@@ -77,6 +86,8 @@ msgid ""
"`float`: these methods will be required to return an instance of :class:"
"`float`."
msgstr ""
+"回傳 :class:`float` 嚴格子類別 ``__float__()`` 方法的支援:這些方法將需要回"
+"傳 :class:`float` 的實例。"
#: ../../deprecations/pending-removal-in-future.rst:32
msgid ""
@@ -84,10 +95,12 @@ msgid ""
"`complex`: these methods will be required to return an instance of :class:"
"`complex`."
msgstr ""
+"回傳 :class:`complex` 嚴格子類別 ``__complex__()`` 方法的支援:這些方法將需要"
+"回傳 :class:`complex` 的實例。"
#: ../../deprecations/pending-removal-in-future.rst:35
msgid "Delegation of ``int()`` to ``__trunc__()`` method."
-msgstr ""
+msgstr "將 ``int()`` 委派給 ``__trunc__()`` 方法。"
#: ../../deprecations/pending-removal-in-future.rst:36
msgid ""
@@ -96,6 +109,8 @@ msgid ""
"single positional argument. (Contributed by Serhiy Storchaka in :gh:"
"`109218`.)"
msgstr ""
+"在 :func:`complex` 建構子中將複數作為 *real* 或 *imag* 引數傳遞現在已被棄用;"
+"它應該只作為單個位置引數傳遞。 (由 Serhiy Storchaka 於 :gh:`109218` 貢獻。)"
#: ../../deprecations/pending-removal-in-future.rst:41
msgid ""
@@ -103,75 +118,88 @@ msgid ""
"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar."
"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)"
msgstr ""
+":mod:`calendar`:``calendar.January`` 和 ``calendar.February`` 常數已被棄用並"
+"被 :data:`calendar.JANUARY` 和 :data:`calendar.FEBRUARY` 取代。 (由 Prince "
+"Roshan 於 :gh:`103636` 貢獻。)"
#: ../../deprecations/pending-removal-in-future.rst:46
msgid ""
":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method "
"instead."
msgstr ""
+":attr:`codeobject.co_lnotab`:請改用 :meth:`codeobject.co_lines` 方法。"
#: ../../deprecations/pending-removal-in-future.rst:49
msgid ":mod:`datetime`:"
-msgstr ""
+msgstr ":mod:`datetime`:"
#: ../../deprecations/pending-removal-in-future.rst:51
msgid ""
":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime."
"UTC)``."
msgstr ""
+":meth:`~datetime.datetime.utcnow`:請改用 ``datetime.datetime."
+"now(tz=datetime.UTC)``。"
#: ../../deprecations/pending-removal-in-future.rst:53
msgid ""
":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime."
"fromtimestamp(timestamp, tz=datetime.UTC)``."
msgstr ""
+":meth:`~datetime.datetime.utcfromtimestamp`:請改用 ``datetime.datetime."
+"fromtimestamp(timestamp, tz=datetime.UTC)``。"
#: ../../deprecations/pending-removal-in-future.rst:56
msgid ":mod:`gettext`: Plural value must be an integer."
-msgstr ""
+msgstr ":mod:`gettext`:複數值必須是整數。"
#: ../../deprecations/pending-removal-in-future.rst:58
msgid ":mod:`importlib`:"
-msgstr ""
+msgstr ":mod:`importlib`:"
#: ../../deprecations/pending-removal-in-future.rst:60
msgid "``load_module()`` method: use ``exec_module()`` instead."
-msgstr ""
+msgstr "``load_module()`` method:請改用 ``exec_module()``。"
#: ../../deprecations/pending-removal-in-future.rst:61
msgid ""
":func:`~importlib.util.cache_from_source` *debug_override* parameter is "
"deprecated: use the *optimization* parameter instead."
msgstr ""
+":func:`~importlib.util.cache_from_source` *debug_override* 參數已被棄用:請改"
+"用 *optimization* 參數。"
#: ../../deprecations/pending-removal-in-future.rst:64
msgid ":mod:`importlib.metadata`:"
-msgstr ""
+msgstr ":mod:`importlib.metadata`:"
#: ../../deprecations/pending-removal-in-future.rst:66
msgid "``EntryPoints`` tuple interface."
-msgstr ""
+msgstr "``EntryPoints`` 元組介面。"
#: ../../deprecations/pending-removal-in-future.rst:67
msgid "Implicit ``None`` on return values."
-msgstr ""
+msgstr "回傳值上的隱式 ``None``。"
#: ../../deprecations/pending-removal-in-future.rst:69
msgid ""
":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use "
"BytesIO and binary mode instead."
msgstr ""
+":mod:`mailbox`:已棄用 StringIO 輸入和文本模式,請改用 BytesIO 和二進位模式。"
#: ../../deprecations/pending-removal-in-future.rst:72
msgid ""
":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process."
-msgstr ""
+msgstr ":mod:`os`:在多執行緒行程中呼叫 :func:`os.register_at_fork`。"
#: ../../deprecations/pending-removal-in-future.rst:74
msgid ""
":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is "
"deprecated, use an exception instance."
msgstr ""
+":class:`!pydoc.ErrorDuringImport`:*exc_info* 參數的元組值已被棄用,請用例外"
+"實例。"
#: ../../deprecations/pending-removal-in-future.rst:77
msgid ""
@@ -181,171 +209,189 @@ msgid ""
"replacement strings can now only contain ASCII letters and digits and "
"underscore. (Contributed by Serhiy Storchaka in :gh:`91760`.)"
msgstr ""
+":mod:`re`:現在對正規表示式中的數值群組參照和群組名稱用了更嚴格的規則。現在只"
+"有 ASCII 數碼序列被接受作為數值參照。位元組模式和替換字串中的群組名稱現在只能"
+"包含 ASCII 字母、數碼和底線。(由 Serhiy Storchaka 於 :gh:`91760` 貢獻。)"
#: ../../deprecations/pending-removal-in-future.rst:84
msgid ""
":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules."
-msgstr ""
+msgstr ":mod:`!sre_compile`、:mod:`!sre_constants` 和 :mod:`!sre_parse` 模組。"
#: ../../deprecations/pending-removal-in-future.rst:86
msgid ""
":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in "
"Python 3.12; use the *onexc* parameter instead."
msgstr ""
+":mod:`shutil`::func:`~shutil.rmtree` 的 *onerror* 參數在 Python 3.12 中已被"
+"棄用;請改用 *onexc* 參數。"
#: ../../deprecations/pending-removal-in-future.rst:89
msgid ":mod:`ssl` options and protocols:"
-msgstr ""
+msgstr ":mod:`ssl` 選項和協定:"
#: ../../deprecations/pending-removal-in-future.rst:91
msgid ":class:`ssl.SSLContext` without protocol argument is deprecated."
-msgstr ""
+msgstr "不帶協定引數的 :class:`ssl.SSLContext` 已被棄用。"
#: ../../deprecations/pending-removal-in-future.rst:92
msgid ""
":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:"
"`!selected_npn_protocol` are deprecated: use ALPN instead."
msgstr ""
+":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` 和 :meth:"
+"`!selected_npn_protocol` 已被棄用:請改用 ALPN。"
#: ../../deprecations/pending-removal-in-future.rst:95
msgid "``ssl.OP_NO_SSL*`` options"
-msgstr ""
+msgstr "``ssl.OP_NO_SSL*`` 選項"
#: ../../deprecations/pending-removal-in-future.rst:96
msgid "``ssl.OP_NO_TLS*`` options"
-msgstr ""
+msgstr "``ssl.OP_NO_TLS*`` 選項"
#: ../../deprecations/pending-removal-in-future.rst:97
msgid "``ssl.PROTOCOL_SSLv3``"
-msgstr ""
+msgstr "``ssl.PROTOCOL_SSLv3``"
#: ../../deprecations/pending-removal-in-future.rst:98
msgid "``ssl.PROTOCOL_TLS``"
-msgstr ""
+msgstr "``ssl.PROTOCOL_TLS``"
#: ../../deprecations/pending-removal-in-future.rst:99
msgid "``ssl.PROTOCOL_TLSv1``"
-msgstr ""
+msgstr "``ssl.PROTOCOL_TLSv1``"
#: ../../deprecations/pending-removal-in-future.rst:100
msgid "``ssl.PROTOCOL_TLSv1_1``"
-msgstr ""
+msgstr "``ssl.PROTOCOL_TLSv1_1``"
#: ../../deprecations/pending-removal-in-future.rst:101
msgid "``ssl.PROTOCOL_TLSv1_2``"
-msgstr ""
+msgstr "``ssl.PROTOCOL_TLSv1_2``"
#: ../../deprecations/pending-removal-in-future.rst:102
msgid "``ssl.TLSVersion.SSLv3``"
-msgstr ""
+msgstr "``ssl.TLSVersion.SSLv3``"
#: ../../deprecations/pending-removal-in-future.rst:103
msgid "``ssl.TLSVersion.TLSv1``"
-msgstr ""
+msgstr "``ssl.TLSVersion.TLSv1``"
#: ../../deprecations/pending-removal-in-future.rst:104
msgid "``ssl.TLSVersion.TLSv1_1``"
-msgstr ""
+msgstr "``ssl.TLSVersion.TLSv1_1``"
#: ../../deprecations/pending-removal-in-future.rst:106
msgid ""
":func:`sysconfig.is_python_build` *check_home* parameter is deprecated and "
"ignored."
msgstr ""
+":func:`sysconfig.is_python_build` 的 *check_home* 參數已被棄用並被忽略。"
#: ../../deprecations/pending-removal-in-future.rst:109
msgid ":mod:`threading` methods:"
-msgstr ""
+msgstr ":mod:`threading` 方法:"
#: ../../deprecations/pending-removal-in-future.rst:111
msgid ""
":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition."
"notify_all`."
msgstr ""
+":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition."
+"notify_all`。"
#: ../../deprecations/pending-removal-in-future.rst:112
msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`."
-msgstr ""
+msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set`。"
#: ../../deprecations/pending-removal-in-future.rst:113
msgid ""
":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :"
"attr:`threading.Thread.daemon` attribute."
msgstr ""
+":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請"
+"用 :attr:`threading.Thread.daemon` 屬性。"
#: ../../deprecations/pending-removal-in-future.rst:115
msgid ""
":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :"
"attr:`threading.Thread.name` attribute."
msgstr ""
+":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :"
+"attr:`threading.Thread.name` 屬性。"
#: ../../deprecations/pending-removal-in-future.rst:117
msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`."
msgstr ""
+":meth:`!threading.currentThread`:請用 :meth:`threading.current_thread`。"
#: ../../deprecations/pending-removal-in-future.rst:118
msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`."
-msgstr ""
+msgstr ":meth:`!threading.activeCount`:請用 :meth:`threading.active_count`。"
#: ../../deprecations/pending-removal-in-future.rst:120
msgid ":class:`typing.Text` (:gh:`92332`)."
-msgstr ""
+msgstr ":class:`typing.Text` (:gh:`92332`)。"
#: ../../deprecations/pending-removal-in-future.rst:122
msgid ""
":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a "
"value that is not ``None`` from a test case."
msgstr ""
+":class:`unittest.IsolatedAsyncioTestCase`:從測試案例中回傳非 ``None`` 的值已"
+"被棄用。"
#: ../../deprecations/pending-removal-in-future.rst:125
msgid ""
":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` "
"instead"
msgstr ""
+":mod:`urllib.parse` 已棄用函式:請改用 :func:`~urllib.parse.urlparse`。"
#: ../../deprecations/pending-removal-in-future.rst:127
msgid "``splitattr()``"
-msgstr ""
+msgstr "``splitattr()``"
#: ../../deprecations/pending-removal-in-future.rst:128
msgid "``splithost()``"
-msgstr ""
+msgstr "``splithost()``"
#: ../../deprecations/pending-removal-in-future.rst:129
msgid "``splitnport()``"
-msgstr ""
+msgstr "``splitnport()``"
#: ../../deprecations/pending-removal-in-future.rst:130
msgid "``splitpasswd()``"
-msgstr ""
+msgstr "``splitpasswd()``"
#: ../../deprecations/pending-removal-in-future.rst:131
msgid "``splitport()``"
-msgstr ""
+msgstr "``splitport()``"
#: ../../deprecations/pending-removal-in-future.rst:132
msgid "``splitquery()``"
-msgstr ""
+msgstr "``splitquery()``"
#: ../../deprecations/pending-removal-in-future.rst:133
msgid "``splittag()``"
-msgstr ""
+msgstr "``splittag()``"
#: ../../deprecations/pending-removal-in-future.rst:134
msgid "``splittype()``"
-msgstr ""
+msgstr "``splittype()``"
#: ../../deprecations/pending-removal-in-future.rst:135
msgid "``splituser()``"
-msgstr ""
+msgstr "``splituser()``"
#: ../../deprecations/pending-removal-in-future.rst:136
msgid "``splitvalue()``"
-msgstr ""
+msgstr "``splitvalue()``"
#: ../../deprecations/pending-removal-in-future.rst:137
msgid "``to_bytes()``"
-msgstr ""
+msgstr "``to_bytes()``"
#: ../../deprecations/pending-removal-in-future.rst:139
msgid ""
@@ -353,12 +399,15 @@ msgid ""
"`~urllib.request.FancyURLopener` style of invoking requests is deprecated. "
"Use newer :func:`~urllib.request.urlopen` functions and methods."
msgstr ""
+":mod:`urllib.request`:呼叫請求的 :class:`~urllib.request.URLopener` 和 :"
+"class:`~urllib.request.FancyURLopener` 風格已被棄用。請改用更新的 :func:"
+"`~urllib.request.urlopen` 函式和方法。"
#: ../../deprecations/pending-removal-in-future.rst:143
msgid ""
":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial "
"writes."
-msgstr ""
+msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分寫入。"
#: ../../deprecations/pending-removal-in-future.rst:146
msgid ""
@@ -367,9 +416,14 @@ msgid ""
"return ``True``. Prefer explicit ``len(elem)`` or ``elem is not None`` tests "
"instead."
msgstr ""
+":mod:`xml.etree.ElementTree`:已棄用對 :class:`~xml.etree.ElementTree."
+"Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 "
+"``len(elem)`` 或 ``elem is not None`` 測試。"
#: ../../deprecations/pending-removal-in-future.rst:151
msgid ""
":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:"
"`~zipimport.zipimporter.exec_module` instead."
msgstr ""
+":meth:`zipimport.zipimporter.load_module` 已被棄用:請改用 :meth:`~zipimport."
+"zipimporter.exec_module`。"
diff --git a/library/stdtypes.po b/library/stdtypes.po
index da60a2e25b..cba4ead41f 100644
--- a/library/stdtypes.po
+++ b/library/stdtypes.po
@@ -1,5 +1,4 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) 2001-2022, Python Software Foundation
+# Copyright (C) 2001-2024, Python Software Foundation
# This file is distributed under the same license as the Python package.
#
# Translators:
@@ -1229,11 +1228,10 @@ msgstr ""
"用邏輯運算子 ``and``、``or`` 和 ``!=`` 而不是 ``&``、``|`` 和 ``^``。"
#: ../../library/stdtypes.rst:834
-#, fuzzy
msgid ""
"The use of the bitwise inversion operator ``~`` is deprecated and will raise "
"an error in Python 3.16."
-msgstr "位元反轉運算子 ``~`` 的使用已被棄用並且將在 Python 3.14 中引發錯誤。"
+msgstr "位元反轉運算子 ``~`` 的使用已被棄用並且將在 Python 3.16 中引發錯誤。"
#: ../../library/stdtypes.rst:837
msgid ""
diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po
index dd572bf66c..bd8dc27ebf 100644
--- a/whatsnew/3.12.po
+++ b/whatsnew/3.12.po
@@ -2380,9 +2380,8 @@ msgstr ""
"``'w'`` 型別 (``Py_UCS4``)。"
#: ../../deprecations/pending-removal-in-3.16.rst:8
-#, fuzzy
msgid ":mod:`builtins`: ``~bool``, bitwise inversion on bool."
-msgstr "``~bool``,對 bool 進行位元反轉。"
+msgstr ":mod:`builtins`:``~bool``,對 bool 進行位元反轉。"
#: ../../deprecations/pending-removal-in-3.16.rst:11
msgid ""
From a2b2bf94846cfd9beea37c962c87db4d15843f2c Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Mon, 26 Aug 2024 18:25:40 +0000
Subject: [PATCH 04/16] sync with cpython 33d9e27b
---
deprecations/pending-removal-in-future.po | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/deprecations/pending-removal-in-future.po b/deprecations/pending-removal-in-future.po
index 9398a92dc7..fa52b56e5c 100644
--- a/deprecations/pending-removal-in-future.po
+++ b/deprecations/pending-removal-in-future.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-26 00:03+0000\n"
+"POT-Creation-Date: 2024-08-26 18:24+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -16,7 +16,6 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
#: ../../deprecations/pending-removal-in-future.rst:2
-#: ../../deprecations/c-api-pending-removal-in-future.rst:2
msgid "Pending Removal in Future Versions"
msgstr "未來版本中的待移除項目"
From 9f867558e57141d28766108d7ea55cef2f26b4b6 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Wed, 28 Aug 2024 13:22:09 +0000
Subject: [PATCH 05/16] sync with cpython ccc6c2b8
---
c-api/tuple.po | 103 +++++++++++++++++++++++++++----------------------
1 file changed, 57 insertions(+), 46 deletions(-)
diff --git a/c-api/tuple.po b/c-api/tuple.po
index e6f3d46808..0d201d62fa 100644
--- a/c-api/tuple.po
+++ b/c-api/tuple.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-04-20 00:03+0000\n"
+"POT-Creation-Date: 2024-08-28 13:20+0000\n"
"PO-Revision-Date: 2017-09-22 18:26+0000\n"
"Last-Translator: Leon H.\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -46,35 +46,37 @@ msgid ""
msgstr ""
#: ../../c-api/tuple.rst:36
-msgid "Return a new tuple object of size *len*, or ``NULL`` on failure."
+msgid ""
+"Return a new tuple object of size *len*, or ``NULL`` with an exception set "
+"on failure."
msgstr ""
-#: ../../c-api/tuple.rst:41
+#: ../../c-api/tuple.rst:42
msgid ""
-"Return a new tuple object of size *n*, or ``NULL`` on failure. The tuple "
-"values are initialized to the subsequent *n* C arguments pointing to Python "
-"objects. ``PyTuple_Pack(2, a, b)`` is equivalent to "
+"Return a new tuple object of size *n*, or ``NULL`` with an exception set on "
+"failure. The tuple values are initialized to the subsequent *n* C arguments "
+"pointing to Python objects. ``PyTuple_Pack(2, a, b)`` is equivalent to "
"``Py_BuildValue(\"(OO)\", a, b)``."
msgstr ""
-#: ../../c-api/tuple.rst:48
-msgid "Take a pointer to a tuple object, and return the size of that tuple."
+#: ../../c-api/tuple.rst:50
+msgid ""
+"Take a pointer to a tuple object, and return the size of that tuple. On "
+"error, return ``-1`` and with an exception set."
msgstr ""
-#: ../../c-api/tuple.rst:53
-msgid ""
-"Return the size of the tuple *p*, which must be non-``NULL`` and point to a "
-"tuple; no error checking is performed."
+#: ../../c-api/tuple.rst:56
+msgid "Like :c:func:`PyTuple_Size`, but without error checking."
msgstr ""
-#: ../../c-api/tuple.rst:59
+#: ../../c-api/tuple.rst:61
msgid ""
"Return the object at position *pos* in the tuple pointed to by *p*. If "
"*pos* is negative or out of bounds, return ``NULL`` and set an :exc:"
"`IndexError` exception."
msgstr ""
-#: ../../c-api/tuple.rst:62
+#: ../../c-api/tuple.rst:64
msgid ""
"The returned reference is borrowed from the tuple *p* (that is: it is only "
"valid as long as you hold a reference to *p*). To get a :term:`strong "
@@ -82,44 +84,49 @@ msgid ""
"func:`PySequence_GetItem`."
msgstr ""
-#: ../../c-api/tuple.rst:71
+#: ../../c-api/tuple.rst:73
msgid "Like :c:func:`PyTuple_GetItem`, but does no checking of its arguments."
msgstr ""
-#: ../../c-api/tuple.rst:76
+#: ../../c-api/tuple.rst:78
msgid ""
"Return the slice of the tuple pointed to by *p* between *low* and *high*, or "
-"``NULL`` on failure. This is the equivalent of the Python expression "
-"``p[low:high]``. Indexing from the end of the tuple is not supported."
+"``NULL`` with an exception set on failure."
+msgstr ""
+
+#: ../../c-api/tuple.rst:81
+msgid ""
+"This is the equivalent of the Python expression ``p[low:high]``. Indexing "
+"from the end of the tuple is not supported."
msgstr ""
-#: ../../c-api/tuple.rst:83
+#: ../../c-api/tuple.rst:87
msgid ""
"Insert a reference to object *o* at position *pos* of the tuple pointed to "
"by *p*. Return ``0`` on success. If *pos* is out of bounds, return ``-1`` "
"and set an :exc:`IndexError` exception."
msgstr ""
-#: ../../c-api/tuple.rst:89
+#: ../../c-api/tuple.rst:93
msgid ""
"This function \"steals\" a reference to *o* and discards a reference to an "
"item already in the tuple at the affected position."
msgstr ""
-#: ../../c-api/tuple.rst:95
+#: ../../c-api/tuple.rst:99
msgid ""
"Like :c:func:`PyTuple_SetItem`, but does no error checking, and should "
"*only* be used to fill in brand new tuples."
msgstr ""
-#: ../../c-api/tuple.rst:100
+#: ../../c-api/tuple.rst:104
msgid ""
"This function \"steals\" a reference to *o*, and, unlike :c:func:"
"`PyTuple_SetItem`, does *not* discard a reference to any item that is being "
"replaced; any reference in the tuple at position *pos* will be leaked."
msgstr ""
-#: ../../c-api/tuple.rst:108
+#: ../../c-api/tuple.rst:112
msgid ""
"Can be used to resize a tuple. *newsize* will be the new length of the "
"tuple. Because tuples are *supposed* to be immutable, this should only be "
@@ -134,11 +141,11 @@ msgid ""
"`SystemError`."
msgstr ""
-#: ../../c-api/tuple.rst:123
+#: ../../c-api/tuple.rst:127
msgid "Struct Sequence Objects"
msgstr ""
-#: ../../c-api/tuple.rst:125
+#: ../../c-api/tuple.rst:129
msgid ""
"Struct sequence objects are the C equivalent of :func:`~collections."
"namedtuple` objects, i.e. a sequence whose items can also be accessed "
@@ -146,44 +153,48 @@ msgid ""
"specific struct sequence type."
msgstr ""
-#: ../../c-api/tuple.rst:132
+#: ../../c-api/tuple.rst:136
msgid ""
"Create a new struct sequence type from the data in *desc*, described below. "
"Instances of the resulting type can be created with :c:func:"
"`PyStructSequence_New`."
msgstr ""
-#: ../../c-api/tuple.rst:138
+#: ../../c-api/tuple.rst:139 ../../c-api/tuple.rst:207
+msgid "Return ``NULL`` with an exception set on failure."
+msgstr ""
+
+#: ../../c-api/tuple.rst:144
msgid "Initializes a struct sequence type *type* from *desc* in place."
msgstr ""
-#: ../../c-api/tuple.rst:143
+#: ../../c-api/tuple.rst:149
msgid ""
-"The same as ``PyStructSequence_InitType``, but returns ``0`` on success and "
-"``-1`` on failure."
+"Like :c:func:`PyStructSequence_InitType`, but returns ``0`` on success and "
+"``-1`` with an exception set on failure."
msgstr ""
-#: ../../c-api/tuple.rst:151
+#: ../../c-api/tuple.rst:157
msgid "Contains the meta information of a struct sequence type to create."
msgstr ""
-#: ../../c-api/tuple.rst:155
+#: ../../c-api/tuple.rst:161
msgid "Name of the struct sequence type."
msgstr ""
-#: ../../c-api/tuple.rst:159
+#: ../../c-api/tuple.rst:165
msgid "Pointer to docstring for the type or ``NULL`` to omit."
msgstr ""
-#: ../../c-api/tuple.rst:163
+#: ../../c-api/tuple.rst:169
msgid "Pointer to ``NULL``-terminated array with field names of the new type."
msgstr ""
-#: ../../c-api/tuple.rst:167
+#: ../../c-api/tuple.rst:173
msgid "Number of fields visible to the Python side (if used as tuple)."
msgstr ""
-#: ../../c-api/tuple.rst:172
+#: ../../c-api/tuple.rst:178
msgid ""
"Describes a field of a struct sequence. As a struct sequence is modeled as a "
"tuple, all fields are typed as :c:expr:`PyObject*`. The index in the :c:"
@@ -192,52 +203,52 @@ msgid ""
"described."
msgstr ""
-#: ../../c-api/tuple.rst:180
+#: ../../c-api/tuple.rst:186
msgid ""
"Name for the field or ``NULL`` to end the list of named fields, set to :c:"
"data:`PyStructSequence_UnnamedField` to leave unnamed."
msgstr ""
-#: ../../c-api/tuple.rst:185
+#: ../../c-api/tuple.rst:191
msgid "Field docstring or ``NULL`` to omit."
msgstr ""
-#: ../../c-api/tuple.rst:190
+#: ../../c-api/tuple.rst:196
msgid "Special value for a field name to leave it unnamed."
msgstr ""
-#: ../../c-api/tuple.rst:192
+#: ../../c-api/tuple.rst:198
msgid "The type was changed from ``char *``."
msgstr ""
-#: ../../c-api/tuple.rst:198
+#: ../../c-api/tuple.rst:204
msgid ""
"Creates an instance of *type*, which must have been created with :c:func:"
"`PyStructSequence_NewType`."
msgstr ""
-#: ../../c-api/tuple.rst:204
+#: ../../c-api/tuple.rst:212
msgid ""
"Return the object at position *pos* in the struct sequence pointed to by "
"*p*. No bounds checking is performed."
msgstr ""
-#: ../../c-api/tuple.rst:210
+#: ../../c-api/tuple.rst:218
msgid "Macro equivalent of :c:func:`PyStructSequence_GetItem`."
msgstr ""
-#: ../../c-api/tuple.rst:215
+#: ../../c-api/tuple.rst:223
msgid ""
"Sets the field at index *pos* of the struct sequence *p* to value *o*. "
"Like :c:func:`PyTuple_SET_ITEM`, this should only be used to fill in brand "
"new instances."
msgstr ""
-#: ../../c-api/tuple.rst:221 ../../c-api/tuple.rst:231
+#: ../../c-api/tuple.rst:229 ../../c-api/tuple.rst:239
msgid "This function \"steals\" a reference to *o*."
msgstr ""
-#: ../../c-api/tuple.rst:226
+#: ../../c-api/tuple.rst:234
msgid ""
"Similar to :c:func:`PyStructSequence_SetItem`, but implemented as a static "
"inlined function."
From dbaa48344833dd934b73fb6420299db4d1341318 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Fri, 30 Aug 2024 18:25:41 +0000
Subject: [PATCH 06/16] sync with cpython d5abd02f
---
c-api/exceptions.po | 4 ++--
c-api/import.po | 4 ++--
deprecations/index.po | 12 +++++++-----
deprecations/pending-removal-in-3.13.po | 5 +++--
deprecations/pending-removal-in-3.15.po | 9 +++++----
howto/descriptor.po | 8 ++++----
howto/enum.po | 8 ++++----
howto/instrumentation.po | 5 +++--
library/ast.po | 5 +++--
library/asyncio-runner.po | 4 ++--
library/compileall.po | 4 ++--
library/contextvars.po | 6 +++---
library/functions.po | 8 +++++---
library/functools.po | 4 ++--
library/getpass.po | 6 +++---
library/inspect.po | 17 ++++++++---------
library/io.po | 12 ++++++------
library/ipaddress.po | 4 ++--
library/os.po | 19 ++++++++++---------
library/pdb.po | 4 ++--
library/signal.po | 4 ++--
library/stdtypes.po | 10 +++++-----
library/subprocess.po | 8 ++++----
library/sys.po | 7 +++----
library/sysconfig.po | 4 ++--
library/tarfile.po | 5 ++---
library/test.po | 4 ++--
library/token.po | 5 ++---
library/unittest.po | 4 ++--
library/zipapp.po | 4 ++--
reference/datamodel.po | 8 ++++----
tutorial/floatingpoint.po | 11 ++++++-----
using/cmdline.po | 4 ++--
whatsnew/3.10.po | 22 +++++++++++++---------
whatsnew/3.12.po | 16 +++++++++-------
whatsnew/3.2.po | 4 ++--
whatsnew/3.3.po | 6 +++---
whatsnew/3.4.po | 4 ++--
whatsnew/3.6.po | 10 +++++-----
whatsnew/3.7.po | 4 ++--
whatsnew/3.8.po | 23 ++++++++++++-----------
whatsnew/3.9.po | 6 +++---
42 files changed, 167 insertions(+), 154 deletions(-)
diff --git a/c-api/exceptions.po b/c-api/exceptions.po
index 80bf8b2dbb..c8207734e8 100644
--- a/c-api/exceptions.po
+++ b/c-api/exceptions.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-04-18 00:04+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+0000\n"
"PO-Revision-Date: 2018-05-23 14:05+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -60,7 +60,7 @@ msgstr ""
#: ../../c-api/exceptions.rst:37
msgid ""
-"The error indicator is **not** the result of :func:`sys.exc_info()`. The "
+"The error indicator is **not** the result of :func:`sys.exc_info`. The "
"former corresponds to an exception that is not yet caught (and is therefore "
"still propagating), while the latter returns an exception after it is caught "
"(and has therefore stopped propagating)."
diff --git a/c-api/import.po b/c-api/import.po
index fbc29ff313..558b2c6c40 100644
--- a/c-api/import.po
+++ b/c-api/import.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-03-07 17:26+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+0000\n"
"PO-Revision-Date: 2018-05-23 14:06+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -206,7 +206,7 @@ msgstr ""
#: ../../c-api/import.rst:176
msgid ""
-"Uses :func:`!imp.source_from_cache()` in calculating the source path if only "
+"Uses :func:`!imp.source_from_cache` in calculating the source path if only "
"the bytecode path is provided."
msgstr ""
diff --git a/deprecations/index.po b/deprecations/index.po
index 38992175f9..663180772e 100644
--- a/deprecations/index.po
+++ b/deprecations/index.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-26 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -185,8 +185,9 @@ msgid "``read_text()``"
msgstr "``read_text()``"
#: ../../deprecations/pending-removal-in-3.13.rst:51
+#, fuzzy
msgid ""
-"Use :func:`importlib.resources.files()` instead. Refer to `importlib-"
+"Use :func:`importlib.resources.files` instead. Refer to `importlib-"
"resources: Migrating from Legacy `_ (:gh:`106531`)"
msgstr ""
@@ -474,12 +475,13 @@ msgstr ""
"代方案。*任何東西*\\ 都比 CGI 更好的來介接一個帶有請求處理器的網頁伺服器。"
#: ../../deprecations/pending-removal-in-3.15.rst:9
+#, fuzzy
msgid ""
":class:`locale`: :func:`locale.getdefaultlocale` was deprecated in Python "
"3.11 and originally planned for removal in Python 3.13 (:gh:`90817`), but "
-"removal has been postponed to Python 3.15. Use :func:`locale.setlocale()`, :"
-"func:`locale.getencoding()` and :func:`locale.getlocale()` instead. "
-"(Contributed by Hugo van Kemenade in :gh:`111187`.)"
+"removal has been postponed to Python 3.15. Use :func:`locale.setlocale`, :"
+"func:`locale.getencoding` and :func:`locale.getlocale` instead. (Contributed "
+"by Hugo van Kemenade in :gh:`111187`.)"
msgstr ""
":class:`locale`::func:`locale.getdefaultlocale` 已在 Python 3.11 中被棄用,"
"原本計劃在 Python 3.13 中移除 (:gh:`90817`),但被延後至 Python 3.15。請改用 :"
diff --git a/deprecations/pending-removal-in-3.13.po b/deprecations/pending-removal-in-3.13.po
index b0fa712937..83bf46b2af 100644
--- a/deprecations/pending-removal-in-3.13.po
+++ b/deprecations/pending-removal-in-3.13.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-25 00:04+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -180,8 +180,9 @@ msgid "``read_text()``"
msgstr "``read_text()``"
#: ../../deprecations/pending-removal-in-3.13.rst:51
+#, fuzzy
msgid ""
-"Use :func:`importlib.resources.files()` instead. Refer to `importlib-"
+"Use :func:`importlib.resources.files` instead. Refer to `importlib-"
"resources: Migrating from Legacy `_ (:gh:`106531`)"
msgstr ""
diff --git a/deprecations/pending-removal-in-3.15.po b/deprecations/pending-removal-in-3.15.po
index df09fa8066..4a14bbf621 100644
--- a/deprecations/pending-removal-in-3.15.po
+++ b/deprecations/pending-removal-in-3.15.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-17 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -32,12 +32,13 @@ msgstr ""
"代方案。*任何東西*\\ 都比 CGI 更好的來介接一個帶有請求處理器的網頁伺服器。"
#: ../../deprecations/pending-removal-in-3.15.rst:9
+#, fuzzy
msgid ""
":class:`locale`: :func:`locale.getdefaultlocale` was deprecated in Python "
"3.11 and originally planned for removal in Python 3.13 (:gh:`90817`), but "
-"removal has been postponed to Python 3.15. Use :func:`locale.setlocale()`, :"
-"func:`locale.getencoding()` and :func:`locale.getlocale()` instead. "
-"(Contributed by Hugo van Kemenade in :gh:`111187`.)"
+"removal has been postponed to Python 3.15. Use :func:`locale.setlocale`, :"
+"func:`locale.getencoding` and :func:`locale.getlocale` instead. (Contributed "
+"by Hugo van Kemenade in :gh:`111187`.)"
msgstr ""
":class:`locale`::func:`locale.getdefaultlocale` 已在 Python 3.11 中被棄用,"
"原本計劃在 Python 3.13 中移除 (:gh:`90817`),但被延後至 Python 3.15。請改用 :"
diff --git a/howto/descriptor.po b/howto/descriptor.po
index f74accc814..ffd0cffabc 100644
--- a/howto/descriptor.po
+++ b/howto/descriptor.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-06-13 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -410,9 +410,9 @@ msgstr ""
msgid ""
"Descriptors are a powerful, general purpose protocol. They are the "
"mechanism behind properties, methods, static methods, class methods, and :"
-"func:`super()`. They are used throughout Python itself. Descriptors "
-"simplify the underlying C code and offer a flexible set of new tools for "
-"everyday Python programs."
+"func:`super`. They are used throughout Python itself. Descriptors simplify "
+"the underlying C code and offer a flexible set of new tools for everyday "
+"Python programs."
msgstr ""
#: ../../howto/descriptor.rst:522
diff --git a/howto/enum.po b/howto/enum.po
index 82e5e23b33..0f7612fafe 100644
--- a/howto/enum.po
+++ b/howto/enum.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-06-20 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -24,8 +24,8 @@ msgstr ""
#: ../../howto/enum.rst:9
msgid ""
"An :class:`Enum` is a set of symbolic names bound to unique values. They "
-"are similar to global variables, but they offer a more useful :func:"
-"`repr()`, grouping, type-safety, and a few other features."
+"are similar to global variables, but they offer a more useful :func:`repr`, "
+"grouping, type-safety, and a few other features."
msgstr ""
#: ../../howto/enum.rst:13
@@ -148,7 +148,7 @@ msgstr ""
#: ../../howto/enum.rst:167
msgid ""
"In cases where the actual values of the members do not matter, you can save "
-"yourself some work and use :func:`auto()` for the values::"
+"yourself some work and use :func:`auto` for the values::"
msgstr ""
#: ../../howto/enum.rst:186
diff --git a/howto/instrumentation.po b/howto/instrumentation.po
index 0850e3c94d..f7bec8aaa9 100644
--- a/howto/instrumentation.po
+++ b/howto/instrumentation.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-10-12 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+0000\n"
"PO-Revision-Date: 2023-08-17 22:17+0800\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -289,9 +289,10 @@ msgid "The arguments are the same as for :c:func:`!function__entry`."
msgstr "引數與 :c:func:`!function__entry` 相同。"
#: ../../howto/instrumentation.rst:309
+#, fuzzy
msgid ""
"Fires when the Python interpreter starts a garbage collection cycle. "
-"``arg0`` is the generation to scan, like :func:`gc.collect()`."
+"``arg0`` is the generation to scan, like :func:`gc.collect`."
msgstr ""
"當 Python 直譯器開始垃圾回收 (garbage collection) 週期時觸發。``arg0`` 是要掃"
"描的一代 (generation),如 :func:`gc.collect()`。"
diff --git a/library/ast.po b/library/ast.po
index 8e1b9e8d98..caa3499991 100644
--- a/library/ast.po
+++ b/library/ast.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-28 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -1271,11 +1271,12 @@ msgstr ""
"PyCF_ONLY_AST)``。"
#: ../../library/ast.rst:2171
+#, fuzzy
msgid ""
"If ``type_comments=True`` is given, the parser is modified to check and "
"return type comments as specified by :pep:`484` and :pep:`526`. This is "
"equivalent to adding :data:`ast.PyCF_TYPE_COMMENTS` to the flags passed to :"
-"func:`compile()`. This will report syntax errors for misplaced type "
+"func:`compile`. This will report syntax errors for misplaced type "
"comments. Without this flag, type comments will be ignored, and the "
"``type_comment`` field on selected AST nodes will always be ``None``. In "
"addition, the locations of ``# type: ignore`` comments will be returned as "
diff --git a/library/asyncio-runner.po b/library/asyncio-runner.po
index 4d864c92fd..80ebb00865 100644
--- a/library/asyncio-runner.po
+++ b/library/asyncio-runner.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-07-17 17:39+0800\n"
+"POT-Creation-Date: 2024-08-30 18:24+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -133,7 +133,7 @@ msgstr ""
#: ../../library/asyncio-runner.rst:92
msgid ""
-"Basically, :func:`asyncio.run()` example can be rewritten with the runner "
+"Basically, :func:`asyncio.run` example can be rewritten with the runner "
"usage::"
msgstr ""
diff --git a/library/compileall.po b/library/compileall.po
index 9bd89d349e..a89bfd4561 100644
--- a/library/compileall.po
+++ b/library/compileall.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-05-09 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -128,7 +128,7 @@ msgstr ""
#: ../../library/compileall.rst:92
msgid ""
"Use *N* workers to compile the files within the given directory. If ``0`` is "
-"used, then the result of :func:`os.cpu_count()` will be used."
+"used, then the result of :func:`os.cpu_count` will be used."
msgstr ""
#: ../../library/compileall.rst:98
diff --git a/library/contextvars.po b/library/contextvars.po
index 5ef8f55540..bb81396e9c 100644
--- a/library/contextvars.po
+++ b/library/contextvars.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-05-09 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -31,7 +31,7 @@ msgstr ""
#: ../../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 "
+"func:`threading.local` to prevent their state from bleeding to other code "
"unexpectedly, when used in concurrent code."
msgstr ""
@@ -181,7 +181,7 @@ msgstr ""
msgid ""
"Every thread will have a different top-level :class:`~contextvars.Context` "
"object. This means that a :class:`ContextVar` object behaves in a similar "
-"fashion to :func:`threading.local()` when values are assigned in different "
+"fashion to :func:`threading.local` when values are assigned in different "
"threads."
msgstr ""
diff --git a/library/functions.po b/library/functions.po
index 781b799f9d..e05dba398b 100644
--- a/library/functions.po
+++ b/library/functions.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-04 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -512,10 +512,11 @@ msgid "The parameter is now positional-only."
msgstr "現在為僅限位置參數。"
#: ../../library/functions.rst:161
+#, fuzzy
msgid ""
"This function drops you into the debugger at the call site. Specifically, "
"it calls :func:`sys.breakpointhook`, passing ``args`` and ``kws`` straight "
-"through. By default, ``sys.breakpointhook()`` calls :func:`pdb.set_trace()` "
+"through. By default, ``sys.breakpointhook()`` calls :func:`pdb.set_trace` "
"expecting no arguments. In this case, it is purely a convenience function "
"so you don't have to explicitly import :mod:`pdb` or type as much code to "
"enter the debugger. However, :func:`sys.breakpointhook` can be set to some "
@@ -2036,6 +2037,7 @@ msgstr ""
"閉,除非 *closefd* 被設為 ``False``。)"
#: ../../library/functions.rst:1263
+#, fuzzy
msgid ""
"*mode* is an optional string that specifies the mode in which the file is "
"opened. It defaults to ``'r'`` which means open for reading in text mode. "
@@ -2044,7 +2046,7 @@ msgid ""
"(which on *some* Unix systems, means that *all* writes append to the end of "
"the file regardless of the current seek position). In text mode, if "
"*encoding* is not specified the encoding used is platform-dependent: :func:"
-"`locale.getencoding()` is called to get the current locale encoding. (For "
+"`locale.getencoding` is called to get the current locale encoding. (For "
"reading and writing raw bytes use binary mode and leave *encoding* "
"unspecified.) The available modes are:"
msgstr ""
diff --git a/library/functools.po b/library/functools.po
index 52eed22cf3..64f97ef6df 100644
--- a/library/functools.po
+++ b/library/functools.po
@@ -54,8 +54,8 @@ msgstr ""
msgid ""
"Returns the same as ``lru_cache(maxsize=None)``, creating a thin wrapper "
"around a dictionary lookup for the function arguments. Because it never "
-"needs to evict old values, this is smaller and faster than :func:"
-"`lru_cache()` with a size limit."
+"needs to evict old values, this is smaller and faster than :func:`lru_cache` "
+"with a size limit."
msgstr ""
"和 ``lru_cache(maxsize=None)`` 回傳相同的值,為函式引數建立一個字典查找的薄包"
"裝器。因為它永遠不需要丟棄舊值,所以這比有大小限制的 :func:`lru_cache()` 更"
diff --git a/library/getpass.po b/library/getpass.po
index b20161096f..3a46239e62 100644
--- a/library/getpass.po
+++ b/library/getpass.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-05-09 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+0000\n"
"PO-Revision-Date: 2022-02-11 12:04+0800\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -98,6 +98,6 @@ msgstr ""
"將引發一個例外。"
#: ../../library/getpass.rst:52
-msgid ""
-"In general, this function should be preferred over :func:`os.getlogin()`."
+#, fuzzy
+msgid "In general, this function should be preferred over :func:`os.getlogin`."
msgstr "大部分情況下,此函式應該要比 :func:`os.getlogin()` 優先使用。"
diff --git a/library/inspect.po b/library/inspect.po
index 8a74de9c9d..b80f768164 100644
--- a/library/inspect.po
+++ b/library/inspect.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-23 00:04+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -1485,7 +1485,7 @@ msgstr ""
#: ../../library/inspect.rst:1206
msgid ""
"If ``eval_str`` is true, values of type ``str`` will be un-stringized using :"
-"func:`eval()`. This is intended for use with stringized annotations (``from "
+"func:`eval`. This is intended for use with stringized annotations (``from "
"__future__ import annotations``)."
msgstr ""
@@ -1515,15 +1515,14 @@ msgstr ""
#: ../../library/inspect.rst:1220
msgid ""
"``eval_str`` controls whether or not values of type ``str`` are replaced "
-"with the result of calling :func:`eval()` on those values:"
+"with the result of calling :func:`eval` on those values:"
msgstr ""
#: ../../library/inspect.rst:1223
msgid ""
-"If eval_str is true, :func:`eval()` is called on values of type ``str``. "
-"(Note that ``get_annotations`` doesn't catch exceptions; if :func:`eval()` "
-"raises an exception, it will unwind the stack past the ``get_annotations`` "
-"call.)"
+"If eval_str is true, :func:`eval` is called on values of type ``str``. (Note "
+"that ``get_annotations`` doesn't catch exceptions; if :func:`eval` raises an "
+"exception, it will unwind the stack past the ``get_annotations`` call.)"
msgstr ""
#: ../../library/inspect.rst:1227
@@ -1533,8 +1532,8 @@ msgstr ""
#: ../../library/inspect.rst:1229
msgid ""
-"``globals`` and ``locals`` are passed in to :func:`eval()`; see the "
-"documentation for :func:`eval()` for more information. If ``globals`` or "
+"``globals`` and ``locals`` are passed in to :func:`eval`; see the "
+"documentation for :func:`eval` for more information. If ``globals`` or "
"``locals`` is ``None``, this function may replace that value with a context-"
"specific default, contingent on ``type(obj)``:"
msgstr ""
diff --git a/library/io.po b/library/io.po
index fc294b51d0..86378243a4 100644
--- a/library/io.po
+++ b/library/io.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-04 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -1491,7 +1491,7 @@ msgstr ""
#: ../../library/io.rst:952
msgid ""
"*encoding* gives the name of the encoding that the stream will be decoded or "
-"encoded with. It defaults to :func:`locale.getencoding()`. "
+"encoded with. It defaults to :func:`locale.getencoding`. "
"``encoding=\"locale\"`` can be used to specify the current locale's encoding "
"explicitly. See :ref:`io-text-encoding` for more information."
msgstr ""
@@ -1786,10 +1786,10 @@ msgstr ""
#: ../../library/io.rst:1185
msgid ""
-"The above implicitly extends to text files, since the :func:`open()` "
-"function will wrap a buffered object inside a :class:`TextIOWrapper`. This "
-"includes standard streams and therefore affects the built-in :func:`print()` "
-"function as well."
+"The above implicitly extends to text files, since the :func:`open` function "
+"will wrap a buffered object inside a :class:`TextIOWrapper`. This includes "
+"standard streams and therefore affects the built-in :func:`print` function "
+"as well."
msgstr ""
#: ../../library/io.rst:24
diff --git a/library/ipaddress.po b/library/ipaddress.po
index 53137322f5..1262b1f168 100644
--- a/library/ipaddress.po
+++ b/library/ipaddress.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-06-16 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -953,7 +953,7 @@ msgstr ""
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 "
-"use this function as the *key* argument to :func:`sorted()`."
+"use this function as the *key* argument to :func:`sorted`."
msgstr ""
#: ../../library/ipaddress.rst:1008
diff --git a/library/os.po b/library/os.po
index d8857b4514..ce32682992 100644
--- a/library/os.po
+++ b/library/os.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-04 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -192,13 +192,14 @@ msgid ""
msgstr ""
#: ../../library/os.rst:116
-msgid ":func:`sys.getfilesystemencoding()` returns ``'utf-8'``."
+#, fuzzy
+msgid ":func:`sys.getfilesystemencoding` returns ``'utf-8'``."
msgstr ":func:`sys.getfilesystemencoding()` 回傳 ``'utf-8'``。"
#: ../../library/os.rst:117
msgid ""
-":func:`locale.getpreferredencoding()` returns ``'utf-8'`` (the "
-"*do_setlocale* argument has no effect)."
+":func:`locale.getpreferredencoding` returns ``'utf-8'`` (the *do_setlocale* "
+"argument has no effect)."
msgstr ""
#: ../../library/os.rst:119
@@ -236,12 +237,12 @@ msgid ""
msgstr ""
#: ../../library/os.rst:136
-msgid ":func:`os.fsdecode()` and :func:`os.fsencode()` use the UTF-8 encoding."
+msgid ":func:`os.fsdecode` and :func:`os.fsencode` use the UTF-8 encoding."
msgstr ""
#: ../../library/os.rst:137
msgid ""
-":func:`open()`, :func:`io.open()`, and :func:`codecs.open()` use the UTF-8 "
+":func:`open`, :func:`io.open`, and :func:`codecs.open` use the UTF-8 "
"encoding by default. However, they still use the strict error handler by "
"default so that attempting to open a binary file in text mode is likely to "
"raise an exception rather than producing nonsense data."
@@ -3063,9 +3064,9 @@ msgstr ""
#: ../../library/os.rst:2757
msgid ""
"Added support for the :term:`context manager` protocol and the :func:"
-"`~scandir.close()` method. If a :func:`scandir` iterator is neither "
-"exhausted nor explicitly closed a :exc:`ResourceWarning` will be emitted in "
-"its destructor."
+"`~scandir.close` method. If a :func:`scandir` iterator is neither exhausted "
+"nor explicitly closed a :exc:`ResourceWarning` will be emitted in its "
+"destructor."
msgstr ""
#: ../../library/os.rst:2763
diff --git a/library/pdb.po b/library/pdb.po
index 47840f05d9..1389ee3bd6 100644
--- a/library/pdb.po
+++ b/library/pdb.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-04 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -79,7 +79,7 @@ msgstr ""
#: ../../library/pdb.rst:51
msgid ""
-"The built-in :func:`breakpoint()`, when called with defaults, can be used "
+"The built-in :func:`breakpoint`, when called with defaults, can be used "
"instead of ``import pdb; pdb.set_trace()``."
msgstr ""
diff --git a/library/signal.po b/library/signal.po
index d2ea696943..000327aaff 100644
--- a/library/signal.po
+++ b/library/signal.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-04 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -485,7 +485,7 @@ msgstr ""
#: ../../library/signal.rst:428
msgid ""
-"Use :func:`threading.get_ident()` or the :attr:`~threading.Thread.ident` "
+"Use :func:`threading.get_ident` or the :attr:`~threading.Thread.ident` "
"attribute of :class:`threading.Thread` objects to get a suitable value for "
"*thread_id*."
msgstr ""
diff --git a/library/stdtypes.po b/library/stdtypes.po
index cba4ead41f..9d6ee4af1c 100644
--- a/library/stdtypes.po
+++ b/library/stdtypes.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-26 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -4122,7 +4122,7 @@ msgstr ""
#: ../../library/stdtypes.rst:3435
msgid ""
-"Unlike :func:`str.swapcase()`, it is always the case that ``bin.swapcase()."
+"Unlike :func:`str.swapcase`, it is always the case that ``bin.swapcase()."
"swapcase() == bin`` for the binary versions. Case conversions are "
"symmetrical in ASCII, even though that is not generally true for arbitrary "
"Unicode code points."
@@ -5958,9 +5958,9 @@ msgstr ""
#: ../../library/stdtypes.rst:5296
msgid ""
-"Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````."
+"Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````."
msgstr ""
#: ../../library/stdtypes.rst:5304
diff --git a/library/subprocess.po b/library/subprocess.po
index d5129c9af3..f488ff404f 100644
--- a/library/subprocess.po
+++ b/library/subprocess.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-04 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -738,7 +738,7 @@ msgstr "新增 *process_group*。"
msgid ""
"If *group* is not ``None``, the setregid() system call will be made in the "
"child process prior to the execution of the subprocess. If the provided "
-"value is a string, it will be looked up via :func:`grp.getgrnam()` and the "
+"value is a string, it will be looked up via :func:`grp.getgrnam` and the "
"value in ``gr_gid`` will be used. If the value is an integer, it will be "
"passed verbatim. (POSIX only)"
msgstr ""
@@ -747,7 +747,7 @@ msgstr ""
msgid ""
"If *extra_groups* is not ``None``, the setgroups() system call will be made "
"in the child process prior to the execution of the subprocess. Strings "
-"provided in *extra_groups* will be looked up via :func:`grp.getgrnam()` and "
+"provided in *extra_groups* will be looked up via :func:`grp.getgrnam` and "
"the values in ``gr_gid`` will be used. Integer values will be passed "
"verbatim. (POSIX only)"
msgstr ""
@@ -756,7 +756,7 @@ msgstr ""
msgid ""
"If *user* is not ``None``, the setreuid() system call will be made in the "
"child process prior to the execution of the subprocess. If the provided "
-"value is a string, it will be looked up via :func:`pwd.getpwnam()` and the "
+"value is a string, it will be looked up via :func:`pwd.getpwnam` and the "
"value in ``pw_uid`` will be used. If the value is an integer, it will be "
"passed verbatim. (POSIX only)"
msgstr ""
diff --git a/library/sys.po b/library/sys.po
index 684febadfc..4f84aa5158 100644
--- a/library/sys.po
+++ b/library/sys.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-04 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -929,14 +929,13 @@ msgid ""
"regardless of their size. This function is mainly useful for tracking and "
"debugging memory leaks. Because of the interpreter's internal caches, the "
"result can vary from call to call; you may have to call :func:"
-"`_clear_type_cache()` and :func:`gc.collect()` to get more predictable "
-"results."
+"`_clear_type_cache` and :func:`gc.collect` to get more predictable results."
msgstr ""
#: ../../library/sys.rst:730
msgid ""
"If a Python build or implementation cannot reasonably compute this "
-"information, :func:`getallocatedblocks()` is allowed to return 0 instead."
+"information, :func:`getallocatedblocks` is allowed to return 0 instead."
msgstr ""
#: ../../library/sys.rst:738
diff --git a/library/sysconfig.po b/library/sysconfig.po
index cb05043805..a55948b159 100644
--- a/library/sysconfig.po
+++ b/library/sysconfig.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-24 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -515,7 +515,7 @@ msgstr ""
#: ../../library/sysconfig.rst:307
msgid ""
"End users should not use this function, but :func:`get_default_scheme` and :"
-"func:`get_preferred_scheme()` instead."
+"func:`get_preferred_scheme` instead."
msgstr ""
#: ../../library/sysconfig.rst:315
diff --git a/library/tarfile.po b/library/tarfile.po
index 90a84b83c5..9c28f33fdc 100644
--- a/library/tarfile.po
+++ b/library/tarfile.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-05-09 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -880,8 +880,7 @@ msgid ""
"default, although, since it affects all uses of *tarfile*, it is best "
"practice to only do so in top-level applications or :mod:`site configuration "
"`. To set a global default this way, a filter function needs to be "
-"wrapped in :func:`staticmethod()` to prevent injection of a ``self`` "
-"argument."
+"wrapped in :func:`staticmethod` to prevent injection of a ``self`` argument."
msgstr ""
#: ../../library/tarfile.rst:615
diff --git a/library/test.po b/library/test.po
index 4ad772506f..cf3576981a 100644
--- a/library/test.po
+++ b/library/test.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-05-09 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -1709,7 +1709,7 @@ msgstr ""
#: ../../library/test.rst:1698
msgid ""
-"A convenience wrapper for :func:`warnings.catch_warnings()` that makes it "
+"A convenience wrapper for :func:`warnings.catch_warnings` that makes it "
"easier to test that a warning was correctly raised. It is approximately "
"equivalent to calling ``warnings.catch_warnings(record=True)`` with :meth:"
"`warnings.simplefilter` set to ``always`` and with the option to "
diff --git a/library/token.po b/library/token.po
index 37f5e01dba..c1ca41b9e8 100644
--- a/library/token.po
+++ b/library/token.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-05-09 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -284,8 +284,7 @@ msgstr ""
#: ../../library/token.rst:77
msgid ""
"Token value indicating that a type comment was recognized. Such tokens are "
-"only produced when :func:`ast.parse()` is invoked with "
-"``type_comments=True``."
+"only produced when :func:`ast.parse` is invoked with ``type_comments=True``."
msgstr ""
#: ../../library/token.rst:82
diff --git a/library/unittest.po b/library/unittest.po
index 37618350e1..cea9d61fbf 100644
--- a/library/unittest.po
+++ b/library/unittest.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-19 01:06+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -2975,7 +2975,7 @@ msgstr ""
#: ../../library/unittest.rst:2523
msgid ""
"The :option:`-c/--catch ` command-line option to unittest, "
-"along with the ``catchbreak`` parameter to :func:`unittest.main()`, provide "
+"along with the ``catchbreak`` parameter to :func:`unittest.main`, provide "
"more friendly handling of control-C during a test run. With catch break "
"behavior enabled control-C will allow the currently running test to "
"complete, and the test run will then end and report all the results so far. "
diff --git a/library/zipapp.po b/library/zipapp.po
index d707ed9f5a..b0c327d25b 100644
--- a/library/zipapp.po
+++ b/library/zipapp.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-05-09 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -425,7 +425,7 @@ msgid ""
"interpreter name, and then a newline (``b'\\n'``) character. The "
"interpreter name can be anything acceptable to the OS \"shebang\" "
"processing, or the Python launcher on Windows. The interpreter should be "
-"encoded in UTF-8 on Windows, and in :func:`sys.getfilesystemencoding()` on "
+"encoded in UTF-8 on Windows, and in :func:`sys.getfilesystemencoding` on "
"POSIX."
msgstr ""
diff --git a/reference/datamodel.po b/reference/datamodel.po
index e64f4904c9..e298b9437b 100644
--- a/reference/datamodel.po
+++ b/reference/datamodel.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-08 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -426,9 +426,9 @@ msgstr ""
msgid ""
"A 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."
+"``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:386
diff --git a/tutorial/floatingpoint.po b/tutorial/floatingpoint.po
index a33ba891ee..5cb248e8e0 100644
--- a/tutorial/floatingpoint.po
+++ b/tutorial/floatingpoint.po
@@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-20 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+0000\n"
"PO-Revision-Date: 2023-06-22 14:43+0800\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -340,11 +340,12 @@ msgstr ""
"善總體準確度 (overall accuracy),使得誤差不至於累積到影響最終總計值的程度:"
#: ../../tutorial/floatingpoint.rst:233
+#, fuzzy
msgid ""
-"The :func:`math.fsum()` goes further and tracks all of the \"lost digits\" "
-"as values are added onto a running total so that the result has only a "
-"single rounding. This is slower than :func:`sum` but will be more accurate "
-"in uncommon cases where large magnitude inputs mostly cancel each other out "
+"The :func:`math.fsum` goes further and tracks all of the \"lost digits\" as "
+"values are added onto a running total so that the result has only a single "
+"rounding. This is slower than :func:`sum` but will be more accurate in "
+"uncommon cases where large magnitude inputs mostly cancel each other out "
"leaving a final sum near zero:"
msgstr ""
":func:`math.fsum()` 更進一步將數值被加到運行總計中的總計時追蹤所有「失去的位"
diff --git a/using/cmdline.po b/using/cmdline.po
index 0ea621fbac..79fcaeae84 100644
--- a/using/cmdline.po
+++ b/using/cmdline.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-04 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -1140,7 +1140,7 @@ msgstr ""
#: ../../using/cmdline.rst:952
msgid ""
"This may also be enabled at runtime with :func:`sys."
-"_enablelegacywindowsfsencoding()`."
+"_enablelegacywindowsfsencoding`."
msgstr ""
#: ../../using/cmdline.rst:955 ../../using/cmdline.rst:969
diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po
index 85abce61ff..df14a69779 100644
--- a/whatsnew/3.10.po
+++ b/whatsnew/3.10.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-04-29 00:04+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+0000\n"
"PO-Revision-Date: 2023-06-26 03:02+0800\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -1754,9 +1754,10 @@ msgid "itertools"
msgstr "itertools"
#: ../../whatsnew/3.10.rst:1236
+#, fuzzy
msgid ""
-"Add :func:`itertools.pairwise()`. (Contributed by Raymond Hettinger in :"
-"issue:`38200`.)"
+"Add :func:`itertools.pairwise`. (Contributed by Raymond Hettinger in :issue:"
+"`38200`.)"
msgstr ""
"新增 :func:`itertools.pairwise()`。(由 Raymond Hettinger 在 :issue:`38200` "
"中貢獻。)"
@@ -1770,8 +1771,9 @@ msgid "os"
msgstr "os"
#: ../../whatsnew/3.10.rst:1248
+#, fuzzy
msgid ""
-"Add :func:`os.cpu_count()` support for VxWorks RTOS. (Contributed by Peixing "
+"Add :func:`os.cpu_count` support for VxWorks RTOS. (Contributed by Peixing "
"Xin in :issue:`41440`.)"
msgstr ""
"為 VxWorks RTOS 新增 :func:`os.cpu_count()` 支援。(由 Peixing Xin 在 :issue:"
@@ -1787,11 +1789,12 @@ msgstr ""
"呼叫。(由 Christian Heimes 在 :issue:`41001` 中貢獻。)"
#: ../../whatsnew/3.10.rst:1255
+#, fuzzy
msgid ""
-"Add :func:`os.splice()` that allows to move data between two file "
-"descriptors without copying between kernel address space and user address "
-"space, where one of the file descriptors must refer to a pipe. (Contributed "
-"by Pablo Galindo in :issue:`41625`.)"
+"Add :func:`os.splice` that allows to move data between two file descriptors "
+"without copying between kernel address space and user address space, where "
+"one of the file descriptors must refer to a pipe. (Contributed by Pablo "
+"Galindo in :issue:`41625`.)"
msgstr ""
"新增 :func:`os.splice()` 以允許在兩個檔案描述器 (file descriptor) 之間移動資"
"料,而無需在核心地址空間 (kernel address space) 和使用者地址空間 (user "
@@ -1869,8 +1872,9 @@ msgid "platform"
msgstr "platform"
#: ../../whatsnew/3.10.rst:1295
+#, fuzzy
msgid ""
-"Add :func:`platform.freedesktop_os_release()` to retrieve operation system "
+"Add :func:`platform.freedesktop_os_release` to retrieve operation system "
"identification from `freedesktop.org os-release `_ standard file. (Contributed by "
"Christian Heimes in :issue:`28468`.)"
diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po
index bd8dc27ebf..663709c477 100644
--- a/whatsnew/3.12.po
+++ b/whatsnew/3.12.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-26 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -2071,8 +2071,9 @@ msgid "``read_text()``"
msgstr "``read_text()``"
#: ../../deprecations/pending-removal-in-3.13.rst:51
+#, fuzzy
msgid ""
-"Use :func:`importlib.resources.files()` instead. Refer to `importlib-"
+"Use :func:`importlib.resources.files` instead. Refer to `importlib-"
"resources: Migrating from Legacy `_ (:gh:`106531`)"
msgstr ""
@@ -2264,12 +2265,13 @@ msgstr ""
"代方案。*任何東西*\\ 都比 CGI 更好的來介接一個帶有請求處理器的網頁伺服器。"
#: ../../deprecations/pending-removal-in-3.15.rst:9
+#, fuzzy
msgid ""
":class:`locale`: :func:`locale.getdefaultlocale` was deprecated in Python "
"3.11 and originally planned for removal in Python 3.13 (:gh:`90817`), but "
-"removal has been postponed to Python 3.15. Use :func:`locale.setlocale()`, :"
-"func:`locale.getencoding()` and :func:`locale.getlocale()` instead. "
-"(Contributed by Hugo van Kemenade in :gh:`111187`.)"
+"removal has been postponed to Python 3.15. Use :func:`locale.setlocale`, :"
+"func:`locale.getencoding` and :func:`locale.getlocale` instead. (Contributed "
+"by Hugo van Kemenade in :gh:`111187`.)"
msgstr ""
":class:`locale`::func:`locale.getdefaultlocale` 已在 Python 3.11 中被棄用,"
"原本計劃在 Python 3.13 中移除 (:gh:`90817`),但被延後至 Python 3.15。請改用 :"
@@ -2926,9 +2928,9 @@ msgstr "hashlib"
#: ../../whatsnew/3.12.rst:1435
msgid ""
"Remove the pure Python implementation of :mod:`hashlib`'s :func:`hashlib."
-"pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires "
+"pbkdf2_hmac`, deprecated in Python 3.10. Python 3.10 and newer requires "
"OpenSSL 1.1.1 (:pep:`644`): this OpenSSL version provides a C implementation "
-"of :func:`~hashlib.pbkdf2_hmac()` which is faster. (Contributed by Victor "
+"of :func:`~hashlib.pbkdf2_hmac` which is faster. (Contributed by Victor "
"Stinner in :gh:`94199`.)"
msgstr ""
diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po
index 684f8b234a..4f855019a6 100644
--- a/whatsnew/3.2.po
+++ b/whatsnew/3.2.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-20 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+0000\n"
"PO-Revision-Date: 2018-05-23 16:20+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -2572,7 +2572,7 @@ msgid ""
"ensuing system calls. The notion of a \"check interval\" to allow thread "
"switches has been abandoned and replaced by an absolute duration expressed "
"in seconds. This parameter is tunable through :func:`sys."
-"setswitchinterval()`. It currently defaults to 5 milliseconds."
+"setswitchinterval`. It currently defaults to 5 milliseconds."
msgstr ""
#: ../../whatsnew/3.2.rst:2327
diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po
index dc5f59f128..97f8eef615 100644
--- a/whatsnew/3.3.po
+++ b/whatsnew/3.3.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-20 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+0000\n"
"PO-Revision-Date: 2018-05-23 16:20+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -996,8 +996,8 @@ msgstr "對核心 Python 語言所做的一些較小的更改包括:"
#: ../../whatsnew/3.3.rst:781
msgid ""
"Added support for Unicode name aliases and named sequences. Both :func:"
-"`unicodedata.lookup()` and ``'\\N{...}'`` now resolve name aliases, and :"
-"func:`unicodedata.lookup()` resolves named sequences too."
+"`unicodedata.lookup` and ``'\\N{...}'`` now resolve name aliases, and :func:"
+"`unicodedata.lookup` resolves named sequences too."
msgstr ""
#: ../../whatsnew/3.3.rst:785
diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po
index 6e6272f306..b3ed186435 100644
--- a/whatsnew/3.4.po
+++ b/whatsnew/3.4.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-14 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+0000\n"
"PO-Revision-Date: 2018-05-23 16:20+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -2678,7 +2678,7 @@ msgstr ""
msgid ""
"The ``-R`` option to the :ref:`python regression test suite ` now "
"also checks for memory allocation leaks, using :func:`sys."
-"getallocatedblocks()`. (Contributed by Antoine Pitrou in :issue:`13390`.)"
+"getallocatedblocks`. (Contributed by Antoine Pitrou in :issue:`13390`.)"
msgstr ""
#: ../../whatsnew/3.4.rst:1973
diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po
index f380ef8255..bf3d5e7469 100644
--- a/whatsnew/3.6.po
+++ b/whatsnew/3.6.po
@@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-20 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+0000\n"
"PO-Revision-Date: 2018-07-15 18:56+0800\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
@@ -557,13 +557,13 @@ msgid ""
"Prior to Python 3.6, data loss could result when using bytes paths on "
"Windows. With this change, using bytes to represent paths is now supported "
"on Windows, provided those bytes are encoded with the encoding returned by :"
-"func:`sys.getfilesystemencoding()`, which now defaults to ``'utf-8'``."
+"func:`sys.getfilesystemencoding`, which now defaults to ``'utf-8'``."
msgstr ""
#: ../../whatsnew/3.6.rst:516
msgid ""
"Applications that do not use str to represent paths should use :func:`os."
-"fsencode()` and :func:`os.fsdecode()` to ensure their bytes are correctly "
+"fsencode` and :func:`os.fsdecode` to ensure their bytes are correctly "
"encoded. To revert to the previous behaviour, set :envvar:"
"`PYTHONLEGACYWINDOWSFSENCODING` or call :func:`sys."
"_enablelegacywindowsfsencoding`."
@@ -902,7 +902,7 @@ msgstr ""
msgid ""
"Note that the pseudo-random generators in the :mod:`random` module should "
"*NOT* be used for security purposes. Use :mod:`secrets` on Python 3.6+ and :"
-"func:`os.urandom()` on Python 3.5 and earlier."
+"func:`os.urandom` on Python 3.5 and earlier."
msgstr ""
#: ../../whatsnew/3.6.rst:787
@@ -1668,7 +1668,7 @@ msgstr "pickletools"
#: ../../whatsnew/3.6.rst:1319
msgid ""
-":func:`pickletools.dis()` now outputs the implicit memo index for the "
+":func:`pickletools.dis` now outputs the implicit memo index for the "
"``MEMOIZE`` opcode. (Contributed by Serhiy Storchaka in :issue:`25382`.)"
msgstr ""
diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po
index 789ecaef6f..b3cf9e6466 100644
--- a/whatsnew/3.7.po
+++ b/whatsnew/3.7.po
@@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-20 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -3327,7 +3327,7 @@ msgstr ""
#: ../../whatsnew/3.7.rst:2369
msgid ""
-":func:`re.sub()` now replaces empty matches adjacent to a previous non-empty "
+":func:`re.sub` now replaces empty matches adjacent to a previous non-empty "
"match. For example ``re.sub('x*', '-', 'abxd')`` returns now ``'-a-b--d-'`` "
"instead of ``'-a-b-d-'`` (the first minus between 'b' and 'd' replaces 'x', "
"and the second minus replaces an empty string between 'x' and 'd')."
diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po
index 789da68496..67b22168f5 100644
--- a/whatsnew/3.8.po
+++ b/whatsnew/3.8.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-20 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -1134,8 +1134,8 @@ msgstr "logging"
#: ../../whatsnew/3.8.rst:939
msgid ""
-"Added a *force* keyword argument to :func:`logging.basicConfig()` When set "
-"to true, any existing handlers attached to the root logger are removed and "
+"Added a *force* keyword argument to :func:`logging.basicConfig` When set to "
+"true, any existing handlers attached to the root logger are removed and "
"closed before carrying out the configuration specified by the other "
"arguments."
msgstr ""
@@ -1453,8 +1453,8 @@ msgstr ""
#: ../../whatsnew/3.8.rst:1178
msgid ""
-"The :func:`socket.if_nameindex()`, :func:`socket.if_nametoindex()`, and :"
-"func:`socket.if_indextoname()` functions have been implemented on Windows. "
+"The :func:`socket.if_nameindex`, :func:`socket.if_nametoindex`, and :func:"
+"`socket.if_indextoname` functions have been implemented on Windows. "
"(Contributed by Zackery Spytz in :issue:`37007`.)"
msgstr ""
@@ -1476,15 +1476,16 @@ msgstr "statistics"
#: ../../whatsnew/3.8.rst:1195
msgid ""
"Added :func:`statistics.fmean` as a faster, floating-point variant of :func:"
-"`statistics.mean()`. (Contributed by Raymond Hettinger and Steven D'Aprano "
+"`statistics.mean`. (Contributed by Raymond Hettinger and Steven D'Aprano "
"in :issue:`35904`.)"
msgstr ""
#: ../../whatsnew/3.8.rst:1199
+#, fuzzy
msgid ""
-"Added :func:`statistics.geometric_mean()` (Contributed by Raymond Hettinger "
+"Added :func:`statistics.geometric_mean` (Contributed by Raymond Hettinger "
"in :issue:`27181`.)"
-msgstr ""
+msgstr "(由 Raymond Hettinger 在 :issue:`36772` 中貢獻。)"
#: ../../whatsnew/3.8.rst:1202
msgid ""
@@ -1678,9 +1679,9 @@ msgstr ""
#: ../../whatsnew/3.8.rst:1370
msgid ""
-"Added :func:`~unittest.addModuleCleanup()` and :meth:`~unittest.TestCase."
+"Added :func:`~unittest.addModuleCleanup` and :meth:`~unittest.TestCase."
"addClassCleanup()` to unittest to support cleanups for :func:`~unittest."
-"setUpModule()` and :meth:`~unittest.TestCase.setUpClass()`. (Contributed by "
+"setUpModule` and :meth:`~unittest.TestCase.setUpClass()`. (Contributed by "
"Lisa Roach in :issue:`24412`.)"
msgstr ""
@@ -1745,7 +1746,7 @@ msgstr ""
#: ../../whatsnew/3.8.rst:1434
msgid ""
"The :mod:`xml.etree.ElementTree` module provides a new function :func:`–xml."
-"etree.ElementTree.canonicalize()` that implements C14N 2.0. (Contributed by "
+"etree.ElementTree.canonicalize` that implements C14N 2.0. (Contributed by "
"Stefan Behnel in :issue:`13611`.)"
msgstr ""
diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po
index 239234ce35..2fea2ebdfd 100644
--- a/whatsnew/3.9.po
+++ b/whatsnew/3.9.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-05-27 00:03+0000\n"
+"POT-Creation-Date: 2024-08-30 18:24+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-"
@@ -1414,8 +1414,8 @@ msgstr ""
#: ../../whatsnew/3.9.rst:985
msgid ""
"``aifc.openfp()`` alias to ``aifc.open()``, ``sunau.openfp()`` alias to "
-"``sunau.open()``, and ``wave.openfp()`` alias to :func:`wave.open()` have "
-"been removed. They were deprecated since Python 3.7. (Contributed by Victor "
+"``sunau.open()``, and ``wave.openfp()`` alias to :func:`wave.open` have been "
+"removed. They were deprecated since Python 3.7. (Contributed by Victor "
"Stinner in :issue:`37320`.)"
msgstr ""
From 9a23ce457d9f8047e3410383ef9fa80b8907c19c Mon Sep 17 00:00:00 2001
From: Matt Wang
Date: Sat, 31 Aug 2024 02:56:57 +0800
Subject: [PATCH 07/16] resolve fuzzy entries
---
deprecations/index.po | 8 +++-----
deprecations/pending-removal-in-3.13.po | 3 +--
deprecations/pending-removal-in-3.15.po | 5 ++---
howto/instrumentation.po | 3 +--
library/ast.po | 3 +--
library/functions.po | 12 +++++-------
library/functools.po | 4 ++--
library/getpass.po | 3 +--
library/os.po | 3 +--
tutorial/floatingpoint.po | 6 ++----
whatsnew/3.10.po | 11 ++++-------
whatsnew/3.12.po | 8 +++-----
whatsnew/3.8.po | 7 ++++---
13 files changed, 30 insertions(+), 46 deletions(-)
diff --git a/deprecations/index.po b/deprecations/index.po
index 663180772e..96ef5f4c93 100644
--- a/deprecations/index.po
+++ b/deprecations/index.po
@@ -185,13 +185,12 @@ msgid "``read_text()``"
msgstr "``read_text()``"
#: ../../deprecations/pending-removal-in-3.13.rst:51
-#, fuzzy
msgid ""
"Use :func:`importlib.resources.files` instead. Refer to `importlib-"
"resources: Migrating from Legacy `_ (:gh:`106531`)"
msgstr ""
-"請改用 :func:`importlib.resources.files()`。請參閱 `importlib-resources: "
+"請改用 :func:`importlib.resources.files`。請參閱 `importlib-resources: "
"Migrating from Legacy `_ (:gh:`106531`)"
@@ -475,7 +474,6 @@ msgstr ""
"代方案。*任何東西*\\ 都比 CGI 更好的來介接一個帶有請求處理器的網頁伺服器。"
#: ../../deprecations/pending-removal-in-3.15.rst:9
-#, fuzzy
msgid ""
":class:`locale`: :func:`locale.getdefaultlocale` was deprecated in Python "
"3.11 and originally planned for removal in Python 3.13 (:gh:`90817`), but "
@@ -485,8 +483,8 @@ msgid ""
msgstr ""
":class:`locale`::func:`locale.getdefaultlocale` 已在 Python 3.11 中被棄用,"
"原本計劃在 Python 3.13 中移除 (:gh:`90817`),但被延後至 Python 3.15。請改用 :"
-"func:`locale.setlocale()`、:func:`locale.getencoding()` 和 :func:`locale."
-"getlocale()`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)"
+"func:`locale.setlocale`、:func:`locale.getencoding` 和 :func:`locale."
+"getlocale`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)"
#: ../../deprecations/pending-removal-in-3.15.rst:16
msgid ""
diff --git a/deprecations/pending-removal-in-3.13.po b/deprecations/pending-removal-in-3.13.po
index 83bf46b2af..75c25c93be 100644
--- a/deprecations/pending-removal-in-3.13.po
+++ b/deprecations/pending-removal-in-3.13.po
@@ -180,12 +180,11 @@ msgid "``read_text()``"
msgstr "``read_text()``"
#: ../../deprecations/pending-removal-in-3.13.rst:51
-#, fuzzy
msgid ""
"Use :func:`importlib.resources.files` instead. Refer to `importlib-"
"resources: Migrating from Legacy `_ (:gh:`106531`)"
msgstr ""
-"請改用 :func:`importlib.resources.files()`。請參閱 `importlib-resources: "
+"請改用 :func:`importlib.resources.files`。請參閱 `importlib-resources: "
"Migrating from Legacy `_ (:gh:`106531`)"
diff --git a/deprecations/pending-removal-in-3.15.po b/deprecations/pending-removal-in-3.15.po
index 4a14bbf621..de1de43e01 100644
--- a/deprecations/pending-removal-in-3.15.po
+++ b/deprecations/pending-removal-in-3.15.po
@@ -32,7 +32,6 @@ msgstr ""
"代方案。*任何東西*\\ 都比 CGI 更好的來介接一個帶有請求處理器的網頁伺服器。"
#: ../../deprecations/pending-removal-in-3.15.rst:9
-#, fuzzy
msgid ""
":class:`locale`: :func:`locale.getdefaultlocale` was deprecated in Python "
"3.11 and originally planned for removal in Python 3.13 (:gh:`90817`), but "
@@ -42,8 +41,8 @@ msgid ""
msgstr ""
":class:`locale`::func:`locale.getdefaultlocale` 已在 Python 3.11 中被棄用,"
"原本計劃在 Python 3.13 中移除 (:gh:`90817`),但被延後至 Python 3.15。請改用 :"
-"func:`locale.setlocale()`、:func:`locale.getencoding()` 和 :func:`locale."
-"getlocale()`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)"
+"func:`locale.setlocale`、:func:`locale.getencoding` 和 :func:`locale."
+"getlocale`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)"
#: ../../deprecations/pending-removal-in-3.15.rst:16
msgid ""
diff --git a/howto/instrumentation.po b/howto/instrumentation.po
index f7bec8aaa9..9170b986c1 100644
--- a/howto/instrumentation.po
+++ b/howto/instrumentation.po
@@ -289,13 +289,12 @@ msgid "The arguments are the same as for :c:func:`!function__entry`."
msgstr "引數與 :c:func:`!function__entry` 相同。"
#: ../../howto/instrumentation.rst:309
-#, fuzzy
msgid ""
"Fires when the Python interpreter starts a garbage collection cycle. "
"``arg0`` is the generation to scan, like :func:`gc.collect`."
msgstr ""
"當 Python 直譯器開始垃圾回收 (garbage collection) 週期時觸發。``arg0`` 是要掃"
-"描的一代 (generation),如 :func:`gc.collect()`。"
+"描的一代 (generation),如 :func:`gc.collect`。"
#: ../../howto/instrumentation.rst:314
msgid ""
diff --git a/library/ast.po b/library/ast.po
index caa3499991..fb1ed01700 100644
--- a/library/ast.po
+++ b/library/ast.po
@@ -1271,7 +1271,6 @@ msgstr ""
"PyCF_ONLY_AST)``。"
#: ../../library/ast.rst:2171
-#, fuzzy
msgid ""
"If ``type_comments=True`` is given, the parser is modified to check and "
"return type comments as specified by :pep:`484` and :pep:`526`. This is "
@@ -1285,7 +1284,7 @@ msgid ""
msgstr ""
"如果給定 ``type_comments=True``,剖析器將被修改為檢查並回傳 :pep:`484` 和 :"
"pep:`526` 指定的型別註釋。這相當於將 :data:`ast.PyCF_TYPE_COMMENTS` 新增到傳"
-"遞給 :func:`compile()` 的旗標中。這將報告錯誤型別註釋的語法錯誤。如果沒有此旗"
+"遞給 :func:`compile` 的旗標中。這將報告錯誤型別註釋的語法錯誤。如果沒有此旗"
"標,型別註釋將被忽略,並且所選 AST 節點上的 ``type_comment`` 欄位將始終為 "
"``None``。此外,``# type: ignore`` 註釋的位置將作為 :class:`Module` 的 "
"``type_ignores`` 屬性回傳(否則它始終是一個空串列)。"
diff --git a/library/functions.po b/library/functions.po
index e05dba398b..297b06d5a5 100644
--- a/library/functions.po
+++ b/library/functions.po
@@ -512,7 +512,6 @@ msgid "The parameter is now positional-only."
msgstr "現在為僅限位置參數。"
#: ../../library/functions.rst:161
-#, fuzzy
msgid ""
"This function drops you into the debugger at the call site. Specifically, "
"it calls :func:`sys.breakpointhook`, passing ``args`` and ``kws`` straight "
@@ -526,9 +525,9 @@ msgid ""
msgstr ""
"這個函式將呼叫 :func:`sys.breakpointhook` 函式,並將 ``args`` 和 ``kws`` 傳遞"
"給它。這將有效地讓你在特定的呼叫點進入除錯器。預設情況下,``sys."
-"breakpointhook()`` 呼叫 :func:`pdb.set_trace()` 不須帶任何引數。這樣的設計是"
-"為了方便使用者,讓他們不需要額外地導入 :mod:`pdb` 模組或輸入太多程式就可以進"
-"入除錯器。然而,可以將 :func:`sys.breakpointhook` 設置為其他函式,並且 :func:"
+"breakpointhook()`` 呼叫 :func:`pdb.set_trace` 不須帶任何引數。這樣的設計是為"
+"了方便使用者,讓他們不需要額外地導入 :mod:`pdb` 模組或輸入太多程式就可以進入"
+"除錯器。然而,可以將 :func:`sys.breakpointhook` 設置為其他函式,並且 :func:"
"`breakpoint` 將自動呼叫該函式,讓你進入所選擇的除錯器。如果無法存取 :func:"
"`sys.breakpointhook` 這個函式,則此函式將引發 :exc:`RuntimeError`。"
@@ -2037,7 +2036,6 @@ msgstr ""
"閉,除非 *closefd* 被設為 ``False``。)"
#: ../../library/functions.rst:1263
-#, fuzzy
msgid ""
"*mode* is an optional string that specifies the mode in which the file is "
"opened. It defaults to ``'r'`` which means open for reading in text mode. "
@@ -2055,8 +2053,8 @@ msgstr ""
"案)、唯一性建立 ``'x'``、追加寫入 ``'a'``\\ (在\\ *一些* Unix 系統上,無論"
"當前的檔案指標在什麼位置,*所有* 寫入都會追加到檔案末尾)。在文字模式,如果沒"
"有指定 *encoding*,則根據電腦平臺來決定使用的編碼:呼叫 :func:`locale."
-"getencoding()` 來獲取當前的本地編碼。(要讀取和寫入原始 bytes,請使用二進位制"
-"模式且不要指定 *encoding*。)可用的模式有:"
+"getencoding` 來獲取當前的本地編碼。(要讀取和寫入原始 bytes,請使用二進位制模"
+"式且不要指定 *encoding*。)可用的模式有:"
#: ../../library/functions.rst:1280
msgid "Character"
diff --git a/library/functools.po b/library/functools.po
index 64f97ef6df..c8c329e113 100644
--- a/library/functools.po
+++ b/library/functools.po
@@ -58,8 +58,8 @@ msgid ""
"with a size limit."
msgstr ""
"和 ``lru_cache(maxsize=None)`` 回傳相同的值,為函式引數建立一個字典查找的薄包"
-"裝器。因為它永遠不需要丟棄舊值,所以這比有大小限制的 :func:`lru_cache()` 更"
-"小、更快。"
+"裝器。因為它永遠不需要丟棄舊值,所以這比有大小限制的 :func:`lru_cache` 更小、"
+"更快。"
#: ../../library/functools.rst:39 ../../library/functools.rst:291
msgid "For example::"
diff --git a/library/getpass.po b/library/getpass.po
index 3a46239e62..16b7ea0454 100644
--- a/library/getpass.po
+++ b/library/getpass.po
@@ -98,6 +98,5 @@ msgstr ""
"將引發一個例外。"
#: ../../library/getpass.rst:52
-#, fuzzy
msgid "In general, this function should be preferred over :func:`os.getlogin`."
-msgstr "大部分情況下,此函式應該要比 :func:`os.getlogin()` 優先使用。"
+msgstr "大部分情況下,此函式應該要比 :func:`os.getlogin` 優先使用。"
diff --git a/library/os.po b/library/os.po
index ce32682992..fec54ddb75 100644
--- a/library/os.po
+++ b/library/os.po
@@ -192,9 +192,8 @@ msgid ""
msgstr ""
#: ../../library/os.rst:116
-#, fuzzy
msgid ":func:`sys.getfilesystemencoding` returns ``'utf-8'``."
-msgstr ":func:`sys.getfilesystemencoding()` 回傳 ``'utf-8'``。"
+msgstr ":func:`sys.getfilesystemencoding` 回傳 ``'utf-8'``。"
#: ../../library/os.rst:117
msgid ""
diff --git a/tutorial/floatingpoint.po b/tutorial/floatingpoint.po
index 5cb248e8e0..95f02c542c 100644
--- a/tutorial/floatingpoint.po
+++ b/tutorial/floatingpoint.po
@@ -1,5 +1,4 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) 2001-2022, Python Software Foundation
+# Copyright (C) 2001-2024, Python Software Foundation
# This file is distributed under the same license as the Python package.
#
# Translators:
@@ -340,7 +339,6 @@ msgstr ""
"善總體準確度 (overall accuracy),使得誤差不至於累積到影響最終總計值的程度:"
#: ../../tutorial/floatingpoint.rst:233
-#, fuzzy
msgid ""
"The :func:`math.fsum` goes further and tracks all of the \"lost digits\" as "
"values are added onto a running total so that the result has only a single "
@@ -348,7 +346,7 @@ msgid ""
"uncommon cases where large magnitude inputs mostly cancel each other out "
"leaving a final sum near zero:"
msgstr ""
-":func:`math.fsum()` 更進一步將數值被加到運行總計中的總計時追蹤所有「失去的位"
+":func:`math.fsum` 更進一步將數值被加到運行總計中的總計時追蹤所有「失去的位"
"數」,以便結果僅有一次捨入。這比 :func:`sum` 慢,但在不常見的情況下會更準確,"
"在這種情況下,大量輸入大多相互抵消,最終的總和會接近於零:"
diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po
index df14a69779..502b861726 100644
--- a/whatsnew/3.10.po
+++ b/whatsnew/3.10.po
@@ -1754,13 +1754,12 @@ msgid "itertools"
msgstr "itertools"
#: ../../whatsnew/3.10.rst:1236
-#, fuzzy
msgid ""
"Add :func:`itertools.pairwise`. (Contributed by Raymond Hettinger in :issue:"
"`38200`.)"
msgstr ""
-"新增 :func:`itertools.pairwise()`。(由 Raymond Hettinger 在 :issue:`38200` "
-"中貢獻。)"
+"新增 :func:`itertools.pairwise`。(由 Raymond Hettinger 在 :issue:`38200` 中"
+"貢獻。)"
#: ../../whatsnew/3.10.rst:1240
msgid "linecache"
@@ -1771,12 +1770,11 @@ msgid "os"
msgstr "os"
#: ../../whatsnew/3.10.rst:1248
-#, fuzzy
msgid ""
"Add :func:`os.cpu_count` support for VxWorks RTOS. (Contributed by Peixing "
"Xin in :issue:`41440`.)"
msgstr ""
-"為 VxWorks RTOS 新增 :func:`os.cpu_count()` 支援。(由 Peixing Xin 在 :issue:"
+"為 VxWorks RTOS 新增 :func:`os.cpu_count` 支援。(由 Peixing Xin 在 :issue:"
"`41440` 中貢獻。)"
#: ../../whatsnew/3.10.rst:1251
@@ -1789,14 +1787,13 @@ msgstr ""
"呼叫。(由 Christian Heimes 在 :issue:`41001` 中貢獻。)"
#: ../../whatsnew/3.10.rst:1255
-#, fuzzy
msgid ""
"Add :func:`os.splice` that allows to move data between two file descriptors "
"without copying between kernel address space and user address space, where "
"one of the file descriptors must refer to a pipe. (Contributed by Pablo "
"Galindo in :issue:`41625`.)"
msgstr ""
-"新增 :func:`os.splice()` 以允許在兩個檔案描述器 (file descriptor) 之間移動資"
+"新增 :func:`os.splice` 以允許在兩個檔案描述器 (file descriptor) 之間移動資"
"料,而無需在核心地址空間 (kernel address space) 和使用者地址空間 (user "
"address space) 之間進行複製,其中檔案描述器之一必須是個 pipe。(由 Pablo "
"Galindo 在 :issue:`41625` 中貢獻。)"
diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po
index 663709c477..ae6127eb46 100644
--- a/whatsnew/3.12.po
+++ b/whatsnew/3.12.po
@@ -2071,13 +2071,12 @@ msgid "``read_text()``"
msgstr "``read_text()``"
#: ../../deprecations/pending-removal-in-3.13.rst:51
-#, fuzzy
msgid ""
"Use :func:`importlib.resources.files` instead. Refer to `importlib-"
"resources: Migrating from Legacy `_ (:gh:`106531`)"
msgstr ""
-"請改用 :func:`importlib.resources.files()`。請參閱 `importlib-resources: "
+"請改用 :func:`importlib.resources.files`。請參閱 `importlib-resources: "
"Migrating from Legacy `_ (:gh:`106531`)"
@@ -2265,7 +2264,6 @@ msgstr ""
"代方案。*任何東西*\\ 都比 CGI 更好的來介接一個帶有請求處理器的網頁伺服器。"
#: ../../deprecations/pending-removal-in-3.15.rst:9
-#, fuzzy
msgid ""
":class:`locale`: :func:`locale.getdefaultlocale` was deprecated in Python "
"3.11 and originally planned for removal in Python 3.13 (:gh:`90817`), but "
@@ -2275,8 +2273,8 @@ msgid ""
msgstr ""
":class:`locale`::func:`locale.getdefaultlocale` 已在 Python 3.11 中被棄用,"
"原本計劃在 Python 3.13 中移除 (:gh:`90817`),但被延後至 Python 3.15。請改用 :"
-"func:`locale.setlocale()`、:func:`locale.getencoding()` 和 :func:`locale."
-"getlocale()`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)"
+"func:`locale.setlocale`、:func:`locale.getencoding` 和 :func:`locale."
+"getlocale`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)"
#: ../../deprecations/pending-removal-in-3.15.rst:16
msgid ""
diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po
index 67b22168f5..bfe683793c 100644
--- a/whatsnew/3.8.po
+++ b/whatsnew/3.8.po
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2022, Python Software Foundation
+# Copyright (C) 2001-2024, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR , YEAR.
#
@@ -1481,11 +1481,12 @@ msgid ""
msgstr ""
#: ../../whatsnew/3.8.rst:1199
-#, fuzzy
msgid ""
"Added :func:`statistics.geometric_mean` (Contributed by Raymond Hettinger "
"in :issue:`27181`.)"
-msgstr "(由 Raymond Hettinger 在 :issue:`36772` 中貢獻。)"
+msgstr ""
+"新增 :func:`statistics.geometric_mean`\\ (由 Raymond Hettinger 在 :issue:"
+"`27181` 中貢獻。)"
#: ../../whatsnew/3.8.rst:1202
msgid ""
From 5ffa57cd47781ec93ca5803a7b60050820633ccc Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Sat, 31 Aug 2024 00:05:13 +0000
Subject: [PATCH 08/16] sync with cpython d5abd02f
---
library/hashlib.po | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/library/hashlib.po b/library/hashlib.po
index 2699ecba6f..7efc9db476 100644
--- a/library/hashlib.po
+++ b/library/hashlib.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-05-23 00:03+0000\n"
+"POT-Creation-Date: 2024-08-31 00:03+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-"
@@ -694,7 +694,7 @@ msgid ""
msgstr ""
"*last_node*:布林值,代表處理的節點是否為最後一個(``False`` 代表順序模式)。"
-#: ../../library/hashlib.rst:-1
+#: ../../library/hashlib.rst:464
msgid "Explanation of tree mode parameters."
msgstr "樹狀模式參數說明。"
@@ -797,8 +797,8 @@ msgid ""
"mode thanks to the indifferentiability property inherited from BLAKE."
msgstr ""
"密鑰雜湊可用於身份驗證,作為\\ `基於雜湊的訊息驗證碼 (Hash-based message "
-"authentication code) `_ (HMAC) 的更快、更"
-"簡單的替代方案。由於繼承自 BLAKE 的不可微特性 (indifferentiability "
+"authentication code) `_ (HMAC) 的更快、"
+"更簡單的替代方案。由於繼承自 BLAKE 的不可微特性 (indifferentiability "
"property),BLAKE2 可以安全地用於 prefix-MAC 模式。"
#: ../../library/hashlib.rst:580
@@ -1030,7 +1030,7 @@ msgstr ""
msgid "*Alexandr Sokolovskiy*"
msgstr "*Alexandr Sokolovskiy*"
-#: ../../library/hashlib.rst:820
+#: ../../library/hashlib.rst:819
msgid "Module :mod:`hmac`"
msgstr ":mod:`hmac` 模組"
@@ -1038,7 +1038,7 @@ msgstr ":mod:`hmac` 模組"
msgid "A module to generate message authentication codes using hashes."
msgstr "使用雜湊生成訊息驗證程式碼的模組。"
-#: ../../library/hashlib.rst:823
+#: ../../library/hashlib.rst:822
msgid "Module :mod:`base64`"
msgstr ":mod:`base64` 模組"
@@ -1046,7 +1046,7 @@ msgstr ":mod:`base64` 模組"
msgid "Another way to encode binary hashes for non-binary environments."
msgstr "另一種在非二進位環境中編碼二進位雜湊的方法。"
-#: ../../library/hashlib.rst:826
+#: ../../library/hashlib.rst:825
msgid "https://nvlpubs.nist.gov/nistpubs/fips/nist.fips.180-4.pdf"
msgstr "https://nvlpubs.nist.gov/nistpubs/fips/nist.fips.180-4.pdf"
@@ -1054,7 +1054,7 @@ msgstr "https://nvlpubs.nist.gov/nistpubs/fips/nist.fips.180-4.pdf"
msgid "The FIPS 180-4 publication on Secure Hash Algorithms."
msgstr "有關安全雜湊演算法的 FIPS 180-4 出版物。"
-#: ../../library/hashlib.rst:829
+#: ../../library/hashlib.rst:828
msgid "https://csrc.nist.gov/publications/detail/fips/202/final"
msgstr "https://csrc.nist.gov/publications/detail/fips/202/final"
@@ -1062,7 +1062,7 @@ msgstr "https://csrc.nist.gov/publications/detail/fips/202/final"
msgid "The FIPS 202 publication on the SHA-3 Standard."
msgstr "有關 SHA-3 標準的 FIPS 202 出版物。"
-#: ../../library/hashlib.rst:832
+#: ../../library/hashlib.rst:831
msgid "https://www.blake2.net/"
msgstr "https://www.blake2.net/"
@@ -1070,7 +1070,7 @@ msgstr "https://www.blake2.net/"
msgid "Official BLAKE2 website."
msgstr "BLAKE2 官方網站。"
-#: ../../library/hashlib.rst:836
+#: ../../library/hashlib.rst:834
msgid "https://en.wikipedia.org/wiki/Cryptographic_hash_function"
msgstr "https://en.wikipedia.org/wiki/Cryptographic_hash_function"
@@ -1082,7 +1082,7 @@ msgstr ""
"包含有關哪些演算法存在已知問題以及這些問題對其使用意味著什麼資訊的維基百科文"
"章。"
-#: ../../library/hashlib.rst:839
+#: ../../library/hashlib.rst:838
msgid "https://www.ietf.org/rfc/rfc8018.txt"
msgstr "https://www.ietf.org/rfc/rfc8018.txt"
From f41dfb918aa3c3e869be11c2540f467e79c24215 Mon Sep 17 00:00:00 2001
From: Matt Wang
Date: Mon, 2 Sep 2024 13:18:40 +0800
Subject: [PATCH 09/16] fix: resolve code block translation - part 1
---
c-api/arg.po | 38 +-
c-api/buffer.po | 69 +++-
c-api/call.po | 12 +-
c-api/capsule.po | 6 +-
c-api/complex.po | 14 +-
c-api/contextvars.po | 11 +-
c-api/dict.po | 63 +++-
c-api/exceptions.po | 35 +-
c-api/gcsupport.po | 20 +-
c-api/import.po | 18 +-
c-api/init.po | 80 ++++-
c-api/init_config.po | 247 ++++++++++++-
c-api/intro.po | 252 ++++++++++++-
c-api/iter.po | 28 +-
c-api/memory.po | 52 ++-
c-api/module.po | 83 ++++-
c-api/perfmaps.po | 6 +
c-api/refcounting.po | 26 +-
c-api/slice.po | 18 +-
c-api/structures.po | 94 ++++-
c-api/typehints.po | 14 +-
c-api/unicode.po | 9 +-
extending/building.po | 18 +-
extending/windows.po | 10 +-
faq/windows.po | 75 +++-
glossary.po | 172 ++++++++-
howto/annotations.po | 46 ++-
library/devmode.po | 140 +++++++-
library/ensurepip.po | 10 +-
library/fileinput.po | 32 +-
library/ftplib.po | 54 ++-
library/gc.po | 58 ++-
library/getopt.po | 47 ++-
library/importlib.po | 189 +++++++++-
library/mmap.po | 69 +++-
library/pkgutil.po | 27 +-
library/platform.po | 17 +-
library/poplib.po | 24 +-
library/shlex.po | 54 ++-
library/sndhdr.po | 16 +-
library/stat.po | 31 +-
library/test.po | 284 ++++++++++++++-
library/time.po | 48 ++-
library/tomllib.po | 34 +-
library/traceback.po | 163 ++++++++-
library/tracemalloc.po | 342 +++++++++++++++++-
library/urllib.request.po | 246 ++++++++++++-
library/uuid.po | 100 ++++--
library/warnings.po | 130 ++++++-
library/webbrowser.po | 185 +++++-----
library/winreg.po | 24 +-
library/winsound.po | 13 +-
library/xdrlib.po | 28 +-
library/xml.dom.pulldom.po | 57 ++-
library/xml.sax.utils.po | 10 +-
library/zipapp.po | 78 +++-
library/zipimport.po | 34 +-
tutorial/stdlib.po | 261 +++++++++++++-
tutorial/venv.po | 170 ++++++++-
using/unix.po | 96 ++++-
whatsnew/3.10.po | 642 ++++++++++++++++++++++++++++++++-
whatsnew/3.11.po | 380 +++++++++++++++++++-
whatsnew/3.5.po | 646 ++++++++++++++++++++++++++++++++-
whatsnew/3.6.po | 358 +++++++++++++++++-
whatsnew/3.7.po | 66 +++-
whatsnew/3.8.po | 718 ++++++++++++++++++++++++++++++++++++-
whatsnew/3.9.po | 243 ++++++++++++-
67 files changed, 7437 insertions(+), 203 deletions(-)
diff --git a/c-api/arg.po b/c-api/arg.po
index 7c5dfeaf2b..a8487118c9 100644
--- a/c-api/arg.po
+++ b/c-api/arg.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-20 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2022-10-16 03:21+0800\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -612,6 +612,10 @@ msgid ""
"*converter* function in turn is called as follows::"
msgstr ""
+#: ../../c-api/arg.rst:316
+msgid "status = converter(object, address);"
+msgstr "status = converter(object, address);"
+
#: ../../c-api/arg.rst:318
msgid ""
"where *object* is the Python object to be converted and *address* is the :c:"
@@ -828,12 +832,44 @@ msgid ""
"the :mod:`!_weakref` helper module for weak references::"
msgstr ""
+#: ../../c-api/arg.rst:477
+msgid ""
+"static PyObject *\n"
+"weakref_ref(PyObject *self, PyObject *args)\n"
+"{\n"
+" PyObject *object;\n"
+" PyObject *callback = NULL;\n"
+" PyObject *result = NULL;\n"
+"\n"
+" if (PyArg_UnpackTuple(args, \"ref\", 1, 2, &object, &callback)) {\n"
+" result = PyWeakref_NewRef(object, callback);\n"
+" }\n"
+" return result;\n"
+"}"
+msgstr ""
+"static PyObject *\n"
+"weakref_ref(PyObject *self, PyObject *args)\n"
+"{\n"
+" PyObject *object;\n"
+" PyObject *callback = NULL;\n"
+" PyObject *result = NULL;\n"
+"\n"
+" if (PyArg_UnpackTuple(args, \"ref\", 1, 2, &object, &callback)) {\n"
+" result = PyWeakref_NewRef(object, callback);\n"
+" }\n"
+" return result;\n"
+"}"
+
#: ../../c-api/arg.rst:490
msgid ""
"The call to :c:func:`PyArg_UnpackTuple` in this example is entirely "
"equivalent to this call to :c:func:`PyArg_ParseTuple`::"
msgstr ""
+#: ../../c-api/arg.rst:493
+msgid "PyArg_ParseTuple(args, \"O|O:ref\", &object, &callback)"
+msgstr "PyArg_ParseTuple(args, \"O|O:ref\", &object, &callback)"
+
#: ../../c-api/arg.rst:498
msgid "Building values"
msgstr ""
diff --git a/c-api/buffer.po b/c-api/buffer.po
index f6a84dd790..cab3ae76e0 100644
--- a/c-api/buffer.po
+++ b/c-api/buffer.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-05-28 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2018-05-23 14:30+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -533,6 +533,16 @@ msgid ""
"dimensional array as follows:"
msgstr ""
+#: ../../c-api/buffer.rst:368
+msgid ""
+"ptr = (char *)buf + indices[0] * strides[0] + ... + indices[n-1] * "
+"strides[n-1];\n"
+"item = *((typeof(item) *)ptr);"
+msgstr ""
+"ptr = (char *)buf + indices[0] * strides[0] + ... + indices[n-1] * "
+"strides[n-1];\n"
+"item = *((typeof(item) *)ptr);"
+
#: ../../c-api/buffer.rst:374
msgid ""
"As noted above, :c:member:`~Py_buffer.buf` can point to any location within "
@@ -540,6 +550,35 @@ msgid ""
"this function:"
msgstr ""
+#: ../../c-api/buffer.rst:378
+msgid ""
+"def verify_structure(memlen, itemsize, ndim, shape, strides, offset):\n"
+" \"\"\"Verify that the parameters represent a valid array within\n"
+" the bounds of the allocated memory:\n"
+" char *mem: start of the physical memory block\n"
+" memlen: length of the physical memory block\n"
+" offset: (char *)buf - mem\n"
+" \"\"\"\n"
+" if offset % itemsize:\n"
+" return False\n"
+" if offset < 0 or offset+itemsize > memlen:\n"
+" return False\n"
+" if any(v % itemsize for v in strides):\n"
+" return False\n"
+"\n"
+" if ndim <= 0:\n"
+" return ndim == 0 and not shape and not strides\n"
+" if 0 in shape:\n"
+" return True\n"
+"\n"
+" imin = sum(strides[j]*(shape[j]-1) for j in range(ndim)\n"
+" if strides[j] <= 0)\n"
+" imax = sum(strides[j]*(shape[j]-1) for j in range(ndim)\n"
+" if strides[j] > 0)\n"
+"\n"
+" return 0 <= offset+imin and offset+imax+itemsize <= memlen"
+msgstr ""
+
#: ../../c-api/buffer.rst:408
msgid "PIL-style: shape, strides and suboffsets"
msgstr ""
@@ -562,6 +601,34 @@ msgid ""
"strides and suboffsets::"
msgstr ""
+#: ../../c-api/buffer.rst:423
+msgid ""
+"void *get_item_pointer(int ndim, void *buf, Py_ssize_t *strides,\n"
+" Py_ssize_t *suboffsets, Py_ssize_t *indices) {\n"
+" char *pointer = (char*)buf;\n"
+" int i;\n"
+" for (i = 0; i < ndim; i++) {\n"
+" pointer += strides[i] * indices[i];\n"
+" if (suboffsets[i] >=0 ) {\n"
+" pointer = *((char**)pointer) + suboffsets[i];\n"
+" }\n"
+" }\n"
+" return (void*)pointer;\n"
+"}"
+msgstr ""
+"void *get_item_pointer(int ndim, void *buf, Py_ssize_t *strides,\n"
+" Py_ssize_t *suboffsets, Py_ssize_t *indices) {\n"
+" char *pointer = (char*)buf;\n"
+" int i;\n"
+" for (i = 0; i < ndim; i++) {\n"
+" pointer += strides[i] * indices[i];\n"
+" if (suboffsets[i] >=0 ) {\n"
+" pointer = *((char**)pointer) + suboffsets[i];\n"
+" }\n"
+" }\n"
+" return (void*)pointer;\n"
+"}"
+
#: ../../c-api/buffer.rst:438
msgid "Buffer-related functions"
msgstr ""
diff --git a/c-api/call.po b/c-api/call.po
index 881a5a11ca..481a78e876 100644
--- a/c-api/call.po
+++ b/c-api/call.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-04-18 00:04+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2022-10-16 03:20+0800\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -41,6 +41,12 @@ msgstr ""
"設定 :c:member:`~PyTypeObject.tp_call` 的類別之實例都是可呼叫的。該擴充槽 "
"(slot) 的簽章為: ::"
+#: ../../c-api/call.rst:17
+msgid ""
+"PyObject *tp_call(PyObject *callable, PyObject *args, PyObject *kwargs);"
+msgstr ""
+"PyObject *tp_call(PyObject *callable, PyObject *args, PyObject *kwargs);"
+
#: ../../c-api/call.rst:19
msgid ""
"A call is made using a tuple for the positional arguments and a dict for the "
@@ -273,6 +279,10 @@ msgid ""
"Currently equivalent to::"
msgstr "給定一個 vectorcall *nargsf* 引數,回傳引數的實際數量。目前等同於: ::"
+#: ../../c-api/call.rst:153
+msgid "(Py_ssize_t)(nargsf & ~PY_VECTORCALL_ARGUMENTS_OFFSET)"
+msgstr "(Py_ssize_t)(nargsf & ~PY_VECTORCALL_ARGUMENTS_OFFSET)"
+
#: ../../c-api/call.rst:155
msgid ""
"However, the function ``PyVectorcall_NARGS`` should be used to allow for "
diff --git a/c-api/capsule.po b/c-api/capsule.po
index 395dca4c92..7ce4bb7a23 100644
--- a/c-api/capsule.po
+++ b/c-api/capsule.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-07-29 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2018-05-23 14:30+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -41,6 +41,10 @@ msgstr ""
msgid "The type of a destructor callback for a capsule. Defined as::"
msgstr ""
+#: ../../c-api/capsule.rst:29
+msgid "typedef void (*PyCapsule_Destructor)(PyObject *);"
+msgstr "typedef void (*PyCapsule_Destructor)(PyObject *);"
+
#: ../../c-api/capsule.rst:31
msgid ""
"See :c:func:`PyCapsule_New` for the semantics of PyCapsule_Destructor "
diff --git a/c-api/complex.po b/c-api/complex.po
index 704d02b7b6..8d905e1455 100644
--- a/c-api/complex.po
+++ b/c-api/complex.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-18 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -61,6 +61,18 @@ msgstr ""
msgid "The structure is defined as::"
msgstr "該結構被定義為: ::"
+#: ../../c-api/complex.rst:35
+msgid ""
+"typedef struct {\n"
+" double real;\n"
+" double imag;\n"
+"} Py_complex;"
+msgstr ""
+"typedef struct {\n"
+" double real;\n"
+" double imag;\n"
+"} Py_complex;"
+
#: ../../c-api/complex.rst:43
msgid ""
"Return the sum of two complex numbers, using the C :c:type:`Py_complex` "
diff --git a/c-api/contextvars.po b/c-api/contextvars.po
index 5dc8f790aa..1f5674b054 100644
--- a/c-api/contextvars.po
+++ b/c-api/contextvars.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-03-07 17:26+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -26,6 +26,15 @@ msgid ""
"`PyContext`, :c:type:`PyContextVar`, and :c:type:`PyContextToken`, e.g.::"
msgstr ""
+#: ../../c-api/contextvars.rst:20
+msgid ""
+"// in 3.7.0:\n"
+"PyContext *PyContext_New(void);\n"
+"\n"
+"// in 3.7.1+:\n"
+"PyObject *PyContext_New(void);"
+msgstr ""
+
#: ../../c-api/contextvars.rst:26
msgid "See :issue:`34762` for more details."
msgstr "更多細節請見 :issue:`34762`。"
diff --git a/c-api/dict.po b/c-api/dict.po
index aa8c1d9f8d..e696336c09 100644
--- a/c-api/dict.po
+++ b/c-api/dict.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-09-03 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -200,6 +200,17 @@ msgstr ""
msgid "For example::"
msgstr "舉例來說: ::"
+#: ../../c-api/dict.rst:181
+msgid ""
+"PyObject *key, *value;\n"
+"Py_ssize_t pos = 0;\n"
+"\n"
+"while (PyDict_Next(self->dict, &pos, &key, &value)) {\n"
+" /* do something interesting with the values... */\n"
+" ...\n"
+"}"
+msgstr ""
+
#: ../../c-api/dict.rst:189
msgid ""
"The dictionary *p* should not be mutated during iteration. It is safe to "
@@ -207,6 +218,44 @@ msgid ""
"so long as the set of keys does not change. For example::"
msgstr ""
+#: ../../c-api/dict.rst:193
+msgid ""
+"PyObject *key, *value;\n"
+"Py_ssize_t pos = 0;\n"
+"\n"
+"while (PyDict_Next(self->dict, &pos, &key, &value)) {\n"
+" long i = PyLong_AsLong(value);\n"
+" if (i == -1 && PyErr_Occurred()) {\n"
+" return -1;\n"
+" }\n"
+" PyObject *o = PyLong_FromLong(i + 1);\n"
+" if (o == NULL)\n"
+" return -1;\n"
+" if (PyDict_SetItem(self->dict, key, o) < 0) {\n"
+" Py_DECREF(o);\n"
+" return -1;\n"
+" }\n"
+" Py_DECREF(o);\n"
+"}"
+msgstr ""
+"PyObject *key, *value;\n"
+"Py_ssize_t pos = 0;\n"
+"\n"
+"while (PyDict_Next(self->dict, &pos, &key, &value)) {\n"
+" long i = PyLong_AsLong(value);\n"
+" if (i == -1 && PyErr_Occurred()) {\n"
+" return -1;\n"
+" }\n"
+" PyObject *o = PyLong_FromLong(i + 1);\n"
+" if (o == NULL)\n"
+" return -1;\n"
+" if (PyDict_SetItem(self->dict, key, o) < 0) {\n"
+" Py_DECREF(o);\n"
+" return -1;\n"
+" }\n"
+" Py_DECREF(o);\n"
+"}"
+
#: ../../c-api/dict.rst:214
msgid ""
"Iterate over mapping object *b* adding key-value pairs to dictionary *a*. "
@@ -235,6 +284,18 @@ msgid ""
"if an exception was raised. Equivalent Python (except for the return value)::"
msgstr ""
+#: ../../c-api/dict.rst:240
+msgid ""
+"def PyDict_MergeFromSeq2(a, seq2, override):\n"
+" for key, value in seq2:\n"
+" if override or key not in a:\n"
+" a[key] = value"
+msgstr ""
+"def PyDict_MergeFromSeq2(a, seq2, override):\n"
+" for key, value in seq2:\n"
+" if override or key not in a:\n"
+" a[key] = value"
+
#: ../../c-api/dict.rst:247
msgid ""
"Register *callback* as a dictionary watcher. Return a non-negative integer "
diff --git a/c-api/exceptions.po b/c-api/exceptions.po
index c8207734e8..0c3adc1d6a 100644
--- a/c-api/exceptions.po
+++ b/c-api/exceptions.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-30 18:24+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2018-05-23 14:05+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -469,6 +469,17 @@ msgstr ""
msgid "For example::"
msgstr ""
+#: ../../c-api/exceptions.rst:438
+msgid ""
+"{\n"
+" PyObject *exc = PyErr_GetRaisedException();\n"
+"\n"
+" /* ... code that might produce other errors ... */\n"
+"\n"
+" PyErr_SetRaisedException(exc);\n"
+"}"
+msgstr ""
+
#: ../../c-api/exceptions.rst:446
msgid ""
":c:func:`PyErr_GetHandledException`, to save the exception currently being "
@@ -504,6 +515,18 @@ msgid ""
"exceptions or save and restore the error indicator temporarily."
msgstr ""
+#: ../../c-api/exceptions.rst:482
+msgid ""
+"{\n"
+" PyObject *type, *value, *traceback;\n"
+" PyErr_Fetch(&type, &value, &traceback);\n"
+"\n"
+" /* ... code that might produce other errors ... */\n"
+"\n"
+" PyErr_Restore(type, value, traceback);\n"
+"}"
+msgstr ""
+
#: ../../c-api/exceptions.rst:496
msgid "Use :c:func:`PyErr_SetRaisedException` instead."
msgstr ""
@@ -551,6 +574,16 @@ msgid ""
"appropriately is desired, the following additional snippet is needed::"
msgstr ""
+#: ../../c-api/exceptions.rst:537
+msgid ""
+"if (tb != NULL) {\n"
+" PyException_SetTraceback(val, tb);\n"
+"}"
+msgstr ""
+"if (tb != NULL) {\n"
+" PyException_SetTraceback(val, tb);\n"
+"}"
+
#: ../../c-api/exceptions.rst:544
msgid ""
"Retrieve the active exception instance, as would be returned by :func:`sys."
diff --git a/c-api/gcsupport.po b/c-api/gcsupport.po
index 9a0ef0b833..e52f8c9b5d 100644
--- a/c-api/gcsupport.po
+++ b/c-api/gcsupport.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-04-18 00:04+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2018-05-23 14:31+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -260,6 +260,24 @@ msgid ""
"macro, :c:member:`~PyTypeObject.tp_traverse` handlers look like::"
msgstr ""
+#: ../../c-api/gcsupport.rst:190
+msgid ""
+"static int\n"
+"my_traverse(Noddy *self, visitproc visit, void *arg)\n"
+"{\n"
+" Py_VISIT(self->foo);\n"
+" Py_VISIT(self->bar);\n"
+" return 0;\n"
+"}"
+msgstr ""
+"static int\n"
+"my_traverse(Noddy *self, visitproc visit, void *arg)\n"
+"{\n"
+" Py_VISIT(self->foo);\n"
+" Py_VISIT(self->bar);\n"
+" return 0;\n"
+"}"
+
#: ../../c-api/gcsupport.rst:198
msgid ""
"The :c:member:`~PyTypeObject.tp_clear` handler must be of the :c:type:"
diff --git a/c-api/import.po b/c-api/import.po
index 558b2c6c40..340d9ccd66 100644
--- a/c-api/import.po
+++ b/c-api/import.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-30 18:24+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2018-05-23 14:06+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -283,6 +283,22 @@ msgid ""
"h`, is::"
msgstr ""
+#: ../../c-api/import.rst:254
+msgid ""
+"struct _frozen {\n"
+" const char *name;\n"
+" const unsigned char *code;\n"
+" int size;\n"
+" bool is_package;\n"
+"};"
+msgstr ""
+"struct _frozen {\n"
+" const char *name;\n"
+" const unsigned char *code;\n"
+" int size;\n"
+" bool is_package;\n"
+"};"
+
#: ../../c-api/import.rst:261
msgid ""
"The new ``is_package`` field indicates whether the module is a package or "
diff --git a/c-api/init.po b/c-api/init.po
index 056d2a952e..d01dbd41c1 100644
--- a/c-api/init.po
+++ b/c-api/init.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-04 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2023-04-24 20:49+0800\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -852,6 +852,10 @@ msgid ""
"something like ::"
msgstr ""
+#: ../../c-api/init.rst:663
+msgid "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\""
+msgstr "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\""
+
#: ../../c-api/init.rst:667
msgid ""
"The first word (up to the first space character) is the current Python "
@@ -898,6 +902,10 @@ msgid ""
"version, in square brackets, for example::"
msgstr ""
+#: ../../c-api/init.rst:705
+msgid "\"[GCC 2.7.2.2]\""
+msgstr "\"[GCC 2.7.2.2]\""
+
#: ../../c-api/init.rst:709 ../../c-api/init.rst:723
msgid ""
"The returned string points into static storage; the caller should not modify "
@@ -911,6 +919,10 @@ msgid ""
"current Python interpreter instance, for example ::"
msgstr ""
+#: ../../c-api/init.rst:719
+msgid "\"#67, Aug 1 1997, 22:34:28\""
+msgstr "\"#67, Aug 1 1997, 22:34:28\""
+
#: ../../c-api/init.rst:735
msgid ""
"This API is kept for backward compatibility: setting :c:member:`PyConfig."
@@ -971,6 +983,10 @@ msgid ""
"`PySys_SetArgv`, for example using::"
msgstr ""
+#: ../../c-api/init.rst:776
+msgid "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");"
+msgstr "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");"
+
#: ../../c-api/init.rst:788
msgid ""
"This API is kept for backward compatibility: setting :c:member:`PyConfig."
@@ -1062,10 +1078,26 @@ msgid ""
"structure::"
msgstr ""
+#: ../../c-api/init.rst:882
+msgid ""
+"Save the thread state in a local variable.\n"
+"Release the global interpreter lock.\n"
+"... Do some blocking I/O operation ...\n"
+"Reacquire the global interpreter lock.\n"
+"Restore the thread state from the local variable."
+msgstr ""
+
#: ../../c-api/init.rst:888
msgid "This is so common that a pair of macros exists to simplify it::"
msgstr ""
+#: ../../c-api/init.rst:890
+msgid ""
+"Py_BEGIN_ALLOW_THREADS\n"
+"... Do some blocking I/O operation ...\n"
+"Py_END_ALLOW_THREADS"
+msgstr ""
+
#: ../../c-api/init.rst:898
msgid ""
"The :c:macro:`Py_BEGIN_ALLOW_THREADS` macro opens a new block and declares a "
@@ -1077,6 +1109,15 @@ msgstr ""
msgid "The block above expands to the following code::"
msgstr ""
+#: ../../c-api/init.rst:904
+msgid ""
+"PyThreadState *_save;\n"
+"\n"
+"_save = PyEval_SaveThread();\n"
+"... Do some blocking I/O operation ...\n"
+"PyEval_RestoreThread(_save);"
+msgstr ""
+
#: ../../c-api/init.rst:914
msgid ""
"Here is how these functions work: the global interpreter lock is used to "
@@ -1130,6 +1171,19 @@ msgid ""
"Python from a C thread is::"
msgstr ""
+#: ../../c-api/init.rst:955
+msgid ""
+"PyGILState_STATE gstate;\n"
+"gstate = PyGILState_Ensure();\n"
+"\n"
+"/* Perform Python actions here. */\n"
+"result = CallSomeFunction();\n"
+"/* evaluate result or handle exception */\n"
+"\n"
+"/* Release the thread. No Python API allowed beyond this point. */\n"
+"PyGILState_Release(gstate);"
+msgstr ""
+
#: ../../c-api/init.rst:965
msgid ""
"Note that the ``PyGILState_*`` functions assume there is only one global "
@@ -1865,6 +1919,30 @@ msgid ""
"certain functionality restricted::"
msgstr ""
+#: ../../c-api/init.rst:1638
+msgid ""
+"PyInterpreterConfig config = {\n"
+" .use_main_obmalloc = 0,\n"
+" .allow_fork = 0,\n"
+" .allow_exec = 0,\n"
+" .allow_threads = 1,\n"
+" .allow_daemon_threads = 0,\n"
+" .check_multi_interp_extensions = 1,\n"
+" .gil = PyInterpreterConfig_OWN_GIL,\n"
+"};\n"
+"PyThreadState *tstate = Py_NewInterpreterFromConfig(&config);"
+msgstr ""
+"PyInterpreterConfig config = {\n"
+" .use_main_obmalloc = 0,\n"
+" .allow_fork = 0,\n"
+" .allow_exec = 0,\n"
+" .allow_threads = 1,\n"
+" .allow_daemon_threads = 0,\n"
+" .check_multi_interp_extensions = 1,\n"
+" .gil = PyInterpreterConfig_OWN_GIL,\n"
+"};\n"
+"PyThreadState *tstate = Py_NewInterpreterFromConfig(&config);"
+
#: ../../c-api/init.rst:1649
msgid ""
"Note that the config is used only briefly and does not get modified. During "
diff --git a/c-api/init_config.po b/c-api/init_config.po
index 36f6ad459a..edab3869bb 100644
--- a/c-api/init_config.po
+++ b/c-api/init_config.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-23 00:04+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -72,6 +72,42 @@ msgstr "範例"
msgid "Example of customized Python always running in isolated mode::"
msgstr ""
+#: ../../c-api/init_config.rst:41
+msgid ""
+"int main(int argc, char **argv)\n"
+"{\n"
+" PyStatus status;\n"
+"\n"
+" PyConfig config;\n"
+" PyConfig_InitPythonConfig(&config);\n"
+" config.isolated = 1;\n"
+"\n"
+" /* Decode command line arguments.\n"
+" Implicitly preinitialize Python (in isolated mode). */\n"
+" status = PyConfig_SetBytesArgv(&config, argc, argv);\n"
+" if (PyStatus_Exception(status)) {\n"
+" goto exception;\n"
+" }\n"
+"\n"
+" status = Py_InitializeFromConfig(&config);\n"
+" if (PyStatus_Exception(status)) {\n"
+" goto exception;\n"
+" }\n"
+" PyConfig_Clear(&config);\n"
+"\n"
+" return Py_RunMain();\n"
+"\n"
+"exception:\n"
+" PyConfig_Clear(&config);\n"
+" if (PyStatus_IsExit(status)) {\n"
+" return status.exitcode;\n"
+" }\n"
+" /* Display the error message and exit the process with\n"
+" non-zero exit code */\n"
+" Py_ExitStatusException(status);\n"
+"}"
+msgstr ""
+
#: ../../c-api/init_config.rst:76
msgid "PyWideStringList"
msgstr "PyWideStringList"
@@ -209,6 +245,48 @@ msgstr ""
msgid "Example::"
msgstr "範例: ::"
+#: ../../c-api/init_config.rst:191
+msgid ""
+"PyStatus alloc(void **ptr, size_t size)\n"
+"{\n"
+" *ptr = PyMem_RawMalloc(size);\n"
+" if (*ptr == NULL) {\n"
+" return PyStatus_NoMemory();\n"
+" }\n"
+" return PyStatus_Ok();\n"
+"}\n"
+"\n"
+"int main(int argc, char **argv)\n"
+"{\n"
+" void *ptr;\n"
+" PyStatus status = alloc(&ptr, 16);\n"
+" if (PyStatus_Exception(status)) {\n"
+" Py_ExitStatusException(status);\n"
+" }\n"
+" PyMem_Free(ptr);\n"
+" return 0;\n"
+"}"
+msgstr ""
+"PyStatus alloc(void **ptr, size_t size)\n"
+"{\n"
+" *ptr = PyMem_RawMalloc(size);\n"
+" if (*ptr == NULL) {\n"
+" return PyStatus_NoMemory();\n"
+" }\n"
+" return PyStatus_Ok();\n"
+"}\n"
+"\n"
+"int main(int argc, char **argv)\n"
+"{\n"
+" void *ptr;\n"
+" PyStatus status = alloc(&ptr, 16);\n"
+" if (PyStatus_Exception(status)) {\n"
+" Py_ExitStatusException(status);\n"
+" }\n"
+" PyMem_Free(ptr);\n"
+" return 0;\n"
+"}"
+
#: ../../c-api/init_config.rst:213
msgid "PyPreConfig"
msgstr "PyPreConfig"
@@ -514,6 +592,26 @@ msgid ""
"`::"
msgstr ""
+#: ../../c-api/init_config.rst:414
+msgid ""
+"PyStatus status;\n"
+"PyPreConfig preconfig;\n"
+"PyPreConfig_InitPythonConfig(&preconfig);\n"
+"\n"
+"preconfig.utf8_mode = 1;\n"
+"\n"
+"status = Py_PreInitialize(&preconfig);\n"
+"if (PyStatus_Exception(status)) {\n"
+" Py_ExitStatusException(status);\n"
+"}\n"
+"\n"
+"/* at this point, Python speaks UTF-8 */\n"
+"\n"
+"Py_Initialize();\n"
+"/* ... use Python API here ... */\n"
+"Py_Finalize();"
+msgstr ""
+
#: ../../c-api/init_config.rst:433
msgid "PyConfig"
msgstr "PyConfig"
@@ -1701,6 +1799,60 @@ msgstr ""
msgid "Example setting the program name::"
msgstr ""
+#: ../../c-api/init_config.rst:1316
+msgid ""
+"void init_python(void)\n"
+"{\n"
+" PyStatus status;\n"
+"\n"
+" PyConfig config;\n"
+" PyConfig_InitPythonConfig(&config);\n"
+"\n"
+" /* Set the program name. Implicitly preinitialize Python. */\n"
+" status = PyConfig_SetString(&config, &config.program_name,\n"
+" L\"/path/to/my_program\");\n"
+" if (PyStatus_Exception(status)) {\n"
+" goto exception;\n"
+" }\n"
+"\n"
+" status = Py_InitializeFromConfig(&config);\n"
+" if (PyStatus_Exception(status)) {\n"
+" goto exception;\n"
+" }\n"
+" PyConfig_Clear(&config);\n"
+" return;\n"
+"\n"
+"exception:\n"
+" PyConfig_Clear(&config);\n"
+" Py_ExitStatusException(status);\n"
+"}"
+msgstr ""
+"void init_python(void)\n"
+"{\n"
+" PyStatus status;\n"
+"\n"
+" PyConfig config;\n"
+" PyConfig_InitPythonConfig(&config);\n"
+"\n"
+" /* Set the program name. Implicitly preinitialize Python. */\n"
+" status = PyConfig_SetString(&config, &config.program_name,\n"
+" L\"/path/to/my_program\");\n"
+" if (PyStatus_Exception(status)) {\n"
+" goto exception;\n"
+" }\n"
+"\n"
+" status = Py_InitializeFromConfig(&config);\n"
+" if (PyStatus_Exception(status)) {\n"
+" goto exception;\n"
+" }\n"
+" PyConfig_Clear(&config);\n"
+" return;\n"
+"\n"
+"exception:\n"
+" PyConfig_Clear(&config);\n"
+" Py_ExitStatusException(status);\n"
+"}"
+
#: ../../c-api/init_config.rst:1342
msgid ""
"More complete example modifying the default configuration, read the "
@@ -1710,6 +1862,61 @@ msgid ""
"called will be left unchanged by initialization::"
msgstr ""
+#: ../../c-api/init_config.rst:1349
+msgid ""
+"PyStatus init_python(const char *program_name)\n"
+"{\n"
+" PyStatus status;\n"
+"\n"
+" PyConfig config;\n"
+" PyConfig_InitPythonConfig(&config);\n"
+"\n"
+" /* Set the program name before reading the configuration\n"
+" (decode byte string from the locale encoding).\n"
+"\n"
+" Implicitly preinitialize Python. */\n"
+" status = PyConfig_SetBytesString(&config, &config.program_name,\n"
+" program_name);\n"
+" if (PyStatus_Exception(status)) {\n"
+" goto done;\n"
+" }\n"
+"\n"
+" /* Read all configuration at once */\n"
+" status = PyConfig_Read(&config);\n"
+" if (PyStatus_Exception(status)) {\n"
+" goto done;\n"
+" }\n"
+"\n"
+" /* Specify sys.path explicitly */\n"
+" /* If you want to modify the default set of paths, finish\n"
+" initialization first and then use PySys_GetObject(\"path\") */\n"
+" config.module_search_paths_set = 1;\n"
+" status = PyWideStringList_Append(&config.module_search_paths,\n"
+" L\"/path/to/stdlib\");\n"
+" if (PyStatus_Exception(status)) {\n"
+" goto done;\n"
+" }\n"
+" status = PyWideStringList_Append(&config.module_search_paths,\n"
+" L\"/path/to/more/modules\");\n"
+" if (PyStatus_Exception(status)) {\n"
+" goto done;\n"
+" }\n"
+"\n"
+" /* Override executable computed by PyConfig_Read() */\n"
+" status = PyConfig_SetString(&config, &config.executable,\n"
+" L\"/path/to/my_executable\");\n"
+" if (PyStatus_Exception(status)) {\n"
+" goto done;\n"
+" }\n"
+"\n"
+" status = Py_InitializeFromConfig(&config);\n"
+"\n"
+"done:\n"
+" PyConfig_Clear(&config);\n"
+" return status;\n"
+"}"
+msgstr ""
+
#: ../../c-api/init_config.rst:1405
msgid "Isolated Configuration"
msgstr ""
@@ -2115,5 +2322,39 @@ msgid ""
"phases::"
msgstr ""
-#~ msgid "See also :c:member:`PyPreConfig.isolated`."
-#~ msgstr "也請見 :c:member:`PyPreConfig.isolated`。"
+#: ../../c-api/init_config.rst:1611
+msgid ""
+"void init_python(void)\n"
+"{\n"
+" PyStatus status;\n"
+"\n"
+" PyConfig config;\n"
+" PyConfig_InitPythonConfig(&config);\n"
+" config._init_main = 0;\n"
+"\n"
+" /* ... customize 'config' configuration ... */\n"
+"\n"
+" status = Py_InitializeFromConfig(&config);\n"
+" PyConfig_Clear(&config);\n"
+" if (PyStatus_Exception(status)) {\n"
+" Py_ExitStatusException(status);\n"
+" }\n"
+"\n"
+" /* Use sys.stderr because sys.stdout is only created\n"
+" by _Py_InitializeMain() */\n"
+" int res = PyRun_SimpleString(\n"
+" \"import sys; \"\n"
+" \"print('Run Python code before _Py_InitializeMain', \"\n"
+" \"file=sys.stderr)\");\n"
+" if (res < 0) {\n"
+" exit(1);\n"
+" }\n"
+"\n"
+" /* ... put more configuration code here ... */\n"
+"\n"
+" status = _Py_InitializeMain();\n"
+" if (PyStatus_Exception(status)) {\n"
+" Py_ExitStatusException(status);\n"
+" }\n"
+"}"
+msgstr ""
diff --git a/c-api/intro.po b/c-api/intro.po
index 46d3a7a73a..5432552e14 100644
--- a/c-api/intro.po
+++ b/c-api/intro.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-02-12 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -95,6 +95,14 @@ msgstr ""
"使用 Python/C API 所需的所有函式、型別和巨集的定義都透過以下這幾行來在你的程"
"式碼中引入:"
+#: ../../c-api/intro.rst:51
+msgid ""
+"#define PY_SSIZE_T_CLEAN\n"
+"#include "
+msgstr ""
+"#define PY_SSIZE_T_CLEAN\n"
+"#include "
+
#: ../../c-api/intro.rst:54
msgid ""
"This implies inclusion of the following standard headers: ````, "
@@ -214,6 +222,32 @@ msgid ""
"item defined in the module file. Example::"
msgstr ""
+#: ../../c-api/intro.rst:119
+msgid ""
+"static struct PyModuleDef spam_module = {\n"
+" PyModuleDef_HEAD_INIT,\n"
+" .m_name = \"spam\",\n"
+" ...\n"
+"};\n"
+"\n"
+"PyMODINIT_FUNC\n"
+"PyInit_spam(void)\n"
+"{\n"
+" return PyModule_Create(&spam_module);\n"
+"}"
+msgstr ""
+"static struct PyModuleDef spam_module = {\n"
+" PyModuleDef_HEAD_INIT,\n"
+" .m_name = \"spam\",\n"
+" ...\n"
+"};\n"
+"\n"
+"PyMODINIT_FUNC\n"
+"PyInit_spam(void)\n"
+"{\n"
+" return PyModule_Create(&spam_module);\n"
+"}"
+
#: ../../c-api/intro.rst:134
msgid "Return the absolute value of ``x``."
msgstr "回傳 ``x`` 的絕對值。"
@@ -257,6 +291,10 @@ msgstr ""
msgid "It must be specified before the function return type. Usage::"
msgstr "它必須在函式回傳型別之前被指定。用法: ::"
+#: ../../c-api/intro.rst:156
+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:162
msgid ""
"Argument must be a character or an integer in the range [-128, 127] or [0, "
@@ -276,6 +314,10 @@ msgstr "將其用於已棄用的聲明。巨集必須放在符號名稱之前。
msgid "Example::"
msgstr "範例: ::"
+#: ../../c-api/intro.rst:172
+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:174
msgid "MSVC support was added."
msgstr "新增了 MSVC 支援。"
@@ -313,6 +355,10 @@ msgstr ""
msgid "Usage::"
msgstr "用法: ::"
+#: ../../c-api/intro.rst:208
+msgid "Py_NO_INLINE static int random(void) { return 4; }"
+msgstr "Py_NO_INLINE static int random(void) { return 4; }"
+
#: ../../c-api/intro.rst:214
msgid ""
"Convert ``x`` to a C string. E.g. ``Py_STRINGIFY(123)`` returns ``\"123\"``."
@@ -384,6 +430,17 @@ msgstr ""
"如 :pep:`7` 中所指明,使用 :c:macro:`PyDoc_STRVAR` 作為文件字串可以支援在沒有"
"文件字串的情況下建置 Python。"
+#: ../../c-api/intro.rst:258
+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"
+"}"
+msgstr ""
+
#: ../../c-api/intro.rst:268
msgid ""
"Creates a docstring for the given input string or an empty string if "
@@ -398,6 +455,15 @@ msgstr ""
"如 :pep:`7` 中所指明,使用 :c:macro:`PyDoc_STR` 指定文件字串以支援在沒有文件"
"字串下建置 Python。"
+#: ../../c-api/intro.rst:276
+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"
+"};"
+msgstr ""
+
#: ../../c-api/intro.rst:286
msgid "Objects, Types and Reference Counts"
msgstr "物件、型別和參照計數"
@@ -611,6 +677,22 @@ msgstr ""
"慣,這些函式旨在竊取參照;例如,建立 tuple ``(1, 2, \"three\")`` 的程式碼可以"
"如下所示(先暫時忘記錯誤處理;更好的編寫方式如下所示):"
+#: ../../c-api/intro.rst:415
+msgid ""
+"PyObject *t;\n"
+"\n"
+"t = PyTuple_New(3);\n"
+"PyTuple_SetItem(t, 0, PyLong_FromLong(1L));\n"
+"PyTuple_SetItem(t, 1, PyLong_FromLong(2L));\n"
+"PyTuple_SetItem(t, 2, PyUnicode_FromString(\"three\"));"
+msgstr ""
+"PyObject *t;\n"
+"\n"
+"t = PyTuple_New(3);\n"
+"PyTuple_SetItem(t, 0, PyLong_FromLong(1L));\n"
+"PyTuple_SetItem(t, 1, PyLong_FromLong(2L));\n"
+"PyTuple_SetItem(t, 2, PyUnicode_FromString(\"three\"));"
+
#: ../../c-api/intro.rst:422
msgid ""
"Here, :c:func:`PyLong_FromLong` returns a new reference which is immediately "
@@ -655,6 +737,18 @@ msgstr ""
"string` 引導。例如上面的兩個程式碼可以用以下程式碼替換(它還負責了錯誤檢"
"查): ::"
+#: ../../c-api/intro.rst:441
+msgid ""
+"PyObject *tuple, *list;\n"
+"\n"
+"tuple = Py_BuildValue(\"(iis)\", 1, 2, \"three\");\n"
+"list = Py_BuildValue(\"[iis]\", 1, 2, \"three\");"
+msgstr ""
+"PyObject *tuple, *list;\n"
+"\n"
+"tuple = Py_BuildValue(\"(iis)\", 1, 2, \"three\");\n"
+"list = Py_BuildValue(\"[iis]\", 1, 2, \"three\");"
+
#: ../../c-api/intro.rst:446
msgid ""
"It is much more common to use :c:func:`PyObject_SetItem` and friends with "
@@ -670,6 +764,50 @@ msgstr ""
"穩健,因為你不取得新的一個參照就可以放棄參照(「讓它被竊取」)。例如,此函式"
"將 list(實際上是任何可變序列)的所有項目設定於給定項目:"
+#: ../../c-api/intro.rst:453
+msgid ""
+"int\n"
+"set_all(PyObject *target, PyObject *item)\n"
+"{\n"
+" Py_ssize_t i, n;\n"
+"\n"
+" n = PyObject_Length(target);\n"
+" if (n < 0)\n"
+" return -1;\n"
+" for (i = 0; i < n; i++) {\n"
+" PyObject *index = PyLong_FromSsize_t(i);\n"
+" if (!index)\n"
+" return -1;\n"
+" if (PyObject_SetItem(target, index, item) < 0) {\n"
+" Py_DECREF(index);\n"
+" return -1;\n"
+" }\n"
+" Py_DECREF(index);\n"
+" }\n"
+" return 0;\n"
+"}"
+msgstr ""
+"int\n"
+"set_all(PyObject *target, PyObject *item)\n"
+"{\n"
+" Py_ssize_t i, n;\n"
+"\n"
+" n = PyObject_Length(target);\n"
+" if (n < 0)\n"
+" return -1;\n"
+" for (i = 0; i < n; i++) {\n"
+" PyObject *index = PyLong_FromSsize_t(i);\n"
+" if (!index)\n"
+" return -1;\n"
+" if (PyObject_SetItem(target, index, item) < 0) {\n"
+" Py_DECREF(index);\n"
+" return -1;\n"
+" }\n"
+" Py_DECREF(index);\n"
+" }\n"
+" return 0;\n"
+"}"
+
#: ../../c-api/intro.rst:476
msgid ""
"The situation is slightly different for function return values. While "
@@ -713,6 +851,62 @@ msgstr ""
"以下是一個範例,說明如何編寫函式來計算一個整數 list 中項目的總和;一次使用 :"
"c:func:`PyList_GetItem`,一次使用 :c:func:`PySequence_GetItem`: ::"
+#: ../../c-api/intro.rst:501
+msgid ""
+"long\n"
+"sum_list(PyObject *list)\n"
+"{\n"
+" Py_ssize_t i, n;\n"
+" long total = 0, value;\n"
+" PyObject *item;\n"
+"\n"
+" n = PyList_Size(list);\n"
+" if (n < 0)\n"
+" return -1; /* Not a list */\n"
+" for (i = 0; i < n; i++) {\n"
+" item = PyList_GetItem(list, i); /* Can't fail */\n"
+" if (!PyLong_Check(item)) continue; /* Skip non-integers */\n"
+" value = PyLong_AsLong(item);\n"
+" if (value == -1 && PyErr_Occurred())\n"
+" /* Integer too big to fit in a C long, bail out */\n"
+" return -1;\n"
+" total += value;\n"
+" }\n"
+" return total;\n"
+"}"
+msgstr ""
+
+#: ../../c-api/intro.rst:527
+msgid ""
+"long\n"
+"sum_sequence(PyObject *sequence)\n"
+"{\n"
+" Py_ssize_t i, n;\n"
+" long total = 0, value;\n"
+" PyObject *item;\n"
+" n = PySequence_Length(sequence);\n"
+" if (n < 0)\n"
+" return -1; /* Has no length */\n"
+" for (i = 0; i < n; i++) {\n"
+" item = PySequence_GetItem(sequence, i);\n"
+" if (item == NULL)\n"
+" return -1; /* Not a sequence, or other failure */\n"
+" if (PyLong_Check(item)) {\n"
+" value = PyLong_AsLong(item);\n"
+" Py_DECREF(item);\n"
+" if (value == -1 && PyErr_Occurred())\n"
+" /* Integer too big to fit in a C long, bail out */\n"
+" return -1;\n"
+" total += value;\n"
+" }\n"
+" else {\n"
+" Py_DECREF(item); /* Discard reference ownership */\n"
+" }\n"
+" }\n"
+" return total;\n"
+"}"
+msgstr ""
+
#: ../../c-api/intro.rst:561
msgid "Types"
msgstr "型別"
@@ -866,10 +1060,66 @@ msgstr ""
"巧這個例子在檢測到錯誤時不需要清理任何擁有的參照。以下範例函式展示了一些錯誤"
"清理。首先,為了提醒你為什麼喜歡 Python,我們展示了等效的 Python 程式碼: ::"
+#: ../../c-api/intro.rst:655
+msgid ""
+"def incr_item(dict, key):\n"
+" try:\n"
+" item = dict[key]\n"
+" except KeyError:\n"
+" item = 0\n"
+" dict[key] = item + 1"
+msgstr ""
+
#: ../../c-api/intro.rst:664
msgid "Here is the corresponding C code, in all its glory::"
msgstr "這是相應的 C 程式碼:"
+#: ../../c-api/intro.rst:666
+msgid ""
+"int\n"
+"incr_item(PyObject *dict, PyObject *key)\n"
+"{\n"
+" /* Objects all initialized to NULL for Py_XDECREF */\n"
+" PyObject *item = NULL, *const_one = NULL, *incremented_item = NULL;\n"
+" int rv = -1; /* Return value initialized to -1 (failure) */\n"
+"\n"
+" item = PyObject_GetItem(dict, key);\n"
+" if (item == NULL) {\n"
+" /* Handle KeyError only: */\n"
+" if (!PyErr_ExceptionMatches(PyExc_KeyError))\n"
+" goto error;\n"
+"\n"
+" /* Clear the error and use zero: */\n"
+" PyErr_Clear();\n"
+" item = PyLong_FromLong(0L);\n"
+" if (item == NULL)\n"
+" goto error;\n"
+" }\n"
+" const_one = PyLong_FromLong(1L);\n"
+" if (const_one == NULL)\n"
+" goto error;\n"
+"\n"
+" incremented_item = PyNumber_Add(item, const_one);\n"
+" if (incremented_item == NULL)\n"
+" goto error;\n"
+"\n"
+" if (PyObject_SetItem(dict, key, incremented_item) < 0)\n"
+" goto error;\n"
+" rv = 0; /* Success */\n"
+" /* Continue with cleanup code */\n"
+"\n"
+" error:\n"
+" /* Cleanup code, shared by success and failure path */\n"
+"\n"
+" /* Use Py_XDECREF() to ignore NULL references */\n"
+" Py_XDECREF(item);\n"
+" Py_XDECREF(const_one);\n"
+" Py_XDECREF(incremented_item);\n"
+"\n"
+" return rv; /* -1 for error, 0 for success */\n"
+"}"
+msgstr ""
+
#: ../../c-api/intro.rst:716
msgid ""
"This example represents an endorsed use of the ``goto`` statement in C! It "
diff --git a/c-api/iter.po b/c-api/iter.po
index 6cb20cd35f..8b674435cc 100644
--- a/c-api/iter.po
+++ b/c-api/iter.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2022-04-03 00:14+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2023-07-01 03:44+0800\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -62,6 +62,32 @@ msgid ""
"something like this::"
msgstr "要編寫一個疊代於疊代器的迴圈,C 程式碼應該會像這樣:"
+#: ../../c-api/iter.rst:33
+msgid ""
+"PyObject *iterator = PyObject_GetIter(obj);\n"
+"PyObject *item;\n"
+"\n"
+"if (iterator == NULL) {\n"
+" /* propagate error */\n"
+"}\n"
+"\n"
+"while ((item = PyIter_Next(iterator))) {\n"
+" /* do something with item */\n"
+" ...\n"
+" /* release reference when done */\n"
+" Py_DECREF(item);\n"
+"}\n"
+"\n"
+"Py_DECREF(iterator);\n"
+"\n"
+"if (PyErr_Occurred()) {\n"
+" /* propagate error */\n"
+"}\n"
+"else {\n"
+" /* continue doing useful work */\n"
+"}"
+msgstr ""
+
#: ../../c-api/iter.rst:59
msgid ""
"The enum value used to represent different results of :c:func:`PyIter_Send`."
diff --git a/c-api/memory.po b/c-api/memory.po
index 359b00698e..e756ad0b09 100644
--- a/c-api/memory.po
+++ b/c-api/memory.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-04-18 00:04+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2018-05-23 14:06+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -72,6 +72,19 @@ msgid ""
"in the following example::"
msgstr ""
+#: ../../c-api/memory.rst:58
+msgid ""
+"PyObject *res;\n"
+"char *buf = (char *) malloc(BUFSIZ); /* for I/O */\n"
+"\n"
+"if (buf == NULL)\n"
+" return PyErr_NoMemory();\n"
+"...Do some I/O operation involving buf...\n"
+"res = PyBytes_FromString(buf);\n"
+"free(buf); /* malloc'ed */\n"
+"return res;"
+msgstr ""
+
#: ../../c-api/memory.rst:68
msgid ""
"In this example, the memory request for the I/O buffer is handled by the C "
@@ -1046,10 +1059,36 @@ msgid ""
"set::"
msgstr ""
+#: ../../c-api/memory.rst:706
+msgid ""
+"PyObject *res;\n"
+"char *buf = (char *) PyMem_Malloc(BUFSIZ); /* for I/O */\n"
+"\n"
+"if (buf == NULL)\n"
+" return PyErr_NoMemory();\n"
+"/* ...Do some I/O operation involving buf... */\n"
+"res = PyBytes_FromString(buf);\n"
+"PyMem_Free(buf); /* allocated with PyMem_Malloc */\n"
+"return res;"
+msgstr ""
+
#: ../../c-api/memory.rst:716
msgid "The same code using the type-oriented function set::"
msgstr ""
+#: ../../c-api/memory.rst:718
+msgid ""
+"PyObject *res;\n"
+"char *buf = PyMem_New(char, BUFSIZ); /* for I/O */\n"
+"\n"
+"if (buf == NULL)\n"
+" return PyErr_NoMemory();\n"
+"/* ...Do some I/O operation involving buf... */\n"
+"res = PyBytes_FromString(buf);\n"
+"PyMem_Del(buf); /* allocated with PyMem_New */\n"
+"return res;"
+msgstr ""
+
#: ../../c-api/memory.rst:728
msgid ""
"Note that in the two examples above, the buffer is always manipulated via "
@@ -1060,6 +1099,17 @@ msgid ""
"different allocators operating on different heaps. ::"
msgstr ""
+#: ../../c-api/memory.rst:735
+msgid ""
+"char *buf1 = PyMem_New(char, BUFSIZ);\n"
+"char *buf2 = (char *) malloc(BUFSIZ);\n"
+"char *buf3 = (char *) PyMem_Malloc(BUFSIZ);\n"
+"...\n"
+"PyMem_Del(buf3); /* Wrong -- should be PyMem_Free() */\n"
+"free(buf2); /* Right -- allocated via malloc() */\n"
+"free(buf1); /* Fatal -- should be PyMem_Del() */"
+msgstr ""
+
#: ../../c-api/memory.rst:743
msgid ""
"In addition to the functions aimed at handling raw memory blocks from the "
diff --git a/c-api/module.po b/c-api/module.po
index 46245beb3f..48fc6f7f0b 100644
--- a/c-api/module.po
+++ b/c-api/module.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-20 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -561,12 +561,58 @@ msgstr ""
msgid "Example usage::"
msgstr "用法範例: ::"
+#: ../../c-api/module.rst:502
+msgid ""
+"static int\n"
+"add_spam(PyObject *module, int value)\n"
+"{\n"
+" PyObject *obj = PyLong_FromLong(value);\n"
+" if (obj == NULL) {\n"
+" return -1;\n"
+" }\n"
+" int res = PyModule_AddObjectRef(module, \"spam\", obj);\n"
+" Py_DECREF(obj);\n"
+" return res;\n"
+" }"
+msgstr ""
+"static int\n"
+"add_spam(PyObject *module, int value)\n"
+"{\n"
+" PyObject *obj = PyLong_FromLong(value);\n"
+" if (obj == NULL) {\n"
+" return -1;\n"
+" }\n"
+" int res = PyModule_AddObjectRef(module, \"spam\", obj);\n"
+" Py_DECREF(obj);\n"
+" return res;\n"
+" }"
+
#: ../../c-api/module.rst:514 ../../c-api/module.rst:567
msgid ""
"The example can also be written without checking explicitly if *obj* is "
"``NULL``::"
msgstr ""
+#: ../../c-api/module.rst:517
+msgid ""
+"static int\n"
+"add_spam(PyObject *module, int value)\n"
+"{\n"
+" PyObject *obj = PyLong_FromLong(value);\n"
+" int res = PyModule_AddObjectRef(module, \"spam\", obj);\n"
+" Py_XDECREF(obj);\n"
+" return res;\n"
+" }"
+msgstr ""
+"static int\n"
+"add_spam(PyObject *module, int value)\n"
+"{\n"
+" PyObject *obj = PyLong_FromLong(value);\n"
+" int res = PyModule_AddObjectRef(module, \"spam\", obj);\n"
+" Py_XDECREF(obj);\n"
+" return res;\n"
+" }"
+
#: ../../c-api/module.rst:526 ../../c-api/module.rst:583
msgid ""
"Note that ``Py_XDECREF()`` should be used instead of ``Py_DECREF()`` in this "
@@ -598,6 +644,41 @@ msgid ""
"func:`Py_DECREF` *value* manually on error."
msgstr ""
+#: ../../c-api/module.rst:551
+msgid ""
+"static int\n"
+"add_spam(PyObject *module, int value)\n"
+"{\n"
+" PyObject *obj = PyLong_FromLong(value);\n"
+" if (obj == NULL) {\n"
+" return -1;\n"
+" }\n"
+" if (PyModule_AddObject(module, \"spam\", obj) < 0) {\n"
+" Py_DECREF(obj);\n"
+" return -1;\n"
+" }\n"
+" // PyModule_AddObject() stole a reference to obj:\n"
+" // Py_DECREF(obj) is not needed here\n"
+" return 0;\n"
+"}"
+msgstr ""
+
+#: ../../c-api/module.rst:570
+msgid ""
+"static int\n"
+"add_spam(PyObject *module, int value)\n"
+"{\n"
+" PyObject *obj = PyLong_FromLong(value);\n"
+" if (PyModule_AddObject(module, \"spam\", obj) < 0) {\n"
+" Py_XDECREF(obj);\n"
+" return -1;\n"
+" }\n"
+" // PyModule_AddObject() stole a reference to obj:\n"
+" // Py_DECREF(obj) is not needed here\n"
+" return 0;\n"
+"}"
+msgstr ""
+
#: ../../c-api/module.rst:589
msgid ""
"Add an integer constant to *module* as *name*. This convenience function "
diff --git a/c-api/perfmaps.po b/c-api/perfmaps.po
index d9f7aed952..f46aea6a4b 100644
--- a/c-api/perfmaps.po
+++ b/c-api/perfmaps.po
@@ -85,6 +85,12 @@ msgstr ""
"將單一條目寫入 ``/tmp/perf-$pid.map`` 檔案。此函式是執行緒安全的。以下是一個"
"條目的範例:"
+#: ../../c-api/perfmaps.rst:38
+msgid ""
+"# address size name\n"
+"7f3529fcf759 b py::bar:/run/t.py"
+msgstr ""
+
#: ../../c-api/perfmaps.rst:41
msgid ""
"Will call :c:func:`PyUnstable_PerfMapState_Init` before writing the entry, "
diff --git a/c-api/refcounting.po b/c-api/refcounting.po
index 042b8619a8..e6bb3e35fd 100644
--- a/c-api/refcounting.po
+++ b/c-api/refcounting.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-03-07 17:26+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -155,10 +155,22 @@ msgstr ""
msgid "For example::"
msgstr "舉例來說: ::"
+#: ../../c-api/refcounting.rst:90
+msgid ""
+"Py_INCREF(obj);\n"
+"self->attr = obj;"
+msgstr ""
+"Py_INCREF(obj);\n"
+"self->attr = obj;"
+
#: ../../c-api/refcounting.rst:93
msgid "can be written as::"
msgstr "可以寫成: ::"
+#: ../../c-api/refcounting.rst:95
+msgid "self->attr = Py_NewRef(obj);"
+msgstr "self->attr = Py_NewRef(obj);"
+
#: ../../c-api/refcounting.rst:97
msgid "See also :c:func:`Py_INCREF`."
msgstr "另請參閱 :c:func:`Py_INCREF`。"
@@ -291,10 +303,22 @@ msgstr ""
msgid "As in case of :c:func:`Py_CLEAR`, \"the obvious\" code can be deadly::"
msgstr "與 :c:func:`Py_CLEAR` 的情況一樣,「明顯的」程式碼可能是致命的: ::"
+#: ../../c-api/refcounting.rst:192
+msgid ""
+"Py_DECREF(dst);\n"
+"dst = src;"
+msgstr ""
+"Py_DECREF(dst);\n"
+"dst = src;"
+
#: ../../c-api/refcounting.rst:195
msgid "The safe way is::"
msgstr "安全的方法是: ::"
+#: ../../c-api/refcounting.rst:197
+msgid "Py_SETREF(dst, src);"
+msgstr "Py_SETREF(dst, src);"
+
#: ../../c-api/refcounting.rst:199
msgid ""
"That arranges to set *dst* to *src* _before_ releasing the reference to the "
diff --git a/c-api/slice.po b/c-api/slice.po
index bd0ac6fc7e..4c70f299c0 100644
--- a/c-api/slice.po
+++ b/c-api/slice.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-11 00:04+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2018-05-23 14:07+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -92,10 +92,26 @@ msgid ""
"`PySlice_AdjustIndices` where ::"
msgstr ""
+#: ../../c-api/slice.rst:64
+msgid ""
+"if (PySlice_GetIndicesEx(slice, length, &start, &stop, &step, &slicelength) "
+"< 0) {\n"
+" // return error\n"
+"}"
+msgstr ""
+
#: ../../c-api/slice.rst:68
msgid "is replaced by ::"
msgstr ""
+#: ../../c-api/slice.rst:70
+msgid ""
+"if (PySlice_Unpack(slice, &start, &stop, &step) < 0) {\n"
+" // return error\n"
+"}\n"
+"slicelength = PySlice_AdjustIndices(length, &start, &stop, step);"
+msgstr ""
+
#: ../../c-api/slice.rst:79
msgid ""
"If ``Py_LIMITED_API`` is not set or set to the value between ``0x03050400`` "
diff --git a/c-api/structures.po b/c-api/structures.po
index 9c279efad3..e46450f6bc 100644
--- a/c-api/structures.po
+++ b/c-api/structures.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-04-18 00:04+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2018-05-23 14:07+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -70,6 +70,10 @@ msgid ""
"without a varying length. The PyObject_HEAD macro expands to::"
msgstr ""
+#: ../../c-api/structures.rst:50
+msgid "PyObject ob_base;"
+msgstr "PyObject ob_base;"
+
#: ../../c-api/structures.rst:52
msgid "See documentation of :c:type:`PyObject` above."
msgstr ""
@@ -81,6 +85,10 @@ msgid ""
"expands to::"
msgstr ""
+#: ../../c-api/structures.rst:61
+msgid "PyVarObject ob_base;"
+msgstr "PyVarObject ob_base;"
+
#: ../../c-api/structures.rst:63
msgid "See documentation of :c:type:`PyVarObject` above."
msgstr "請見上面 :c:type:`PyVarObject` 的文件。"
@@ -160,6 +168,14 @@ msgid ""
"`PyObject` type. This macro expands to::"
msgstr ""
+#: ../../c-api/structures.rst:148
+msgid ""
+"_PyObject_EXTRA_INIT\n"
+"1, type,"
+msgstr ""
+"_PyObject_EXTRA_INIT\n"
+"1, type,"
+
#: ../../c-api/structures.rst:154
msgid ""
"This is a macro which expands to initialization values for a new :c:type:"
@@ -167,6 +183,14 @@ msgid ""
"This macro expands to::"
msgstr ""
+#: ../../c-api/structures.rst:158
+msgid ""
+"_PyObject_EXTRA_INIT\n"
+"1, type, size,"
+msgstr ""
+"_PyObject_EXTRA_INIT\n"
+"1, type, size,"
+
#: ../../c-api/structures.rst:163
msgid "Implementing functions and methods"
msgstr "實作函式與方法"
@@ -185,6 +209,14 @@ msgstr ""
msgid "The function signature is::"
msgstr ""
+#: ../../c-api/structures.rst:176
+msgid ""
+"PyObject *PyCFunction(PyObject *self,\n"
+" PyObject *args);"
+msgstr ""
+"PyObject *PyCFunction(PyObject *self,\n"
+" PyObject *args);"
+
#: ../../c-api/structures.rst:181
msgid ""
"Type of the functions used to implement Python callables in C with "
@@ -192,12 +224,32 @@ msgid ""
"The function signature is::"
msgstr ""
+#: ../../c-api/structures.rst:185
+msgid ""
+"PyObject *PyCFunctionWithKeywords(PyObject *self,\n"
+" PyObject *args,\n"
+" PyObject *kwargs);"
+msgstr ""
+"PyObject *PyCFunctionWithKeywords(PyObject *self,\n"
+" PyObject *args,\n"
+" PyObject *kwargs);"
+
#: ../../c-api/structures.rst:192
msgid ""
"Type of the functions used to implement Python callables in C with "
"signature :c:macro:`METH_FASTCALL`. The function signature is::"
msgstr ""
+#: ../../c-api/structures.rst:196
+msgid ""
+"PyObject *_PyCFunctionFast(PyObject *self,\n"
+" PyObject *const *args,\n"
+" Py_ssize_t nargs);"
+msgstr ""
+"PyObject *_PyCFunctionFast(PyObject *self,\n"
+" PyObject *const *args,\n"
+" Py_ssize_t nargs);"
+
#: ../../c-api/structures.rst:202
msgid ""
"Type of the functions used to implement Python callables in C with "
@@ -205,6 +257,18 @@ msgid ""
"METH_KEYWORDS>`. The function signature is::"
msgstr ""
+#: ../../c-api/structures.rst:206
+msgid ""
+"PyObject *_PyCFunctionFastWithKeywords(PyObject *self,\n"
+" PyObject *const *args,\n"
+" Py_ssize_t nargs,\n"
+" PyObject *kwnames);"
+msgstr ""
+"PyObject *_PyCFunctionFastWithKeywords(PyObject *self,\n"
+" PyObject *const *args,\n"
+" Py_ssize_t nargs,\n"
+" PyObject *kwnames);"
+
#: ../../c-api/structures.rst:213
msgid ""
"Type of the functions used to implement Python callables in C with "
@@ -212,6 +276,20 @@ msgid ""
"METH_FASTCALL-METH_KEYWORDS>`. The function signature is::"
msgstr ""
+#: ../../c-api/structures.rst:217
+msgid ""
+"PyObject *PyCMethod(PyObject *self,\n"
+" PyTypeObject *defining_class,\n"
+" PyObject *const *args,\n"
+" Py_ssize_t nargs,\n"
+" PyObject *kwnames)"
+msgstr ""
+"PyObject *PyCMethod(PyObject *self,\n"
+" PyTypeObject *defining_class,\n"
+" PyObject *const *args,\n"
+" Py_ssize_t nargs,\n"
+" PyObject *kwnames)"
+
#: ../../c-api/structures.rst:228
msgid ""
"Structure used to describe a method of an extension type. This structure "
@@ -509,6 +587,20 @@ msgid ""
"``Py_T_PYSSIZET`` and ``Py_READONLY``, for example::"
msgstr ""
+#: ../../c-api/structures.rst:490
+msgid ""
+"static PyMemberDef spam_type_members[] = {\n"
+" {\"__vectorcalloffset__\", Py_T_PYSSIZET,\n"
+" offsetof(Spam_object, vectorcall), Py_READONLY},\n"
+" {NULL} /* Sentinel */\n"
+"};"
+msgstr ""
+"static PyMemberDef spam_type_members[] = {\n"
+" {\"__vectorcalloffset__\", Py_T_PYSSIZET,\n"
+" offsetof(Spam_object, vectorcall), Py_READONLY},\n"
+" {NULL} /* Sentinel */\n"
+"};"
+
#: ../../c-api/structures.rst:496
msgid "(You may need to ``#include `` for :c:func:`!offsetof`.)"
msgstr ""
diff --git a/c-api/typehints.po b/c-api/typehints.po
index a7843a65f7..6849cd7da0 100644
--- a/c-api/typehints.po
+++ b/c-api/typehints.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-07-29 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2022-10-16 16:16+0800\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -61,6 +61,18 @@ msgstr ""
msgid "Here's an example of how to make an extension type generic::"
msgstr "以下是個讓一個擴充型別泛用化 (generic) 的例子: ::"
+#: ../../c-api/typehints.rst:30
+msgid ""
+"...\n"
+"static PyMethodDef my_obj_methods[] = {\n"
+" // Other methods.\n"
+" ...\n"
+" {\"__class_getitem__\", Py_GenericAlias, METH_O|METH_CLASS, \"See PEP "
+"585\"}\n"
+" ...\n"
+"}"
+msgstr ""
+
#: ../../c-api/typehints.rst:38
msgid "The data model method :meth:`~object.__class_getitem__`."
msgstr "資料模型方法 :meth:`~object.__class_getitem__`。"
diff --git a/c-api/unicode.po b/c-api/unicode.po
index daa2d1e50c..4f9ef92983 100644
--- a/c-api/unicode.po
+++ b/c-api/unicode.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-02-15 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2018-05-23 14:08+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -1240,6 +1240,13 @@ msgid ""
"byte order::"
msgstr ""
+#: ../../c-api/unicode.rst:1029 ../../c-api/unicode.rst:1079
+msgid ""
+"*byteorder == -1: little endian\n"
+"*byteorder == 0: native order\n"
+"*byteorder == 1: big endian"
+msgstr ""
+
#: ../../c-api/unicode.rst:1033
msgid ""
"If ``*byteorder`` is zero, and the first four bytes of the input data are a "
diff --git a/extending/building.po b/extending/building.po
index ea72239809..8a2a5ced44 100644
--- a/extending/building.po
+++ b/extending/building.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-08-18 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2018-05-23 14:09+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -58,6 +58,22 @@ msgid ""
"*punycode* encoding with hyphens replaced by underscores. In Python::"
msgstr ""
+#: ../../extending/building.rst:32
+msgid ""
+"def initfunc_name(name):\n"
+" try:\n"
+" suffix = b'_' + name.encode('ascii')\n"
+" except UnicodeEncodeError:\n"
+" suffix = b'U_' + name.encode('punycode').replace(b'-', b'_')\n"
+" return b'PyInit' + suffix"
+msgstr ""
+"def initfunc_name(name):\n"
+" try:\n"
+" suffix = b'_' + name.encode('ascii')\n"
+" except UnicodeEncodeError:\n"
+" suffix = b'U_' + name.encode('punycode').replace(b'-', b'_')\n"
+" return b'PyInit' + suffix"
+
#: ../../extending/building.rst:39
msgid ""
"It is possible to export multiple modules from a single shared library by "
diff --git a/extending/windows.po b/extending/windows.po
index 9f4cf7c014..41856183ab 100644
--- a/extending/windows.po
+++ b/extending/windows.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-10-11 17:13+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -157,6 +157,14 @@ msgid ""
"spam), you could use these commands::"
msgstr ""
+#: ../../extending/windows.rst:115
+msgid ""
+"cl /LD /I/python/include spam.c ../libs/pythonXY.lib\n"
+"cl /LD /I/python/include ni.c spam.lib ../libs/pythonXY.lib"
+msgstr ""
+"cl /LD /I/python/include spam.c ../libs/pythonXY.lib\n"
+"cl /LD /I/python/include ni.c spam.lib ../libs/pythonXY.lib"
+
#: ../../extending/windows.rst:118
msgid ""
"The first command created three files: :file:`spam.obj`, :file:`spam.dll` "
diff --git a/faq/windows.po b/faq/windows.po
index c727619395..a4fa46fa95 100644
--- a/faq/windows.po
+++ b/faq/windows.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2022-11-08 00:19+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2022-11-09 17:25+0800\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -56,6 +56,10 @@ msgstr ""
"窗。你應該能夠認出何時已啟動這樣的視窗,因為你將看到 Windows「命令提示字"
"元」,它通常看起來像這樣:"
+#: ../../faq/windows.rst:35
+msgid "C:\\>"
+msgstr "C:\\>"
+
#: ../../faq/windows.rst:39
msgid ""
"The letter may be different, and there might be other things after it, so "
@@ -64,6 +68,10 @@ msgstr ""
"第一個字母可能不一樣,且後面也可能還有其他內容,因此你可能會很容易看到類似以"
"下的文字:"
+#: ../../faq/windows.rst:42
+msgid "D:\\YourName\\Projects\\Python>"
+msgstr "D:\\YourName\\Projects\\Python>"
+
#: ../../faq/windows.rst:46
msgid ""
"depending on how your computer has been set up and what else you have "
@@ -94,10 +102,28 @@ msgstr ""
"首先,你需要確保你的命令視窗會將單字 \"py\" 識別為啟動直譯器的指令。如果你已"
"經開啟一個命令視窗,則你應該試試輸入命令 ``py`` 並按下 return 鍵:"
+#: ../../faq/windows.rst:60
+msgid "C:\\Users\\YourName> py"
+msgstr "C:\\Users\\YourName> py"
+
#: ../../faq/windows.rst:64
msgid "You should then see something like:"
msgstr "然後,你應該看到類似下面的內容:"
+#: ../../faq/windows.rst:66
+msgid ""
+"Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit "
+"(Intel)] on win32\n"
+"Type \"help\", \"copyright\", \"credits\" or \"license\" for more "
+"information.\n"
+">>>"
+msgstr ""
+"Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit "
+"(Intel)] on win32\n"
+"Type \"help\", \"copyright\", \"credits\" or \"license\" for more "
+"information.\n"
+">>>"
+
#: ../../faq/windows.rst:72
msgid ""
"You have started the interpreter in \"interactive mode\". That means you can "
@@ -109,6 +135,18 @@ msgstr ""
"運算式,並在等待時執行或計算它們。這是 Python 最強大的功能之一。輸入你所選的"
"幾個運算式並查看結果,可以檢驗此功能:"
+#: ../../faq/windows.rst:77
+msgid ""
+">>> print(\"Hello\")\n"
+"Hello\n"
+">>> \"Hello\" * 3\n"
+"'HelloHelloHello'"
+msgstr ""
+">>> print(\"Hello\")\n"
+"Hello\n"
+">>> \"Hello\" * 3\n"
+"'HelloHelloHello'"
+
#: ../../faq/windows.rst:84
msgid ""
"Many people use the interactive mode as a convenient yet highly programmable "
@@ -149,6 +187,10 @@ msgstr ""
"名為 ``hello.py``,且你的命令提示字元在你的家目錄 (home directory) 中順利地被"
"開啟,那麼你就會看到類似以下的內容: ::"
+#: ../../faq/windows.rst:104
+msgid "C:\\Users\\YourName>"
+msgstr "C:\\Users\\YourName>"
+
#: ../../faq/windows.rst:106
msgid ""
"So now you'll ask the ``py`` command to give your script to Python by typing "
@@ -157,6 +199,14 @@ msgstr ""
"因此,現在你將透過鍵入 ``py`` 加上腳本路徑,來使用 ``py`` 命令將你的腳本提供"
"給 Python: ::"
+#: ../../faq/windows.rst:110
+msgid ""
+"C:\\Users\\YourName> py Desktop\\hello.py\n"
+"hello"
+msgstr ""
+"C:\\Users\\YourName> py Desktop\\hello.py\n"
+"hello"
+
#: ../../faq/windows.rst:114
msgid "How do I make Python scripts executable?"
msgstr "如何使 Python 腳本可以執行?"
@@ -347,6 +397,15 @@ msgid ""
"interpreter with your extension module."
msgstr "簡而言之,你可以使用以下程式碼,以你的擴充模組初始化 Python 直譯器。"
+#: ../../faq/windows.rst:210
+msgid ""
+"#include \n"
+"...\n"
+"Py_Initialize(); // Initialize Python.\n"
+"initmyAppc(); // Initialize (import) the helper class.\n"
+"PyRun_SimpleString(\"import myApp\"); // Import the shadow class."
+msgstr ""
+
#: ../../faq/windows.rst:218
msgid ""
"There are two problems with Python's C API which will become apparent if you "
@@ -372,6 +431,16 @@ msgid ""
"void functions:"
msgstr "問題 2:SWIG 在為 void 函式產生包裝函式 (wrapper) 時會產生以下程式碼:"
+#: ../../faq/windows.rst:229
+msgid ""
+"Py_INCREF(Py_None);\n"
+"_resultobj = Py_None;\n"
+"return _resultobj;"
+msgstr ""
+"Py_INCREF(Py_None);\n"
+"_resultobj = Py_None;\n"
+"return _resultobj;"
+
#: ../../faq/windows.rst:235
msgid ""
"Alas, Py_None is a macro that expands to a reference to a complex data "
@@ -382,6 +451,10 @@ msgstr ""
"_Py_NoneStruct 的複雜資料結構。同樣的,此程式碼在多編譯器環境中將會失效。請將"
"此類程式碼替換為:"
+#: ../../faq/windows.rst:239
+msgid "return Py_BuildValue(\"\");"
+msgstr "return Py_BuildValue(\"\");"
+
#: ../../faq/windows.rst:243
msgid ""
"It may be possible to use SWIG's ``%typemap`` command to make the change "
diff --git a/glossary.po b/glossary.po
index 8084a0eca4..a996679f43 100644
--- a/glossary.po
+++ b/glossary.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-05-31 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -166,6 +166,12 @@ msgstr ""
"遞的引數。例如,``3`` 和 ``5`` 都是以下 :func:`complex` 呼叫中的關鍵字引"
"數: ::"
+#: ../../glossary.rst:72
+msgid ""
+"complex(real=3, imag=5)\n"
+"complex(**{'real': 3, 'imag': 5})"
+msgstr ""
+
#: ../../glossary.rst:75
msgid ""
":dfn:`positional argument`: an argument that is not a keyword argument. "
@@ -177,6 +183,12 @@ msgstr ""
"引數列表的起始處出現,和(或)作為 ``*`` 之後的 :term:`iterable`\\ (可疊代物"
"件)中的元素被傳遞。例如,``3`` 和 ``5`` 都是以下呼叫中的位置引數: ::"
+#: ../../glossary.rst:81
+msgid ""
+"complex(3, 5)\n"
+"complex(*(3, 5))"
+msgstr ""
+
#: ../../glossary.rst:84
msgid ""
"Arguments are assigned to the named local variables in a function body. See "
@@ -492,6 +504,10 @@ msgstr ""
"一個 callable 是可以被呼叫的物件,呼叫時可能以下列形式帶有一組引數(請見 :"
"term:`argument`): ::"
+#: ../../glossary.rst:218
+msgid "callable(argument1, argument2, argumentN)"
+msgstr ""
+
#: ../../glossary.rst:220
msgid ""
"A :term:`function`, and by extension a :term:`method`, is a callable. An "
@@ -679,6 +695,24 @@ msgid ""
"definitions are semantically equivalent::"
msgstr "裝飾器語法只是語法糖。以下兩個函式定義在語義上是等效的: ::"
+#: ../../glossary.rst:303
+msgid ""
+"def f(arg):\n"
+" ...\n"
+"f = staticmethod(f)\n"
+"\n"
+"@staticmethod\n"
+"def f(arg):\n"
+" ..."
+msgstr ""
+"def f(arg):\n"
+" ...\n"
+"f = staticmethod(f)\n"
+"\n"
+"@staticmethod\n"
+"def f(arg):\n"
+" ..."
+
#: ../../glossary.rst:311
msgid ""
"The same concept exists for classes, but is less commonly used there. See "
@@ -1032,6 +1066,14 @@ msgstr ""
"函式註釋通常被使用於\\ :term:`型別提示 `:例如,這個函式預期會得到"
"兩個 :class:`int` 引數,並會有一個 :class:`int` 回傳值: ::"
+#: ../../glossary.rst:463
+msgid ""
+"def sum_two_numbers(a: int, b: int) -> int:\n"
+" return a + b"
+msgstr ""
+"def sum_two_numbers(a: int, b: int) -> int:\n"
+" return a + b"
+
#: ../../glossary.rst:466
msgid "Function annotation syntax is explained in section :ref:`function`."
msgstr "函式註釋的語法在\\ :ref:`function`\\ 章節有詳細解釋。"
@@ -1065,6 +1107,16 @@ msgstr ""
"import 此模組並對其變數求值,你可以看見一個新的功能是何時首次被新增到此語言"
"中,以及它何時將會(或已經)成為預設的功能: ::"
+#: ../../glossary.rst:482
+msgid ""
+">>> import __future__\n"
+">>> __future__.division\n"
+"_Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)"
+msgstr ""
+">>> import __future__\n"
+">>> __future__.division\n"
+"_Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)"
+
#: ../../glossary.rst:485
msgid "garbage collection"
msgstr "garbage collection(垃圾回收)"
@@ -1139,6 +1191,12 @@ msgstr ""
"`!for` 子句,該子句定義了迴圈變數、範圍以及一個選擇性的 :keyword:`!if` 子句。"
"該組合運算式會為外層函式產生多個值: ::"
+#: ../../glossary.rst:521
+msgid ""
+">>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81\n"
+"285"
+msgstr ""
+
#: ../../glossary.rst:523
msgid "generic function"
msgstr "generic function(泛型函式)"
@@ -1854,6 +1912,16 @@ msgstr ""
"有些內建型別是 named tuple,包括由 :func:`time.localtime` 和 :func:`os.stat` "
"回傳的值。另一個例子是 :data:`sys.float_info`: ::"
+#: ../../glossary.rst:832
+msgid ""
+">>> sys.float_info[1] # indexed access\n"
+"1024\n"
+">>> sys.float_info.max_exp # named field access\n"
+"1024\n"
+">>> isinstance(sys.float_info, tuple) # kind of tuple\n"
+"True"
+msgstr ""
+
#: ../../glossary.rst:839
msgid ""
"Some named tuples are built-in types (such as the above examples). "
@@ -2006,6 +2074,10 @@ msgstr ""
"置 `\\ 或是作為\\ :term:`關鍵字引數 `\\ 被傳遞的引數。這"
"是參數的預設類型,例如以下的 *foo* 和 *bar*: ::"
+#: ../../glossary.rst:906
+msgid "def func(foo, bar=None): ..."
+msgstr "def func(foo, bar=None): ..."
+
#: ../../glossary.rst:910
msgid ""
":dfn:`positional-only`: specifies an argument that can be supplied only by "
@@ -2017,6 +2089,10 @@ msgstr ""
"式定義的參數列表中包含一個 ``/`` 字元,就可以在該字元前面定義僅限位置參數,例"
"如以下的 *posonly1* 和 *posonly2*: ::"
+#: ../../glossary.rst:915
+msgid "def func(posonly1, posonly2, /, positional_or_keyword): ..."
+msgstr "def func(posonly1, posonly2, /, positional_or_keyword): ..."
+
#: ../../glossary.rst:919
msgid ""
":dfn:`keyword-only`: specifies an argument that can be supplied only by "
@@ -2030,6 +2106,10 @@ msgstr ""
"單純的 ``*`` 字元,就可以在其後方定義僅限關鍵字參數,例如以下的 *kw_only1* "
"和 *kw_only2*: ::"
+#: ../../glossary.rst:925
+msgid "def func(arg, *, kw_only1, kw_only2): ..."
+msgstr "def func(arg, *, kw_only1, kw_only2): ..."
+
#: ../../glossary.rst:927
msgid ""
":dfn:`var-positional`: specifies that an arbitrary sequence of positional "
@@ -2042,6 +2122,10 @@ msgstr ""
"數(在已被其他參數接受的任何位置引數之外)。這類參數是透過在其參數名稱字首加"
"上 ``*`` 來定義的,例如以下的 *args*: ::"
+#: ../../glossary.rst:933
+msgid "def func(*args, **kwargs): ..."
+msgstr "def func(*args, **kwargs): ..."
+
#: ../../glossary.rst:935
msgid ""
":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be "
@@ -2277,10 +2361,26 @@ msgstr ""
"keyword:`for` 陳述式,對一個可疊代物件的所有元素進行迴圈。許多其他語言並沒有"
"這種類型的架構,所以不熟悉 Python 的人有時會使用一個數值計數器來代替: ::"
+#: ../../glossary.rst:1036
+msgid ""
+"for i in range(len(food)):\n"
+" print(food[i])"
+msgstr ""
+"for i in range(len(food)):\n"
+" print(food[i])"
+
#: ../../glossary.rst:1039
msgid "As opposed to the cleaner, Pythonic method::"
msgstr "相較之下,以下方法更簡潔、更具有 Python 風格: ::"
+#: ../../glossary.rst:1041
+msgid ""
+"for piece in food:\n"
+" print(piece)"
+msgstr ""
+"for piece in food:\n"
+" print(piece)"
+
#: ../../glossary.rst:1043
msgid "qualified name"
msgstr "qualified name(限定名稱)"
@@ -2296,6 +2396,32 @@ msgstr ""
"或 method 的「路徑」,如 :pep:`3155` 中的定義。對於頂層的函式和 class 而言,"
"限定名稱與其物件名稱相同: ::"
+#: ../../glossary.rst:1050
+msgid ""
+">>> class C:\n"
+"... class D:\n"
+"... def meth(self):\n"
+"... pass\n"
+"...\n"
+">>> C.__qualname__\n"
+"'C'\n"
+">>> C.D.__qualname__\n"
+"'C.D'\n"
+">>> C.D.meth.__qualname__\n"
+"'C.D.meth'"
+msgstr ""
+">>> class C:\n"
+"... class D:\n"
+"... def meth(self):\n"
+"... pass\n"
+"...\n"
+">>> C.__qualname__\n"
+"'C'\n"
+">>> C.D.__qualname__\n"
+"'C.D'\n"
+">>> C.D.meth.__qualname__\n"
+"'C.D.meth'"
+
#: ../../glossary.rst:1062
msgid ""
"When used to refer to modules, the *fully qualified name* means the entire "
@@ -2305,6 +2431,16 @@ msgstr ""
"當用於引用模組時,*完全限定名稱 (fully qualified name)* 是表示該模組的完整點"
"分隔路徑,包括任何的父套件,例如 ``email.mime.text``: ::"
+#: ../../glossary.rst:1066
+msgid ""
+">>> import email.mime.text\n"
+">>> email.mime.text.__name__\n"
+"'email.mime.text'"
+msgstr ""
+">>> import email.mime.text\n"
+">>> email.mime.text.__name__\n"
+"'email.mime.text'"
+
#: ../../glossary.rst:1069
msgid "reference count"
msgstr "reference count(參照計數)"
@@ -2616,10 +2752,32 @@ msgid ""
msgstr ""
"型別別名對於簡化\\ :term:`型別提示 (type hint) ` 很有用。例如: ::"
+#: ../../glossary.rst:1205
+msgid ""
+"def remove_gray_shades(\n"
+" colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n"
+" pass"
+msgstr ""
+"def remove_gray_shades(\n"
+" colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n"
+" pass"
+
#: ../../glossary.rst:1209
msgid "could be made more readable like this::"
msgstr "可以寫成這樣,更具有可讀性: ::"
+#: ../../glossary.rst:1211
+msgid ""
+"Color = tuple[int, int, int]\n"
+"\n"
+"def remove_gray_shades(colors: list[Color]) -> list[Color]:\n"
+" pass"
+msgstr ""
+"Color = tuple[int, int, int]\n"
+"\n"
+"def remove_gray_shades(colors: list[Color]) -> list[Color]:\n"
+" pass"
+
#: ../../glossary.rst:1216 ../../glossary.rst:1230
msgid "See :mod:`typing` and :pep:`484`, which describe this functionality."
msgstr "請參閱 :mod:`typing` 和 :pep:`484`,有此功能的描述。"
@@ -2684,6 +2842,14 @@ msgid ""
"When annotating a variable or a class attribute, assignment is optional::"
msgstr "註釋變數或 class 屬性時,賦值是選擇性的: ::"
+#: ../../glossary.rst:1244
+msgid ""
+"class C:\n"
+" field: 'annotation'"
+msgstr ""
+"class C:\n"
+" field: 'annotation'"
+
#: ../../glossary.rst:1247
msgid ""
"Variable annotations are usually used for :term:`type hints `: "
@@ -2692,6 +2858,10 @@ msgstr ""
"變數註釋通常用於\\ :term:`型別提示 (type hint) `:例如,這個變數預"
"期會取得 :class:`int`\\ (整數)值: ::"
+#: ../../glossary.rst:1251
+msgid "count: int = 0"
+msgstr "count: int = 0"
+
#: ../../glossary.rst:1253
msgid "Variable annotation syntax is explained in section :ref:`annassign`."
msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。"
diff --git a/howto/annotations.po b/howto/annotations.po
index f4dd9ba9f3..0135a78029 100644
--- a/howto/annotations.po
+++ b/howto/annotations.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-12-13 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -163,6 +163,26 @@ msgstr ""
"類別的 ``__annotations__`` 屬性可能會無意中回傳\\ *基底類別的註釋字典。*\\ 舉"
"例來說: ::"
+#: ../../howto/annotations.rst:89
+msgid ""
+"class Base:\n"
+" a: int = 3\n"
+" b: str = 'abc'\n"
+"\n"
+"class Derived(Base):\n"
+" pass\n"
+"\n"
+"print(Derived.__annotations__)"
+msgstr ""
+"class Base:\n"
+" a: int = 3\n"
+" b: str = 'abc'\n"
+"\n"
+"class Derived(Base):\n"
+" pass\n"
+"\n"
+"print(Derived.__annotations__)"
+
#: ../../howto/annotations.rst:98
msgid "This will print the annotations dict from ``Base``, not ``Derived``."
msgstr "這將印出 (print) 來自 ``Base`` 的註釋字典,而不是 ``Derived``。"
@@ -191,6 +211,18 @@ msgstr ""
"總而言之,以下是一些範例程式碼,可以安全地存取 Python 3.9 及先前版本中任意物"
"件上的 ``__annotations__`` 屬性:"
+#: ../../howto/annotations.rst:113
+msgid ""
+"if isinstance(o, type):\n"
+" ann = o.__dict__.get('__annotations__', None)\n"
+"else:\n"
+" ann = getattr(o, '__annotations__', None)"
+msgstr ""
+"if isinstance(o, type):\n"
+" ann = o.__dict__.get('__annotations__', None)\n"
+"else:\n"
+" ann = getattr(o, '__annotations__', None)"
+
#: ../../howto/annotations.rst:118
msgid ""
"After running this code, ``ann`` should be either a dictionary or ``None``. "
@@ -407,6 +439,18 @@ msgstr ""
"annotations``),並且你指定一個字串作為註釋,則該字串本身將被引用。實際上,註"
"釋被引用了\\ *兩次。*\\ 例如: ::"
+#: ../../howto/annotations.rst:227
+msgid ""
+"from __future__ import annotations\n"
+"def foo(a: \"str\"): pass\n"
+"\n"
+"print(foo.__annotations__)"
+msgstr ""
+"from __future__ import annotations\n"
+"def foo(a: \"str\"): pass\n"
+"\n"
+"print(foo.__annotations__)"
+
#: ../../howto/annotations.rst:232
msgid ""
"This prints ``{'a': \"'str'\"}``. This shouldn't really be considered a "
diff --git a/library/devmode.po b/library/devmode.po
index 73632bf44b..5449742012 100644
--- a/library/devmode.po
+++ b/library/devmode.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-10-11 17:13+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2024-05-03 02:14+0800\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -54,6 +54,12 @@ msgid ""
"but with additional effects described below::"
msgstr "啟用 Python 開發模式類似以下指令,但具有如下所述的附加效果:"
+#: ../../library/devmode.rst:24
+msgid ""
+"PYTHONMALLOC=debug PYTHONASYNCIODEBUG=1 python -W default -X faulthandler"
+msgstr ""
+"PYTHONMALLOC=debug PYTHONASYNCIODEBUG=1 python -W default -X faulthandler"
+
#: ../../library/devmode.rst:26
msgid "Effects of the Python Development Mode:"
msgstr "Python 開發模式的效果:"
@@ -132,7 +138,8 @@ msgstr "請參閱 :c:func:`PyMem_SetupDebugHooks` C 函式。"
msgid ""
"It behaves as if the :envvar:`PYTHONMALLOC` environment variable is set to "
"``debug``."
-msgstr "它的行為就好像是將 :envvar:`PYTHONMALLOC` 環境變數設定為 ``debug`` 一樣。"
+msgstr ""
+"它的行為就好像是將 :envvar:`PYTHONMALLOC` 環境變數設定為 ``debug`` 一樣。"
#: ../../library/devmode.rst:57
msgid ""
@@ -259,6 +266,20 @@ msgid ""
"in the command line::"
msgstr "計算命令列中指定的文字檔案列數的腳本範例: ::"
+#: ../../library/devmode.rst:116
+msgid ""
+"import sys\n"
+"\n"
+"def main():\n"
+" fp = open(sys.argv[1])\n"
+" nlines = len(fp.readlines())\n"
+" print(nlines)\n"
+" # The file is closed implicitly\n"
+"\n"
+"if __name__ == \"__main__\":\n"
+" main()"
+msgstr ""
+
#: ../../library/devmode.rst:127
msgid ""
"The script does not close the file explicitly. By default, Python does not "
@@ -267,23 +288,80 @@ msgstr ""
"該腳本不會明確關閉檔案。預設情況下,Python 不會發出任何警告。使用 README.txt "
"的範例,該檔案有 269 列:"
+#: ../../library/devmode.rst:130
+msgid ""
+"$ python script.py README.txt\n"
+"269"
+msgstr ""
+"$ python script.py README.txt\n"
+"269"
+
#: ../../library/devmode.rst:135
msgid ""
"Enabling the Python Development Mode displays a :exc:`ResourceWarning` "
"warning:"
msgstr "啟用 Python 開發模式會顯示 :exc:`ResourceWarning` 警告:"
+#: ../../library/devmode.rst:137
+msgid ""
+"$ python -X dev script.py README.txt\n"
+"269\n"
+"script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='README."
+"rst' mode='r' encoding='UTF-8'>\n"
+" main()\n"
+"ResourceWarning: Enable tracemalloc to get the object allocation traceback"
+msgstr ""
+"$ python -X dev script.py README.txt\n"
+"269\n"
+"script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='README."
+"rst' mode='r' encoding='UTF-8'>\n"
+" main()\n"
+"ResourceWarning: Enable tracemalloc to get the object allocation traceback"
+
#: ../../library/devmode.rst:145
msgid ""
"In addition, enabling :mod:`tracemalloc` shows the line where the file was "
"opened:"
msgstr "此外,啟用 :mod:`tracemalloc` 會顯示檔案被開啟的那一列:"
+#: ../../library/devmode.rst:148
+msgid ""
+"$ python -X dev -X tracemalloc=5 script.py README.rst\n"
+"269\n"
+"script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='README."
+"rst' mode='r' encoding='UTF-8'>\n"
+" main()\n"
+"Object allocated at (most recent call last):\n"
+" File \"script.py\", lineno 10\n"
+" main()\n"
+" File \"script.py\", lineno 4\n"
+" fp = open(sys.argv[1])"
+msgstr ""
+"$ python -X dev -X tracemalloc=5 script.py README.rst\n"
+"269\n"
+"script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='README."
+"rst' mode='r' encoding='UTF-8'>\n"
+" main()\n"
+"Object allocated at (most recent call last):\n"
+" File \"script.py\", lineno 10\n"
+" main()\n"
+" File \"script.py\", lineno 4\n"
+" fp = open(sys.argv[1])"
+
#: ../../library/devmode.rst:160
msgid ""
"The fix is to close explicitly the file. Example using a context manager::"
msgstr "修復方法是明確關閉該檔案。以下是使用情境管理器的範例: ::"
+#: ../../library/devmode.rst:162
+msgid ""
+"def main():\n"
+" # Close the file explicitly when exiting the with block\n"
+" with open(sys.argv[1]) as fp:\n"
+" nlines = len(fp.readlines())\n"
+" print(nlines)"
+msgstr ""
+
#: ../../library/devmode.rst:168
msgid ""
"Not closing a resource explicitly can leave a resource open for way longer "
@@ -303,10 +381,32 @@ msgstr "檔案描述器的錯誤範例"
msgid "Script displaying the first line of itself::"
msgstr "顯示自身第一列的腳本: ::"
+#: ../../library/devmode.rst:179
+msgid ""
+"import os\n"
+"\n"
+"def main():\n"
+" fp = open(__file__)\n"
+" firstline = fp.readline()\n"
+" print(firstline.rstrip())\n"
+" os.close(fp.fileno())\n"
+" # The file is closed implicitly\n"
+"\n"
+"main()"
+msgstr ""
+
#: ../../library/devmode.rst:190
msgid "By default, Python does not emit any warning:"
msgstr "預設情況下,Python 不會發出任何警告:"
+#: ../../library/devmode.rst:192
+msgid ""
+"$ python script.py\n"
+"import os"
+msgstr ""
+"$ python script.py\n"
+"import os"
+
#: ../../library/devmode.rst:197
msgid ""
"The Python Development Mode shows a :exc:`ResourceWarning` and logs a \"Bad "
@@ -315,6 +415,34 @@ msgstr ""
"Python 開發模式在最終化 (finalize) 檔案物件時顯示 :exc:`ResourceWarning` 並記"
"錄 \"Bad file descriptor\" 錯誤:"
+#: ../../library/devmode.rst:200
+msgid ""
+"$ python -X dev script.py\n"
+"import os\n"
+"script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='script."
+"py' mode='r' encoding='UTF-8'>\n"
+" main()\n"
+"ResourceWarning: Enable tracemalloc to get the object allocation traceback\n"
+"Exception ignored in: <_io.TextIOWrapper name='script.py' mode='r' "
+"encoding='UTF-8'>\n"
+"Traceback (most recent call last):\n"
+" File \"script.py\", line 10, in \n"
+" main()\n"
+"OSError: [Errno 9] Bad file descriptor"
+msgstr ""
+"$ python -X dev script.py\n"
+"import os\n"
+"script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='script."
+"py' mode='r' encoding='UTF-8'>\n"
+" main()\n"
+"ResourceWarning: Enable tracemalloc to get the object allocation traceback\n"
+"Exception ignored in: <_io.TextIOWrapper name='script.py' mode='r' "
+"encoding='UTF-8'>\n"
+"Traceback (most recent call last):\n"
+" File \"script.py\", line 10, in \n"
+" main()\n"
+"OSError: [Errno 9] Bad file descriptor"
+
#: ../../library/devmode.rst:213
msgid ""
"``os.close(fp.fileno())`` closes the file descriptor. When the file object "
@@ -323,10 +451,10 @@ msgid ""
"worst case scenario, closing it twice can lead to a crash (see :issue:"
"`18748` for an example)."
msgstr ""
-"``os.close(fp.fileno())`` 會關閉檔案描述器。當檔案物件最終化函式 (finalizer) 嘗"
-"試再次關閉檔案描述器時,它會失敗並出現 ``Bad file descriptor`` 錯誤。檔案描述"
-"器只能關閉一次。在最壞的情況下,將它關閉兩次可能會導致崩潰 (crash)(相關範例"
-"請參閱 :issue:`18748`)。"
+"``os.close(fp.fileno())`` 會關閉檔案描述器。當檔案物件最終化函式 (finalizer) "
+"嘗試再次關閉檔案描述器時,它會失敗並出現 ``Bad file descriptor`` 錯誤。檔案描"
+"述器只能關閉一次。在最壞的情況下,將它關閉兩次可能會導致崩潰 (crash)(相關範"
+"例請參閱 :issue:`18748`)。"
#: ../../library/devmode.rst:219
msgid ""
diff --git a/library/ensurepip.po b/library/ensurepip.po
index beed2826ca..151641a7b2 100644
--- a/library/ensurepip.po
+++ b/library/ensurepip.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-04 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -101,6 +101,10 @@ msgstr "使用直譯器 (interpreter) 的 ``-m`` 來調用命令列介面"
msgid "The simplest possible invocation is::"
msgstr "最簡單可行的調用: ::"
+#: ../../library/ensurepip.rst:50
+msgid "python -m ensurepip"
+msgstr "python -m ensurepip"
+
#: ../../library/ensurepip.rst:52
msgid ""
"This invocation will install ``pip`` if it is not already installed, but "
@@ -112,6 +116,10 @@ msgstr ""
"upgrade`` 參數來確保 ``pip`` 的安裝版本至少為當前 ``ensurepip`` 中最新可用的"
"版本: ::"
+#: ../../library/ensurepip.rst:57
+msgid "python -m ensurepip --upgrade"
+msgstr "python -m ensurepip --upgrade"
+
#: ../../library/ensurepip.rst:59
msgid ""
"By default, ``pip`` is installed into the current virtual environment (if "
diff --git a/library/fileinput.po b/library/fileinput.po
index eedb8c97fd..c54fab2cc5 100644
--- a/library/fileinput.po
+++ b/library/fileinput.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-06-13 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -37,6 +37,16 @@ msgstr ""
msgid "The typical use is::"
msgstr ""
+#: ../../library/fileinput.rst:20
+msgid ""
+"import fileinput\n"
+"for line in fileinput.input(encoding=\"utf-8\"):\n"
+" process(line)"
+msgstr ""
+"import fileinput\n"
+"for line in fileinput.input(encoding=\"utf-8\"):\n"
+" process(line)"
+
#: ../../library/fileinput.rst:24
msgid ""
"This iterates over the lines of all files listed in ``sys.argv[1:]``, "
@@ -109,6 +119,18 @@ msgid ""
"keyword:`!with` statement is exited, even if an exception occurs::"
msgstr ""
+#: ../../library/fileinput.rst:70
+msgid ""
+"with fileinput.input(files=('spam.txt', 'eggs.txt'), encoding=\"utf-8\") as "
+"f:\n"
+" for line in f:\n"
+" process(line)"
+msgstr ""
+"with fileinput.input(files=('spam.txt', 'eggs.txt'), encoding=\"utf-8\") as "
+"f:\n"
+" for line in f:\n"
+" process(line)"
+
#: ../../library/fileinput.rst:74 ../../library/fileinput.rst:170
msgid "Can be used as a context manager."
msgstr ""
@@ -225,6 +247,14 @@ msgid ""
"keyword:`!with` statement is exited, even if an exception occurs::"
msgstr ""
+#: ../../library/fileinput.rst:167
+msgid ""
+"with FileInput(files=('spam.txt', 'eggs.txt')) as input:\n"
+" process(input)"
+msgstr ""
+"with FileInput(files=('spam.txt', 'eggs.txt')) as input:\n"
+" process(input)"
+
#: ../../library/fileinput.rst:173
msgid "The keyword parameter *mode* and *openhook* are now keyword-only."
msgstr ""
diff --git a/library/ftplib.po b/library/ftplib.po
index 241aab64ef..3042e7310a 100644
--- a/library/ftplib.po
+++ b/library/ftplib.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-04 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -62,6 +62,28 @@ msgstr ""
msgid "Here's a sample session using the :mod:`ftplib` module::"
msgstr "這是一個使用 :mod:`ftplib` 模組的會話範例:"
+#: ../../library/ftplib.rst:28
+msgid ""
+">>> from ftplib import FTP\n"
+">>> ftp = FTP('ftp.us.debian.org') # connect to host, default port\n"
+">>> ftp.login() # user anonymous, passwd anonymous@\n"
+"'230 Login successful.'\n"
+">>> ftp.cwd('debian') # change into \"debian\" directory\n"
+"'250 Directory successfully changed.'\n"
+">>> ftp.retrlines('LIST') # list directory contents\n"
+"-rw-rw-r-- 1 1176 1176 1063 Jun 15 10:18 README\n"
+"...\n"
+"drwxr-sr-x 5 1176 1176 4096 Dec 19 2000 pool\n"
+"drwxr-sr-x 4 1176 1176 4096 Nov 17 2008 project\n"
+"drwxr-xr-x 3 1176 1176 4096 Oct 10 2012 tools\n"
+"'226 Directory send OK.'\n"
+">>> with open('README', 'wb') as fp:\n"
+">>> ftp.retrbinary('RETR README', fp.write)\n"
+"'226 Transfer complete.'\n"
+">>> ftp.quit()\n"
+"'221 Goodbye.'"
+msgstr ""
+
#: ../../library/ftplib.rst:51
msgid "Reference"
msgstr "參考"
@@ -586,6 +608,36 @@ msgstr "已棄用的 *keyfile* 和 *certfile* 參數已被移除。"
msgid "Here's a sample session using the :class:`FTP_TLS` class::"
msgstr "這是一個使用 :class:`FTP_TLS` 類別的範例會話:"
+#: ../../library/ftplib.rst:516
+msgid ""
+">>> ftps = FTP_TLS('ftp.pureftpd.org')\n"
+">>> ftps.login()\n"
+"'230 Anonymous user logged in'\n"
+">>> ftps.prot_p()\n"
+"'200 Data protection level set to \"private\"'\n"
+">>> ftps.nlst()\n"
+"['6jack', 'OpenBSD', 'antilink', 'blogbench', 'bsdcam', 'clockspeed', "
+"'djbdns-jedi', 'docs', 'eaccelerator-jedi', 'favicon.ico', 'francotone', "
+"'fugu', 'ignore', 'libpuzzle', 'metalog', 'minidentd', 'misc', 'mysql-udf-"
+"global-user-variables', 'php-jenkins-hash', 'php-skein-hash', 'php-webdav', "
+"'phpaudit', 'phpbench', 'pincaster', 'ping', 'posto', 'pub', 'public', "
+"'public_keys', 'pure-ftpd', 'qscan', 'qtc', 'sharedance', 'skycache', "
+"'sound', 'tmp', 'ucarp']"
+msgstr ""
+">>> ftps = FTP_TLS('ftp.pureftpd.org')\n"
+">>> ftps.login()\n"
+"'230 Anonymous user logged in'\n"
+">>> ftps.prot_p()\n"
+"'200 Data protection level set to \"private\"'\n"
+">>> ftps.nlst()\n"
+"['6jack', 'OpenBSD', 'antilink', 'blogbench', 'bsdcam', 'clockspeed', "
+"'djbdns-jedi', 'docs', 'eaccelerator-jedi', 'favicon.ico', 'francotone', "
+"'fugu', 'ignore', 'libpuzzle', 'metalog', 'minidentd', 'misc', 'mysql-udf-"
+"global-user-variables', 'php-jenkins-hash', 'php-skein-hash', 'php-webdav', "
+"'phpaudit', 'phpbench', 'pincaster', 'ping', 'posto', 'pub', 'public', "
+"'public_keys', 'pure-ftpd', 'qscan', 'qtc', 'sharedance', 'skycache', "
+"'sound', 'tmp', 'ucarp']"
+
#: ../../library/ftplib.rst:524
msgid ""
":class:`!FTP_TLS` class inherits from :class:`FTP`, defining these "
diff --git a/library/gc.po b/library/gc.po
index 98e9675951..ac05411f77 100644
--- a/library/gc.po
+++ b/library/gc.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-04 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -282,6 +282,34 @@ msgstr ""
"件)會被追蹤。然而,有一些特定型別最佳化會被用來減少垃圾回收器在簡單實例(如"
"只含有原子性的鍵和值的字典)上的足跡: ::"
+#: ../../library/gc.rst:173
+msgid ""
+">>> gc.is_tracked(0)\n"
+"False\n"
+">>> gc.is_tracked(\"a\")\n"
+"False\n"
+">>> gc.is_tracked([])\n"
+"True\n"
+">>> gc.is_tracked({})\n"
+"False\n"
+">>> gc.is_tracked({\"a\": 1})\n"
+"False\n"
+">>> gc.is_tracked({\"a\": []})\n"
+"True"
+msgstr ""
+">>> gc.is_tracked(0)\n"
+"False\n"
+">>> gc.is_tracked(\"a\")\n"
+"False\n"
+">>> gc.is_tracked([])\n"
+"True\n"
+">>> gc.is_tracked({})\n"
+"False\n"
+">>> gc.is_tracked({\"a\": 1})\n"
+"False\n"
+">>> gc.is_tracked({\"a\": []})\n"
+"True"
+
#: ../../library/gc.rst:191
msgid ""
"Returns ``True`` if the given object has been finalized by the garbage "
@@ -289,6 +317,34 @@ msgid ""
msgstr ""
"如果給定物件已被垃圾回收器終結則回傳 ``True``,否則回傳 ``False``。: ::"
+#: ../../library/gc.rst:194
+msgid ""
+">>> x = None\n"
+">>> class Lazarus:\n"
+"... def __del__(self):\n"
+"... global x\n"
+"... x = self\n"
+"...\n"
+">>> lazarus = Lazarus()\n"
+">>> gc.is_finalized(lazarus)\n"
+"False\n"
+">>> del lazarus\n"
+">>> gc.is_finalized(x)\n"
+"True"
+msgstr ""
+">>> x = None\n"
+">>> class Lazarus:\n"
+"... def __del__(self):\n"
+"... global x\n"
+"... x = self\n"
+"...\n"
+">>> lazarus = Lazarus()\n"
+">>> gc.is_finalized(lazarus)\n"
+"False\n"
+">>> del lazarus\n"
+">>> gc.is_finalized(x)\n"
+"True"
+
#: ../../library/gc.rst:212
msgid ""
"Freeze all the objects tracked by the garbage collector; move them to a "
diff --git a/library/getopt.po b/library/getopt.po
index 00cc74f4ae..01b5b5326d 100644
--- a/library/getopt.po
+++ b/library/getopt.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-05-09 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2016-01-31 07:19+0000\n"
"Last-Translator: Liang-Bo Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -134,6 +134,38 @@ msgstr ""
msgid "In a script, typical usage is something like this::"
msgstr ""
+#: ../../library/getopt.rst:120
+msgid ""
+"import getopt, sys\n"
+"\n"
+"def main():\n"
+" try:\n"
+" opts, args = getopt.getopt(sys.argv[1:], \"ho:v\", [\"help\", "
+"\"output=\"])\n"
+" except getopt.GetoptError as err:\n"
+" # print help information and exit:\n"
+" print(err) # will print something like \"option -a not "
+"recognized\"\n"
+" usage()\n"
+" sys.exit(2)\n"
+" output = None\n"
+" verbose = False\n"
+" for o, a in opts:\n"
+" if o == \"-v\":\n"
+" verbose = True\n"
+" elif o in (\"-h\", \"--help\"):\n"
+" usage()\n"
+" sys.exit()\n"
+" elif o in (\"-o\", \"--output\"):\n"
+" output = a\n"
+" else:\n"
+" assert False, \"unhandled option\"\n"
+" # ...\n"
+"\n"
+"if __name__ == \"__main__\":\n"
+" main()"
+msgstr ""
+
#: ../../library/getopt.rst:147
msgid ""
"Note that an equivalent command line interface could be produced with less "
@@ -141,6 +173,19 @@ msgid ""
"`argparse` module::"
msgstr ""
+#: ../../library/getopt.rst:150
+msgid ""
+"import argparse\n"
+"\n"
+"if __name__ == '__main__':\n"
+" parser = argparse.ArgumentParser()\n"
+" parser.add_argument('-o', '--output')\n"
+" parser.add_argument('-v', dest='verbose', action='store_true')\n"
+" args = parser.parse_args()\n"
+" # ... do something with args.output ...\n"
+" # ... do something with args.verbose .."
+msgstr ""
+
#: ../../library/getopt.rst:162
msgid "Module :mod:`argparse`"
msgstr ":mod:`argparse` 模組"
diff --git a/library/importlib.po b/library/importlib.po
index e4e4cecca2..e6be299e9b 100644
--- a/library/importlib.po
+++ b/library/importlib.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-23 00:04+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -321,6 +321,18 @@ msgid ""
"if desired::"
msgstr ""
+#: ../../library/importlib.rst:182
+msgid ""
+"try:\n"
+" cache\n"
+"except NameError:\n"
+" cache = {}"
+msgstr ""
+"try:\n"
+" cache\n"
+"except NameError:\n"
+" cache = {}"
+
#: ../../library/importlib.rst:187
msgid ""
"It is generally not very useful to reload built-in or dynamically loaded "
@@ -372,6 +384,28 @@ msgstr ""
msgid "ABC hierarchy::"
msgstr ""
+#: ../../library/importlib.rst:227
+msgid ""
+"object\n"
+" +-- MetaPathFinder\n"
+" +-- PathEntryFinder\n"
+" +-- Loader\n"
+" +-- ResourceLoader --------+\n"
+" +-- InspectLoader |\n"
+" +-- ExecutionLoader --+\n"
+" +-- FileLoader\n"
+" +-- SourceLoader"
+msgstr ""
+"object\n"
+" +-- MetaPathFinder\n"
+" +-- PathEntryFinder\n"
+" +-- Loader\n"
+" +-- ResourceLoader --------+\n"
+" +-- InspectLoader |\n"
+" +-- ExecutionLoader --+\n"
+" +-- FileLoader\n"
+" +-- SourceLoader"
+
#: ../../library/importlib.rst:240
msgid "An abstract base class representing a :term:`meta path finder`."
msgstr ""
@@ -1368,6 +1402,24 @@ msgid ""
"public for introspecting the ``__loader__`` attribute on namespace packages::"
msgstr ""
+#: ../../library/importlib.rst:1155
+msgid ""
+">>> from importlib.machinery import NamespaceLoader\n"
+">>> import my_namespace\n"
+">>> isinstance(my_namespace.__loader__, NamespaceLoader)\n"
+"True\n"
+">>> import importlib.abc\n"
+">>> isinstance(my_namespace.__loader__, importlib.abc.Loader)\n"
+"True"
+msgstr ""
+">>> from importlib.machinery import NamespaceLoader\n"
+">>> import my_namespace\n"
+">>> isinstance(my_namespace.__loader__, NamespaceLoader)\n"
+"True\n"
+">>> import importlib.abc\n"
+">>> isinstance(my_namespace.__loader__, importlib.abc.Loader)\n"
+"True"
+
#: ../../library/importlib.rst:1168
msgid ""
"A specification for a module's import-system-related state. This is "
@@ -1715,6 +1767,18 @@ msgid ""
"of by instance. ::"
msgstr ""
+#: ../../library/importlib.rst:1472
+msgid ""
+"suffixes = importlib.machinery.SOURCE_SUFFIXES\n"
+"loader = importlib.machinery.SourceFileLoader\n"
+"lazy_loader = importlib.util.LazyLoader.factory(loader)\n"
+"finder = importlib.machinery.FileFinder(path, (lazy_loader, suffixes))"
+msgstr ""
+"suffixes = importlib.machinery.SOURCE_SUFFIXES\n"
+"loader = importlib.machinery.SourceFileLoader\n"
+"lazy_loader = importlib.util.LazyLoader.factory(loader)\n"
+"finder = importlib.machinery.FileFinder(path, (lazy_loader, suffixes))"
+
#: ../../library/importlib.rst:1480
msgid "Examples"
msgstr "範例"
@@ -1728,6 +1792,16 @@ msgid ""
"To programmatically import a module, use :func:`importlib.import_module`. ::"
msgstr ""
+#: ../../library/importlib.rst:1488
+msgid ""
+"import importlib\n"
+"\n"
+"itertools = importlib.import_module('itertools')"
+msgstr ""
+"import importlib\n"
+"\n"
+"itertools = importlib.import_module('itertools')"
+
#: ../../library/importlib.rst:1494
msgid "Checking if a module can be imported"
msgstr ""
@@ -1744,6 +1818,26 @@ msgid ""
"find_spec` will import the parent module. ::"
msgstr ""
+#: ../../library/importlib.rst:1503
+msgid ""
+"import importlib.util\n"
+"import sys\n"
+"\n"
+"# For illustrative purposes.\n"
+"name = 'itertools'\n"
+"\n"
+"if name in sys.modules:\n"
+" print(f\"{name!r} already in sys.modules\")\n"
+"elif (spec := importlib.util.find_spec(name)) is not None:\n"
+" # If you chose to perform the actual import ...\n"
+" module = importlib.util.module_from_spec(spec)\n"
+" sys.modules[name] = module\n"
+" spec.loader.exec_module(module)\n"
+" print(f\"{name!r} has been imported\")\n"
+"else:\n"
+" print(f\"can't find the {name!r} module\")"
+msgstr ""
+
#: ../../library/importlib.rst:1522
msgid "Importing a source file directly"
msgstr ""
@@ -1752,6 +1846,22 @@ msgstr ""
msgid "To import a Python source file directly, use the following recipe::"
msgstr ""
+#: ../../library/importlib.rst:1526
+msgid ""
+"import importlib.util\n"
+"import sys\n"
+"\n"
+"# For illustrative purposes.\n"
+"import tokenize\n"
+"file_path = tokenize.__file__\n"
+"module_name = tokenize.__name__\n"
+"\n"
+"spec = importlib.util.spec_from_file_location(module_name, file_path)\n"
+"module = importlib.util.module_from_spec(spec)\n"
+"sys.modules[module_name] = module\n"
+"spec.loader.exec_module(module)"
+msgstr ""
+
#: ../../library/importlib.rst:1541
msgid "Implementing lazy imports"
msgstr ""
@@ -1760,6 +1870,26 @@ msgstr ""
msgid "The example below shows how to implement lazy imports::"
msgstr ""
+#: ../../library/importlib.rst:1545
+msgid ""
+">>> import importlib.util\n"
+">>> import sys\n"
+">>> def lazy_import(name):\n"
+"... spec = importlib.util.find_spec(name)\n"
+"... loader = importlib.util.LazyLoader(spec.loader)\n"
+"... spec.loader = loader\n"
+"... module = importlib.util.module_from_spec(spec)\n"
+"... sys.modules[name] = module\n"
+"... loader.exec_module(module)\n"
+"... return module\n"
+"...\n"
+">>> lazy_typing = lazy_import(\"typing\")\n"
+">>> #lazy_typing is a real module object,\n"
+">>> #but it is not loaded in memory yet.\n"
+">>> lazy_typing.TYPE_CHECKING\n"
+"False"
+msgstr ""
+
#: ../../library/importlib.rst:1565
msgid "Setting up an importer"
msgstr ""
@@ -1778,6 +1908,30 @@ msgid ""
"for the appropriate classes defined within this package)::"
msgstr ""
+#: ../../library/importlib.rst:1578
+msgid ""
+"import importlib.machinery\n"
+"import sys\n"
+"\n"
+"# For illustrative purposes only.\n"
+"SpamMetaPathFinder = importlib.machinery.PathFinder\n"
+"SpamPathEntryFinder = importlib.machinery.FileFinder\n"
+"loader_details = (importlib.machinery.SourceFileLoader,\n"
+" importlib.machinery.SOURCE_SUFFIXES)\n"
+"\n"
+"# Setting up a meta path finder.\n"
+"# Make sure to put the finder in the proper location in the list in terms "
+"of\n"
+"# priority.\n"
+"sys.meta_path.append(SpamMetaPathFinder)\n"
+"\n"
+"# Setting up a path entry finder.\n"
+"# Make sure to put the path hook in the proper location in the list in "
+"terms\n"
+"# of priority.\n"
+"sys.path_hooks.append(SpamPathEntryFinder.path_hook(loader_details))"
+msgstr ""
+
#: ../../library/importlib.rst:1599
msgid "Approximating :func:`importlib.import_module`"
msgstr ""
@@ -1790,6 +1944,39 @@ msgid ""
"approximate implementation of :func:`importlib.import_module`::"
msgstr ""
+#: ../../library/importlib.rst:1607
+msgid ""
+"import importlib.util\n"
+"import sys\n"
+"\n"
+"def import_module(name, package=None):\n"
+" \"\"\"An approximate implementation of import.\"\"\"\n"
+" absolute_name = importlib.util.resolve_name(name, package)\n"
+" try:\n"
+" return sys.modules[absolute_name]\n"
+" except KeyError:\n"
+" pass\n"
+"\n"
+" path = None\n"
+" if '.' in absolute_name:\n"
+" parent_name, _, child_name = absolute_name.rpartition('.')\n"
+" parent_module = import_module(parent_name)\n"
+" path = parent_module.__spec__.submodule_search_locations\n"
+" for finder in sys.meta_path:\n"
+" spec = finder.find_spec(absolute_name, path)\n"
+" if spec is not None:\n"
+" break\n"
+" else:\n"
+" msg = f'No module named {absolute_name!r}'\n"
+" raise ModuleNotFoundError(msg, name=absolute_name)\n"
+" module = importlib.util.module_from_spec(spec)\n"
+" sys.modules[absolute_name] = module\n"
+" spec.loader.exec_module(module)\n"
+" if path is not None:\n"
+" setattr(parent_module, child_name, module)\n"
+" return module"
+msgstr ""
+
#: ../../library/importlib.rst:443
msgid "universal newlines"
msgstr "universal newlines"
diff --git a/library/mmap.po b/library/mmap.po
index efd708f69d..0a218bd00d 100644
--- a/library/mmap.po
+++ b/library/mmap.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-04 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -182,12 +182,49 @@ msgstr ""
msgid "This example shows a simple way of using :class:`~mmap.mmap`::"
msgstr ""
+#: ../../library/mmap.rst:111
+msgid ""
+"import mmap\n"
+"\n"
+"# write a simple example file\n"
+"with open(\"hello.txt\", \"wb\") as f:\n"
+" f.write(b\"Hello Python!\\n\")\n"
+"\n"
+"with open(\"hello.txt\", \"r+b\") as f:\n"
+" # memory-map the file, size 0 means whole file\n"
+" mm = mmap.mmap(f.fileno(), 0)\n"
+" # read content via standard file methods\n"
+" print(mm.readline()) # prints b\"Hello Python!\\n\"\n"
+" # read content via slice notation\n"
+" print(mm[:5]) # prints b\"Hello\"\n"
+" # update content using slice notation;\n"
+" # note that new content must have same size\n"
+" mm[6:] = b\" world!\\n\"\n"
+" # ... and read again using standard file methods\n"
+" mm.seek(0)\n"
+" print(mm.readline()) # prints b\"Hello world!\\n\"\n"
+" # close the map\n"
+" mm.close()"
+msgstr ""
+
#: ../../library/mmap.rst:134
msgid ""
":class:`~mmap.mmap` can also be used as a context manager in a :keyword:"
"`with` statement::"
msgstr ""
+#: ../../library/mmap.rst:137
+msgid ""
+"import mmap\n"
+"\n"
+"with mmap.mmap(-1, 13) as mm:\n"
+" mm.write(b\"Hello world!\")"
+msgstr ""
+"import mmap\n"
+"\n"
+"with mmap.mmap(-1, 13) as mm:\n"
+" mm.write(b\"Hello world!\")"
+
#: ../../library/mmap.rst:142
msgid "Context manager support."
msgstr ""
@@ -198,6 +235,36 @@ msgid ""
"data between the parent and child processes::"
msgstr ""
+#: ../../library/mmap.rst:149
+msgid ""
+"import mmap\n"
+"import os\n"
+"\n"
+"mm = mmap.mmap(-1, 13)\n"
+"mm.write(b\"Hello world!\")\n"
+"\n"
+"pid = os.fork()\n"
+"\n"
+"if pid == 0: # In a child process\n"
+" mm.seek(0)\n"
+" print(mm.readline())\n"
+"\n"
+" mm.close()"
+msgstr ""
+"import mmap\n"
+"import os\n"
+"\n"
+"mm = mmap.mmap(-1, 13)\n"
+"mm.write(b\"Hello world!\")\n"
+"\n"
+"pid = os.fork()\n"
+"\n"
+"if pid == 0: # 在子行程中\n"
+" mm.seek(0)\n"
+" print(mm.readline())\n"
+"\n"
+" mm.close()"
+
#: ../../library/mmap.rst:165
msgid "Memory-mapped file objects support the following methods:"
msgstr ""
diff --git a/library/pkgutil.po b/library/pkgutil.po
index c75e251798..8c6aba317d 100644
--- a/library/pkgutil.po
+++ b/library/pkgutil.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-20 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2024-03-08 16:07+0000\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -44,6 +44,14 @@ msgstr ""
"擴充組成一個套件之模組的搜尋路徑。預期用法是將以下程式碼放入套件的 :file:"
"`__init__.py`: ::"
+#: ../../library/pkgutil.rst:25
+msgid ""
+"from pkgutil import extend_path\n"
+"__path__ = extend_path(__path__, __name__)"
+msgstr ""
+"from pkgutil import extend_path\n"
+"__path__ = extend_path(__path__, __name__)"
+
#: ../../library/pkgutil.rst:28
msgid ""
"For each directory on :data:`sys.path` that has a subdirectory that matches "
@@ -248,6 +256,15 @@ msgstr ""
msgid "Examples::"
msgstr "範例: ::"
+#: ../../library/pkgutil.rst:167
+msgid ""
+"# list all modules python can access\n"
+"walk_packages()\n"
+"\n"
+"# list all submodules of ctypes\n"
+"walk_packages(ctypes.__path__, ctypes.__name__ + '.')"
+msgstr ""
+
#: ../../library/pkgutil.rst:187
msgid "Get a resource from a package."
msgstr "從套件中取得資源。"
@@ -278,6 +295,14 @@ msgid ""
"this is the rough equivalent of::"
msgstr "對於位於檔案系統中且已被引入過的套件,這大致相當於: ::"
+#: ../../library/pkgutil.rst:202
+msgid ""
+"d = os.path.dirname(sys.modules[package].__file__)\n"
+"data = open(os.path.join(d, resource), 'rb').read()"
+msgstr ""
+"d = os.path.dirname(sys.modules[package].__file__)\n"
+"data = open(os.path.join(d, resource), 'rb').read()"
+
#: ../../library/pkgutil.rst:205
msgid ""
"If the package cannot be located or loaded, or it uses a :term:`loader` "
diff --git a/library/platform.po b/library/platform.po
index 9a25d70bbc..2e904a0cc5 100644
--- a/library/platform.po
+++ b/library/platform.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-05-09 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -91,6 +91,10 @@ msgstr ""
"要獲取當前直譯器的 \"64 位元性 (64-bitness)\",更可靠的做法是查詢 :data:`sys."
"maxsize` 屬性: ::"
+#: ../../library/platform.rst:51
+msgid "is_64bits = sys.maxsize > 2**32"
+msgstr "is_64bits = sys.maxsize > 2**32"
+
#: ../../library/platform.rst:56
msgid ""
"Returns the machine type, e.g. ``'AMD64'``. An empty string is returned if "
@@ -444,3 +448,14 @@ msgstr ""
#: ../../library/platform.rst:289
msgid "Example::"
msgstr "範例: ::"
+
+#: ../../library/platform.rst:291
+msgid ""
+"def get_like_distro():\n"
+" info = platform.freedesktop_os_release()\n"
+" ids = [info[\"ID\"]]\n"
+" if \"ID_LIKE\" in info:\n"
+" # ids are space separated and ordered by precedence\n"
+" ids.extend(info[\"ID_LIKE\"].split())\n"
+" return ids"
+msgstr ""
diff --git a/library/poplib.po b/library/poplib.po
index c64749d17a..3f678ffc37 100644
--- a/library/poplib.po
+++ b/library/poplib.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-04 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -315,6 +315,28 @@ msgid ""
"retrieves and prints all messages::"
msgstr ""
+#: ../../library/poplib.rst:260
+msgid ""
+"import getpass, poplib\n"
+"\n"
+"M = poplib.POP3('localhost')\n"
+"M.user(getpass.getuser())\n"
+"M.pass_(getpass.getpass())\n"
+"numMessages = len(M.list()[1])\n"
+"for i in range(numMessages):\n"
+" for j in M.retr(i+1)[1]:\n"
+" print(j)"
+msgstr ""
+"import getpass, poplib\n"
+"\n"
+"M = poplib.POP3('localhost')\n"
+"M.user(getpass.getuser())\n"
+"M.pass_(getpass.getpass())\n"
+"numMessages = len(M.list()[1])\n"
+"for i in range(numMessages):\n"
+" for j in M.retr(i+1)[1]:\n"
+" print(j)"
+
#: ../../library/poplib.rst:270
msgid ""
"At the end of the module, there is a test section that contains a more "
diff --git a/library/shlex.po b/library/shlex.po
index 2702cfff0c..1994b4f5db 100644
--- a/library/shlex.po
+++ b/library/shlex.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-05-09 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -478,6 +478,32 @@ msgid ""
"following snippet:"
msgstr ""
+#: ../../library/shlex.rst:412
+msgid ""
+">>> import shlex\n"
+">>> text = \"a && b; c && d || e; f >'abc'; (def \\\"ghi\\\")\"\n"
+">>> s = shlex.shlex(text, posix=True)\n"
+">>> s.whitespace_split = True\n"
+">>> list(s)\n"
+"['a', '&&', 'b;', 'c', '&&', 'd', '||', 'e;', 'f', '>abc;', '(def', 'ghi)']\n"
+">>> s = shlex.shlex(text, posix=True, punctuation_chars=True)\n"
+">>> s.whitespace_split = True\n"
+">>> list(s)\n"
+"['a', '&&', 'b', ';', 'c', '&&', 'd', '||', 'e', ';', 'f', '>', 'abc', ';',\n"
+"'(', 'def', 'ghi', ')']"
+msgstr ""
+">>> import shlex\n"
+">>> text = \"a && b; c && d || e; f >'abc'; (def \\\"ghi\\\")\"\n"
+">>> s = shlex.shlex(text, posix=True)\n"
+">>> s.whitespace_split = True\n"
+">>> list(s)\n"
+"['a', '&&', 'b;', 'c', '&&', 'd', '||', 'e;', 'f', '>abc;', '(def', 'ghi)']\n"
+">>> s = shlex.shlex(text, posix=True, punctuation_chars=True)\n"
+">>> s.whitespace_split = True\n"
+">>> list(s)\n"
+"['a', '&&', 'b', ';', 'c', '&&', 'd', '||', 'e', ';', 'f', '>', 'abc', ';',\n"
+"'(', 'def', 'ghi', ')']"
+
#: ../../library/shlex.rst:427
msgid ""
"Of course, tokens will be returned which are not valid for shells, and "
@@ -491,6 +517,18 @@ msgid ""
"used to determine which characters constitute punctuation. For example::"
msgstr ""
+#: ../../library/shlex.rst:434
+msgid ""
+">>> import shlex\n"
+">>> s = shlex.shlex(\"a && b || c\", punctuation_chars=\"|\")\n"
+">>> list(s)\n"
+"['a', '&', '&', 'b', '||', 'c']"
+msgstr ""
+">>> import shlex\n"
+">>> s = shlex.shlex(\"a && b || c\", punctuation_chars=\"|\")\n"
+">>> list(s)\n"
+"['a', '&', '&', 'b', '||', 'c']"
+
#: ../../library/shlex.rst:439
msgid ""
"When ``punctuation_chars`` is specified, the :attr:`~shlex.wordchars` "
@@ -499,6 +537,20 @@ msgid ""
"line arguments (e.g. ``--color=auto``). Hence::"
msgstr ""
+#: ../../library/shlex.rst:444
+msgid ""
+">>> import shlex\n"
+">>> s = shlex.shlex('~/a && b-c --color=auto || d *.py?',\n"
+"... punctuation_chars=True)\n"
+">>> list(s)\n"
+"['~/a', '&&', 'b-c', '--color=auto', '||', 'd', '*.py?']"
+msgstr ""
+">>> import shlex\n"
+">>> s = shlex.shlex('~/a && b-c --color=auto || d *.py?',\n"
+"... punctuation_chars=True)\n"
+">>> list(s)\n"
+"['~/a', '&&', 'b-c', '--color=auto', '||', 'd', '*.py?']"
+
#: ../../library/shlex.rst:450
msgid ""
"However, to match the shell as closely as possible, it is recommended to "
diff --git a/library/sndhdr.po b/library/sndhdr.po
index 190dec9d0f..62e9d90ce2 100644
--- a/library/sndhdr.po
+++ b/library/sndhdr.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-20 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2022-06-11 15:40+0800\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -208,6 +208,20 @@ msgstr ""
msgid "Example:"
msgstr "範例:"
+#: ../../library/sndhdr.rst:97
+msgid ""
+">>> import sndhdr\n"
+">>> imghdr.what('bass.wav')\n"
+"'wav'\n"
+">>> imghdr.whathdr('bass.wav')\n"
+"'wav'"
+msgstr ""
+">>> import sndhdr\n"
+">>> imghdr.what('bass.wav')\n"
+"'wav'\n"
+">>> imghdr.whathdr('bass.wav')\n"
+"'wav'"
+
#: ../../library/sndhdr.rst:13
msgid "A-LAW"
msgstr "A-LAW"
diff --git a/library/stat.po b/library/stat.po
index 34f1d48a4b..e0d8fce823 100644
--- a/library/stat.po
+++ b/library/stat.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-05-09 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -117,6 +117,35 @@ msgstr ""
msgid "Example::"
msgstr "範例: ::"
+#: ../../library/stat.rst:103
+msgid ""
+"import os, sys\n"
+"from stat import *\n"
+"\n"
+"def walktree(top, callback):\n"
+" '''recursively descend the directory tree rooted at top,\n"
+" calling the callback function for each regular file'''\n"
+"\n"
+" for f in os.listdir(top):\n"
+" pathname = os.path.join(top, f)\n"
+" mode = os.lstat(pathname).st_mode\n"
+" if S_ISDIR(mode):\n"
+" # It's a directory, recurse into it\n"
+" walktree(pathname, callback)\n"
+" elif S_ISREG(mode):\n"
+" # It's a file, call the callback function\n"
+" callback(pathname)\n"
+" else:\n"
+" # Unknown file type, print a message\n"
+" print('Skipping %s' % pathname)\n"
+"\n"
+"def visitfile(file):\n"
+" print('visiting', file)\n"
+"\n"
+"if __name__ == '__main__':\n"
+" walktree(sys.argv[1], visitfile)"
+msgstr ""
+
#: ../../library/stat.rst:129
msgid ""
"An additional utility function is provided to convert a file's mode in a "
diff --git a/library/test.po b/library/test.po
index cf3576981a..79851fd564 100644
--- a/library/test.po
+++ b/library/test.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-30 18:24+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -86,6 +86,40 @@ msgstr ""
msgid "A basic boilerplate is often used::"
msgstr ""
+#: ../../library/test.rst:57
+msgid ""
+"import unittest\n"
+"from test import support\n"
+"\n"
+"class MyTestCase1(unittest.TestCase):\n"
+"\n"
+" # Only use setUp() and tearDown() if necessary\n"
+"\n"
+" def setUp(self):\n"
+" ... code to execute in preparation for tests ...\n"
+"\n"
+" def tearDown(self):\n"
+" ... code to execute to clean up after tests ...\n"
+"\n"
+" def test_feature_one(self):\n"
+" # Test feature one.\n"
+" ... testing code ...\n"
+"\n"
+" def test_feature_two(self):\n"
+" # Test feature two.\n"
+" ... testing code ...\n"
+"\n"
+" ... more test methods ...\n"
+"\n"
+"class MyTestCase2(unittest.TestCase):\n"
+" ... same structure as MyTestCase1 ...\n"
+"\n"
+"... more test classes ...\n"
+"\n"
+"if __name__ == '__main__':\n"
+" unittest.main()"
+msgstr ""
+
#: ../../library/test.rst:88
msgid ""
"This code pattern allows the testing suite to be run by :mod:`test."
@@ -160,6 +194,40 @@ msgid ""
"subclassing a basic test class with a class that specifies the input::"
msgstr ""
+#: ../../library/test.rst:129
+msgid ""
+"class TestFuncAcceptsSequencesMixin:\n"
+"\n"
+" func = mySuperWhammyFunction\n"
+"\n"
+" def test_func(self):\n"
+" self.func(self.arg)\n"
+"\n"
+"class AcceptLists(TestFuncAcceptsSequencesMixin, unittest.TestCase):\n"
+" arg = [1, 2, 3]\n"
+"\n"
+"class AcceptStrings(TestFuncAcceptsSequencesMixin, unittest.TestCase):\n"
+" arg = 'abc'\n"
+"\n"
+"class AcceptTuples(TestFuncAcceptsSequencesMixin, unittest.TestCase):\n"
+" arg = (1, 2, 3)"
+msgstr ""
+"class TestFuncAcceptsSequencesMixin:\n"
+"\n"
+" func = mySuperWhammyFunction\n"
+"\n"
+" def test_func(self):\n"
+" self.func(self.arg)\n"
+"\n"
+"class AcceptLists(TestFuncAcceptsSequencesMixin, unittest.TestCase):\n"
+" arg = [1, 2, 3]\n"
+"\n"
+"class AcceptStrings(TestFuncAcceptsSequencesMixin, unittest.TestCase):\n"
+" arg = 'abc'\n"
+"\n"
+"class AcceptTuples(TestFuncAcceptsSequencesMixin, unittest.TestCase):\n"
+" arg = (1, 2, 3)"
+
#: ../../library/test.rst:145
msgid ""
"When using this pattern, remember that all classes that inherit from :class:"
@@ -490,10 +558,34 @@ msgstr ""
msgid "Example::"
msgstr "範例: ::"
+#: ../../library/test.rst:428
+msgid ""
+"for _ in support.busy_retry(support.SHORT_TIMEOUT):\n"
+" if check():\n"
+" break"
+msgstr ""
+"for _ in support.busy_retry(support.SHORT_TIMEOUT):\n"
+" if check():\n"
+" break"
+
#: ../../library/test.rst:432 ../../library/test.rst:456
msgid "Example of error=False usage::"
msgstr "error=False 用法範例: ::"
+#: ../../library/test.rst:434
+msgid ""
+"for _ in support.busy_retry(support.SHORT_TIMEOUT, error=False):\n"
+" if check():\n"
+" break\n"
+"else:\n"
+" raise RuntimeError('my custom error')"
+msgstr ""
+"for _ in support.busy_retry(support.SHORT_TIMEOUT, error=False):\n"
+" if check():\n"
+" break\n"
+"else:\n"
+" raise RuntimeError('my custom error')"
+
#: ../../library/test.rst:442
msgid "Wait strategy that applies exponential backoff."
msgstr ""
@@ -513,6 +605,30 @@ msgstr "請見 :func:`busy_retry` 文件以瞭解參數用法。"
msgid "Example raising an exception after SHORT_TIMEOUT seconds::"
msgstr "在 SHORT_TIMEOUT 秒後引發例外的範例: ::"
+#: ../../library/test.rst:452
+msgid ""
+"for _ in support.sleeping_retry(support.SHORT_TIMEOUT):\n"
+" if check():\n"
+" break"
+msgstr ""
+"for _ in support.sleeping_retry(support.SHORT_TIMEOUT):\n"
+" if check():\n"
+" break"
+
+#: ../../library/test.rst:458
+msgid ""
+"for _ in support.sleeping_retry(support.SHORT_TIMEOUT, error=False):\n"
+" if check():\n"
+" break\n"
+"else:\n"
+" raise RuntimeError('my custom error')"
+msgstr ""
+"for _ in support.sleeping_retry(support.SHORT_TIMEOUT, error=False):\n"
+" if check():\n"
+" break\n"
+"else:\n"
+" raise RuntimeError('my custom error')"
+
#: ../../library/test.rst:466
msgid ""
"Return ``True`` if *resource* is enabled and available. The list of "
@@ -570,6 +686,13 @@ msgid ""
"returns ``True`` or ``False`` depending on the host platform. Example usage::"
msgstr ""
+#: ../../library/test.rst:524
+msgid ""
+"check_impl_detail() # Only on CPython (default).\n"
+"check_impl_detail(jython=True) # Only on Jython.\n"
+"check_impl_detail(cpython=False) # Everywhere except CPython."
+msgstr ""
+
#: ../../library/test.rst:531
msgid ""
"Set the values for :data:`max_memuse` and :data:`real_max_memuse` for big "
@@ -610,10 +733,34 @@ msgstr ""
msgid "Example use with output streams::"
msgstr "使用輸出串流的範例: ::"
+#: ../../library/test.rst:568
+msgid ""
+"with captured_stdout() as stdout, captured_stderr() as stderr:\n"
+" print(\"hello\")\n"
+" print(\"error\", file=sys.stderr)\n"
+"assert stdout.getvalue() == \"hello\\n\"\n"
+"assert stderr.getvalue() == \"error\\n\""
+msgstr ""
+"with captured_stdout() as stdout, captured_stderr() as stderr:\n"
+" print(\"hello\")\n"
+" print(\"error\", file=sys.stderr)\n"
+"assert stdout.getvalue() == \"hello\\n\"\n"
+"assert stderr.getvalue() == \"error\\n\""
+
#: ../../library/test.rst:574
msgid "Example use with input stream::"
msgstr "使用輸入串流的範例: ::"
+#: ../../library/test.rst:576
+msgid ""
+"with captured_stdin() as stdin:\n"
+" stdin.write('hello\\n')\n"
+" stdin.seek(0)\n"
+" # call test code that consumes from sys.stdin\n"
+" captured = input()\n"
+"self.assertEqual(captured, \"hello\")"
+msgstr ""
+
#: ../../library/test.rst:586
msgid "A context manager that temporary disables :mod:`faulthandler`."
msgstr ""
@@ -641,6 +788,14 @@ msgstr ""
msgid "Usage::"
msgstr "用法: ::"
+#: ../../library/test.rst:609
+msgid ""
+"with swap_attr(obj, \"attr\", 5):\n"
+" ..."
+msgstr ""
+"with swap_attr(obj, \"attr\", 5):\n"
+" ..."
+
#: ../../library/test.rst:612
msgid ""
"This will set ``obj.attr`` to 5 for the duration of the ``with`` block, "
@@ -658,6 +813,14 @@ msgstr ""
msgid "Context manager to swap out an item with a new object."
msgstr ""
+#: ../../library/test.rst:627
+msgid ""
+"with swap_item(obj, \"item\", 5):\n"
+" ..."
+msgstr ""
+"with swap_item(obj, \"item\", 5):\n"
+" ..."
+
#: ../../library/test.rst:630
msgid ""
"This will set ``obj[\"item\"]`` to 5 for the duration of the ``with`` block, "
@@ -890,6 +1053,19 @@ msgid ""
"the stored object."
msgstr ""
+#: ../../library/test.rst:862
+msgid ""
+"with support.catch_unraisable_exception() as cm:\n"
+" # code creating an \"unraisable exception\"\n"
+" ...\n"
+"\n"
+" # check the unraisable exception: use cm.unraisable\n"
+" ...\n"
+"\n"
+"# cm.unraisable attribute no longer exists at this point\n"
+"# (to break a reference cycle)"
+msgstr ""
+
#: ../../library/test.rst:877
msgid ""
"Generic implementation of the :mod:`unittest` ``load_tests`` protocol for "
@@ -899,6 +1075,20 @@ msgid ""
"the following::"
msgstr ""
+#: ../../library/test.rst:883
+msgid ""
+"import os\n"
+"from test.support import load_package_tests\n"
+"\n"
+"def load_tests(*args):\n"
+" return load_package_tests(os.path.dirname(__file__), *args)"
+msgstr ""
+"import os\n"
+"from test.support import load_package_tests\n"
+"\n"
+"def load_tests(*args):\n"
+" return load_package_tests(os.path.dirname(__file__), *args)"
+
#: ../../library/test.rst:892
msgid ""
"Returns the set of attributes, functions or methods of *ref_api* not found "
@@ -975,6 +1165,26 @@ msgstr ""
msgid "Example use::"
msgstr "用法範例: ::"
+#: ../../library/test.rst:951
+msgid ""
+"import bar\n"
+"import foo\n"
+"import unittest\n"
+"from test import support\n"
+"\n"
+"class MiscTestCase(unittest.TestCase):\n"
+" def test__all__(self):\n"
+" support.check__all__(self, foo)\n"
+"\n"
+"class OtherTestCase(unittest.TestCase):\n"
+" def test__all__(self):\n"
+" extra = {'BAR_CONST', 'FOO_CONST'}\n"
+" not_exported = {'baz'} # Undocumented name.\n"
+" # bar imports part of its API from _bar.\n"
+" support.check__all__(self, bar, ('bar', '_bar'),\n"
+" extra=extra, not_exported=not_exported)"
+msgstr ""
+
#: ../../library/test.rst:972
msgid ""
"Skip tests if the :mod:`multiprocessing.synchronize` module is missing, if "
@@ -1365,6 +1575,21 @@ msgstr "參閱 :func:`threading.excepthook` 文件。"
msgid "These attributes are deleted at the context manager exit."
msgstr "這些屬性會在離開情境管理器時被刪除。"
+#: ../../library/test.rst:1328
+msgid ""
+"with threading_helper.catch_threading_exception() as cm:\n"
+" # code spawning a thread which raises an exception\n"
+" ...\n"
+"\n"
+" # check the thread exception, use cm attributes:\n"
+" # exc_type, exc_value, exc_traceback, thread\n"
+" ...\n"
+"\n"
+"# exc_type, exc_value, exc_traceback, thread attributes of cm no longer\n"
+"# exists at this point\n"
+"# (to avoid reference cycles)"
+msgstr ""
+
#: ../../library/test.rst:1344
msgid ":mod:`test.support.os_helper` --- Utilities for os tests"
msgstr ":mod:`test.support.os_helper` --- 用於 os 測試的工具"
@@ -1608,6 +1833,16 @@ msgid ""
"imported."
msgstr "如果無法引入指定的模組則此函式會引發 :exc:`ImportError`。"
+#: ../../library/test.rst:1578
+msgid ""
+"# Get copies of the warnings module for testing without affecting the\n"
+"# version being used by the rest of the test suite. One copy uses the\n"
+"# C implementation, the other is forced to use the pure Python fallback\n"
+"# implementation\n"
+"py_warnings = import_fresh_module('warnings', blocked=['_warnings'])\n"
+"c_warnings = import_fresh_module('warnings', fresh=['_warnings'])"
+msgstr ""
+
#: ../../library/test.rst:1590
msgid ""
"This function imports and returns the named module. Unlike a normal import, "
@@ -1652,6 +1887,12 @@ msgid ""
"`DeprecationWarning` on import. Example usage::"
msgstr ""
+#: ../../library/test.rst:1632
+msgid ""
+"with CleanImport('foo'):\n"
+" importlib.import_module('foo') # New reference."
+msgstr ""
+
#: ../../library/test.rst:1638
msgid "A context manager to temporarily add directories to :data:`sys.path`."
msgstr ""
@@ -1688,6 +1929,13 @@ msgid ""
"category=category) `. For example::"
msgstr ""
+#: ../../library/test.rst:1668
+msgid ""
+"@warning_helper.ignore_warnings(category=DeprecationWarning)\n"
+"def test_suppress_warning():\n"
+" # do something"
+msgstr ""
+
#: ../../library/test.rst:1677
msgid ""
"Context manager to check that no :exc:`ResourceWarning` was raised. You "
@@ -1732,6 +1980,10 @@ msgstr ""
msgid "If no arguments are specified, it defaults to::"
msgstr "如果沒有指定引數,預設為: ::"
+#: ../../library/test.rst:1715
+msgid "check_warnings((\"\", Warning), quiet=True)"
+msgstr "check_warnings((\"\", Warning), quiet=True)"
+
#: ../../library/test.rst:1717
msgid "In this case all warnings are caught and no errors are raised."
msgstr ""
@@ -1758,6 +2010,14 @@ msgstr ""
msgid "The context manager is designed to be used like this::"
msgstr ""
+#: ../../library/test.rst:1733
+msgid ""
+"with check_warnings((\"assertion is always true\", SyntaxWarning),\n"
+" (\"\", UserWarning)):\n"
+" exec('assert(False, \"Hey!\")')\n"
+" warnings.warn(UserWarning(\"Hide me!\"))"
+msgstr ""
+
#: ../../library/test.rst:1738
msgid ""
"In this case if either warning was not raised, or some other warning was "
@@ -1770,6 +2030,28 @@ msgid ""
"checking whether or not they occurred, code like this can be used::"
msgstr ""
+#: ../../library/test.rst:1744
+msgid ""
+"with check_warnings(quiet=True) as w:\n"
+" warnings.warn(\"foo\")\n"
+" assert str(w.args[0]) == \"foo\"\n"
+" warnings.warn(\"bar\")\n"
+" assert str(w.args[0]) == \"bar\"\n"
+" assert str(w.warnings[0].args[0]) == \"foo\"\n"
+" assert str(w.warnings[1].args[0]) == \"bar\"\n"
+" w.reset()\n"
+" assert len(w.warnings) == 0"
+msgstr ""
+"with check_warnings(quiet=True) as w:\n"
+" warnings.warn(\"foo\")\n"
+" assert str(w.args[0]) == \"foo\"\n"
+" warnings.warn(\"bar\")\n"
+" assert str(w.args[0]) == \"bar\"\n"
+" assert str(w.warnings[0].args[0]) == \"foo\"\n"
+" assert str(w.warnings[1].args[0]) == \"bar\"\n"
+" w.reset()\n"
+" assert len(w.warnings) == 0"
+
#: ../../library/test.rst:1755
msgid ""
"Here all warnings will be caught, and the test code tests the captured "
diff --git a/library/time.po b/library/time.po
index 138b23dcc1..1262f3248e 100644
--- a/library/time.po
+++ b/library/time.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-07-20 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2024-08-14 16:05+0800\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -932,6 +932,16 @@ msgstr ""
"以下是一個範例,其為一種與 :rfc:`2822` 網際網路電子郵件標準中指定的日期格式兼"
"容的格式。 [1]_: ::"
+#: ../../library/time.rst:524
+msgid ""
+">>> from time import gmtime, strftime\n"
+">>> strftime(\"%a, %d %b %Y %H:%M:%S +0000\", gmtime())\n"
+"'Thu, 28 Jun 2001 14:17:15 +0000'"
+msgstr ""
+">>> from time import gmtime, strftime\n"
+">>> strftime(\"%a, %d %b %Y %H:%M:%S +0000\", gmtime())\n"
+"'Thu, 28 Jun 2001 14:17:15 +0000'"
+
#: ../../library/time.rst:528
msgid ""
"Additional directives may be supported on certain platforms, but only the "
@@ -1241,6 +1251,10 @@ msgid ""
"added for clarity)::"
msgstr ""
+#: ../../library/time.rst:729
+msgid "std offset [dst [offset [,start[/time], end[/time]]]]"
+msgstr "std offset [dst [offset [,start[/time], end[/time]]]]"
+
#: ../../library/time.rst:731
msgid "Where the components are:"
msgstr ""
@@ -1315,6 +1329,26 @@ msgid ""
"or '+') is allowed. The default, if time is not given, is 02:00:00."
msgstr ""
+#: ../../library/time.rst:767
+msgid ""
+">>> os.environ['TZ'] = 'EST+05EDT,M4.1.0,M10.5.0'\n"
+">>> time.tzset()\n"
+">>> time.strftime('%X %x %Z')\n"
+"'02:07:36 05/08/03 EDT'\n"
+">>> os.environ['TZ'] = 'AEST-10AEDT-11,M10.5.0,M3.5.0'\n"
+">>> time.tzset()\n"
+">>> time.strftime('%X %x %Z')\n"
+"'16:08:12 05/08/03 AEST'"
+msgstr ""
+">>> os.environ['TZ'] = 'EST+05EDT,M4.1.0,M10.5.0'\n"
+">>> time.tzset()\n"
+">>> time.strftime('%X %x %Z')\n"
+"'02:07:36 05/08/03 EDT'\n"
+">>> os.environ['TZ'] = 'AEST-10AEDT-11,M10.5.0,M3.5.0'\n"
+">>> time.tzset()\n"
+">>> time.strftime('%X %x %Z')\n"
+"'16:08:12 05/08/03 AEST'"
+
#: ../../library/time.rst:776
msgid ""
"On many Unix systems (including \\*BSD, Linux, Solaris, and Darwin), it is "
@@ -1326,6 +1360,18 @@ msgid ""
"``'Australia/Melbourne'``, ``'Egypt'`` or ``'Europe/Amsterdam'``. ::"
msgstr ""
+#: ../../library/time.rst:784
+msgid ""
+">>> os.environ['TZ'] = 'US/Eastern'\n"
+">>> time.tzset()\n"
+">>> time.tzname\n"
+"('EST', 'EDT')\n"
+">>> os.environ['TZ'] = 'Egypt'\n"
+">>> time.tzset()\n"
+">>> time.tzname\n"
+"('EET', 'EEST')"
+msgstr ""
+
#: ../../library/time.rst:797
msgid "Clock ID Constants"
msgstr ""
diff --git a/library/tomllib.po b/library/tomllib.po
index d53d734a75..a30eb9f52e 100644
--- a/library/tomllib.po
+++ b/library/tomllib.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-05-09 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2022-11-18 01:56+0800\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -111,10 +111,42 @@ msgstr "範例"
msgid "Parsing a TOML file::"
msgstr "剖析一個 TOML 檔案: ::"
+#: ../../library/tomllib.rst:73
+msgid ""
+"import tomllib\n"
+"\n"
+"with open(\"pyproject.toml\", \"rb\") as f:\n"
+" data = tomllib.load(f)"
+msgstr ""
+"import tomllib\n"
+"\n"
+"with open(\"pyproject.toml\", \"rb\") as f:\n"
+" data = tomllib.load(f)"
+
#: ../../library/tomllib.rst:78
msgid "Parsing a TOML string::"
msgstr "剖析一個 TOML 字串: ::"
+#: ../../library/tomllib.rst:80
+msgid ""
+"import tomllib\n"
+"\n"
+"toml_str = \"\"\"\n"
+"python-version = \"3.11.0\"\n"
+"python-implementation = \"CPython\"\n"
+"\"\"\"\n"
+"\n"
+"data = tomllib.loads(toml_str)"
+msgstr ""
+"import tomllib\n"
+"\n"
+"toml_str = \"\"\"\n"
+"python-version = \"3.11.0\"\n"
+"python-implementation = \"CPython\"\n"
+"\"\"\"\n"
+"\n"
+"data = tomllib.loads(toml_str)"
+
#: ../../library/tomllib.rst:91
msgid "Conversion Table"
msgstr "轉換表"
diff --git a/library/traceback.po b/library/traceback.po
index 999a0dc8e2..850a2f458f 100644
--- a/library/traceback.po
+++ b/library/traceback.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-26 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -560,26 +560,187 @@ msgid ""
"`code` module. ::"
msgstr ""
+#: ../../library/traceback.rst:499
+msgid ""
+"import sys, traceback\n"
+"\n"
+"def run_user_code(envdir):\n"
+" source = input(\">>> \")\n"
+" try:\n"
+" exec(source, envdir)\n"
+" except Exception:\n"
+" print(\"Exception in user code:\")\n"
+" print(\"-\"*60)\n"
+" traceback.print_exc(file=sys.stdout)\n"
+" print(\"-\"*60)\n"
+"\n"
+"envdir = {}\n"
+"while True:\n"
+" run_user_code(envdir)"
+msgstr ""
+
#: ../../library/traceback.rst:516
msgid ""
"The following example demonstrates the different ways to print and format "
"the exception and traceback:"
msgstr ""
+#: ../../library/traceback.rst:519
+msgid ""
+"import sys, traceback\n"
+"\n"
+"def lumberjack():\n"
+" bright_side_of_life()\n"
+"\n"
+"def bright_side_of_life():\n"
+" return tuple()[0]\n"
+"\n"
+"try:\n"
+" lumberjack()\n"
+"except IndexError:\n"
+" exc = sys.exception()\n"
+" print(\"*** print_tb:\")\n"
+" traceback.print_tb(exc.__traceback__, limit=1, file=sys.stdout)\n"
+" print(\"*** print_exception:\")\n"
+" traceback.print_exception(exc, limit=2, file=sys.stdout)\n"
+" print(\"*** print_exc:\")\n"
+" traceback.print_exc(limit=2, file=sys.stdout)\n"
+" print(\"*** format_exc, first and last line:\")\n"
+" formatted_lines = traceback.format_exc().splitlines()\n"
+" print(formatted_lines[0])\n"
+" print(formatted_lines[-1])\n"
+" print(\"*** format_exception:\")\n"
+" print(repr(traceback.format_exception(exc)))\n"
+" print(\"*** extract_tb:\")\n"
+" print(repr(traceback.extract_tb(exc.__traceback__)))\n"
+" print(\"*** format_tb:\")\n"
+" print(repr(traceback.format_tb(exc.__traceback__)))\n"
+" print(\"*** tb_lineno:\", exc.__traceback__.tb_lineno)"
+msgstr ""
+
#: ../../library/traceback.rst:551
msgid "The output for the example would look similar to this:"
msgstr ""
+#: ../../library/traceback.rst:553
+msgid ""
+"*** print_tb:\n"
+" File \"\", line 10, in \n"
+" lumberjack()\n"
+"*** print_exception:\n"
+"Traceback (most recent call last):\n"
+" File \"\", line 10, in \n"
+" lumberjack()\n"
+" File \"\", line 4, in lumberjack\n"
+" bright_side_of_life()\n"
+"IndexError: tuple index out of range\n"
+"*** print_exc:\n"
+"Traceback (most recent call last):\n"
+" File \"\", line 10, in \n"
+" lumberjack()\n"
+" File \"\", line 4, in lumberjack\n"
+" bright_side_of_life()\n"
+"IndexError: tuple index out of range\n"
+"*** format_exc, first and last line:\n"
+"Traceback (most recent call last):\n"
+"IndexError: tuple index out of range\n"
+"*** format_exception:\n"
+"['Traceback (most recent call last):\\n',\n"
+" ' File \"\", line 10, in \\n "
+"lumberjack()\\n',\n"
+" ' File \"\", line 4, in lumberjack\\n "
+"bright_side_of_life()\\n',\n"
+" ' File \"\", line 7, in bright_side_of_life\\n "
+"return tuple()[0]\\n ~~~~~~~^^^\\n',\n"
+" 'IndexError: tuple index out of range\\n']\n"
+"*** extract_tb:\n"
+"[, line 10 in >,\n"
+" , line 4 in lumberjack>,\n"
+" , line 7 in bright_side_of_life>]\n"
+"*** format_tb:\n"
+"[' File \"\", line 10, in \\n "
+"lumberjack()\\n',\n"
+" ' File \"\", line 4, in lumberjack\\n "
+"bright_side_of_life()\\n',\n"
+" ' File \"\", line 7, in bright_side_of_life\\n "
+"return tuple()[0]\\n ~~~~~~~^^^\\n']\n"
+"*** tb_lineno: 10"
+msgstr ""
+
#: ../../library/traceback.rst:593
msgid ""
"The following example shows the different ways to print and format the "
"stack::"
msgstr ""
+#: ../../library/traceback.rst:595
+msgid ""
+">>> import traceback\n"
+">>> def another_function():\n"
+"... lumberstack()\n"
+"...\n"
+">>> def lumberstack():\n"
+"... traceback.print_stack()\n"
+"... print(repr(traceback.extract_stack()))\n"
+"... print(repr(traceback.format_stack()))\n"
+"...\n"
+">>> another_function()\n"
+" File \"\", line 10, in \n"
+" another_function()\n"
+" File \"\", line 3, in another_function\n"
+" lumberstack()\n"
+" File \"\", line 6, in lumberstack\n"
+" traceback.print_stack()\n"
+"[('', 10, '', 'another_function()'),\n"
+" ('', 3, 'another_function', 'lumberstack()'),\n"
+" ('', 7, 'lumberstack', 'print(repr(traceback.extract_stack()))')]\n"
+"[' File \"\", line 10, in \\n another_function()\\n',\n"
+" ' File \"\", line 3, in another_function\\n "
+"lumberstack()\\n',\n"
+" ' File \"\", line 8, in lumberstack\\n print(repr(traceback."
+"format_stack()))\\n']"
+msgstr ""
+">>> import traceback\n"
+">>> def another_function():\n"
+"... lumberstack()\n"
+"...\n"
+">>> def lumberstack():\n"
+"... traceback.print_stack()\n"
+"... print(repr(traceback.extract_stack()))\n"
+"... print(repr(traceback.format_stack()))\n"
+"...\n"
+">>> another_function()\n"
+" File \"\", line 10, in \n"
+" another_function()\n"
+" File \"\", line 3, in another_function\n"
+" lumberstack()\n"
+" File \"\", line 6, in lumberstack\n"
+" traceback.print_stack()\n"
+"[('', 10, '', 'another_function()'),\n"
+" ('', 3, 'another_function', 'lumberstack()'),\n"
+" ('', 7, 'lumberstack', 'print(repr(traceback.extract_stack()))')]\n"
+"[' File \"\", line 10, in \\n another_function()\\n',\n"
+" ' File \"\", line 3, in another_function\\n "
+"lumberstack()\\n',\n"
+" ' File \"\", line 8, in lumberstack\\n print(repr(traceback."
+"format_stack()))\\n']"
+
#: ../../library/traceback.rst:619
msgid "This last example demonstrates the final few formatting functions:"
msgstr ""
+#: ../../library/traceback.rst:621
+msgid ""
+">>> import traceback\n"
+">>> traceback.format_list([('spam.py', 3, '', 'spam.eggs()'),\n"
+"... ('eggs.py', 42, 'eggs', 'return \"bacon\"')])\n"
+"[' File \"spam.py\", line 3, in \\n spam.eggs()\\n',\n"
+" ' File \"eggs.py\", line 42, in eggs\\n return \"bacon\"\\n']\n"
+">>> an_error = IndexError('tuple index out of range')\n"
+">>> traceback.format_exception_only(type(an_error), an_error)\n"
+"['IndexError: tuple index out of range\\n']"
+msgstr ""
+
#: ../../library/traceback.rst:17
msgid "object"
msgstr "object(物件)"
diff --git a/library/tracemalloc.po b/library/tracemalloc.po
index 64e9bd0481..7ca51be507 100644
--- a/library/tracemalloc.po
+++ b/library/tracemalloc.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-05-09 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -75,10 +75,57 @@ msgstr ""
msgid "Display the 10 files allocating the most memory::"
msgstr ""
+#: ../../library/tracemalloc.rst:41
+msgid ""
+"import tracemalloc\n"
+"\n"
+"tracemalloc.start()\n"
+"\n"
+"# ... run your application ...\n"
+"\n"
+"snapshot = tracemalloc.take_snapshot()\n"
+"top_stats = snapshot.statistics('lineno')\n"
+"\n"
+"print(\"[ Top 10 ]\")\n"
+"for stat in top_stats[:10]:\n"
+" print(stat)"
+msgstr ""
+"import tracemalloc\n"
+"\n"
+"tracemalloc.start()\n"
+"\n"
+"# ... run your application ...\n"
+"\n"
+"snapshot = tracemalloc.take_snapshot()\n"
+"top_stats = snapshot.statistics('lineno')\n"
+"\n"
+"print(\"[ Top 10 ]\")\n"
+"for stat in top_stats[:10]:\n"
+" print(stat)"
+
#: ../../library/tracemalloc.rst:55 ../../library/tracemalloc.rst:225
msgid "Example of output of the Python test suite::"
msgstr ""
+#: ../../library/tracemalloc.rst:57
+msgid ""
+"[ Top 10 ]\n"
+":716: size=4855 KiB, count=39328, average=126 "
+"B\n"
+":284: size=521 KiB, count=3199, average=167 B\n"
+"/usr/lib/python3.4/collections/__init__.py:368: size=244 KiB, count=2315, "
+"average=108 B\n"
+"/usr/lib/python3.4/unittest/case.py:381: size=185 KiB, count=779, "
+"average=243 B\n"
+"/usr/lib/python3.4/unittest/case.py:402: size=154 KiB, count=378, "
+"average=416 B\n"
+"/usr/lib/python3.4/abc.py:133: size=88.7 KiB, count=347, average=262 B\n"
+":1446: size=70.4 KiB, count=911, average=79 B\n"
+":1454: size=52.0 KiB, count=25, average=2131 B\n"
+":5: size=49.7 KiB, count=148, average=344 B\n"
+"/usr/lib/python3.4/sysconfig.py:411: size=48.0 KiB, count=1, average=48.0 KiB"
+msgstr ""
+
#: ../../library/tracemalloc.rst:69
msgid ""
"We can see that Python loaded ``4855 KiB`` data (bytecode and constants) "
@@ -98,11 +145,74 @@ msgstr ""
msgid "Take two snapshots and display the differences::"
msgstr ""
+#: ../../library/tracemalloc.rst:81
+msgid ""
+"import tracemalloc\n"
+"tracemalloc.start()\n"
+"# ... start your application ...\n"
+"\n"
+"snapshot1 = tracemalloc.take_snapshot()\n"
+"# ... call the function leaking memory ...\n"
+"snapshot2 = tracemalloc.take_snapshot()\n"
+"\n"
+"top_stats = snapshot2.compare_to(snapshot1, 'lineno')\n"
+"\n"
+"print(\"[ Top 10 differences ]\")\n"
+"for stat in top_stats[:10]:\n"
+" print(stat)"
+msgstr ""
+
#: ../../library/tracemalloc.rst:95
msgid ""
"Example of output before/after running some tests of the Python test suite::"
msgstr ""
+#: ../../library/tracemalloc.rst:97
+msgid ""
+"[ Top 10 differences ]\n"
+":716: size=8173 KiB (+4428 KiB), count=71332 "
+"(+39369), average=117 B\n"
+"/usr/lib/python3.4/linecache.py:127: size=940 KiB (+940 KiB), count=8106 "
+"(+8106), average=119 B\n"
+"/usr/lib/python3.4/unittest/case.py:571: size=298 KiB (+298 KiB), count=589 "
+"(+589), average=519 B\n"
+":284: size=1005 KiB (+166 KiB), count=7423 "
+"(+1526), average=139 B\n"
+"/usr/lib/python3.4/mimetypes.py:217: size=112 KiB (+112 KiB), count=1334 "
+"(+1334), average=86 B\n"
+"/usr/lib/python3.4/http/server.py:848: size=96.0 KiB (+96.0 KiB), count=1 "
+"(+1), average=96.0 KiB\n"
+"/usr/lib/python3.4/inspect.py:1465: size=83.5 KiB (+83.5 KiB), count=109 "
+"(+109), average=784 B\n"
+"/usr/lib/python3.4/unittest/mock.py:491: size=77.7 KiB (+77.7 KiB), "
+"count=143 (+143), average=557 B\n"
+"/usr/lib/python3.4/urllib/parse.py:476: size=71.8 KiB (+71.8 KiB), count=969 "
+"(+969), average=76 B\n"
+"/usr/lib/python3.4/contextlib.py:38: size=67.2 KiB (+67.2 KiB), count=126 "
+"(+126), average=546 B"
+msgstr ""
+"[ Top 10 differences ]\n"
+":716: size=8173 KiB (+4428 KiB), count=71332 "
+"(+39369), average=117 B\n"
+"/usr/lib/python3.4/linecache.py:127: size=940 KiB (+940 KiB), count=8106 "
+"(+8106), average=119 B\n"
+"/usr/lib/python3.4/unittest/case.py:571: size=298 KiB (+298 KiB), count=589 "
+"(+589), average=519 B\n"
+":284: size=1005 KiB (+166 KiB), count=7423 "
+"(+1526), average=139 B\n"
+"/usr/lib/python3.4/mimetypes.py:217: size=112 KiB (+112 KiB), count=1334 "
+"(+1334), average=86 B\n"
+"/usr/lib/python3.4/http/server.py:848: size=96.0 KiB (+96.0 KiB), count=1 "
+"(+1), average=96.0 KiB\n"
+"/usr/lib/python3.4/inspect.py:1465: size=83.5 KiB (+83.5 KiB), count=109 "
+"(+109), average=784 B\n"
+"/usr/lib/python3.4/unittest/mock.py:491: size=77.7 KiB (+77.7 KiB), "
+"count=143 (+143), average=557 B\n"
+"/usr/lib/python3.4/urllib/parse.py:476: size=71.8 KiB (+71.8 KiB), count=969 "
+"(+969), average=76 B\n"
+"/usr/lib/python3.4/contextlib.py:38: size=67.2 KiB (+67.2 KiB), count=126 "
+"(+126), average=546 B"
+
#: ../../library/tracemalloc.rst:109
msgid ""
"We can see that Python has loaded ``8173 KiB`` of module data (bytecode and "
@@ -127,11 +237,102 @@ msgstr ""
msgid "Code to display the traceback of the biggest memory block::"
msgstr ""
+#: ../../library/tracemalloc.rst:125
+msgid ""
+"import tracemalloc\n"
+"\n"
+"# Store 25 frames\n"
+"tracemalloc.start(25)\n"
+"\n"
+"# ... run your application ...\n"
+"\n"
+"snapshot = tracemalloc.take_snapshot()\n"
+"top_stats = snapshot.statistics('traceback')\n"
+"\n"
+"# pick the biggest memory block\n"
+"stat = top_stats[0]\n"
+"print(\"%s memory blocks: %.1f KiB\" % (stat.count, stat.size / 1024))\n"
+"for line in stat.traceback.format():\n"
+" print(line)"
+msgstr ""
+
#: ../../library/tracemalloc.rst:141
msgid ""
"Example of output of the Python test suite (traceback limited to 25 frames)::"
msgstr ""
+#: ../../library/tracemalloc.rst:143
+msgid ""
+"903 memory blocks: 870.1 KiB\n"
+" File \"\", line 716\n"
+" File \"\", line 1036\n"
+" File \"\", line 934\n"
+" File \"\", line 1068\n"
+" File \"\", line 619\n"
+" File \"\", line 1581\n"
+" File \"\", line 1614\n"
+" File \"/usr/lib/python3.4/doctest.py\", line 101\n"
+" import pdb\n"
+" File \"\", line 284\n"
+" File \"\", line 938\n"
+" File \"\", line 1068\n"
+" File \"\", line 619\n"
+" File \"\", line 1581\n"
+" File \"\", line 1614\n"
+" File \"/usr/lib/python3.4/test/support/__init__.py\", line 1728\n"
+" import doctest\n"
+" File \"/usr/lib/python3.4/test/test_pickletools.py\", line 21\n"
+" support.run_doctest(pickletools)\n"
+" File \"/usr/lib/python3.4/test/regrtest.py\", line 1276\n"
+" test_runner()\n"
+" File \"/usr/lib/python3.4/test/regrtest.py\", line 976\n"
+" display_failure=not verbose)\n"
+" File \"/usr/lib/python3.4/test/regrtest.py\", line 761\n"
+" match_tests=ns.match_tests)\n"
+" File \"/usr/lib/python3.4/test/regrtest.py\", line 1563\n"
+" main()\n"
+" File \"/usr/lib/python3.4/test/__main__.py\", line 3\n"
+" regrtest.main_in_temp_cwd()\n"
+" File \"/usr/lib/python3.4/runpy.py\", line 73\n"
+" exec(code, run_globals)\n"
+" File \"/usr/lib/python3.4/runpy.py\", line 160\n"
+" \"__main__\", fname, loader, pkg_name)"
+msgstr ""
+"903 memory blocks: 870.1 KiB\n"
+" File \"\", line 716\n"
+" File \"\", line 1036\n"
+" File \"\", line 934\n"
+" File \"\", line 1068\n"
+" File \"\", line 619\n"
+" File \"\", line 1581\n"
+" File \"\", line 1614\n"
+" File \"/usr/lib/python3.4/doctest.py\", line 101\n"
+" import pdb\n"
+" File \"\", line 284\n"
+" File \"\", line 938\n"
+" File \"\", line 1068\n"
+" File \"\", line 619\n"
+" File \"\", line 1581\n"
+" File \"\", line 1614\n"
+" File \"/usr/lib/python3.4/test/support/__init__.py\", line 1728\n"
+" import doctest\n"
+" File \"/usr/lib/python3.4/test/test_pickletools.py\", line 21\n"
+" support.run_doctest(pickletools)\n"
+" File \"/usr/lib/python3.4/test/regrtest.py\", line 1276\n"
+" test_runner()\n"
+" File \"/usr/lib/python3.4/test/regrtest.py\", line 976\n"
+" display_failure=not verbose)\n"
+" File \"/usr/lib/python3.4/test/regrtest.py\", line 761\n"
+" match_tests=ns.match_tests)\n"
+" File \"/usr/lib/python3.4/test/regrtest.py\", line 1563\n"
+" main()\n"
+" File \"/usr/lib/python3.4/test/__main__.py\", line 3\n"
+" regrtest.main_in_temp_cwd()\n"
+" File \"/usr/lib/python3.4/runpy.py\", line 73\n"
+" exec(code, run_globals)\n"
+" File \"/usr/lib/python3.4/runpy.py\", line 160\n"
+" \"__main__\", fname, loader, pkg_name)"
+
#: ../../library/tracemalloc.rst:178
msgid ""
"We can see that the most memory was allocated in the :mod:`importlib` module "
@@ -151,6 +352,91 @@ msgid ""
"output, ignoring ```` and ```` files::"
msgstr ""
+#: ../../library/tracemalloc.rst:191
+msgid ""
+"import linecache\n"
+"import os\n"
+"import tracemalloc\n"
+"\n"
+"def display_top(snapshot, key_type='lineno', limit=10):\n"
+" snapshot = snapshot.filter_traces((\n"
+" tracemalloc.Filter(False, \"\"),\n"
+" tracemalloc.Filter(False, \"\"),\n"
+" ))\n"
+" top_stats = snapshot.statistics(key_type)\n"
+"\n"
+" print(\"Top %s lines\" % limit)\n"
+" for index, stat in enumerate(top_stats[:limit], 1):\n"
+" frame = stat.traceback[0]\n"
+" print(\"#%s: %s:%s: %.1f KiB\"\n"
+" % (index, frame.filename, frame.lineno, stat.size / 1024))\n"
+" line = linecache.getline(frame.filename, frame.lineno).strip()\n"
+" if line:\n"
+" print(' %s' % line)\n"
+"\n"
+" other = top_stats[limit:]\n"
+" if other:\n"
+" size = sum(stat.size for stat in other)\n"
+" print(\"%s other: %.1f KiB\" % (len(other), size / 1024))\n"
+" total = sum(stat.size for stat in top_stats)\n"
+" print(\"Total allocated size: %.1f KiB\" % (total / 1024))\n"
+"\n"
+"tracemalloc.start()\n"
+"\n"
+"# ... run your application ...\n"
+"\n"
+"snapshot = tracemalloc.take_snapshot()\n"
+"display_top(snapshot)"
+msgstr ""
+
+#: ../../library/tracemalloc.rst:227
+msgid ""
+"Top 10 lines\n"
+"#1: Lib/base64.py:414: 419.8 KiB\n"
+" _b85chars2 = [(a + b) for a in _b85chars for b in _b85chars]\n"
+"#2: Lib/base64.py:306: 419.8 KiB\n"
+" _a85chars2 = [(a + b) for a in _a85chars for b in _a85chars]\n"
+"#3: collections/__init__.py:368: 293.6 KiB\n"
+" exec(class_definition, namespace)\n"
+"#4: Lib/abc.py:133: 115.2 KiB\n"
+" cls = super().__new__(mcls, name, bases, namespace)\n"
+"#5: unittest/case.py:574: 103.1 KiB\n"
+" testMethod()\n"
+"#6: Lib/linecache.py:127: 95.4 KiB\n"
+" lines = fp.readlines()\n"
+"#7: urllib/parse.py:476: 71.8 KiB\n"
+" for a in _hexdig for b in _hexdig}\n"
+"#8: :5: 62.0 KiB\n"
+"#9: Lib/_weakrefset.py:37: 60.0 KiB\n"
+" self.data = set()\n"
+"#10: Lib/base64.py:142: 59.8 KiB\n"
+" _b32tab2 = [a + b for a in _b32tab for b in _b32tab]\n"
+"6220 other: 3602.8 KiB\n"
+"Total allocated size: 5303.1 KiB"
+msgstr ""
+"Top 10 lines\n"
+"#1: Lib/base64.py:414: 419.8 KiB\n"
+" _b85chars2 = [(a + b) for a in _b85chars for b in _b85chars]\n"
+"#2: Lib/base64.py:306: 419.8 KiB\n"
+" _a85chars2 = [(a + b) for a in _a85chars for b in _a85chars]\n"
+"#3: collections/__init__.py:368: 293.6 KiB\n"
+" exec(class_definition, namespace)\n"
+"#4: Lib/abc.py:133: 115.2 KiB\n"
+" cls = super().__new__(mcls, name, bases, namespace)\n"
+"#5: unittest/case.py:574: 103.1 KiB\n"
+" testMethod()\n"
+"#6: Lib/linecache.py:127: 95.4 KiB\n"
+" lines = fp.readlines()\n"
+"#7: urllib/parse.py:476: 71.8 KiB\n"
+" for a in _hexdig for b in _hexdig}\n"
+"#8: :5: 62.0 KiB\n"
+"#9: Lib/_weakrefset.py:37: 60.0 KiB\n"
+" self.data = set()\n"
+"#10: Lib/base64.py:142: 59.8 KiB\n"
+" _b32tab2 = [a + b for a in _b32tab for b in _b32tab]\n"
+"6220 other: 3602.8 KiB\n"
+"Total allocated size: 5303.1 KiB"
+
#: ../../library/tracemalloc.rst:253
msgid "Record the current and peak size of all traced memory blocks"
msgstr ""
@@ -164,10 +450,40 @@ msgid ""
"memory usage during the computations::"
msgstr ""
+#: ../../library/tracemalloc.rst:261
+msgid ""
+"import tracemalloc\n"
+"\n"
+"tracemalloc.start()\n"
+"\n"
+"# Example code: compute a sum with a large temporary list\n"
+"large_sum = sum(list(range(100000)))\n"
+"\n"
+"first_size, first_peak = tracemalloc.get_traced_memory()\n"
+"\n"
+"tracemalloc.reset_peak()\n"
+"\n"
+"# Example code: compute a sum with a small temporary list\n"
+"small_sum = sum(list(range(1000)))\n"
+"\n"
+"second_size, second_peak = tracemalloc.get_traced_memory()\n"
+"\n"
+"print(f\"{first_size=}, {first_peak=}\")\n"
+"print(f\"{second_size=}, {second_peak=}\")"
+msgstr ""
+
#: ../../library/tracemalloc.rst:280 ../../library/tracemalloc.rst:759
msgid "Output::"
msgstr "輸出: ::"
+#: ../../library/tracemalloc.rst:282
+msgid ""
+"first_size=664, first_peak=3592984\n"
+"second_size=804, second_peak=29704"
+msgstr ""
+"first_size=664, first_peak=3592984\n"
+"second_size=804, second_peak=29704"
+
#: ../../library/tracemalloc.rst:285
msgid ""
"Using :func:`reset_peak` ensured we could accurately record the peak during "
@@ -788,3 +1104,27 @@ msgstr ""
#: ../../library/tracemalloc.rst:753
msgid "Example::"
msgstr "範例: ::"
+
+#: ../../library/tracemalloc.rst:755
+msgid ""
+"print(\"Traceback (most recent call first):\")\n"
+"for line in traceback:\n"
+" print(line)"
+msgstr ""
+"print(\"Traceback (most recent call first):\")\n"
+"for line in traceback:\n"
+" print(line)"
+
+#: ../../library/tracemalloc.rst:761
+msgid ""
+"Traceback (most recent call first):\n"
+" File \"test.py\", line 9\n"
+" obj = Object()\n"
+" File \"test.py\", line 12\n"
+" tb = tracemalloc.get_object_traceback(f())"
+msgstr ""
+"Traceback (most recent call first):\n"
+" File \"test.py\", line 9\n"
+" obj = Object()\n"
+" File \"test.py\", line 12\n"
+" tb = tracemalloc.get_object_traceback(f())"
diff --git a/library/urllib.request.po b/library/urllib.request.po
index 2b50a10f5f..0551aa13a6 100644
--- a/library/urllib.request.po
+++ b/library/urllib.request.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-04 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -1462,7 +1462,7 @@ msgstr ""
#: ../../library/urllib.request.rst:1193
msgid "Examples"
-msgstr ""
+msgstr "範例"
#: ../../library/urllib.request.rst:1195
msgid ""
@@ -1476,6 +1476,32 @@ msgid ""
"of it. ::"
msgstr ""
+#: ../../library/urllib.request.rst:1201
+msgid ""
+">>> import urllib.request\n"
+">>> with urllib.request.urlopen('http://www.python.org/') as f:\n"
+"... print(f.read(300))\n"
+"...\n"
+"b'\\n\\n\\n\\n\\n\\n\n"
+"\\n\n"
+"Codestin Search App Some text
and more
"
+"html>'\n"
+"doc = pulldom.parseString(xml)\n"
+"for event, node in doc:\n"
+" if event == pulldom.START_ELEMENT and node.tagName == 'p':\n"
+" # Following statement only prints ''\n"
+" print(node.toxml())\n"
+" doc.expandNode(node)\n"
+" # Following statement prints node with all its children 'Some "
+"text
and more
'\n"
+" print(node.toxml())"
+msgstr ""
diff --git a/library/xml.sax.utils.po b/library/xml.sax.utils.po
index ce50b55f26..87dd0585ea 100644
--- a/library/xml.sax.utils.po
+++ b/library/xml.sax.utils.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-05-09 00:03+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -77,6 +77,14 @@ msgid ""
"directly as an attribute value::"
msgstr ""
+#: ../../library/xml.sax.utils.rst:55
+msgid ""
+">>> print(\"\" % quoteattr(\"ab ' cd \\\" ef\"))\n"
+""
+msgstr ""
+">>> print(\"\" % quoteattr(\"ab ' cd \\\" ef\"))\n"
+""
+
#: ../../library/xml.sax.utils.rst:58
msgid ""
"This function is useful when generating attribute values for HTML or any "
diff --git a/library/zipapp.po b/library/zipapp.po
index b0c327d25b..bdb7de3d4a 100644
--- a/library/zipapp.po
+++ b/library/zipapp.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-30 18:24+0000\n"
+"POT-Creation-Date: 2024-09-01 22:24+0800\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-"
@@ -45,6 +45,16 @@ msgid ""
"module ``myapp`` in the archive."
msgstr ""
+#: ../../library/zipapp.rst:30
+msgid ""
+"$ python -m zipapp myapp -m \"myapp:main\"\n"
+"$ python myapp.pyz\n"
+"