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

Skip to content

Commit 0e52b88

Browse files
github-actions[bot]mattwang44
authored andcommitted
sync with cpython 45e55991
1 parent 24ed14d commit 0e52b88

File tree

3 files changed

+639
-606
lines changed

3 files changed

+639
-606
lines changed

c-api/gcsupport.po

Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: Python 3.12\n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2023-07-29 00:03+0000\n"
10+
"POT-Creation-Date: 2024-02-14 00:03+0000\n"
1111
"PO-Revision-Date: 2018-05-23 14:31+0000\n"
1212
"Last-Translator: Adrian Liaw <[email protected]>\n"
1313
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -139,12 +139,18 @@ msgstr ""
139139

140140
#: ../../c-api/gcsupport.rst:88
141141
msgid ""
142-
"Resize an object allocated by :c:macro:`PyObject_NewVar`. Returns the "
143-
"resized object or ``NULL`` on failure. *op* must not be tracked by the "
144-
"collector yet."
142+
"Resize an object allocated by :c:macro:`PyObject_NewVar`. Returns the "
143+
"resized object of type ``TYPE*`` (refers to any C type) or ``NULL`` on "
144+
"failure."
145145
msgstr ""
146146

147-
#: ../../c-api/gcsupport.rst:94
147+
#: ../../c-api/gcsupport.rst:92
148+
msgid ""
149+
"*op* must be of type :c:expr:`PyVarObject *` and must not be tracked by the "
150+
"collector yet. *newsize* must be of type :c:type:`Py_ssize_t`."
151+
msgstr ""
152+
153+
#: ../../c-api/gcsupport.rst:99
148154
msgid ""
149155
"Adds the object *op* to the set of container objects tracked by the "
150156
"collector. The collector can run at unexpected times so objects must be "
@@ -153,45 +159,45 @@ msgid ""
153159
"usually near the end of the constructor."
154160
msgstr ""
155161

156-
#: ../../c-api/gcsupport.rst:103
162+
#: ../../c-api/gcsupport.rst:108
157163
msgid ""
158164
"Returns non-zero if the object implements the garbage collector protocol, "
159165
"otherwise returns 0."
160166
msgstr ""
161167

162-
#: ../../c-api/gcsupport.rst:106
168+
#: ../../c-api/gcsupport.rst:111
163169
msgid ""
164170
"The object cannot be tracked by the garbage collector if this function "
165171
"returns 0."
166172
msgstr ""
167173

168-
#: ../../c-api/gcsupport.rst:111
174+
#: ../../c-api/gcsupport.rst:116
169175
msgid ""
170176
"Returns 1 if the object type of *op* implements the GC protocol and *op* is "
171177
"being currently tracked by the garbage collector and 0 otherwise."
172178
msgstr ""
173179

174-
#: ../../c-api/gcsupport.rst:114
180+
#: ../../c-api/gcsupport.rst:119
175181
msgid "This is analogous to the Python function :func:`gc.is_tracked`."
176182
msgstr ""
177183

178-
#: ../../c-api/gcsupport.rst:121
184+
#: ../../c-api/gcsupport.rst:126
179185
msgid ""
180186
"Returns 1 if the object type of *op* implements the GC protocol and *op* has "
181187
"been already finalized by the garbage collector and 0 otherwise."
182188
msgstr ""
183189

184-
#: ../../c-api/gcsupport.rst:124
190+
#: ../../c-api/gcsupport.rst:129
185191
msgid "This is analogous to the Python function :func:`gc.is_finalized`."
186192
msgstr ""
187193

188-
#: ../../c-api/gcsupport.rst:131
194+
#: ../../c-api/gcsupport.rst:136
189195
msgid ""
190196
"Releases memory allocated to an object using :c:macro:`PyObject_GC_New` or :"
191197
"c:macro:`PyObject_GC_NewVar`."
192198
msgstr ""
193199

194-
#: ../../c-api/gcsupport.rst:137
200+
#: ../../c-api/gcsupport.rst:142
195201
msgid ""
196202
"Remove the object *op* from the set of container objects tracked by the "
197203
"collector. Note that :c:func:`PyObject_GC_Track` can be called again on "
@@ -201,19 +207,19 @@ msgid ""
201207
"handler become invalid."
202208
msgstr ""
203209

204-
#: ../../c-api/gcsupport.rst:146
210+
#: ../../c-api/gcsupport.rst:151
205211
msgid ""
206212
"The :c:func:`!_PyObject_GC_TRACK` and :c:func:`!_PyObject_GC_UNTRACK` macros "
207213
"have been removed from the public C API."
208214
msgstr ""
209215

210-
#: ../../c-api/gcsupport.rst:149
216+
#: ../../c-api/gcsupport.rst:154
211217
msgid ""
212218
"The :c:member:`~PyTypeObject.tp_traverse` handler accepts a function "
213219
"parameter of this type:"
214220
msgstr ""
215221

216-
#: ../../c-api/gcsupport.rst:154
222+
#: ../../c-api/gcsupport.rst:159
217223
msgid ""
218224
"Type of the visitor function passed to the :c:member:`~PyTypeObject."
219225
"tp_traverse` handler. The function should be called with an object to "
@@ -223,13 +229,13 @@ msgid ""
223229
"users will need to write their own visitor functions."
224230
msgstr ""
225231

226-
#: ../../c-api/gcsupport.rst:161
232+
#: ../../c-api/gcsupport.rst:166
227233
msgid ""
228234
"The :c:member:`~PyTypeObject.tp_traverse` handler must have the following "
229235
"type:"
230236
msgstr ""
231237

232-
#: ../../c-api/gcsupport.rst:166
238+
#: ../../c-api/gcsupport.rst:171
233239
msgid ""
234240
"Traversal function for a container object. Implementations must call the "
235241
"*visit* function for each object directly contained by *self*, with the "
@@ -239,28 +245,28 @@ msgid ""
239245
"returned immediately."
240246
msgstr ""
241247

242-
#: ../../c-api/gcsupport.rst:173
248+
#: ../../c-api/gcsupport.rst:178
243249
msgid ""
244250
"To simplify writing :c:member:`~PyTypeObject.tp_traverse` handlers, a :c:"
245251
"func:`Py_VISIT` macro is provided. In order to use this macro, the :c:"
246252
"member:`~PyTypeObject.tp_traverse` implementation must name its arguments "
247253
"exactly *visit* and *arg*:"
248254
msgstr ""
249255

250-
#: ../../c-api/gcsupport.rst:180
256+
#: ../../c-api/gcsupport.rst:185
251257
msgid ""
252258
"If *o* is not ``NULL``, call the *visit* callback, with arguments *o* and "
253259
"*arg*. If *visit* returns a non-zero value, then return it. Using this "
254260
"macro, :c:member:`~PyTypeObject.tp_traverse` handlers look like::"
255261
msgstr ""
256262

257-
#: ../../c-api/gcsupport.rst:193
263+
#: ../../c-api/gcsupport.rst:198
258264
msgid ""
259265
"The :c:member:`~PyTypeObject.tp_clear` handler must be of the :c:type:"
260266
"`inquiry` type, or ``NULL`` if the object is immutable."
261267
msgstr ""
262268

263-
#: ../../c-api/gcsupport.rst:199
269+
#: ../../c-api/gcsupport.rst:204
264270
msgid ""
265271
"Drop references that may have created reference cycles. Immutable objects "
266272
"do not have to define this method since they can never directly create "
@@ -270,78 +276,78 @@ msgid ""
270276
"in a reference cycle."
271277
msgstr ""
272278

273-
#: ../../c-api/gcsupport.rst:208
279+
#: ../../c-api/gcsupport.rst:213
274280
msgid "Controlling the Garbage Collector State"
275281
msgstr ""
276282

277-
#: ../../c-api/gcsupport.rst:210
283+
#: ../../c-api/gcsupport.rst:215
278284
msgid ""
279285
"The C-API provides the following functions for controlling garbage "
280286
"collection runs."
281287
msgstr ""
282288

283-
#: ../../c-api/gcsupport.rst:215
289+
#: ../../c-api/gcsupport.rst:220
284290
msgid ""
285291
"Perform a full garbage collection, if the garbage collector is enabled. "
286292
"(Note that :func:`gc.collect` runs it unconditionally.)"
287293
msgstr ""
288294

289-
#: ../../c-api/gcsupport.rst:218
295+
#: ../../c-api/gcsupport.rst:223
290296
msgid ""
291297
"Returns the number of collected + unreachable objects which cannot be "
292298
"collected. If the garbage collector is disabled or already collecting, "
293299
"returns ``0`` immediately. Errors during garbage collection are passed to :"
294300
"data:`sys.unraisablehook`. This function does not raise exceptions."
295301
msgstr ""
296302

297-
#: ../../c-api/gcsupport.rst:228
303+
#: ../../c-api/gcsupport.rst:233
298304
msgid ""
299305
"Enable the garbage collector: similar to :func:`gc.enable`. Returns the "
300306
"previous state, 0 for disabled and 1 for enabled."
301307
msgstr ""
302308

303-
#: ../../c-api/gcsupport.rst:236
309+
#: ../../c-api/gcsupport.rst:241
304310
msgid ""
305311
"Disable the garbage collector: similar to :func:`gc.disable`. Returns the "
306312
"previous state, 0 for disabled and 1 for enabled."
307313
msgstr ""
308314

309-
#: ../../c-api/gcsupport.rst:244
315+
#: ../../c-api/gcsupport.rst:249
310316
msgid ""
311317
"Query the state of the garbage collector: similar to :func:`gc.isenabled`. "
312318
"Returns the current state, 0 for disabled and 1 for enabled."
313319
msgstr ""
314320

315-
#: ../../c-api/gcsupport.rst:251
321+
#: ../../c-api/gcsupport.rst:256
316322
msgid "Querying Garbage Collector State"
317323
msgstr ""
318324

319-
#: ../../c-api/gcsupport.rst:253
325+
#: ../../c-api/gcsupport.rst:258
320326
msgid ""
321327
"The C-API provides the following interface for querying information about "
322328
"the garbage collector."
323329
msgstr ""
324330

325-
#: ../../c-api/gcsupport.rst:258
331+
#: ../../c-api/gcsupport.rst:263
326332
msgid ""
327333
"Run supplied *callback* on all live GC-capable objects. *arg* is passed "
328334
"through to all invocations of *callback*."
329335
msgstr ""
330336

331-
#: ../../c-api/gcsupport.rst:262
337+
#: ../../c-api/gcsupport.rst:267
332338
msgid ""
333339
"If new objects are (de)allocated by the callback it is undefined if they "
334340
"will be visited."
335341
msgstr ""
336342

337-
#: ../../c-api/gcsupport.rst:265
343+
#: ../../c-api/gcsupport.rst:270
338344
msgid ""
339345
"Garbage collection is disabled during operation. Explicitly running a "
340346
"collection in the callback may lead to undefined behaviour e.g. visiting the "
341347
"same objects multiple times or not at all."
342348
msgstr ""
343349

344-
#: ../../c-api/gcsupport.rst:273
350+
#: ../../c-api/gcsupport.rst:278
345351
msgid ""
346352
"Type of the visitor function to be passed to :c:func:"
347353
"`PyUnstable_GC_VisitObjects`. *arg* is the same as the *arg* passed to "

0 commit comments

Comments
 (0)