Skip to content

Commit 6d38ced

Browse files
sync with cpython d2fced71
1 parent a208431 commit 6d38ced

File tree

3 files changed

+147
-637
lines changed

3 files changed

+147
-637
lines changed

c-api/code.po

Lines changed: 53 additions & 49 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: 2024-02-12 00:03+0000\n"
10+
"POT-Creation-Date: 2024-02-22 00:03+0000\n"
1111
"PO-Revision-Date: 2015-12-09 17:51+0000\n"
1212
"Last-Translator: Liang-Bo Wang <[email protected]>\n"
1313
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -48,170 +48,174 @@ msgid ""
4848
msgstr ""
4949

5050
#: ../../c-api/code.rst:35
51-
msgid "Return the number of free variables in *co*."
51+
msgid "Return the number of free variables in a code object."
5252
msgstr ""
5353

5454
#: ../../c-api/code.rst:39
55+
msgid "Return the position of the first free variable in a code object."
56+
msgstr ""
57+
58+
#: ../../c-api/code.rst:43
5559
msgid ""
5660
"Return a new code object. If you need a dummy code object to create a "
5761
"frame, use :c:func:`PyCode_NewEmpty` instead."
5862
msgstr ""
5963

60-
#: ../../c-api/code.rst:42
64+
#: ../../c-api/code.rst:46
6165
msgid ""
6266
"Since the definition of the bytecode changes often, calling :c:func:"
6367
"`PyUnstable_Code_New` directly can bind you to a precise Python version."
6468
msgstr ""
6569

66-
#: ../../c-api/code.rst:45
70+
#: ../../c-api/code.rst:49
6771
msgid ""
6872
"The many arguments of this function are inter-dependent in complex ways, "
6973
"meaning that subtle changes to values are likely to result in incorrect "
7074
"execution or VM crashes. Use this function only with extreme care."
7175
msgstr ""
7276

73-
#: ../../c-api/code.rst:49
77+
#: ../../c-api/code.rst:53
7478
msgid "Added ``qualname`` and ``exceptiontable`` parameters."
7579
msgstr "新增 ``qualname`` 和 ``exceptiontable`` 參數。"
7680

77-
#: ../../c-api/code.rst:56
81+
#: ../../c-api/code.rst:60
7882
msgid ""
7983
"Renamed from ``PyCode_New`` as part of :ref:`unstable-c-api`. The old name "
8084
"is deprecated, but will remain available until the signature changes again."
8185
msgstr ""
8286

83-
#: ../../c-api/code.rst:62
87+
#: ../../c-api/code.rst:66
8488
msgid ""
8589
"Similar to :c:func:`PyUnstable_Code_New`, but with an extra "
8690
"\"posonlyargcount\" for positional-only arguments. The same caveats that "
8791
"apply to ``PyUnstable_Code_New`` also apply to this function."
8892
msgstr ""
8993

90-
#: ../../c-api/code.rst:67
94+
#: ../../c-api/code.rst:71
9195
msgid "as ``PyCode_NewWithPosOnlyArgs``"
9296
msgstr ""
9397

94-
#: ../../c-api/code.rst:69
98+
#: ../../c-api/code.rst:73
9599
msgid "Added ``qualname`` and ``exceptiontable`` parameters."
96100
msgstr "新增 ``qualname`` 和 ``exceptiontable`` 參數。"
97101

98-
#: ../../c-api/code.rst:74
102+
#: ../../c-api/code.rst:78
99103
msgid ""
100104
"Renamed to ``PyUnstable_Code_NewWithPosOnlyArgs``. The old name is "
101105
"deprecated, but will remain available until the signature changes again."
102106
msgstr ""
103107

104-
#: ../../c-api/code.rst:80
108+
#: ../../c-api/code.rst:84
105109
msgid ""
106110
"Return a new empty code object with the specified filename, function name, "
107111
"and first line number. The resulting code object will raise an ``Exception`` "
108112
"if executed."
109113
msgstr ""
110114

111-
#: ../../c-api/code.rst:86
115+
#: ../../c-api/code.rst:90
112116
msgid ""
113117
"Return the line number of the instruction that occurs on or before "
114118
"``byte_offset`` and ends after it. If you just need the line number of a "
115119
"frame, use :c:func:`PyFrame_GetLineNumber` instead."
116120
msgstr ""
117121

118-
#: ../../c-api/code.rst:89
122+
#: ../../c-api/code.rst:93
119123
msgid ""
120124
"For efficiently iterating over the line numbers in a code object, use `the "
121125
"API described in PEP 626 <https://peps.python.org/pep-0626/#out-of-process-"
122126
"debuggers-and-profilers>`_."
123127
msgstr ""
124128

125-
#: ../../c-api/code.rst:94
129+
#: ../../c-api/code.rst:98
126130
msgid ""
127131
"Sets the passed ``int`` pointers to the source code line and column numbers "
128132
"for the instruction at ``byte_offset``. Sets the value to ``0`` when "
129133
"information is not available for any particular element."
130134
msgstr ""
131135

132-
#: ../../c-api/code.rst:98
136+
#: ../../c-api/code.rst:102
133137
msgid "Returns ``1`` if the function succeeds and 0 otherwise."
134138
msgstr ""
135139

136-
#: ../../c-api/code.rst:104
140+
#: ../../c-api/code.rst:108
137141
msgid ""
138142
"Equivalent to the Python code ``getattr(co, 'co_code')``. Returns a strong "
139143
"reference to a :c:type:`PyBytesObject` representing the bytecode in a code "
140144
"object. On error, ``NULL`` is returned and an exception is raised."
141145
msgstr ""
142146

143-
#: ../../c-api/code.rst:109
147+
#: ../../c-api/code.rst:113
144148
msgid ""
145149
"This ``PyBytesObject`` may be created on-demand by the interpreter and does "
146150
"not necessarily represent the bytecode actually executed by CPython. The "
147151
"primary use case for this function is debuggers and profilers."
148152
msgstr ""
149153

150-
#: ../../c-api/code.rst:117
154+
#: ../../c-api/code.rst:121
151155
msgid ""
152156
"Equivalent to the Python code ``getattr(co, 'co_varnames')``. Returns a new "
153157
"reference to a :c:type:`PyTupleObject` containing the names of the local "
154158
"variables. On error, ``NULL`` is returned and an exception is raised."
155159
msgstr ""
156160

157-
#: ../../c-api/code.rst:126
161+
#: ../../c-api/code.rst:130
158162
msgid ""
159163
"Equivalent to the Python code ``getattr(co, 'co_cellvars')``. Returns a new "
160164
"reference to a :c:type:`PyTupleObject` containing the names of the local "
161165
"variables that are referenced by nested functions. On error, ``NULL`` is "
162166
"returned and an exception is raised."
163167
msgstr ""
164168

165-
#: ../../c-api/code.rst:135
169+
#: ../../c-api/code.rst:139
166170
msgid ""
167171
"Equivalent to the Python code ``getattr(co, 'co_freevars')``. Returns a new "
168172
"reference to a :c:type:`PyTupleObject` containing the names of the free "
169173
"variables. On error, ``NULL`` is returned and an exception is raised."
170174
msgstr ""
171175

172-
#: ../../c-api/code.rst:143
176+
#: ../../c-api/code.rst:147
173177
msgid ""
174178
"Register *callback* as a code object watcher for the current interpreter. "
175179
"Return an ID which may be passed to :c:func:`PyCode_ClearWatcher`. In case "
176180
"of error (e.g. no more watcher IDs available), return ``-1`` and set an "
177181
"exception."
178182
msgstr ""
179183

180-
#: ../../c-api/code.rst:152
184+
#: ../../c-api/code.rst:156
181185
msgid ""
182186
"Clear watcher identified by *watcher_id* previously returned from :c:func:"
183187
"`PyCode_AddWatcher` for the current interpreter. Return ``0`` on success, or "
184188
"``-1`` and set an exception on error (e.g. if the given *watcher_id* was "
185189
"never registered.)"
186190
msgstr ""
187191

188-
#: ../../c-api/code.rst:161
192+
#: ../../c-api/code.rst:165
189193
msgid ""
190194
"Enumeration of possible code object watcher events: - "
191195
"``PY_CODE_EVENT_CREATE`` - ``PY_CODE_EVENT_DESTROY``"
192196
msgstr ""
193197

194-
#: ../../c-api/code.rst:169
198+
#: ../../c-api/code.rst:173
195199
msgid "Type of a code object watcher callback function."
196200
msgstr ""
197201

198-
#: ../../c-api/code.rst:171
202+
#: ../../c-api/code.rst:175
199203
msgid ""
200204
"If *event* is ``PY_CODE_EVENT_CREATE``, then the callback is invoked after "
201205
"`co` has been fully initialized. Otherwise, the callback is invoked before "
202206
"the destruction of *co* takes place, so the prior state of *co* can be "
203207
"inspected."
204208
msgstr ""
205209

206-
#: ../../c-api/code.rst:176
210+
#: ../../c-api/code.rst:180
207211
msgid ""
208212
"If *event* is ``PY_CODE_EVENT_DESTROY``, taking a reference in the callback "
209213
"to the about-to-be-destroyed code object will resurrect it and prevent it "
210214
"from being freed at this time. When the resurrected object is destroyed "
211215
"later, any watcher callbacks active at that time will be called again."
212216
msgstr ""
213217

214-
#: ../../c-api/code.rst:181
218+
#: ../../c-api/code.rst:185
215219
msgid ""
216220
"Users of this API should not rely on internal runtime implementation "
217221
"details. Such details may include, but are not limited to, the exact order "
@@ -221,14 +225,14 @@ msgid ""
221225
"the Python code being executed."
222226
msgstr ""
223227

224-
#: ../../c-api/code.rst:188
228+
#: ../../c-api/code.rst:192
225229
msgid ""
226230
"If the callback sets an exception, it must return ``-1``; this exception "
227231
"will be printed as an unraisable exception using :c:func:"
228232
"`PyErr_WriteUnraisable`. Otherwise it should return ``0``."
229233
msgstr ""
230234

231-
#: ../../c-api/code.rst:192
235+
#: ../../c-api/code.rst:196
232236
msgid ""
233237
"There may already be a pending exception set on entry to the callback. In "
234238
"this case, the callback should return ``0`` with the same exception still "
@@ -237,85 +241,85 @@ msgid ""
237241
"it before returning."
238242
msgstr ""
239243

240-
#: ../../c-api/code.rst:202
244+
#: ../../c-api/code.rst:206
241245
msgid "Extra information"
242246
msgstr ""
243247

244-
#: ../../c-api/code.rst:204
248+
#: ../../c-api/code.rst:208
245249
msgid ""
246250
"To support low-level extensions to frame evaluation, such as external just-"
247251
"in-time compilers, it is possible to attach arbitrary extra data to code "
248252
"objects."
249253
msgstr ""
250254

251-
#: ../../c-api/code.rst:208
255+
#: ../../c-api/code.rst:212
252256
msgid ""
253257
"These functions are part of the unstable C API tier: this functionality is a "
254258
"CPython implementation detail, and the API may change without deprecation "
255259
"warnings."
256260
msgstr ""
257261

258-
#: ../../c-api/code.rst:214
262+
#: ../../c-api/code.rst:218
259263
msgid "Return a new an opaque index value used to adding data to code objects."
260264
msgstr ""
261265

262-
#: ../../c-api/code.rst:216
266+
#: ../../c-api/code.rst:220
263267
msgid ""
264268
"You generally call this function once (per interpreter) and use the result "
265269
"with ``PyCode_GetExtra`` and ``PyCode_SetExtra`` to manipulate data on "
266270
"individual code objects."
267271
msgstr ""
268272

269-
#: ../../c-api/code.rst:220
273+
#: ../../c-api/code.rst:224
270274
msgid ""
271275
"If *free* is not ``NULL``: when a code object is deallocated, *free* will be "
272276
"called on non-``NULL`` data stored under the new index. Use :c:func:"
273277
"`Py_DecRef` when storing :c:type:`PyObject`."
274278
msgstr ""
275279

276-
#: ../../c-api/code.rst:226
280+
#: ../../c-api/code.rst:230
277281
msgid "as ``_PyEval_RequestCodeExtraIndex``"
278282
msgstr ""
279283

280-
#: ../../c-api/code.rst:230
284+
#: ../../c-api/code.rst:234
281285
msgid ""
282286
"Renamed to ``PyUnstable_Eval_RequestCodeExtraIndex``. The old private name "
283287
"is deprecated, but will be available until the API changes."
284288
msgstr ""
285289

286-
#: ../../c-api/code.rst:236
290+
#: ../../c-api/code.rst:240
287291
msgid ""
288292
"Set *extra* to the extra data stored under the given index. Return 0 on "
289293
"success. Set an exception and return -1 on failure."
290294
msgstr ""
291295

292-
#: ../../c-api/code.rst:239
296+
#: ../../c-api/code.rst:243
293297
msgid ""
294298
"If no data was set under the index, set *extra* to ``NULL`` and return 0 "
295299
"without setting an exception."
296300
msgstr ""
297301

298-
#: ../../c-api/code.rst:244
302+
#: ../../c-api/code.rst:248
299303
msgid "as ``_PyCode_GetExtra``"
300304
msgstr ""
301305

302-
#: ../../c-api/code.rst:248
306+
#: ../../c-api/code.rst:252
303307
msgid ""
304308
"Renamed to ``PyUnstable_Code_GetExtra``. The old private name is deprecated, "
305309
"but will be available until the API changes."
306310
msgstr ""
307311

308-
#: ../../c-api/code.rst:254
312+
#: ../../c-api/code.rst:258
309313
msgid ""
310314
"Set the extra data stored under the given index to *extra*. Return 0 on "
311315
"success. Set an exception and return -1 on failure."
312316
msgstr ""
313317

314-
#: ../../c-api/code.rst:259
318+
#: ../../c-api/code.rst:263
315319
msgid "as ``_PyCode_SetExtra``"
316320
msgstr ""
317321

318-
#: ../../c-api/code.rst:263
322+
#: ../../c-api/code.rst:267
319323
msgid ""
320324
"Renamed to ``PyUnstable_Code_SetExtra``. The old private name is deprecated, "
321325
"but will be available until the API changes."
@@ -333,27 +337,27 @@ msgstr "code(程式碼)"
333337
msgid "code object"
334338
msgstr "code object(程式碼物件)"
335339

336-
#: ../../c-api/code.rst:52
340+
#: ../../c-api/code.rst:56
337341
#, fuzzy
338342
msgid "PyCode_New (C function)"
339343
msgstr "PyCode_New"
340344

341-
#: ../../c-api/code.rst:65
345+
#: ../../c-api/code.rst:69
342346
#, fuzzy
343347
msgid "PyCode_NewWithPosOnlyArgs (C function)"
344348
msgstr "PyCode_NewWithPosOnlyArgs"
345349

346-
#: ../../c-api/code.rst:224
350+
#: ../../c-api/code.rst:228
347351
#, fuzzy
348352
msgid "_PyEval_RequestCodeExtraIndex (C function)"
349353
msgstr "_PyEval_RequestCodeExtraIndex"
350354

351-
#: ../../c-api/code.rst:242
355+
#: ../../c-api/code.rst:246
352356
#, fuzzy
353357
msgid "_PyCode_GetExtra (C function)"
354358
msgstr "_PyCode_GetExtra"
355359

356-
#: ../../c-api/code.rst:257
360+
#: ../../c-api/code.rst:261
357361
#, fuzzy
358362
msgid "_PyCode_SetExtra (C function)"
359363
msgstr "_PyCode_SetExtra"

0 commit comments

Comments
 (0)