Skip to content

Commit 545aaae

Browse files
committed
Translate c-api/number.po
Complete 41 untranslated entries covering numeric operations, in-place operations, and type conversions. Preserve English operator names, code expressions, and reST references. Fix two reST formatting issues and remove redundant failure wording. Validation: sphinx-lint, PO parsing, 79-character line-width checks, and git diff --check passed.
1 parent fdfcaed commit 545aaae

1 file changed

Lines changed: 104 additions & 13 deletions

File tree

‎c-api/number.po‎

Lines changed: 104 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgstr ""
77
"Project-Id-Version: Python 3.14\n"
88
"Report-Msgid-Bugs-To: \n"
99
"POT-Creation-Date: 2024-07-20 00:03+0000\n"
10-
"PO-Revision-Date: 2018-05-23 14:07+0000\n"
10+
"PO-Revision-Date: 2026-11-07 14:25+0800\n"
1111
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
1212
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1313
"tw)\n"
@@ -16,6 +16,7 @@ msgstr ""
1616
"Content-Type: text/plain; charset=UTF-8\n"
1717
"Content-Transfer-Encoding: 8bit\n"
1818
"Plural-Forms: nplurals=1; plural=0;\n"
19+
"X-Generator: Poedit 3.10\n"
1920

2021
#: ../../c-api/number.rst:6
2122
msgid "Number Protocol"
@@ -26,40 +27,51 @@ msgid ""
2627
"Returns ``1`` if the object *o* provides numeric protocols, and false "
2728
"otherwise. This function always succeeds."
2829
msgstr ""
30+
"若物件 *o* 提供數值協定,則回傳 ``1``,否則回傳假值。此函式總會成功執行。"
2931

3032
#: ../../c-api/number.rst:14
3133
msgid "Returns ``1`` if *o* is an index integer."
32-
msgstr ""
34+
msgstr "若 *o* 為索引整數,則回傳 ``1``。"
3335

3436
#: ../../c-api/number.rst:20
3537
msgid ""
3638
"Returns the result of adding *o1* and *o2*, or ``NULL`` on failure. This is "
3739
"the equivalent of the Python expression ``o1 + o2``."
3840
msgstr ""
41+
"回傳 *o1* 與 *o2* 相加的結果,失敗時回傳 ``NULL``。這相當於 Python 運算式 "
42+
"``o1 + o2``。"
3943

4044
#: ../../c-api/number.rst:26
4145
msgid ""
4246
"Returns the result of subtracting *o2* from *o1*, or ``NULL`` on failure. "
4347
"This is the equivalent of the Python expression ``o1 - o2``."
4448
msgstr ""
49+
"回傳 *o1* 減去 *o2* 的結果,失敗時回傳 ``NULL``。這相當於 Python 運算式 ``o1 "
50+
"- o2``。"
4551

4652
#: ../../c-api/number.rst:32
4753
msgid ""
4854
"Returns the result of multiplying *o1* and *o2*, or ``NULL`` on failure. "
4955
"This is the equivalent of the Python expression ``o1 * o2``."
5056
msgstr ""
57+
"回傳 *o1* 與 *o2* 相乘的結果,失敗時回傳 ``NULL``。這相當於 Python 運算式 "
58+
"``o1 * o2``。"
5159

5260
#: ../../c-api/number.rst:38
5361
msgid ""
5462
"Returns the result of matrix multiplication on *o1* and *o2*, or ``NULL`` on "
5563
"failure. This is the equivalent of the Python expression ``o1 @ o2``."
5664
msgstr ""
65+
"回傳對 *o1* 與 *o2* 進行矩陣乘法的結果,失敗時回傳 ``NULL``。這相當於 Python 運"
66+
"算式 ``o1 @ o2``。"
5767

5868
#: ../../c-api/number.rst:46
5969
msgid ""
6070
"Return the floor of *o1* divided by *o2*, or ``NULL`` on failure. This is "
6171
"the equivalent of the Python expression ``o1 // o2``."
6272
msgstr ""
73+
"回傳 *o1* 除以 *o2* 後向下取整的結果,失敗時回傳 ``NULL``。這相當於 Python 運"
74+
"算式 ``o1 // o2``。"
6375

6476
#: ../../c-api/number.rst:52
6577
msgid ""
@@ -70,18 +82,26 @@ msgid ""
7082
"point value when passed two integers. This is the equivalent of the Python "
7183
"expression ``o1 / o2``."
7284
msgstr ""
85+
"回傳 *o1* 除以 *o2* 所得數學值的合理近似值,失敗時回傳 ``NULL``。回傳數值之所"
86+
"以是「近似值」,是因為二進位浮點數無法精確表示所有實數。;無法以二進位表示所"
87+
"有實數。即使傳入兩個整數,此函式仍可能回傳浮點數值。這相當於 Python 運算式 "
88+
"``o1 / o2``。"
7389

7490
#: ../../c-api/number.rst:61
7591
msgid ""
7692
"Returns the remainder of dividing *o1* by *o2*, or ``NULL`` on failure. "
7793
"This is the equivalent of the Python expression ``o1 % o2``."
7894
msgstr ""
95+
"回傳 *o1* 除以 *o2* 的餘數,失敗時回傳 ``NULL``。這相當於 Python 運算式 ``o1 "
96+
"% o2``。"
7997

8098
#: ../../c-api/number.rst:69
8199
msgid ""
82100
"See the built-in function :func:`divmod`. Returns ``NULL`` on failure. This "
83101
"is the equivalent of the Python expression ``divmod(o1, o2)``."
84102
msgstr ""
103+
"請參閱內建函式 :func:`divmod`。失敗時回傳 ``NULL``。這相當於 Python 運算式 "
104+
"``divmod(o1, o2)``。"
85105

86106
#: ../../c-api/number.rst:77
87107
msgid ""
@@ -90,95 +110,122 @@ msgid ""
90110
"optional. If *o3* is to be ignored, pass :c:data:`Py_None` in its place "
91111
"(passing ``NULL`` for *o3* would cause an illegal memory access)."
92112
msgstr ""
113+
"請參閱內建函式 :func:`pow`。失敗時回傳 ``NULL``。這相當於 Python 運算式 "
114+
"``pow(o1, o2, o3)``,其中 *o3* 為選用引數。若要忽略 *o3*,請在其位置傳"
115+
"入 :c:data:`Py_None`。若將 ``NULL`` 傳給 *o3*,會造成非法記憶體存取。"
93116

94117
#: ../../c-api/number.rst:85
95118
msgid ""
96119
"Returns the negation of *o* on success, or ``NULL`` on failure. This is the "
97120
"equivalent of the Python expression ``-o``."
98121
msgstr ""
122+
"成功時回傳 *o* 的相反數,失敗時回傳 ``NULL``。這相當於 Python 運算式 ``-o``。"
99123

100124
#: ../../c-api/number.rst:91
101125
msgid ""
102126
"Returns *o* on success, or ``NULL`` on failure. This is the equivalent of "
103127
"the Python expression ``+o``."
104-
msgstr ""
128+
msgstr "成功時回傳 *o*,失敗時回傳 ``NULL``。這相當於 Python 運算式 ``+o``。"
105129

106130
#: ../../c-api/number.rst:99
107131
msgid ""
108132
"Returns the absolute value of *o*, or ``NULL`` on failure. This is the "
109133
"equivalent of the Python expression ``abs(o)``."
110134
msgstr ""
135+
"回傳 *o* 的絕對值,失敗時回傳 ``NULL``。這相當於 Python 運算式 ``abs(o)``。"
111136

112137
#: ../../c-api/number.rst:105
113138
msgid ""
114139
"Returns the bitwise negation of *o* on success, or ``NULL`` on failure. "
115140
"This is the equivalent of the Python expression ``~o``."
116141
msgstr ""
142+
"成功時回傳 *o* 逐位元反相的結果,失敗時回傳 ``NULL``。這相當於 Python 運算式 "
143+
"``~o``。"
117144

118145
#: ../../c-api/number.rst:111
119146
msgid ""
120147
"Returns the result of left shifting *o1* by *o2* on success, or ``NULL`` on "
121148
"failure. This is the equivalent of the Python expression ``o1 << o2``."
122149
msgstr ""
150+
"成功時回傳將 *o1* 左移 *o2* 位的結果,失敗時回傳 ``NULL``。這相當於 Python 運"
151+
"算式 ``o1 << o2``。"
123152

124153
#: ../../c-api/number.rst:117
125154
msgid ""
126155
"Returns the result of right shifting *o1* by *o2* on success, or ``NULL`` on "
127156
"failure. This is the equivalent of the Python expression ``o1 >> o2``."
128157
msgstr ""
158+
"成功時回傳將 *o1* 右移 *o2* 位的結果,失敗時回傳 ``NULL``。這相當於 Python 運"
159+
"算式 ``o1 >> o2``。"
129160

130161
#: ../../c-api/number.rst:123
131162
msgid ""
132163
"Returns the \"bitwise and\" of *o1* and *o2* on success and ``NULL`` on "
133164
"failure. This is the equivalent of the Python expression ``o1 & o2``."
134165
msgstr ""
166+
"成功時回傳 *o1* 與 *o2* 進行 \"bitwise and\" 運算的結果,失敗時回傳 "
167+
"``NULL``。這相當於 Python 運算式 ``o1 & o2``。"
135168

136169
#: ../../c-api/number.rst:129
137170
msgid ""
138171
"Returns the \"bitwise exclusive or\" of *o1* by *o2* on success, or ``NULL`` "
139172
"on failure. This is the equivalent of the Python expression ``o1 ^ o2``."
140173
msgstr ""
174+
"成功時回傳 *o1* 與 *o2* 進行 \"bitwise exclusive or\" 運算的結果,失敗時回傳 "
175+
"``NULL``。這相當於 Python 運算式 ``o1 ^ o2``。"
141176

142177
#: ../../c-api/number.rst:135
143178
msgid ""
144179
"Returns the \"bitwise or\" of *o1* and *o2* on success, or ``NULL`` on "
145180
"failure. This is the equivalent of the Python expression ``o1 | o2``."
146181
msgstr ""
182+
"成功時回傳 *o1* 與 *o2* 進行 \"bitwise or\" 運算的結果,失敗時回傳 ``NULL``。"
183+
"這相當於 Python 運算式 ``o1 | o2``。"
147184

148185
#: ../../c-api/number.rst:141
149186
msgid ""
150187
"Returns the result of adding *o1* and *o2*, or ``NULL`` on failure. The "
151188
"operation is done *in-place* when *o1* supports it. This is the equivalent "
152189
"of the Python statement ``o1 += o2``."
153190
msgstr ""
191+
"回傳 *o1* 與 *o2* 相加的結果,失敗時回傳 ``NULL``。若 *o1* 支援,則會以 *in-"
192+
"place* 方式執行此運算。這相當於 Python 陳述式 ``o1 += o2``。"
154193

155194
#: ../../c-api/number.rst:148
156195
msgid ""
157196
"Returns the result of subtracting *o2* from *o1*, or ``NULL`` on failure. "
158197
"The operation is done *in-place* when *o1* supports it. This is the "
159198
"equivalent of the Python statement ``o1 -= o2``."
160199
msgstr ""
200+
"回傳 *o1* 減去 *o2* 的結果,失敗時回傳 ``NULL``。若 *o1* 支援,則會以 *in-"
201+
"place* 方式執行此運算。這相當於 Python 陳述式 ``o1 -= o2``。"
161202

162203
#: ../../c-api/number.rst:155
163204
msgid ""
164205
"Returns the result of multiplying *o1* and *o2*, or ``NULL`` on failure. "
165206
"The operation is done *in-place* when *o1* supports it. This is the "
166207
"equivalent of the Python statement ``o1 *= o2``."
167208
msgstr ""
209+
"回傳 *o1* 與 *o2* 相乘的結果,失敗時回傳 ``NULL``。若 *o1* 支援,則會以 *in-"
210+
"place* 方式執行此運算。這相當於 Python 陳述式 ``o1 *= o2``。"
168211

169212
#: ../../c-api/number.rst:162
170213
msgid ""
171214
"Returns the result of matrix multiplication on *o1* and *o2*, or ``NULL`` on "
172215
"failure. The operation is done *in-place* when *o1* supports it. This is "
173216
"the equivalent of the Python statement ``o1 @= o2``."
174217
msgstr ""
218+
"回傳對 *o1* 與 *o2* 進行矩陣乘法的結果,失敗時回傳 ``NULL``。若 *o1* 支援,則"
219+
"會以 *in-place* 方式執行此運算。這相當於 Python 陳述式 ``o1 @= o2``。"
175220

176221
#: ../../c-api/number.rst:171
177222
msgid ""
178223
"Returns the mathematical floor of dividing *o1* by *o2*, or ``NULL`` on "
179224
"failure. The operation is done *in-place* when *o1* supports it. This is "
180225
"the equivalent of the Python statement ``o1 //= o2``."
181226
msgstr ""
227+
"回傳 *o1* 除以 *o2* 後向下取整的結果,失敗時回傳 ``NULL``。若 *o1* 支援,則會"
228+
"以 *in-place* 方式執行此運算。這相當於 Python 陳述式 ``o1 //= o2``。"
182229

183230
#: ../../c-api/number.rst:178
184231
msgid ""
@@ -190,13 +237,19 @@ msgid ""
190237
"*o1* supports it. This is the equivalent of the Python statement ``o1 /= "
191238
"o2``."
192239
msgstr ""
240+
"回傳 *o1* 除以 *o2* 所得數學值的合理近似值,失敗時回傳 ``NULL``。回傳值之所以"
241+
"是「近似值」,是因為二進位浮點數只能表示近似值;無法以二進位表示所有實數。即"
242+
"使傳入兩個整數,此函式仍可能回傳浮點數值。若 *o1* 支援,則會以 *in-place* 方"
243+
"式執行此運算。這相當於 Python 陳述式 ``o1 /= o2``。"
193244

194245
#: ../../c-api/number.rst:188
195246
msgid ""
196247
"Returns the remainder of dividing *o1* by *o2*, or ``NULL`` on failure. The "
197248
"operation is done *in-place* when *o1* supports it. This is the equivalent "
198249
"of the Python statement ``o1 %= o2``."
199250
msgstr ""
251+
"回傳 *o1* 除以 *o2* 的餘數,失敗時回傳 ``NULL``。若 *o1* 支援,則會以 *in-"
252+
"place* 方式執行此運算。這相當於 Python 陳述式 ``o1 %= o2``。"
200253

201254
#: ../../c-api/number.rst:197
202255
msgid ""
@@ -207,98 +260,136 @@ msgid ""
207260
"pass :c:data:`Py_None` in its place (passing ``NULL`` for *o3* would cause "
208261
"an illegal memory access)."
209262
msgstr ""
263+
"請參閱內建函式 :func:`pow`。失敗時回傳 ``NULL``。若 *o1* 支援,則會以 *in-"
264+
"place* 方式執行此運算。當 o3 為 :c:data:`Py_None` 時,這相當於 Python 陳述式 "
265+
"``o1 **= o2``;否則,相當於 ``pow(o1, o2, o3)`` 的原地運算版本。若要忽略 "
266+
"*o3*,請在其位置傳入 :c:data:`Py_None`。若將 ``NULL`` 傳給 *o3*,會造成非法記"
267+
"憶體存取。"
210268

211269
#: ../../c-api/number.rst:206
212270
msgid ""
213271
"Returns the result of left shifting *o1* by *o2* on success, or ``NULL`` on "
214272
"failure. The operation is done *in-place* when *o1* supports it. This is "
215273
"the equivalent of the Python statement ``o1 <<= o2``."
216274
msgstr ""
275+
"成功時回傳將 *o1* 左移 *o2* 位的結果,失敗時回傳 ``NULL``。若 *o1* 支援,則會"
276+
"以 *in-place* 方式執行此運算。這相當於 Python 陳述式 ``o1 <<= o2``。"
217277

218278
#: ../../c-api/number.rst:213
219279
msgid ""
220280
"Returns the result of right shifting *o1* by *o2* on success, or ``NULL`` on "
221281
"failure. The operation is done *in-place* when *o1* supports it. This is "
222282
"the equivalent of the Python statement ``o1 >>= o2``."
223283
msgstr ""
284+
"成功時回傳將 *o1* 右移 *o2* 位的結果,失敗時回傳 ``NULL``。若 *o1* 支援,則會"
285+
"以 *in-place* 方式執行此運算。這相當於 Python 陳述式 ``o1 >>= o2``。"
224286

225287
#: ../../c-api/number.rst:220
226288
msgid ""
227289
"Returns the \"bitwise and\" of *o1* and *o2* on success and ``NULL`` on "
228290
"failure. The operation is done *in-place* when *o1* supports it. This is "
229291
"the equivalent of the Python statement ``o1 &= o2``."
230292
msgstr ""
293+
"成功時回傳 *o1* 與 *o2* 進行 \"bitwise and\" 運算的結果,失敗時回傳 "
294+
"``NULL``。若 *o1* 支援,則會以 *in-place* 方式執行此運算。這相當於 Python 陳"
295+
"述式 ``o1 &= o2``。"
231296

232297
#: ../../c-api/number.rst:227
233298
msgid ""
234299
"Returns the \"bitwise exclusive or\" of *o1* by *o2* on success, or ``NULL`` "
235300
"on failure. The operation is done *in-place* when *o1* supports it. This "
236301
"is the equivalent of the Python statement ``o1 ^= o2``."
237302
msgstr ""
303+
"成功時回傳 *o1* 與 *o2* 進行 \"bitwise exclusive or\" 運算的結果,失敗時回傳 "
304+
"``NULL``。若 *o1* 支援,則會以 *in-place* 方式執行此運算。這相當於 Python 陳"
305+
"述式 ``o1 ^= o2``。"
238306

239307
#: ../../c-api/number.rst:234
240308
msgid ""
241309
"Returns the \"bitwise or\" of *o1* and *o2* on success, or ``NULL`` on "
242310
"failure. The operation is done *in-place* when *o1* supports it. This is "
243311
"the equivalent of the Python statement ``o1 |= o2``."
244312
msgstr ""
313+
"成功時回傳 *o1* 與 *o2* 進行 \"bitwise or\" 運算的結果,失敗時回傳 ``NULL``。"
314+
"若 *o1* 支援,則會以 *in-place* 方式執行此運算。這相當於 Python 陳述式 ``o1 |"
315+
"= o2``。"
245316

246317
#: ../../c-api/number.rst:243
247318
msgid ""
248319
"Returns the *o* converted to an integer object on success, or ``NULL`` on "
249320
"failure. This is the equivalent of the Python expression ``int(o)``."
250321
msgstr ""
322+
"成功時回傳將 *o* 轉換為整數物件的結果,失敗時回傳 ``NULL``。這相當於 Python "
323+
"運算式 ``int(o)``。"
251324

252325
#: ../../c-api/number.rst:251
253326
msgid ""
254327
"Returns the *o* converted to a float object on success, or ``NULL`` on "
255328
"failure. This is the equivalent of the Python expression ``float(o)``."
256329
msgstr ""
330+
"成功時回傳將 *o* 轉換為浮點數物件的結果,失敗時回傳 ``NULL``。這相當於 "
331+
"Python 運算式 ``float(o)``。"
257332

258333
#: ../../c-api/number.rst:257
259334
msgid ""
260-
"Returns the *o* converted to a Python int on success or ``NULL`` with a :exc:"
261-
"`TypeError` exception raised on failure."
335+
"Returns the *o* converted to a Python int on success or ``NULL`` with "
336+
"a :exc:`TypeError` exception raised on failure."
262337
msgstr ""
338+
"成功時回傳將 *o* 轉換為 Python int 的結果;失敗時引發 :exc:`TypeError` 例外並"
339+
"回傳 ``NULL``。"
263340

264341
#: ../../c-api/number.rst:260
265342
msgid ""
266343
"The result always has exact type :class:`int`. Previously, the result could "
267344
"have been an instance of a subclass of ``int``."
268345
msgstr ""
346+
"結果的確切型別一律為 :class:`int`。先前,結果可能是 ``int`` 子類別的實例。"
269347

270348
#: ../../c-api/number.rst:267
271349
msgid ""
272350
"Returns the integer *n* converted to base *base* as a string. The *base* "
273351
"argument must be one of 2, 8, 10, or 16. For base 2, 8, or 16, the returned "
274352
"string is prefixed with a base marker of ``'0b'``, ``'0o'``, or ``'0x'``, "
275-
"respectively. If *n* is not a Python int, it is converted with :c:func:"
276-
"`PyNumber_Index` first."
353+
"respectively. If *n* is not a Python int, it is converted "
354+
"with :c:func:`PyNumber_Index` first."
277355
msgstr ""
356+
"將整數 *n* 轉換為以 *base* 為基底的字串並回傳。*base* 引數必須為 2、8、10 或 "
357+
"16 其中之一。當基底為 2、8 或 16 時,回傳的字串會分別加上 ``'0b'``、``'0o'`` "
358+
"或 ``'0x'`` 作為進位前綴。若 *n* 不是 Python int,則會先使"
359+
"用 :c:func:`PyNumber_Index` 進行轉換。"
278360

279361
#: ../../c-api/number.rst:276
280362
msgid ""
281363
"Returns *o* converted to a :c:type:`Py_ssize_t` value if *o* can be "
282364
"interpreted as an integer. If the call fails, an exception is raised and "
283365
"``-1`` is returned."
284366
msgstr ""
367+
"若 *o* 可解讀為整數,則將其轉換為 :c:type:`Py_ssize_t` 值並回傳。若呼叫失敗,"
368+
"則會引發例外並回傳 ``-1``。"
285369

286370
#: ../../c-api/number.rst:279
287371
msgid ""
288-
"If *o* can be converted to a Python int but the attempt to convert to a :c:"
289-
"type:`Py_ssize_t` value would raise an :exc:`OverflowError`, then the *exc* "
290-
"argument is the type of exception that will be raised (usually :exc:"
291-
"`IndexError` or :exc:`OverflowError`). If *exc* is ``NULL``, then the "
292-
"exception is cleared and the value is clipped to ``PY_SSIZE_T_MIN`` for a "
293-
"negative integer or ``PY_SSIZE_T_MAX`` for a positive integer."
372+
"If *o* can be converted to a Python int but the attempt to convert to "
373+
"a :c:type:`Py_ssize_t` value would raise an :exc:`OverflowError`, then the "
374+
"*exc* argument is the type of exception that will be raised "
375+
"(usually :exc:`IndexError` or :exc:`OverflowError`). If *exc* is ``NULL``, "
376+
"then the exception is cleared and the value is clipped to ``PY_SSIZE_T_MIN`` "
377+
"for a negative integer or ``PY_SSIZE_T_MAX`` for a positive integer."
294378
msgstr ""
379+
"若 *o* 可以轉換為 Python int,但嘗試轉換為 :c:type:`Py_ssize_t` 值時會引"
380+
"發 :exc:`OverflowError`,則 *exc* 引數指定要引發的例外型別(通常"
381+
"為 :exc:`IndexError` 或 :exc:`OverflowError`)。若 *exc* 為 ``NULL``,則會清"
382+
"除該例外,並將負整數的值限制為 ``PY_SSIZE_T_MIN``,正整數的值限制為 "
383+
"``PY_SSIZE_T_MAX``。"
295384

296385
#: ../../c-api/number.rst:289
297386
msgid ""
298387
"Returns ``1`` if *o* is an index integer (has the ``nb_index`` slot of the "
299388
"``tp_as_number`` structure filled in), and ``0`` otherwise. This function "
300389
"always succeeds."
301390
msgstr ""
391+
"若 *o* 為索引整數(即其 ``tp_as_number`` 結構中的 ``nb_index`` 插槽已填入),"
392+
"則回傳 ``1``,否則回傳 ``0``。此函式總是會成功執行。"
302393

303394
#: ../../c-api/number.rst:67 ../../c-api/number.rst:75
304395
#: ../../c-api/number.rst:97 ../../c-api/number.rst:195

0 commit comments

Comments
 (0)