Skip to content

Commit 0cd09b2

Browse files
sync with cpython 6ffeef10
1 parent a9b4f03 commit 0cd09b2

File tree

1 file changed

+46
-40
lines changed

1 file changed

+46
-40
lines changed

howto/free-threading-extensions.po

Lines changed: 46 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ msgid ""
66
msgstr ""
77
"Project-Id-Version: Python 3.13\n"
88
"Report-Msgid-Bugs-To: \n"
9-
"POT-Creation-Date: 2025-06-27 07:36+0000\n"
9+
"POT-Creation-Date: 2025-07-24 00:16+0000\n"
1010
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1111
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1212
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -268,68 +268,74 @@ msgid ":c:func:`PyList_GetItem`"
268268
msgstr ":c:func:`PyList_GetItem`"
269269

270270
#: ../../howto/free-threading-extensions.rst:160
271+
#: ../../howto/free-threading-extensions.rst:162
271272
msgid ":c:func:`PyList_GetItemRef`"
272273
msgstr ":c:func:`PyList_GetItemRef`"
273274

274275
#: ../../howto/free-threading-extensions.rst:162
276+
#, fuzzy
277+
msgid ":c:func:`PyList_GET_ITEM`"
278+
msgstr ":c:func:`PyList_GetItem`"
279+
280+
#: ../../howto/free-threading-extensions.rst:164
275281
msgid ":c:func:`PyDict_GetItem`"
276282
msgstr ":c:func:`PyDict_GetItem`"
277283

278-
#: ../../howto/free-threading-extensions.rst:162
279284
#: ../../howto/free-threading-extensions.rst:164
285+
#: ../../howto/free-threading-extensions.rst:166
280286
msgid ":c:func:`PyDict_GetItemRef`"
281287
msgstr ":c:func:`PyDict_GetItemRef`"
282288

283-
#: ../../howto/free-threading-extensions.rst:164
289+
#: ../../howto/free-threading-extensions.rst:166
284290
msgid ":c:func:`PyDict_GetItemWithError`"
285291
msgstr ":c:func:`PyDict_GetItemWithError`"
286292

287-
#: ../../howto/free-threading-extensions.rst:166
293+
#: ../../howto/free-threading-extensions.rst:168
288294
msgid ":c:func:`PyDict_GetItemString`"
289295
msgstr ":c:func:`PyDict_GetItemString`"
290296

291-
#: ../../howto/free-threading-extensions.rst:166
297+
#: ../../howto/free-threading-extensions.rst:168
292298
msgid ":c:func:`PyDict_GetItemStringRef`"
293299
msgstr ":c:func:`PyDict_GetItemStringRef`"
294300

295-
#: ../../howto/free-threading-extensions.rst:168
301+
#: ../../howto/free-threading-extensions.rst:170
296302
msgid ":c:func:`PyDict_SetDefault`"
297303
msgstr ":c:func:`PyDict_SetDefault`"
298304

299-
#: ../../howto/free-threading-extensions.rst:168
305+
#: ../../howto/free-threading-extensions.rst:170
300306
msgid ":c:func:`PyDict_SetDefaultRef`"
301307
msgstr ":c:func:`PyDict_SetDefaultRef`"
302308

303-
#: ../../howto/free-threading-extensions.rst:170
309+
#: ../../howto/free-threading-extensions.rst:172
304310
msgid ":c:func:`PyDict_Next`"
305311
msgstr ":c:func:`PyDict_Next`"
306312

307-
#: ../../howto/free-threading-extensions.rst:170
313+
#: ../../howto/free-threading-extensions.rst:172
308314
msgid "none (see :ref:`PyDict_Next`)"
309315
msgstr ""
310316

311-
#: ../../howto/free-threading-extensions.rst:172
317+
#: ../../howto/free-threading-extensions.rst:174
312318
msgid ":c:func:`PyWeakref_GetObject`"
313319
msgstr ":c:func:`PyWeakref_GetObject`"
314320

315-
#: ../../howto/free-threading-extensions.rst:172
316321
#: ../../howto/free-threading-extensions.rst:174
322+
#: ../../howto/free-threading-extensions.rst:176
317323
msgid ":c:func:`PyWeakref_GetRef`"
318324
msgstr ":c:func:`PyWeakref_GetRef`"
319325

320-
#: ../../howto/free-threading-extensions.rst:174
326+
#: ../../howto/free-threading-extensions.rst:176
321327
msgid ":c:func:`PyWeakref_GET_OBJECT`"
322328
msgstr ":c:func:`PyWeakref_GET_OBJECT`"
323329

324-
#: ../../howto/free-threading-extensions.rst:176
330+
#: ../../howto/free-threading-extensions.rst:178
325331
msgid ":c:func:`PyImport_AddModule`"
326332
msgstr ":c:func:`PyImport_AddModule`"
327333

328-
#: ../../howto/free-threading-extensions.rst:176
334+
#: ../../howto/free-threading-extensions.rst:178
329335
msgid ":c:func:`PyImport_AddModuleRef`"
330336
msgstr ":c:func:`PyImport_AddModuleRef`"
331337

332-
#: ../../howto/free-threading-extensions.rst:179
338+
#: ../../howto/free-threading-extensions.rst:181
333339
msgid ""
334340
"Not all APIs that return borrowed references are problematic. For example, :"
335341
"c:func:`PyTuple_GetItem` is safe because tuples are immutable. Similarly, "
@@ -340,18 +346,18 @@ msgid ""
340346
"context is safe."
341347
msgstr ""
342348

343-
#: ../../howto/free-threading-extensions.rst:187
349+
#: ../../howto/free-threading-extensions.rst:189
344350
msgid ""
345351
"Some of these functions were added in Python 3.13. You can use the "
346352
"`pythoncapi-compat <https://github.com/python/pythoncapi-compat>`_ package "
347353
"to provide implementations of these functions for older Python versions."
348354
msgstr ""
349355

350-
#: ../../howto/free-threading-extensions.rst:195
356+
#: ../../howto/free-threading-extensions.rst:197
351357
msgid "Memory Allocation APIs"
352358
msgstr ""
353359

354-
#: ../../howto/free-threading-extensions.rst:197
360+
#: ../../howto/free-threading-extensions.rst:199
355361
msgid ""
356362
"Python's memory management C API provides functions in three different :ref:"
357363
"`allocation domains <allocator-domains>`: \"raw\", \"mem\", and \"object\". "
@@ -361,36 +367,36 @@ msgid ""
361367
"where this was only a best practice and not a hard requirement."
362368
msgstr ""
363369

364-
#: ../../howto/free-threading-extensions.rst:206
370+
#: ../../howto/free-threading-extensions.rst:208
365371
msgid ""
366372
"Search for uses of :c:func:`PyObject_Malloc` in your extension and check "
367373
"that the allocated memory is used for Python objects. Use :c:func:"
368374
"`PyMem_Malloc` to allocate buffers instead of :c:func:`PyObject_Malloc`."
369375
msgstr ""
370376

371-
#: ../../howto/free-threading-extensions.rst:213
377+
#: ../../howto/free-threading-extensions.rst:215
372378
msgid "Thread State and GIL APIs"
373379
msgstr ""
374380

375-
#: ../../howto/free-threading-extensions.rst:215
381+
#: ../../howto/free-threading-extensions.rst:217
376382
msgid ""
377383
"Python provides a set of functions and macros to manage thread state and the "
378384
"GIL, such as:"
379385
msgstr ""
380386

381-
#: ../../howto/free-threading-extensions.rst:218
387+
#: ../../howto/free-threading-extensions.rst:220
382388
msgid ":c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release`"
383389
msgstr ":c:func:`PyGILState_Ensure` 和 :c:func:`PyGILState_Release`"
384390

385-
#: ../../howto/free-threading-extensions.rst:219
391+
#: ../../howto/free-threading-extensions.rst:221
386392
msgid ":c:func:`PyEval_SaveThread` and :c:func:`PyEval_RestoreThread`"
387393
msgstr ":c:func:`PyEval_SaveThread` 和 :c:func:`PyEval_RestoreThread`"
388394

389-
#: ../../howto/free-threading-extensions.rst:220
395+
#: ../../howto/free-threading-extensions.rst:222
390396
msgid ":c:macro:`Py_BEGIN_ALLOW_THREADS` and :c:macro:`Py_END_ALLOW_THREADS`"
391397
msgstr ":c:macro:`Py_BEGIN_ALLOW_THREADS` 和 :c:macro:`Py_END_ALLOW_THREADS`"
392398

393-
#: ../../howto/free-threading-extensions.rst:222
399+
#: ../../howto/free-threading-extensions.rst:224
394400
msgid ""
395401
"These functions should still be used in the free-threaded build to manage "
396402
"thread state even when the :term:`GIL` is disabled. For example, if you "
@@ -399,68 +405,68 @@ msgid ""
399405
"Python thread state."
400406
msgstr ""
401407

402-
#: ../../howto/free-threading-extensions.rst:228
408+
#: ../../howto/free-threading-extensions.rst:230
403409
msgid ""
404410
"You should continue to call :c:func:`PyEval_SaveThread` or :c:macro:"
405411
"`Py_BEGIN_ALLOW_THREADS` around blocking operations, such as I/O or lock "
406412
"acquisitions, to allow other threads to run the :term:`cyclic garbage "
407413
"collector <garbage collection>`."
408414
msgstr ""
409415

410-
#: ../../howto/free-threading-extensions.rst:235
416+
#: ../../howto/free-threading-extensions.rst:237
411417
msgid "Protecting Internal Extension State"
412418
msgstr ""
413419

414-
#: ../../howto/free-threading-extensions.rst:237
420+
#: ../../howto/free-threading-extensions.rst:239
415421
msgid ""
416422
"Your extension may have internal state that was previously protected by the "
417423
"GIL. You may need to add locking to protect this state. The approach will "
418424
"depend on your extension, but some common patterns include:"
419425
msgstr ""
420426

421-
#: ../../howto/free-threading-extensions.rst:241
427+
#: ../../howto/free-threading-extensions.rst:243
422428
msgid ""
423429
"**Caches**: global caches are a common source of shared state. Consider "
424430
"using a lock to protect the cache or disabling it in the free-threaded build "
425431
"if the cache is not critical for performance."
426432
msgstr ""
427433

428-
#: ../../howto/free-threading-extensions.rst:244
434+
#: ../../howto/free-threading-extensions.rst:246
429435
msgid ""
430436
"**Global State**: global state may need to be protected by a lock or moved "
431437
"to thread local storage. C11 and C++11 provide the ``thread_local`` or "
432438
"``_Thread_local`` for `thread-local storage <https://en.cppreference.com/w/c/"
433439
"language/storage_duration>`_."
434440
msgstr ""
435441

436-
#: ../../howto/free-threading-extensions.rst:251
442+
#: ../../howto/free-threading-extensions.rst:253
437443
msgid "Building Extensions for the Free-Threaded Build"
438444
msgstr ""
439445

440-
#: ../../howto/free-threading-extensions.rst:253
446+
#: ../../howto/free-threading-extensions.rst:255
441447
msgid ""
442448
"C API extensions need to be built specifically for the free-threaded build. "
443449
"The wheels, shared libraries, and binaries are indicated by a ``t`` suffix."
444450
msgstr ""
445451

446-
#: ../../howto/free-threading-extensions.rst:256
452+
#: ../../howto/free-threading-extensions.rst:258
447453
msgid ""
448454
"`pypa/manylinux <https://github.com/pypa/manylinux>`_ supports the free-"
449455
"threaded build, with the ``t`` suffix, such as ``python3.13t``."
450456
msgstr ""
451457

452-
#: ../../howto/free-threading-extensions.rst:258
458+
#: ../../howto/free-threading-extensions.rst:260
453459
msgid ""
454460
"`pypa/cibuildwheel <https://github.com/pypa/cibuildwheel>`_ supports the "
455461
"free-threaded build if you set `CIBW_ENABLE to cpython-freethreading "
456462
"<https://cibuildwheel.pypa.io/en/stable/options/#enable>`_."
457463
msgstr ""
458464

459-
#: ../../howto/free-threading-extensions.rst:263
465+
#: ../../howto/free-threading-extensions.rst:265
460466
msgid "Limited C API and Stable ABI"
461467
msgstr ""
462468

463-
#: ../../howto/free-threading-extensions.rst:265
469+
#: ../../howto/free-threading-extensions.rst:267
464470
msgid ""
465471
"The free-threaded build does not currently support the :ref:`Limited C API "
466472
"<limited-c-api>` or the stable ABI. If you use `setuptools <https://"
@@ -470,24 +476,24 @@ msgid ""
470476
"API when building with the free-threaded build."
471477
msgstr ""
472478

473-
#: ../../howto/free-threading-extensions.rst:273
479+
#: ../../howto/free-threading-extensions.rst:275
474480
msgid ""
475481
"You will need to build separate wheels specifically for the free-threaded "
476482
"build. If you currently use the stable ABI, you can continue to build a "
477483
"single wheel for multiple non-free-threaded Python versions."
478484
msgstr ""
479485

480-
#: ../../howto/free-threading-extensions.rst:279
486+
#: ../../howto/free-threading-extensions.rst:281
481487
msgid "Windows"
482488
msgstr "Windows"
483489

484-
#: ../../howto/free-threading-extensions.rst:281
490+
#: ../../howto/free-threading-extensions.rst:283
485491
msgid ""
486492
"Due to a limitation of the official Windows installer, you will need to "
487493
"manually define ``Py_GIL_DISABLED=1`` when building extensions from source."
488494
msgstr ""
489495

490-
#: ../../howto/free-threading-extensions.rst:286
496+
#: ../../howto/free-threading-extensions.rst:288
491497
msgid ""
492498
"`Porting Extension Modules to Support Free-Threading <https://py-free-"
493499
"threading.github.io/porting/>`_: A community-maintained porting guide for "

0 commit comments

Comments
 (0)