Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a59adde

Browse files
github-actions[bot]mattwang44
authored andcommitted
sync with cpython 23192aba
1 parent ff2e2be commit a59adde

File tree

7 files changed

+550
-535
lines changed

7 files changed

+550
-535
lines changed

c-api/tuple.po

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: Python 3.12\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2023-07-28 00:03+0000\n"
11+
"POT-Creation-Date: 2024-04-20 00:03+0000\n"
1212
"PO-Revision-Date: 2017-09-22 18:26+0000\n"
1313
"Last-Translator: Leon H.\n"
1414
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -74,44 +74,52 @@ msgid ""
7474
"`IndexError` exception."
7575
msgstr ""
7676

77-
#: ../../c-api/tuple.rst:65
77+
#: ../../c-api/tuple.rst:62
78+
msgid ""
79+
"The returned reference is borrowed from the tuple *p* (that is: it is only "
80+
"valid as long as you hold a reference to *p*). To get a :term:`strong "
81+
"reference`, use :c:func:`Py_NewRef(PyTuple_GetItem(...)) <Py_NewRef>` or :c:"
82+
"func:`PySequence_GetItem`."
83+
msgstr ""
84+
85+
#: ../../c-api/tuple.rst:71
7886
msgid "Like :c:func:`PyTuple_GetItem`, but does no checking of its arguments."
7987
msgstr ""
8088

81-
#: ../../c-api/tuple.rst:70
89+
#: ../../c-api/tuple.rst:76
8290
msgid ""
8391
"Return the slice of the tuple pointed to by *p* between *low* and *high*, or "
8492
"``NULL`` on failure. This is the equivalent of the Python expression "
8593
"``p[low:high]``. Indexing from the end of the tuple is not supported."
8694
msgstr ""
8795

88-
#: ../../c-api/tuple.rst:77
96+
#: ../../c-api/tuple.rst:83
8997
msgid ""
9098
"Insert a reference to object *o* at position *pos* of the tuple pointed to "
9199
"by *p*. Return ``0`` on success. If *pos* is out of bounds, return ``-1`` "
92100
"and set an :exc:`IndexError` exception."
93101
msgstr ""
94102

95-
#: ../../c-api/tuple.rst:83
103+
#: ../../c-api/tuple.rst:89
96104
msgid ""
97105
"This function \"steals\" a reference to *o* and discards a reference to an "
98106
"item already in the tuple at the affected position."
99107
msgstr ""
100108

101-
#: ../../c-api/tuple.rst:89
109+
#: ../../c-api/tuple.rst:95
102110
msgid ""
103111
"Like :c:func:`PyTuple_SetItem`, but does no error checking, and should "
104112
"*only* be used to fill in brand new tuples."
105113
msgstr ""
106114

107-
#: ../../c-api/tuple.rst:94
115+
#: ../../c-api/tuple.rst:100
108116
msgid ""
109117
"This function \"steals\" a reference to *o*, and, unlike :c:func:"
110118
"`PyTuple_SetItem`, does *not* discard a reference to any item that is being "
111119
"replaced; any reference in the tuple at position *pos* will be leaked."
112120
msgstr ""
113121

114-
#: ../../c-api/tuple.rst:102
122+
#: ../../c-api/tuple.rst:108
115123
msgid ""
116124
"Can be used to resize a tuple. *newsize* will be the new length of the "
117125
"tuple. Because tuples are *supposed* to be immutable, this should only be "
@@ -126,56 +134,56 @@ msgid ""
126134
"`SystemError`."
127135
msgstr ""
128136

129-
#: ../../c-api/tuple.rst:117
137+
#: ../../c-api/tuple.rst:123
130138
msgid "Struct Sequence Objects"
131139
msgstr ""
132140

133-
#: ../../c-api/tuple.rst:119
141+
#: ../../c-api/tuple.rst:125
134142
msgid ""
135143
"Struct sequence objects are the C equivalent of :func:`~collections."
136144
"namedtuple` objects, i.e. a sequence whose items can also be accessed "
137145
"through attributes. To create a struct sequence, you first have to create a "
138146
"specific struct sequence type."
139147
msgstr ""
140148

141-
#: ../../c-api/tuple.rst:126
149+
#: ../../c-api/tuple.rst:132
142150
msgid ""
143151
"Create a new struct sequence type from the data in *desc*, described below. "
144152
"Instances of the resulting type can be created with :c:func:"
145153
"`PyStructSequence_New`."
146154
msgstr ""
147155

148-
#: ../../c-api/tuple.rst:132
156+
#: ../../c-api/tuple.rst:138
149157
msgid "Initializes a struct sequence type *type* from *desc* in place."
150158
msgstr ""
151159

152-
#: ../../c-api/tuple.rst:137
160+
#: ../../c-api/tuple.rst:143
153161
msgid ""
154162
"The same as ``PyStructSequence_InitType``, but returns ``0`` on success and "
155163
"``-1`` on failure."
156164
msgstr ""
157165

158-
#: ../../c-api/tuple.rst:145
166+
#: ../../c-api/tuple.rst:151
159167
msgid "Contains the meta information of a struct sequence type to create."
160168
msgstr ""
161169

162-
#: ../../c-api/tuple.rst:149
170+
#: ../../c-api/tuple.rst:155
163171
msgid "Name of the struct sequence type."
164172
msgstr ""
165173

166-
#: ../../c-api/tuple.rst:153
174+
#: ../../c-api/tuple.rst:159
167175
msgid "Pointer to docstring for the type or ``NULL`` to omit."
168176
msgstr ""
169177

170-
#: ../../c-api/tuple.rst:157
178+
#: ../../c-api/tuple.rst:163
171179
msgid "Pointer to ``NULL``-terminated array with field names of the new type."
172180
msgstr ""
173181

174-
#: ../../c-api/tuple.rst:161
182+
#: ../../c-api/tuple.rst:167
175183
msgid "Number of fields visible to the Python side (if used as tuple)."
176184
msgstr ""
177185

178-
#: ../../c-api/tuple.rst:166
186+
#: ../../c-api/tuple.rst:172
179187
msgid ""
180188
"Describes a field of a struct sequence. As a struct sequence is modeled as a "
181189
"tuple, all fields are typed as :c:expr:`PyObject*`. The index in the :c:"
@@ -184,52 +192,52 @@ msgid ""
184192
"described."
185193
msgstr ""
186194

187-
#: ../../c-api/tuple.rst:174
195+
#: ../../c-api/tuple.rst:180
188196
msgid ""
189197
"Name for the field or ``NULL`` to end the list of named fields, set to :c:"
190198
"data:`PyStructSequence_UnnamedField` to leave unnamed."
191199
msgstr ""
192200

193-
#: ../../c-api/tuple.rst:179
201+
#: ../../c-api/tuple.rst:185
194202
msgid "Field docstring or ``NULL`` to omit."
195203
msgstr ""
196204

197-
#: ../../c-api/tuple.rst:184
205+
#: ../../c-api/tuple.rst:190
198206
msgid "Special value for a field name to leave it unnamed."
199207
msgstr ""
200208

201-
#: ../../c-api/tuple.rst:186
209+
#: ../../c-api/tuple.rst:192
202210
msgid "The type was changed from ``char *``."
203211
msgstr ""
204212

205-
#: ../../c-api/tuple.rst:192
213+
#: ../../c-api/tuple.rst:198
206214
msgid ""
207215
"Creates an instance of *type*, which must have been created with :c:func:"
208216
"`PyStructSequence_NewType`."
209217
msgstr ""
210218

211-
#: ../../c-api/tuple.rst:198
219+
#: ../../c-api/tuple.rst:204
212220
msgid ""
213221
"Return the object at position *pos* in the struct sequence pointed to by "
214222
"*p*. No bounds checking is performed."
215223
msgstr ""
216224

217-
#: ../../c-api/tuple.rst:204
225+
#: ../../c-api/tuple.rst:210
218226
msgid "Macro equivalent of :c:func:`PyStructSequence_GetItem`."
219227
msgstr ""
220228

221-
#: ../../c-api/tuple.rst:209
229+
#: ../../c-api/tuple.rst:215
222230
msgid ""
223231
"Sets the field at index *pos* of the struct sequence *p* to value *o*. "
224232
"Like :c:func:`PyTuple_SET_ITEM`, this should only be used to fill in brand "
225233
"new instances."
226234
msgstr ""
227235

228-
#: ../../c-api/tuple.rst:215 ../../c-api/tuple.rst:225
236+
#: ../../c-api/tuple.rst:221 ../../c-api/tuple.rst:231
229237
msgid "This function \"steals\" a reference to *o*."
230238
msgstr ""
231239

232-
#: ../../c-api/tuple.rst:220
240+
#: ../../c-api/tuple.rst:226
233241
msgid ""
234242
"Similar to :c:func:`PyStructSequence_SetItem`, but implemented as a static "
235243
"inlined function."

0 commit comments

Comments
 (0)