Skip to content

Commit f3042a1

Browse files
pydoc-zh-tw[bot]github-actions[bot]mattwang44
authored
Sync with CPython 3.13 (#1008)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: W. H. Wang <mattwang44@gmail.com>
1 parent e7b5675 commit f3042a1

39 files changed

+3548
-2711
lines changed

c-api/object.po

+91-90
Large diffs are not rendered by default.

faq/library.po

+1-1
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@ msgstr "``uniform(a, b)`` 會選擇 [a, b) 範圍內的浮點數。"
13011301
#: ../../faq/library.rst:805
13021302
msgid ""
13031303
"``normalvariate(mean, sdev)`` samples the normal (Gaussian) distribution."
1304-
msgstr "``normalvariate(mean, sdev)`` 對常態(高斯)分佈進行採樣 (sample)。"
1304+
msgstr "``normalvariate(mean, sdev)`` 對常態(高斯)分佈進行取樣 (sample)。"
13051305

13061306
#: ../../faq/library.rst:807
13071307
msgid "Some higher-level functions operate on sequences directly, such as:"

faq/programming.po

+8-3
Original file line numberDiff line numberDiff line change
@@ -4205,7 +4205,7 @@ msgid ""
42054205
msgstr ""
42064206
"模組可以透過查看預定義的全域變數 ``__name__`` 來找出自己的模組名稱。如果它的"
42074207
"值為``'__main__'``,則該程式作為腳本運行。許多通常透過引入使用的模組還提供命"
4208-
"令行界面或自檢,只有在檢查 ``__name__`` 後才執行此程式碼: ::"
4208+
"令行介面或自檢,只有在檢查 ``__name__`` 後才執行此程式碼: ::"
42094209

42104210
#: ../../faq/programming.rst:2134
42114211
msgid ""
@@ -4216,11 +4216,16 @@ msgid ""
42164216
"if __name__ == '__main__':\n"
42174217
" main()"
42184218
msgstr ""
4219+
"def main():\n"
4220+
" print('Running test...')\n"
4221+
" ...\n"
4222+
"\n"
4223+
"if __name__ == '__main__':\n"
4224+
" main()"
42194225

42204226
#: ../../faq/programming.rst:2143
4221-
#, fuzzy
42224227
msgid "How can I have modules that mutually import each other?"
4223-
msgstr "我怎樣才能擁有相互引入的模組?"
4228+
msgstr "要怎樣才能擁有相互引入的模組?"
42244229

42254230
#: ../../faq/programming.rst:2145
42264231
msgid "Suppose you have the following modules:"

howto/argparse-optparse.po

+85-37
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ msgid ""
66
msgstr ""
77
"Project-Id-Version: Python 3.13\n"
88
"Report-Msgid-Bugs-To: \n"
9-
"POT-Creation-Date: 2024-10-09 00:13+0000\n"
9+
"POT-Creation-Date: 2024-12-29 11:18+0000\n"
1010
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1111
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1212
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -16,103 +16,151 @@ msgstr ""
1616
"Content-Type: text/plain; charset=UTF-8\n"
1717
"Content-Transfer-Encoding: 8bit\n"
1818

19-
#: ../../howto/argparse-optparse.rst:7
20-
msgid "Upgrading optparse code"
21-
msgstr "升級 optparse 程式碼"
19+
#: ../../howto/argparse-optparse.rst:8
20+
msgid "Migrating ``optparse`` code to ``argparse``"
21+
msgstr "將 ``optparse`` 程式碼遷移到 ``argparse``"
2222

23-
#: ../../howto/argparse-optparse.rst:9
23+
#: ../../howto/argparse-optparse.rst:10
2424
msgid ""
25-
"Originally, the :mod:`argparse` module had attempted to maintain "
26-
"compatibility with :mod:`optparse`. However, :mod:`optparse` was difficult "
27-
"to extend transparently, particularly with the changes required to support "
28-
"``nargs=`` specifiers and better usage messages. When most everything in :"
29-
"mod:`optparse` had either been copy-pasted over or monkey-patched, it no "
30-
"longer seemed practical to try to maintain the backwards compatibility."
25+
"The :mod:`argparse` module offers several higher level features not natively "
26+
"provided by the :mod:`optparse` module, including:"
3127
msgstr ""
28+
":mod:`argparse` 模組提供了一些高階功能,這些功能在 :mod:`optparse` 模組中並未"
29+
"原生提供,包括:"
3230

33-
#: ../../howto/argparse-optparse.rst:16
34-
msgid ""
35-
"The :mod:`argparse` module improves on the :mod:`optparse` module in a "
36-
"number of ways including:"
37-
msgstr ""
38-
39-
#: ../../howto/argparse-optparse.rst:19
31+
#: ../../howto/argparse-optparse.rst:13
4032
msgid "Handling positional arguments."
41-
msgstr ""
33+
msgstr "處理位置引數。"
4234

43-
#: ../../howto/argparse-optparse.rst:20
35+
#: ../../howto/argparse-optparse.rst:14
4436
msgid "Supporting subcommands."
45-
msgstr ""
37+
msgstr "支援子命令。"
4638

47-
#: ../../howto/argparse-optparse.rst:21
39+
#: ../../howto/argparse-optparse.rst:15
4840
msgid "Allowing alternative option prefixes like ``+`` and ``/``."
49-
msgstr ""
41+
msgstr "允許替代選項前綴,如 ``+`` 和 ``/``。"
5042

51-
#: ../../howto/argparse-optparse.rst:22
43+
#: ../../howto/argparse-optparse.rst:16
5244
msgid "Handling zero-or-more and one-or-more style arguments."
5345
msgstr ""
46+
"處理零或多個 (zero-or-more) 和一個或多個 (and one-or-more) 樣式的引數。"
5447

55-
#: ../../howto/argparse-optparse.rst:23
48+
#: ../../howto/argparse-optparse.rst:17
5649
msgid "Producing more informative usage messages."
57-
msgstr ""
50+
msgstr "產生更多資訊的使用訊息。"
5851

59-
#: ../../howto/argparse-optparse.rst:24
52+
#: ../../howto/argparse-optparse.rst:18
6053
msgid "Providing a much simpler interface for custom ``type`` and ``action``."
54+
msgstr "為自訂 ``type`` 和 ``action`` 提供了一個更簡單的介面。"
55+
56+
#: ../../howto/argparse-optparse.rst:20
57+
msgid ""
58+
"Originally, the :mod:`argparse` module attempted to maintain compatibility "
59+
"with :mod:`optparse`. However, the fundamental design differences between "
60+
"supporting declarative command line option processing (while leaving "
61+
"positional argument processing to application code), and supporting both "
62+
"named options and positional arguments in the declarative interface mean "
63+
"that the API has diverged from that of ``optparse`` over time."
64+
msgstr ""
65+
"最初 :mod:`argparse` 模組試圖保持與 :mod:`optparse` 的相容性,但在基礎設計上"
66+
"的存在差異 -- 支援宣告式 (declarative) 命令列選項處理 (同時將位置引數處理留給"
67+
"應用程式的程式碼) 和在宣告式介面中支援命名選項 (named options) 和位置引數 -- "
68+
"代表 API 隨著時間的推移已經與 ``optparse`` API 分歧。"
69+
70+
#: ../../howto/argparse-optparse.rst:27
71+
msgid ""
72+
"As described in :ref:`choosing-an-argument-parser`, applications that are "
73+
"currently using :mod:`optparse` and are happy with the way it works can just "
74+
"continue to use ``optparse``."
75+
msgstr ""
76+
"如 :ref:`choosing-an-argument-parser` 中所述,目前使用 :mod:`optparse` 並對其"
77+
"運作方式滿意的應用程式可以繼續使用 ``optparse``。"
78+
79+
#: ../../howto/argparse-optparse.rst:31
80+
msgid ""
81+
"Application developers that are considering migrating should also review the "
82+
"list of intrinsic behavioural differences described in that section before "
83+
"deciding whether or not migration is desirable."
6184
msgstr ""
85+
"在決定是否遷移之前,應用程式開發人員應該先檢閱該段落中描述的內在行為差異清"
86+
"單,來決定是否值得遷移。"
6287

63-
#: ../../howto/argparse-optparse.rst:26
64-
msgid "A partial upgrade path from :mod:`optparse` to :mod:`argparse`:"
88+
#: ../../howto/argparse-optparse.rst:35
89+
msgid ""
90+
"For applications that do choose to migrate from :mod:`optparse` to :mod:"
91+
"`argparse`, the following suggestions should be helpful:"
6592
msgstr ""
93+
"對於選擇從 :mod:`optparse` 遷移到 :mod:`argparse` 的應用程式,以下建議應會有"
94+
"所幫助:"
6695

67-
#: ../../howto/argparse-optparse.rst:28
96+
#: ../../howto/argparse-optparse.rst:38
6897
msgid ""
6998
"Replace all :meth:`optparse.OptionParser.add_option` calls with :meth:"
7099
"`ArgumentParser.add_argument` calls."
71100
msgstr ""
101+
"將所有 :meth:`optparse.OptionParser.add_option` 呼叫替換為 :meth:"
102+
"`ArgumentParser.add_argument` 呼叫。"
72103

73-
#: ../../howto/argparse-optparse.rst:31
104+
#: ../../howto/argparse-optparse.rst:41
74105
msgid ""
75106
"Replace ``(options, args) = parser.parse_args()`` with ``args = parser."
76107
"parse_args()`` and add additional :meth:`ArgumentParser.add_argument` calls "
77108
"for the positional arguments. Keep in mind that what was previously called "
78109
"``options``, now in the :mod:`argparse` context is called ``args``."
79110
msgstr ""
111+
"將 ``(options, args) = parser.parse_args()`` 替換為 ``args = parser."
112+
"parse_args()``,並為位置引數新增額外的 :meth:`ArgumentParser.add_argument` 呼"
113+
"叫。請記住,以前稱為 ``options`` 的東西,在 :mod:`argparse` 情境中現在稱為 "
114+
"``args``。"
80115

81-
#: ../../howto/argparse-optparse.rst:36
116+
#: ../../howto/argparse-optparse.rst:46
82117
msgid ""
83118
"Replace :meth:`optparse.OptionParser.disable_interspersed_args` by using :"
84119
"meth:`~ArgumentParser.parse_intermixed_args` instead of :meth:"
85120
"`~ArgumentParser.parse_args`."
86121
msgstr ""
122+
"使用 :meth:`~ArgumentParser.parse_intermixed_args` 來替換掉 :meth:`optparse."
123+
"OptionParser.disable_interspersed_args`,而不是使用 :meth:`~ArgumentParser."
124+
"parse_args`。"
87125

88-
#: ../../howto/argparse-optparse.rst:40
126+
#: ../../howto/argparse-optparse.rst:50
89127
msgid ""
90128
"Replace callback actions and the ``callback_*`` keyword arguments with "
91129
"``type`` or ``action`` arguments."
92130
msgstr ""
131+
"將回呼動作和 ``callback_*`` 關鍵字引數替換為 ``type`` 或 ``action`` 引數。"
93132

94-
#: ../../howto/argparse-optparse.rst:43
133+
#: ../../howto/argparse-optparse.rst:53
95134
msgid ""
96135
"Replace string names for ``type`` keyword arguments with the corresponding "
97136
"type objects (e.g. int, float, complex, etc)."
98137
msgstr ""
138+
"將 ``type`` 關鍵字引數的字串名稱替換為相應的類型物件 (例如 int、float、"
139+
"complex 等)。"
99140

100-
#: ../../howto/argparse-optparse.rst:46
141+
#: ../../howto/argparse-optparse.rst:56
101142
msgid ""
102143
"Replace :class:`optparse.Values` with :class:`Namespace` and :exc:`optparse."
103144
"OptionError` and :exc:`optparse.OptionValueError` with :exc:`ArgumentError`."
104145
msgstr ""
146+
"將 :class:`optparse.Values` 替換為 :class:`Namespace`,並將 :exc:`optparse."
147+
"OptionError` 和 :exc:`optparse.OptionValueError` 替換為 :exc:"
148+
"`ArgumentError`。"
105149

106-
#: ../../howto/argparse-optparse.rst:50
150+
#: ../../howto/argparse-optparse.rst:60
107151
msgid ""
108152
"Replace strings with implicit arguments such as ``%default`` or ``%prog`` "
109153
"with the standard Python syntax to use dictionaries to format strings, that "
110154
"is, ``%(default)s`` and ``%(prog)s``."
111155
msgstr ""
156+
"將隱式引數的字串,如 ``%default`` 或 ``%prog`` 替換為使用字典來格式化字串的標"
157+
"準 Python 語法,即 ``%(default)s`` 和 ``%(prog)s``。"
112158

113-
#: ../../howto/argparse-optparse.rst:54
159+
#: ../../howto/argparse-optparse.rst:64
114160
msgid ""
115161
"Replace the OptionParser constructor ``version`` argument with a call to "
116162
"``parser.add_argument('--version', action='version', version='<the "
117163
"version>')``."
118164
msgstr ""
165+
"將 OptionParser 建構函式的 ``version`` 引數替換為呼叫 ``parser."
166+
"add_argument('--version', action='version', version='<the version>')``。"

0 commit comments

Comments
 (0)