Skip to content

Commit c2ad2bd

Browse files
sync with cpython ed38c20d
1 parent f0e37d6 commit c2ad2bd

File tree

3 files changed

+153
-111
lines changed

3 files changed

+153
-111
lines changed

c-api/bytearray.po

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ msgid ""
66
msgstr ""
77
"Project-Id-Version: Python 3.14\n"
88
"Report-Msgid-Bugs-To: \n"
9-
"POT-Creation-Date: 2025-09-08 15:25+0800\n"
9+
"POT-Creation-Date: 2026-03-28 00:21+0000\n"
1010
"PO-Revision-Date: 2023-08-12 11:42+0800\n"
1111
"Last-Translator: Liang-Bo Wang <me@liang2.tw>\n"
1212
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -61,62 +61,75 @@ msgstr "直接 API 函式"
6161

6262
#: ../../c-api/bytearray.rst:42
6363
msgid ""
64-
"Return a new bytearray object from any object, *o*, that implements "
65-
"the :ref:`buffer protocol <bufferobjects>`."
64+
"Return a new bytearray object from any object, *o*, that implements the :ref:"
65+
"`buffer protocol <bufferobjects>`."
6666
msgstr ""
6767
"由任意物件 *o* 回傳一個新的位元組陣列物件,並實作了\\ :ref:`緩衝協定 (buffer "
6868
"protocol) <bufferobjects>`。"
6969

70-
#: ../../c-api/bytearray.rst:45 ../../c-api/bytearray.rst:52
71-
#: ../../c-api/bytearray.rst:59
70+
#: ../../c-api/bytearray.rst:45 ../../c-api/bytearray.rst:56
71+
#: ../../c-api/bytearray.rst:63
7272
msgid "On failure, return ``NULL`` with an exception set."
7373
msgstr "在失敗時,會回傳 ``NULL`` 並設定例外。"
7474

75-
#: ../../c-api/bytearray.rst:50
75+
#: ../../c-api/bytearray.rst:48 ../../c-api/bytearray.rst:66
76+
msgid ""
77+
"If the object implements the buffer protocol, then the buffer must not be "
78+
"mutated while the bytearray object is being created."
79+
msgstr ""
80+
81+
#: ../../c-api/bytearray.rst:54
7682
msgid "Create a new bytearray object from *string* and its length, *len*."
7783
msgstr "從 *string* 及其長度 *len* 建立一個新的位元組陣列物件。"
7884

79-
#: ../../c-api/bytearray.rst:57
85+
#: ../../c-api/bytearray.rst:61
8086
msgid ""
8187
"Concat bytearrays *a* and *b* and return a new bytearray with the result."
8288
msgstr "連接位元組陣列 *a* 和 *b*,並回傳一個包含結果的新位元組陣列。"
8389

84-
#: ../../c-api/bytearray.rst:64
90+
#: ../../c-api/bytearray.rst:72
8591
msgid "Return the size of *bytearray* after checking for a ``NULL`` pointer."
8692
msgstr "在檢查為 ``NULL`` 指標後,回傳 *bytearray* 的大小。"
8793

88-
#: ../../c-api/bytearray.rst:69
94+
#: ../../c-api/bytearray.rst:77
8995
msgid ""
9096
"Return the contents of *bytearray* as a char array after checking for a "
9197
"``NULL`` pointer. The returned array always has an extra null byte appended."
9298
msgstr ""
9399
"在檢查是否為 ``NULL`` 指標後,將 *bytearray* 的內容回傳為字元陣列。回傳的陣列"
94100
"總是會多附加一個空位元組。"
95101

96-
#: ../../c-api/bytearray.rst:76
102+
#: ../../c-api/bytearray.rst:82 ../../c-api/bytearray.rst:104
103+
msgid ""
104+
"It is not thread-safe to mutate the bytearray object while using the "
105+
"returned char array."
106+
msgstr ""
107+
108+
#: ../../c-api/bytearray.rst:87
97109
msgid ""
98110
"Resize the internal buffer of *bytearray* to *len*. Failure is a ``-1`` "
99111
"return with an exception set."
100-
msgstr "將 *bytearray* 的內部緩衝區大小調整為 *len*。失敗時會回傳 ``-1`` 並設定例外。"
112+
msgstr ""
113+
"將 *bytearray* 的內部緩衝區大小調整為 *len*。失敗時會回傳 ``-1`` 並設定例外。"
101114

102-
#: ../../c-api/bytearray.rst:79
115+
#: ../../c-api/bytearray.rst:90
103116
msgid ""
104117
"A negative *len* will now result in an exception being set and -1 returned."
105118
msgstr "負的 *len* 現在會設定例外並回傳 -1。"
106119

107-
#: ../../c-api/bytearray.rst:84
120+
#: ../../c-api/bytearray.rst:95
108121
msgid "Macros"
109122
msgstr "巨集"
110123

111-
#: ../../c-api/bytearray.rst:86
124+
#: ../../c-api/bytearray.rst:97
112125
msgid "These macros trade safety for speed and they don't check pointers."
113126
msgstr "這些巨集犧牲了安全性以換取速度,並且它們不會檢查指標。"
114127

115-
#: ../../c-api/bytearray.rst:90
128+
#: ../../c-api/bytearray.rst:101
116129
msgid "Similar to :c:func:`PyByteArray_AsString`, but without error checking."
117130
msgstr "與 :c:func:`PyByteArray_AsString` 類似,但沒有錯誤檢查。"
118131

119-
#: ../../c-api/bytearray.rst:95
132+
#: ../../c-api/bytearray.rst:109
120133
msgid "Similar to :c:func:`PyByteArray_Size`, but without error checking."
121134
msgstr "與 :c:func:`PyByteArray_Size` 類似,但沒有錯誤檢查。"
122135

c-api/bytes.po

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ msgid ""
66
msgstr ""
77
"Project-Id-Version: Python 3.14\n"
88
"Report-Msgid-Bugs-To: \n"
9-
"POT-Creation-Date: 2026-01-22 16:55+0000\n"
9+
"POT-Creation-Date: 2026-03-28 00:21+0000\n"
1010
"PO-Revision-Date: 2018-05-23 14:04+0000\n"
1111
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
1212
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -245,15 +245,21 @@ msgid ""
245245
"protocol."
246246
msgstr ""
247247

248-
#: ../../c-api/bytes.rst:129
248+
#: ../../c-api/bytes.rst:127
249+
msgid ""
250+
"If the object implements the buffer protocol, then the buffer must not be "
251+
"mutated while the bytes object is being created."
252+
msgstr ""
253+
254+
#: ../../c-api/bytes.rst:133
249255
msgid "Return the length of the bytes in bytes object *o*."
250256
msgstr ""
251257

252-
#: ../../c-api/bytes.rst:134
258+
#: ../../c-api/bytes.rst:138
253259
msgid "Similar to :c:func:`PyBytes_Size`, but without error checking."
254260
msgstr "和 :c:func:`PyBytes_Size` 類似,但不進行錯誤檢查。"
255261

256-
#: ../../c-api/bytes.rst:139
262+
#: ../../c-api/bytes.rst:143
257263
msgid ""
258264
"Return a pointer to the contents of *o*. The pointer refers to the internal "
259265
"buffer of *o*, which consists of ``len(o) + 1`` bytes. The last byte in the "
@@ -264,24 +270,24 @@ msgid ""
264270
"`PyBytes_AsString` returns ``NULL`` and raises :exc:`TypeError`."
265271
msgstr ""
266272

267-
#: ../../c-api/bytes.rst:151
273+
#: ../../c-api/bytes.rst:155
268274
msgid "Similar to :c:func:`PyBytes_AsString`, but without error checking."
269275
msgstr "和 :c:func:`PyBytes_AsString` 類似,但不進行錯誤檢查。"
270276

271-
#: ../../c-api/bytes.rst:156
277+
#: ../../c-api/bytes.rst:160
272278
msgid ""
273279
"Return the null-terminated contents of the object *obj* through the output "
274280
"variables *buffer* and *length*. Returns ``0`` on success."
275281
msgstr ""
276282

277-
#: ../../c-api/bytes.rst:160
283+
#: ../../c-api/bytes.rst:164
278284
msgid ""
279285
"If *length* is ``NULL``, the bytes object may not contain embedded null "
280286
"bytes; if it does, the function returns ``-1`` and a :exc:`ValueError` is "
281287
"raised."
282288
msgstr ""
283289

284-
#: ../../c-api/bytes.rst:164
290+
#: ../../c-api/bytes.rst:168
285291
msgid ""
286292
"The buffer refers to an internal buffer of *obj*, which includes an "
287293
"additional null byte at the end (not counted in *length*). The data must "
@@ -291,13 +297,13 @@ msgid ""
291297
"returns ``-1`` and raises :exc:`TypeError`."
292298
msgstr ""
293299

294-
#: ../../c-api/bytes.rst:171
300+
#: ../../c-api/bytes.rst:175
295301
msgid ""
296302
"Previously, :exc:`TypeError` was raised when embedded null bytes were "
297303
"encountered in the bytes object."
298304
msgstr ""
299305

300-
#: ../../c-api/bytes.rst:178
306+
#: ../../c-api/bytes.rst:182
301307
msgid ""
302308
"Create a new bytes object in *\\*bytes* containing the contents of *newpart* "
303309
"appended to *bytes*; the caller will own the new reference. The reference "
@@ -306,37 +312,49 @@ msgid ""
306312
"of *\\*bytes* will be set to ``NULL``; the appropriate exception will be set."
307313
msgstr ""
308314

309-
#: ../../c-api/bytes.rst:187
315+
#: ../../c-api/bytes.rst:189 ../../c-api/bytes.rst:199
316+
msgid ""
317+
"If *newpart* implements the buffer protocol, then the buffer must not be "
318+
"mutated while the new bytes object is being created."
319+
msgstr ""
320+
321+
#: ../../c-api/bytes.rst:194
310322
msgid ""
311323
"Create a new bytes object in *\\*bytes* containing the contents of *newpart* "
312324
"appended to *bytes*. This version releases the :term:`strong reference` to "
313325
"*newpart* (i.e. decrements its reference count)."
314326
msgstr ""
315327

316-
#: ../../c-api/bytes.rst:194
328+
#: ../../c-api/bytes.rst:205
317329
msgid "Similar to ``sep.join(iterable)`` in Python."
318330
msgstr "類似 Python 中的 ``sep.join(iterable)``。"
319331

320-
#: ../../c-api/bytes.rst:196
332+
#: ../../c-api/bytes.rst:207
321333
msgid ""
322334
"*sep* must be Python :class:`bytes` object. (Note that :c:func:"
323335
"`PyUnicode_Join` accepts ``NULL`` separator and treats it as a space, "
324336
"whereas :c:func:`PyBytes_Join` doesn't accept ``NULL`` separator.)"
325337
msgstr ""
326338

327-
#: ../../c-api/bytes.rst:201
339+
#: ../../c-api/bytes.rst:212
328340
msgid ""
329341
"*iterable* must be an iterable object yielding objects that implement the :"
330342
"ref:`buffer protocol <bufferobjects>`."
331343
msgstr ""
332344

333-
#: ../../c-api/bytes.rst:204
345+
#: ../../c-api/bytes.rst:215
334346
msgid ""
335347
"On success, return a new :class:`bytes` object. On error, set an exception "
336348
"and return ``NULL``."
337349
msgstr ""
338350

339-
#: ../../c-api/bytes.rst:212
351+
#: ../../c-api/bytes.rst:221
352+
msgid ""
353+
"If *iterable* objects implement the buffer protocol, then the buffers must "
354+
"not be mutated while the new bytes object is being created."
355+
msgstr ""
356+
357+
#: ../../c-api/bytes.rst:226
340358
msgid ""
341359
"Resize a bytes object. *newsize* will be the new length of the bytes object. "
342360
"You can think of it as creating a new bytes object and destroying the old "
@@ -348,19 +366,19 @@ msgid ""
348366
"``NULL``, :exc:`MemoryError` is set, and ``-1`` is returned."
349367
msgstr ""
350368

351-
#: ../../c-api/bytes.rst:226
369+
#: ../../c-api/bytes.rst:240
352370
msgid ""
353371
"Get the string representation of *bytes*. This function is currently used to "
354372
"implement :meth:`!bytes.__repr__` in Python."
355373
msgstr ""
356374

357-
#: ../../c-api/bytes.rst:229
375+
#: ../../c-api/bytes.rst:243
358376
msgid ""
359377
"This function does not do type checking; it is undefined behavior to pass "
360378
"*bytes* as a non-bytes object or ``NULL``."
361379
msgstr ""
362380

363-
#: ../../c-api/bytes.rst:232
381+
#: ../../c-api/bytes.rst:246
364382
msgid ""
365383
"If *smartquotes* is true, the representation will use a double-quoted string "
366384
"instead of single-quoted string when single-quotes are present in *bytes*. "
@@ -369,33 +387,33 @@ msgid ""
369387
"is false."
370388
msgstr ""
371389

372-
#: ../../c-api/bytes.rst:238
390+
#: ../../c-api/bytes.rst:252
373391
msgid ""
374392
"On success, this function returns a :term:`strong reference` to a :class:"
375393
"`str` object containing the representation. On failure, this returns "
376394
"``NULL`` with an exception set."
377395
msgstr ""
378396

379-
#: ../../c-api/bytes.rst:245
397+
#: ../../c-api/bytes.rst:259
380398
msgid ""
381399
"Unescape a backslash-escaped string *s*. *s* must not be ``NULL``. *len* "
382400
"must be the size of *s*."
383401
msgstr ""
384402

385-
#: ../../c-api/bytes.rst:248
403+
#: ../../c-api/bytes.rst:262
386404
msgid ""
387405
"*errors* must be one of ``\"strict\"``, ``\"replace\"``, or ``\"ignore\"``. "
388406
"If *errors* is ``NULL``, then ``\"strict\"`` is used by default."
389407
msgstr ""
390408

391-
#: ../../c-api/bytes.rst:251
409+
#: ../../c-api/bytes.rst:265
392410
msgid ""
393411
"On success, this function returns a :term:`strong reference` to a Python :"
394412
"class:`bytes` object containing the unescaped string. On failure, this "
395413
"function returns ``NULL`` with an exception set."
396414
msgstr ""
397415

398-
#: ../../c-api/bytes.rst:255
416+
#: ../../c-api/bytes.rst:269
399417
msgid "*unicode* and *recode_encoding* are now unused."
400418
msgstr ""
401419

0 commit comments

Comments
 (0)