Skip to content

Commit c08a2fc

Browse files
Sync with CPython 3.13 (#984)
1 parent b92df3c commit c08a2fc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+9086
-8994
lines changed

Diff for: .scripts/poetry.lock

+131-97
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: c-api/code.po

+60-55
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: Python 3.13\n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2024-09-24 07:20+0000\n"
10+
"POT-Creation-Date: 2024-10-09 00:13+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,180 +48,185 @@ msgid ""
4848
msgstr ""
4949

5050
#: ../../c-api/code.rst:35
51-
msgid "Return the number of free variables in a code object."
51+
msgid ""
52+
"Return the number of :term:`free (closure) variables <closure variable>` in "
53+
"a code object."
5254
msgstr ""
5355

54-
#: ../../c-api/code.rst:39
55-
msgid "Return the position of the first free variable in a code object."
56+
#: ../../c-api/code.rst:40
57+
msgid ""
58+
"Return the position of the first :term:`free (closure) variable <closure "
59+
"variable>` in a code object."
5660
msgstr ""
5761

58-
#: ../../c-api/code.rst:43
62+
#: ../../c-api/code.rst:45
5963
msgid ""
6064
"Renamed from ``PyCode_GetFirstFree`` as part of :ref:`unstable-c-api`. The "
6165
"old name is deprecated, but will remain available until the signature "
6266
"changes again."
6367
msgstr ""
6468

65-
#: ../../c-api/code.rst:49
69+
#: ../../c-api/code.rst:51
6670
msgid ""
6771
"Return a new code object. If you need a dummy code object to create a "
6872
"frame, use :c:func:`PyCode_NewEmpty` instead."
6973
msgstr ""
7074

71-
#: ../../c-api/code.rst:52
75+
#: ../../c-api/code.rst:54
7276
msgid ""
7377
"Since the definition of the bytecode changes often, calling :c:func:"
7478
"`PyUnstable_Code_New` directly can bind you to a precise Python version."
7579
msgstr ""
7680

77-
#: ../../c-api/code.rst:55
81+
#: ../../c-api/code.rst:57
7882
msgid ""
7983
"The many arguments of this function are inter-dependent in complex ways, "
8084
"meaning that subtle changes to values are likely to result in incorrect "
8185
"execution or VM crashes. Use this function only with extreme care."
8286
msgstr ""
8387

84-
#: ../../c-api/code.rst:59
88+
#: ../../c-api/code.rst:61
8589
msgid "Added ``qualname`` and ``exceptiontable`` parameters."
8690
msgstr "新增 ``qualname`` 和 ``exceptiontable`` 參數。"
8791

88-
#: ../../c-api/code.rst:66
92+
#: ../../c-api/code.rst:68
8993
msgid ""
9094
"Renamed from ``PyCode_New`` as part of :ref:`unstable-c-api`. The old name "
9195
"is deprecated, but will remain available until the signature changes again."
9296
msgstr ""
9397

94-
#: ../../c-api/code.rst:72
98+
#: ../../c-api/code.rst:74
9599
msgid ""
96100
"Similar to :c:func:`PyUnstable_Code_New`, but with an extra "
97101
"\"posonlyargcount\" for positional-only arguments. The same caveats that "
98102
"apply to ``PyUnstable_Code_New`` also apply to this function."
99103
msgstr ""
100104

101-
#: ../../c-api/code.rst:77
105+
#: ../../c-api/code.rst:79
102106
msgid "as ``PyCode_NewWithPosOnlyArgs``"
103107
msgstr ""
104108

105-
#: ../../c-api/code.rst:79
109+
#: ../../c-api/code.rst:81
106110
msgid "Added ``qualname`` and ``exceptiontable`` parameters."
107111
msgstr "新增 ``qualname`` 和 ``exceptiontable`` 參數。"
108112

109-
#: ../../c-api/code.rst:84
113+
#: ../../c-api/code.rst:86
110114
msgid ""
111115
"Renamed to ``PyUnstable_Code_NewWithPosOnlyArgs``. The old name is "
112116
"deprecated, but will remain available until the signature changes again."
113117
msgstr ""
114118

115-
#: ../../c-api/code.rst:90
119+
#: ../../c-api/code.rst:92
116120
msgid ""
117121
"Return a new empty code object with the specified filename, function name, "
118122
"and first line number. The resulting code object will raise an ``Exception`` "
119123
"if executed."
120124
msgstr ""
121125

122-
#: ../../c-api/code.rst:96
126+
#: ../../c-api/code.rst:98
123127
msgid ""
124128
"Return the line number of the instruction that occurs on or before "
125129
"``byte_offset`` and ends after it. If you just need the line number of a "
126130
"frame, use :c:func:`PyFrame_GetLineNumber` instead."
127131
msgstr ""
128132

129-
#: ../../c-api/code.rst:99
133+
#: ../../c-api/code.rst:101
130134
msgid ""
131135
"For efficiently iterating over the line numbers in a code object, use :pep:"
132136
"`the API described in PEP 626 <0626#out-of-process-debuggers-and-profilers>`."
133137
msgstr ""
134138

135-
#: ../../c-api/code.rst:104
139+
#: ../../c-api/code.rst:106
136140
msgid ""
137141
"Sets the passed ``int`` pointers to the source code line and column numbers "
138142
"for the instruction at ``byte_offset``. Sets the value to ``0`` when "
139143
"information is not available for any particular element."
140144
msgstr ""
141145

142-
#: ../../c-api/code.rst:108
146+
#: ../../c-api/code.rst:110
143147
msgid "Returns ``1`` if the function succeeds and 0 otherwise."
144148
msgstr ""
145149

146-
#: ../../c-api/code.rst:114
150+
#: ../../c-api/code.rst:116
147151
msgid ""
148152
"Equivalent to the Python code ``getattr(co, 'co_code')``. Returns a strong "
149153
"reference to a :c:type:`PyBytesObject` representing the bytecode in a code "
150154
"object. On error, ``NULL`` is returned and an exception is raised."
151155
msgstr ""
152156

153-
#: ../../c-api/code.rst:119
157+
#: ../../c-api/code.rst:121
154158
msgid ""
155159
"This ``PyBytesObject`` may be created on-demand by the interpreter and does "
156160
"not necessarily represent the bytecode actually executed by CPython. The "
157161
"primary use case for this function is debuggers and profilers."
158162
msgstr ""
159163

160-
#: ../../c-api/code.rst:127
164+
#: ../../c-api/code.rst:129
161165
msgid ""
162166
"Equivalent to the Python code ``getattr(co, 'co_varnames')``. Returns a new "
163167
"reference to a :c:type:`PyTupleObject` containing the names of the local "
164168
"variables. On error, ``NULL`` is returned and an exception is raised."
165169
msgstr ""
166170

167-
#: ../../c-api/code.rst:136
171+
#: ../../c-api/code.rst:138
168172
msgid ""
169173
"Equivalent to the Python code ``getattr(co, 'co_cellvars')``. Returns a new "
170174
"reference to a :c:type:`PyTupleObject` containing the names of the local "
171175
"variables that are referenced by nested functions. On error, ``NULL`` is "
172176
"returned and an exception is raised."
173177
msgstr ""
174178

175-
#: ../../c-api/code.rst:145
179+
#: ../../c-api/code.rst:147
176180
msgid ""
177181
"Equivalent to the Python code ``getattr(co, 'co_freevars')``. Returns a new "
178-
"reference to a :c:type:`PyTupleObject` containing the names of the free "
179-
"variables. On error, ``NULL`` is returned and an exception is raised."
182+
"reference to a :c:type:`PyTupleObject` containing the names of the :term:"
183+
"`free (closure) variables <closure variable>`. On error, ``NULL`` is "
184+
"returned and an exception is raised."
180185
msgstr ""
181186

182-
#: ../../c-api/code.rst:153
187+
#: ../../c-api/code.rst:156
183188
msgid ""
184189
"Register *callback* as a code object watcher for the current interpreter. "
185190
"Return an ID which may be passed to :c:func:`PyCode_ClearWatcher`. In case "
186191
"of error (e.g. no more watcher IDs available), return ``-1`` and set an "
187192
"exception."
188193
msgstr ""
189194

190-
#: ../../c-api/code.rst:162
195+
#: ../../c-api/code.rst:165
191196
msgid ""
192197
"Clear watcher identified by *watcher_id* previously returned from :c:func:"
193198
"`PyCode_AddWatcher` for the current interpreter. Return ``0`` on success, or "
194199
"``-1`` and set an exception on error (e.g. if the given *watcher_id* was "
195200
"never registered.)"
196201
msgstr ""
197202

198-
#: ../../c-api/code.rst:171
203+
#: ../../c-api/code.rst:174
199204
msgid ""
200205
"Enumeration of possible code object watcher events: - "
201206
"``PY_CODE_EVENT_CREATE`` - ``PY_CODE_EVENT_DESTROY``"
202207
msgstr ""
203208

204-
#: ../../c-api/code.rst:179
209+
#: ../../c-api/code.rst:182
205210
msgid "Type of a code object watcher callback function."
206211
msgstr ""
207212

208-
#: ../../c-api/code.rst:181
213+
#: ../../c-api/code.rst:184
209214
msgid ""
210215
"If *event* is ``PY_CODE_EVENT_CREATE``, then the callback is invoked after "
211216
"`co` has been fully initialized. Otherwise, the callback is invoked before "
212217
"the destruction of *co* takes place, so the prior state of *co* can be "
213218
"inspected."
214219
msgstr ""
215220

216-
#: ../../c-api/code.rst:186
221+
#: ../../c-api/code.rst:189
217222
msgid ""
218223
"If *event* is ``PY_CODE_EVENT_DESTROY``, taking a reference in the callback "
219224
"to the about-to-be-destroyed code object will resurrect it and prevent it "
220225
"from being freed at this time. When the resurrected object is destroyed "
221226
"later, any watcher callbacks active at that time will be called again."
222227
msgstr ""
223228

224-
#: ../../c-api/code.rst:191
229+
#: ../../c-api/code.rst:194
225230
msgid ""
226231
"Users of this API should not rely on internal runtime implementation "
227232
"details. Such details may include, but are not limited to, the exact order "
@@ -231,14 +236,14 @@ msgid ""
231236
"the Python code being executed."
232237
msgstr ""
233238

234-
#: ../../c-api/code.rst:198
239+
#: ../../c-api/code.rst:201
235240
msgid ""
236241
"If the callback sets an exception, it must return ``-1``; this exception "
237242
"will be printed as an unraisable exception using :c:func:"
238243
"`PyErr_WriteUnraisable`. Otherwise it should return ``0``."
239244
msgstr ""
240245

241-
#: ../../c-api/code.rst:202
246+
#: ../../c-api/code.rst:205
242247
msgid ""
243248
"There may already be a pending exception set on entry to the callback. In "
244249
"this case, the callback should return ``0`` with the same exception still "
@@ -247,85 +252,85 @@ msgid ""
247252
"it before returning."
248253
msgstr ""
249254

250-
#: ../../c-api/code.rst:212
255+
#: ../../c-api/code.rst:215
251256
msgid "Extra information"
252257
msgstr ""
253258

254-
#: ../../c-api/code.rst:214
259+
#: ../../c-api/code.rst:217
255260
msgid ""
256261
"To support low-level extensions to frame evaluation, such as external just-"
257262
"in-time compilers, it is possible to attach arbitrary extra data to code "
258263
"objects."
259264
msgstr ""
260265

261-
#: ../../c-api/code.rst:218
266+
#: ../../c-api/code.rst:221
262267
msgid ""
263268
"These functions are part of the unstable C API tier: this functionality is a "
264269
"CPython implementation detail, and the API may change without deprecation "
265270
"warnings."
266271
msgstr ""
267272

268-
#: ../../c-api/code.rst:224
273+
#: ../../c-api/code.rst:227
269274
msgid "Return a new an opaque index value used to adding data to code objects."
270275
msgstr ""
271276

272-
#: ../../c-api/code.rst:226
277+
#: ../../c-api/code.rst:229
273278
msgid ""
274279
"You generally call this function once (per interpreter) and use the result "
275280
"with ``PyCode_GetExtra`` and ``PyCode_SetExtra`` to manipulate data on "
276281
"individual code objects."
277282
msgstr ""
278283

279-
#: ../../c-api/code.rst:230
284+
#: ../../c-api/code.rst:233
280285
msgid ""
281286
"If *free* is not ``NULL``: when a code object is deallocated, *free* will be "
282287
"called on non-``NULL`` data stored under the new index. Use :c:func:"
283288
"`Py_DecRef` when storing :c:type:`PyObject`."
284289
msgstr ""
285290

286-
#: ../../c-api/code.rst:236
291+
#: ../../c-api/code.rst:239
287292
msgid "as ``_PyEval_RequestCodeExtraIndex``"
288293
msgstr ""
289294

290-
#: ../../c-api/code.rst:240
295+
#: ../../c-api/code.rst:243
291296
msgid ""
292297
"Renamed to ``PyUnstable_Eval_RequestCodeExtraIndex``. The old private name "
293298
"is deprecated, but will be available until the API changes."
294299
msgstr ""
295300

296-
#: ../../c-api/code.rst:246
301+
#: ../../c-api/code.rst:249
297302
msgid ""
298303
"Set *extra* to the extra data stored under the given index. Return 0 on "
299304
"success. Set an exception and return -1 on failure."
300305
msgstr ""
301306

302-
#: ../../c-api/code.rst:249
307+
#: ../../c-api/code.rst:252
303308
msgid ""
304309
"If no data was set under the index, set *extra* to ``NULL`` and return 0 "
305310
"without setting an exception."
306311
msgstr ""
307312

308-
#: ../../c-api/code.rst:254
313+
#: ../../c-api/code.rst:257
309314
msgid "as ``_PyCode_GetExtra``"
310315
msgstr ""
311316

312-
#: ../../c-api/code.rst:258
317+
#: ../../c-api/code.rst:261
313318
msgid ""
314319
"Renamed to ``PyUnstable_Code_GetExtra``. The old private name is deprecated, "
315320
"but will be available until the API changes."
316321
msgstr ""
317322

318-
#: ../../c-api/code.rst:264
323+
#: ../../c-api/code.rst:267
319324
msgid ""
320325
"Set the extra data stored under the given index to *extra*. Return 0 on "
321326
"success. Set an exception and return -1 on failure."
322327
msgstr ""
323328

324-
#: ../../c-api/code.rst:269
329+
#: ../../c-api/code.rst:272
325330
msgid "as ``_PyCode_SetExtra``"
326331
msgstr ""
327332

328-
#: ../../c-api/code.rst:273
333+
#: ../../c-api/code.rst:276
329334
msgid ""
330335
"Renamed to ``PyUnstable_Code_SetExtra``. The old private name is deprecated, "
331336
"but will be available until the API changes."
@@ -343,22 +348,22 @@ msgstr "code(程式碼)"
343348
msgid "code object"
344349
msgstr "code object(程式碼物件)"
345350

346-
#: ../../c-api/code.rst:62
351+
#: ../../c-api/code.rst:64
347352
msgid "PyCode_New (C function)"
348353
msgstr "PyCode_New(C 函式)"
349354

350-
#: ../../c-api/code.rst:75
355+
#: ../../c-api/code.rst:77
351356
msgid "PyCode_NewWithPosOnlyArgs (C function)"
352357
msgstr "PyCode_NewWithPosOnlyArgs(C 函式)"
353358

354-
#: ../../c-api/code.rst:234
359+
#: ../../c-api/code.rst:237
355360
msgid "_PyEval_RequestCodeExtraIndex (C function)"
356361
msgstr "_PyEval_RequestCodeExtraIndex(C 函式)"
357362

358-
#: ../../c-api/code.rst:252
363+
#: ../../c-api/code.rst:255
359364
msgid "_PyCode_GetExtra (C function)"
360365
msgstr "_PyCode_GetExtra(C 函式)"
361366

362-
#: ../../c-api/code.rst:267
367+
#: ../../c-api/code.rst:270
363368
msgid "_PyCode_SetExtra (C function)"
364369
msgstr "_PyCode_SetExtra(C 函式)"

Diff for: c-api/exceptions.po

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: Python 3.13\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2024-09-27 00:14+0000\n"
11+
"POT-Creation-Date: 2024-10-11 00:13+0000\n"
1212
"PO-Revision-Date: 2018-05-23 14:05+0000\n"
1313
"Last-Translator: Adrian Liaw <[email protected]>\n"
1414
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -267,8 +267,8 @@ msgstr ""
267267
#: ../../c-api/exceptions.rst:234 ../../c-api/exceptions.rst:242
268268
#: ../../c-api/exceptions.rst:253 ../../c-api/exceptions.rst:263
269269
#: ../../c-api/exceptions.rst:271 ../../c-api/exceptions.rst:281
270-
msgid ":ref:`Availability <availability>`: Windows."
271-
msgstr ":ref:`適用 <availability>`:Windows。"
270+
msgid "Availability"
271+
msgstr ""
272272

273273
#: ../../c-api/exceptions.rst:239
274274
msgid ""

0 commit comments

Comments
 (0)