Skip to content

Commit 7878424

Browse files
sync with cpython d6375c3d
1 parent 0b04804 commit 7878424

4 files changed

Lines changed: 226 additions & 198 deletions

File tree

c-api/bytearray.po

Lines changed: 29 additions & 21 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-03-28 00:21+0000\n"
9+
"POT-Creation-Date: 2026-09-16 00:19+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-"
@@ -27,109 +27,117 @@ msgid ""
2727
"This subtype of :c:type:`PyObject` represents a Python bytearray object."
2828
msgstr "這個 :c:type:`PyObject` 的子型別代表了 Python 的位元組陣列物件。"
2929

30-
#: ../../c-api/bytearray.rst:18
30+
#: ../../c-api/bytearray.rst:17
31+
msgid ""
32+
"The internal buffer of :c:type:`PyByteArrayObject` always includes an extra "
33+
"trailing null byte for compatibility with null terminated C strings. This "
34+
"extra byte is not counted in :c:func:`PyByteArray_Size` nor in the *len* "
35+
"arguments of the functions below."
36+
msgstr ""
37+
38+
#: ../../c-api/bytearray.rst:24
3139
msgid ""
3240
"This instance of :c:type:`PyTypeObject` represents the Python bytearray "
3341
"type; it is the same object as :class:`bytearray` in the Python layer."
3442
msgstr ""
3543
"這個 :c:type:`PyTypeObject` 的實例代表了 Python 的位元組陣列型別;在 Python "
3644
"層中的 :class:`bytearray` 為同一個物件。"
3745

38-
#: ../../c-api/bytearray.rst:23
46+
#: ../../c-api/bytearray.rst:29
3947
msgid "Type check macros"
4048
msgstr "型別檢查巨集"
4149

42-
#: ../../c-api/bytearray.rst:27
50+
#: ../../c-api/bytearray.rst:33
4351
msgid ""
4452
"Return true if the object *o* is a bytearray object or an instance of a "
4553
"subtype of the bytearray type. This function always succeeds."
4654
msgstr ""
4755
"如果物件 *o* 是一個位元組陣列物件,或者是位元組陣列型別的子型別的實例,則回傳"
4856
"真值。此函式總是會成功執行。"
4957

50-
#: ../../c-api/bytearray.rst:33
58+
#: ../../c-api/bytearray.rst:39
5159
msgid ""
5260
"Return true if the object *o* is a bytearray object, but not an instance of "
5361
"a subtype of the bytearray type. This function always succeeds."
5462
msgstr ""
5563
"如果物件 *o* 是一個位元組陣列物件,但不是位元組陣列型別的子型別的實例,則回傳"
5664
"真值。此函式總是會成功執行。"
5765

58-
#: ../../c-api/bytearray.rst:38
66+
#: ../../c-api/bytearray.rst:44
5967
msgid "Direct API functions"
6068
msgstr "直接 API 函式"
6169

62-
#: ../../c-api/bytearray.rst:42
70+
#: ../../c-api/bytearray.rst:48
6371
msgid ""
6472
"Return a new bytearray object from any object, *o*, that implements the :ref:"
6573
"`buffer protocol <bufferobjects>`."
6674
msgstr ""
6775
"由任意物件 *o* 回傳一個新的位元組陣列物件,並實作了\\ :ref:`緩衝協定 (buffer "
6876
"protocol) <bufferobjects>`。"
6977

70-
#: ../../c-api/bytearray.rst:45 ../../c-api/bytearray.rst:56
71-
#: ../../c-api/bytearray.rst:63
78+
#: ../../c-api/bytearray.rst:51 ../../c-api/bytearray.rst:62
79+
#: ../../c-api/bytearray.rst:69
7280
msgid "On failure, return ``NULL`` with an exception set."
7381
msgstr "在失敗時,會回傳 ``NULL`` 並設定例外。"
7482

75-
#: ../../c-api/bytearray.rst:48 ../../c-api/bytearray.rst:66
83+
#: ../../c-api/bytearray.rst:54 ../../c-api/bytearray.rst:72
7684
msgid ""
7785
"If the object implements the buffer protocol, then the buffer must not be "
7886
"mutated while the bytearray object is being created."
7987
msgstr ""
8088

81-
#: ../../c-api/bytearray.rst:54
89+
#: ../../c-api/bytearray.rst:60
8290
msgid "Create a new bytearray object from *string* and its length, *len*."
8391
msgstr "從 *string* 及其長度 *len* 建立一個新的位元組陣列物件。"
8492

85-
#: ../../c-api/bytearray.rst:61
93+
#: ../../c-api/bytearray.rst:67
8694
msgid ""
8795
"Concat bytearrays *a* and *b* and return a new bytearray with the result."
8896
msgstr "連接位元組陣列 *a* 和 *b*,並回傳一個包含結果的新位元組陣列。"
8997

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

94-
#: ../../c-api/bytearray.rst:77
102+
#: ../../c-api/bytearray.rst:83
95103
msgid ""
96104
"Return the contents of *bytearray* as a char array after checking for a "
97105
"``NULL`` pointer. The returned array always has an extra null byte appended."
98106
msgstr ""
99107
"在檢查是否為 ``NULL`` 指標後,將 *bytearray* 的內容回傳為字元陣列。回傳的陣列"
100108
"總是會多附加一個空位元組。"
101109

102-
#: ../../c-api/bytearray.rst:82 ../../c-api/bytearray.rst:104
110+
#: ../../c-api/bytearray.rst:88 ../../c-api/bytearray.rst:110
103111
msgid ""
104112
"It is not thread-safe to mutate the bytearray object while using the "
105113
"returned char array."
106114
msgstr ""
107115

108-
#: ../../c-api/bytearray.rst:87
116+
#: ../../c-api/bytearray.rst:93
109117
msgid ""
110118
"Resize the internal buffer of *bytearray* to *len*. Failure is a ``-1`` "
111119
"return with an exception set."
112120
msgstr ""
113121
"將 *bytearray* 的內部緩衝區大小調整為 *len*。失敗時會回傳 ``-1`` 並設定例外。"
114122

115-
#: ../../c-api/bytearray.rst:90
123+
#: ../../c-api/bytearray.rst:96
116124
msgid ""
117125
"A negative *len* will now result in an exception being set and -1 returned."
118126
msgstr "負的 *len* 現在會設定例外並回傳 -1。"
119127

120-
#: ../../c-api/bytearray.rst:95
128+
#: ../../c-api/bytearray.rst:101
121129
msgid "Macros"
122130
msgstr "巨集"
123131

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

128-
#: ../../c-api/bytearray.rst:101
136+
#: ../../c-api/bytearray.rst:107
129137
msgid "Similar to :c:func:`PyByteArray_AsString`, but without error checking."
130138
msgstr "與 :c:func:`PyByteArray_AsString` 類似,但沒有錯誤檢查。"
131139

132-
#: ../../c-api/bytearray.rst:109
140+
#: ../../c-api/bytearray.rst:115
133141
msgid "Similar to :c:func:`PyByteArray_Size`, but without error checking."
134142
msgstr "與 :c:func:`PyByteArray_Size` 類似,但沒有錯誤檢查。"
135143

0 commit comments

Comments
 (0)