Skip to content

Commit eeb092e

Browse files
sync with cpython 23e37710
1 parent cb5c595 commit eeb092e

File tree

3 files changed

+370
-300
lines changed

3 files changed

+370
-300
lines changed

c-api/conversion.po

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ msgid ""
99
msgstr ""
1010
"Project-Id-Version: Python 3.14\n"
1111
"Report-Msgid-Bugs-To: \n"
12-
"POT-Creation-Date: 2025-09-08 15:25+0800\n"
12+
"POT-Creation-Date: 2025-11-03 00:16+0000\n"
1313
"PO-Revision-Date: 2023-12-11 18:26+0000\n"
1414
"Last-Translator: Matt Wang <[email protected]>\n"
1515
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -31,17 +31,17 @@ msgstr "用於數字轉換和格式化字串輸出的函式。"
3131
#: ../../c-api/conversion.rst:13
3232
msgid ""
3333
"Output not more than *size* bytes to *str* according to the format string "
34-
"*format* and the extra arguments. See the Unix man "
35-
"page :manpage:`snprintf(3)`."
34+
"*format* and the extra arguments. See the Unix man page :manpage:"
35+
"`snprintf(3)`."
3636
msgstr ""
3737
"根據格式字串 *format* 和額外引數,輸出不超過 *size* 位元組給 *str*。請參閱 "
3838
"Unix 使用手冊 :manpage:`snprintf(3)`。"
3939

4040
#: ../../c-api/conversion.rst:19
4141
msgid ""
4242
"Output not more than *size* bytes to *str* according to the format string "
43-
"*format* and the variable argument list *va*. Unix man "
44-
"page :manpage:`vsnprintf(3)`."
43+
"*format* and the variable argument list *va*. Unix man page :manpage:"
44+
"`vsnprintf(3)`."
4545
msgstr ""
4646
"根據格式字串 *format* 和變數引數串列 *va*,輸出不超過 *size* 位元組給 *str*。"
4747
"Unix 使用手冊 :manpage:`vsnprintf(3)`。"
@@ -53,9 +53,9 @@ msgid ""
5353
"is to guarantee consistent behavior in corner cases, which the Standard C "
5454
"functions do not."
5555
msgstr ""
56-
":c:func:`PyOS_snprintf` 和 :c:func:`PyOS_vsnprintf` 包裝標準 C 函式庫函"
57-
"式 :c:func:`snprintf` 和 :c:func:`vsnprintf`。它們的目的是確保邊角案例 "
58-
"(corner case) 下的行為一致,而標準 C 函式則不然。"
56+
":c:func:`PyOS_snprintf` 和 :c:func:`PyOS_vsnprintf` 包裝標準 C 函式庫函式 :c:"
57+
"func:`snprintf` 和 :c:func:`vsnprintf`。它們的目的是確保邊角案例 (corner "
58+
"case) 下的行為一致,而標準 C 函式則不然。"
5959

6060
#: ../../c-api/conversion.rst:28
6161
msgid ""
@@ -96,10 +96,11 @@ msgstr ""
9696
"才能成功。在這種情況下,``str[size-1]`` 是 ``'\\0'``。"
9797

9898
#: ../../c-api/conversion.rst:44
99+
#, fuzzy
99100
msgid ""
100-
"When ``rv < 0``, \"something bad happened.\" ``str[size-1]`` is ``'\\0'`` in "
101-
"this case too, but the rest of *str* is undefined. The exact cause of the "
102-
"error depends on the underlying platform."
101+
"When ``rv < 0``, the output conversion failed and ``str[size-1]`` is "
102+
"``'\\0'`` in this case too, but the rest of *str* is undefined. The exact "
103+
"cause of the error depends on the underlying platform."
103104
msgstr ""
104105
"當 ``rv < 0`` 時,代表「有不好的事情發生了」。在這種情況下,``str[size-1]`` "
105106
"也是 ``'\\0'``,但 *str* 的其餘部分未定義。錯誤的確切原因取決於底層平台。"
@@ -129,9 +130,9 @@ msgstr ""
129130
#: ../../c-api/conversion.rst:63
130131
msgid ""
131132
"If the converted value falls out of range of corresponding return type, "
132-
"range error occurs (:c:data:`errno` is set to :c:macro:`!ERANGE`) "
133-
"and :c:macro:`!ULONG_MAX` is returned. If no conversion can be performed, "
134-
"``0`` is returned."
133+
"range error occurs (:c:data:`errno` is set to :c:macro:`!ERANGE`) and :c:"
134+
"macro:`!ULONG_MAX` is returned. If no conversion can be performed, ``0`` is "
135+
"returned."
135136
msgstr ""
136137

137138
#: ../../c-api/conversion.rst:68
@@ -169,9 +170,9 @@ msgstr ""
169170

170171
#: ../../c-api/conversion.rst:95
171172
msgid ""
172-
"If ``endptr`` is ``NULL``, convert the whole string. "
173-
"Raise :exc:`ValueError` and return ``-1.0`` if the string is not a valid "
174-
"representation of a floating-point number."
173+
"If ``endptr`` is ``NULL``, convert the whole string. Raise :exc:"
174+
"`ValueError` and return ``-1.0`` if the string is not a valid representation "
175+
"of a floating-point number."
175176
msgstr ""
176177
"如果 ``endptr`` 為 ``NULL``,則轉換整個字串。如果字串不是浮點數的有效表示,則"
177178
"引發 :exc:`ValueError` 並回傳 ``-1.0``。"

c-api/dict.po

Lines changed: 62 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: Python 3.14\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-09-08 15:25+0800\n"
11+
"POT-Creation-Date: 2025-11-03 00:16+0000\n"
1212
"PO-Revision-Date: 2017-09-22 18:26+0000\n"
1313
"Last-Translator: Liang-Bo Wang <[email protected]>\n"
1414
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -33,8 +33,8 @@ msgid ""
3333
"This instance of :c:type:`PyTypeObject` represents the Python dictionary "
3434
"type. This is the same object as :class:`dict` in the Python layer."
3535
msgstr ""
36-
":c:type:`PyTypeObject` 實例代表一個 Python 字典型態。此與 Python 層中"
37-
"的 :class:`dict` 為同一個物件。"
36+
":c:type:`PyTypeObject` 實例代表一個 Python 字典型態。此與 Python 層中的 :"
37+
"class:`dict` 為同一個物件。"
3838

3939
#: ../../c-api/dict.rst:24
4040
msgid ""
@@ -69,16 +69,16 @@ msgstr "清空現有字典中的所有鍵值對。"
6969

7070
#: ../../c-api/dict.rst:53
7171
msgid ""
72-
"Determine if dictionary *p* contains *key*. If an item in *p* is matches "
72+
"Determine if dictionary *p* contains *key*. If an item in *p* matches "
7373
"*key*, return ``1``, otherwise return ``0``. On error, return ``-1``. This "
7474
"is equivalent to the Python expression ``key in p``."
7575
msgstr ""
7676

7777
#: ../../c-api/dict.rst:60
7878
msgid ""
79-
"This is the same as :c:func:`PyDict_Contains`, but *key* is specified as "
80-
"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
81-
"a :c:expr:`PyObject*`."
79+
"This is the same as :c:func:`PyDict_Contains`, but *key* is specified as a :"
80+
"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:"
81+
"`PyObject*`."
8282
msgstr ""
8383

8484
#: ../../c-api/dict.rst:69
@@ -87,32 +87,32 @@ msgstr ""
8787

8888
#: ../../c-api/dict.rst:74
8989
msgid ""
90-
"Insert *val* into the dictionary *p* with a key of *key*. *key* must "
91-
"be :term:`hashable`; if it isn't, :exc:`TypeError` will be raised. Return "
92-
"``0`` on success or ``-1`` on failure. This function *does not* steal a "
93-
"reference to *val*."
90+
"Insert *val* into the dictionary *p* with a key of *key*. *key* must be :"
91+
"term:`hashable`; if it isn't, :exc:`TypeError` will be raised. Return ``0`` "
92+
"on success or ``-1`` on failure. This function *does not* steal a reference "
93+
"to *val*."
9494
msgstr ""
9595

9696
#: ../../c-api/dict.rst:82
9797
msgid ""
98-
"This is the same as :c:func:`PyDict_SetItem`, but *key* is specified as "
99-
"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
100-
"a :c:expr:`PyObject*`."
98+
"This is the same as :c:func:`PyDict_SetItem`, but *key* is specified as a :c:"
99+
"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:"
100+
"`PyObject*`."
101101
msgstr ""
102102

103103
#: ../../c-api/dict.rst:89
104104
msgid ""
105-
"Remove the entry in dictionary *p* with key *key*. *key* must "
106-
"be :term:`hashable`; if it isn't, :exc:`TypeError` is raised. If *key* is "
107-
"not in the dictionary, :exc:`KeyError` is raised. Return ``0`` on success or "
108-
"``-1`` on failure."
105+
"Remove the entry in dictionary *p* with key *key*. *key* must be :term:"
106+
"`hashable`; if it isn't, :exc:`TypeError` is raised. If *key* is not in the "
107+
"dictionary, :exc:`KeyError` is raised. Return ``0`` on success or ``-1`` on "
108+
"failure."
109109
msgstr ""
110110

111111
#: ../../c-api/dict.rst:97
112112
msgid ""
113-
"This is the same as :c:func:`PyDict_DelItem`, but *key* is specified as "
114-
"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
115-
"a :c:expr:`PyObject*`."
113+
"This is the same as :c:func:`PyDict_DelItem`, but *key* is specified as a :c:"
114+
"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:"
115+
"`PyObject*`."
116116
msgstr ""
117117

118118
#: ../../c-api/dict.rst:104
@@ -148,9 +148,9 @@ msgstr ""
148148

149149
#: ../../c-api/dict.rst:125
150150
msgid ""
151-
"Exceptions that occur while this calls :meth:`~object.__hash__` "
152-
"and :meth:`~object.__eq__` methods are silently ignored. Prefer "
153-
"the :c:func:`PyDict_GetItemWithError` function instead."
151+
"Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:"
152+
"`~object.__eq__` methods are silently ignored. Prefer the :c:func:"
153+
"`PyDict_GetItemWithError` function instead."
154154
msgstr ""
155155

156156
#: ../../c-api/dict.rst:129
@@ -168,25 +168,23 @@ msgstr ""
168168

169169
#: ../../c-api/dict.rst:144
170170
msgid ""
171-
"This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as "
172-
"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
173-
"a :c:expr:`PyObject*`."
171+
"This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a :c:"
172+
"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:"
173+
"`PyObject*`."
174174
msgstr ""
175175

176176
#: ../../c-api/dict.rst:150
177177
msgid ""
178-
"Exceptions that occur while this calls :meth:`~object.__hash__` "
179-
"and :meth:`~object.__eq__` methods or while creating the "
180-
"temporary :class:`str` object are silently ignored. Prefer using "
181-
"the :c:func:`PyDict_GetItemWithError` function with your "
182-
"own :c:func:`PyUnicode_FromString` *key* instead."
178+
"Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:"
179+
"`~object.__eq__` methods or while creating the temporary :class:`str` object "
180+
"are silently ignored. Prefer using the :c:func:`PyDict_GetItemWithError` "
181+
"function with your own :c:func:`PyUnicode_FromString` *key* instead."
183182
msgstr ""
184183

185184
#: ../../c-api/dict.rst:159
186185
msgid ""
187-
"Similar to :c:func:`PyDict_GetItemRef`, but *key* is specified as "
188-
"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
189-
"a :c:expr:`PyObject*`."
186+
"Similar to :c:func:`PyDict_GetItemRef`, but *key* is specified as a :c:expr:"
187+
"`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`."
190188
msgstr ""
191189

192190
#: ../../c-api/dict.rst:168
@@ -222,7 +220,7 @@ msgstr ""
222220
#: ../../c-api/dict.rst:200
223221
msgid ""
224222
"Remove *key* from dictionary *p* and optionally return the removed value. Do "
225-
"not raise :exc:`KeyError` if the key missing."
223+
"not raise :exc:`KeyError` if the key is missing."
226224
msgstr ""
227225

228226
#: ../../c-api/dict.rst:203
@@ -239,8 +237,8 @@ msgstr ""
239237

240238
#: ../../c-api/dict.rst:209
241239
msgid ""
242-
"Similar to :meth:`dict.pop`, but without the default value and not "
243-
"raising :exc:`KeyError` if the key missing."
240+
"Similar to :meth:`dict.pop`, but without the default value and not raising :"
241+
"exc:`KeyError` if the key is missing."
244242
msgstr ""
245243

246244
#: ../../c-api/dict.rst:217
@@ -273,16 +271,16 @@ msgstr "回傳字典中項目的數量。此與於字典呼叫 ``len(p)`` 等效
273271

274272
#: ../../c-api/dict.rst:250
275273
msgid ""
276-
"Iterate over all key-value pairs in the dictionary *p*. "
277-
"The :c:type:`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` "
278-
"prior to the first call to this function to start the iteration; the "
279-
"function returns true for each pair in the dictionary, and false once all "
280-
"pairs have been reported. The parameters *pkey* and *pvalue* should either "
281-
"point to :c:expr:`PyObject*` variables that will be filled in with each key "
282-
"and value, respectively, or may be ``NULL``. Any references returned "
283-
"through them are borrowed. *ppos* should not be altered during iteration. "
284-
"Its value represents offsets within the internal dictionary structure, and "
285-
"since the structure is sparse, the offsets are not consecutive."
274+
"Iterate over all key-value pairs in the dictionary *p*. The :c:type:"
275+
"`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` prior to the "
276+
"first call to this function to start the iteration; the function returns "
277+
"true for each pair in the dictionary, and false once all pairs have been "
278+
"reported. The parameters *pkey* and *pvalue* should either point to :c:expr:"
279+
"`PyObject*` variables that will be filled in with each key and value, "
280+
"respectively, or may be ``NULL``. Any references returned through them are "
281+
"borrowed. *ppos* should not be altered during iteration. Its value "
282+
"represents offsets within the internal dictionary structure, and since the "
283+
"structure is sparse, the offsets are not consecutive."
286284
msgstr ""
287285

288286
#: ../../c-api/dict.rst:261
@@ -348,9 +346,8 @@ msgstr ""
348346
#: ../../c-api/dict.rst:293
349347
msgid ""
350348
"The function is not thread-safe in the :term:`free-threaded <free "
351-
"threading>` build without external synchronization. You can "
352-
"use :c:macro:`Py_BEGIN_CRITICAL_SECTION` to lock the dictionary while "
353-
"iterating over it::"
349+
"threading>` build without external synchronization. You can use :c:macro:"
350+
"`Py_BEGIN_CRITICAL_SECTION` to lock the dictionary while iterating over it::"
354351
msgstr ""
355352

356353
#: ../../c-api/dict.rst:298
@@ -373,9 +370,9 @@ msgid ""
373370
"critical section. However, the references returned for *pkey* and *pvalue* "
374371
"are :term:`borrowed <borrowed reference>` and are only valid while the "
375372
"critical section is held. If you need to use these objects outside the "
376-
"critical section or when the critical section can be suspended, create "
377-
"a :term:`strong reference <strong reference>` (for example, "
378-
"using :c:func:`Py_NewRef`)."
373+
"critical section or when the critical section can be suspended, create a :"
374+
"term:`strong reference <strong reference>` (for example, using :c:func:"
375+
"`Py_NewRef`)."
379376
msgstr ""
380377

381378
#: ../../c-api/dict.rst:316
@@ -390,10 +387,10 @@ msgstr ""
390387

391388
#: ../../c-api/dict.rst:326
392389
msgid ""
393-
"This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to "
394-
"``a.update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall "
395-
"back to the iterating over a sequence of key value pairs if the second "
396-
"argument has no \"keys\" attribute. Return ``0`` on success or ``-1`` if an "
390+
"This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to ``a."
391+
"update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall back "
392+
"to the iterating over a sequence of key value pairs if the second argument "
393+
"has no \"keys\" attribute. Return ``0`` on success or ``-1`` if an "
397394
"exception was raised."
398395
msgstr ""
399396

@@ -428,15 +425,15 @@ msgstr ""
428425

429426
#: ../../c-api/dict.rst:358
430427
msgid ""
431-
"Clear watcher identified by *watcher_id* previously returned "
432-
"from :c:func:`PyDict_AddWatcher`. Return ``0`` on success, ``-1`` on error "
433-
"(e.g. if the given *watcher_id* was never registered.)"
428+
"Clear watcher identified by *watcher_id* previously returned from :c:func:"
429+
"`PyDict_AddWatcher`. Return ``0`` on success, ``-1`` on error (e.g. if the "
430+
"given *watcher_id* was never registered.)"
434431
msgstr ""
435432

436433
#: ../../c-api/dict.rst:366
437434
msgid ""
438-
"Mark dictionary *dict* as watched. The callback granted *watcher_id* "
439-
"by :c:func:`PyDict_AddWatcher` will be called when *dict* is modified or "
435+
"Mark dictionary *dict* as watched. The callback granted *watcher_id* by :c:"
436+
"func:`PyDict_AddWatcher` will be called when *dict* is modified or "
440437
"deallocated. Return ``0`` on success or ``-1`` on error."
441438
msgstr ""
442439

@@ -502,8 +499,8 @@ msgstr ""
502499
#: ../../c-api/dict.rst:418
503500
msgid ""
504501
"If the callback sets an exception, it must return ``-1``; this exception "
505-
"will be printed as an unraisable exception "
506-
"using :c:func:`PyErr_WriteUnraisable`. Otherwise it should return ``0``."
502+
"will be printed as an unraisable exception using :c:func:"
503+
"`PyErr_WriteUnraisable`. Otherwise it should return ``0``."
507504
msgstr ""
508505

509506
#: ../../c-api/dict.rst:422

0 commit comments

Comments
 (0)