|
8 | 8 | msgstr "" |
9 | 9 | "Project-Id-Version: Python 3.15\n" |
10 | 10 | "Report-Msgid-Bugs-To: \n" |
11 | | -"POT-Creation-Date: 2026-06-21 15:47+0000\n" |
| 11 | +"POT-Creation-Date: 2026-06-25 16:18+0000\n" |
12 | 12 | "PO-Revision-Date: 2026-06-03 18:21+0000\n" |
13 | 13 | "Language-Team: Panjabi (Punjabi) (https://app.transifex.com/python-doc/" |
14 | 14 | "teams/5390/pa/)\n" |
@@ -387,6 +387,110 @@ msgid "" |
387 | 387 | "documentation for details on this API." |
388 | 388 | msgstr "" |
389 | 389 |
|
| 390 | +msgid "" |
| 391 | +"As in the example, your ``PyModExport_`` function should *only* return a " |
| 392 | +"pointer to static data. If you cannot avoid additional code, refer to the :" |
| 393 | +"ref:`caveats in PyModExport documentation <pymodexport-api-caveats>`." |
| 394 | +msgstr "" |
| 395 | + |
| 396 | +msgid "Existing slots" |
| 397 | +msgstr "" |
| 398 | + |
| 399 | +msgid "" |
| 400 | +"If you have a ``Py_mod_slots`` slot, check the array it refers to. It should " |
| 401 | +"be a :c:type:`PyModuleDef_Slot` array like the following:" |
| 402 | +msgstr "" |
| 403 | + |
| 404 | +msgid "" |
| 405 | +"static PyObject *create_module(PyObject *spec, PyModuleDef *def) { ... }\n" |
| 406 | +"static int my_first_module_exec(PyObject *module) { ... }\n" |
| 407 | +"static int my_second_module_exec(PyObject *module) { ... }\n" |
| 408 | +"\n" |
| 409 | +"static PyModuleDef_Slot my_slots[] = {\n" |
| 410 | +" {Py_mod_gil, Py_MOD_GIL_NOT_USED},\n" |
| 411 | +" {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},\n" |
| 412 | +" {Py_mod_create, my_module_create},\n" |
| 413 | +" {Py_mod_exec, my_first_module_exec},\n" |
| 414 | +" {Py_mod_exec, my_second_module_exec},\n" |
| 415 | +" {0, NULL}\n" |
| 416 | +"};" |
| 417 | +msgstr "" |
| 418 | + |
| 419 | +msgid "``py_mod_create``" |
| 420 | +msgstr "" |
| 421 | + |
| 422 | +msgid "" |
| 423 | +"If you have a :c:macro:`Py_mod_create` entry, make sure the function can be " |
| 424 | +"called with ``NULL`` as its second argument (instead of the :c:type:" |
| 425 | +"`PyModuleDef`, which you are removing). Often, this argument isn't used at " |
| 426 | +"all; you can check by renaming it:" |
| 427 | +msgstr "" |
| 428 | + |
| 429 | +msgid "" |
| 430 | +"static PyObject *create_module(PyObject *spec, PyModuleDef *_unused) { ... }" |
| 431 | +msgstr "" |
| 432 | + |
| 433 | +msgid "" |
| 434 | +"If the argument is used, find a different way to pass in the data. Commonly, " |
| 435 | +"the information is static and you can refer to it directly. (If you're " |
| 436 | +"reusing a single function for several different modules, consider defining " |
| 437 | +"several functions instead.)" |
| 438 | +msgstr "" |
| 439 | + |
| 440 | +msgid "Multiple ``py_mod_exec``" |
| 441 | +msgstr "" |
| 442 | + |
| 443 | +msgid "" |
| 444 | +"If you have *more than one* :c:macro:`Py_mod_exec` entry, consolidate them: " |
| 445 | +"create a new function that calls the others, and replace existing slots with " |
| 446 | +"it." |
| 447 | +msgstr "" |
| 448 | + |
| 449 | +msgid "" |
| 450 | +"static int my_module_exec(PyObject *module) {\n" |
| 451 | +" if (my_first_module_exec(module) < 0) return -1;\n" |
| 452 | +" if (my_second_module_exec(module) < 0) return -1;\n" |
| 453 | +"}\n" |
| 454 | +"\n" |
| 455 | +"static PyModuleDef_Slot my_slots[] = {\n" |
| 456 | +" ...\n" |
| 457 | +" /* (remove other Py_mod_exec slots) */\n" |
| 458 | +" ...\n" |
| 459 | +" {Py_mod_exec, my_module_exec},\n" |
| 460 | +" {0, NULL}\n" |
| 461 | +"};" |
| 462 | +msgstr "" |
| 463 | + |
| 464 | +msgid "" |
| 465 | +"If the functions aren't used elsewhere, you can combine their bodies instead." |
| 466 | +msgstr "" |
| 467 | + |
| 468 | +msgid "Merging slot arrays" |
| 469 | +msgstr "" |
| 470 | + |
| 471 | +msgid "" |
| 472 | +"Optionally, when you break compatibility with Python 3.14, you may clean up " |
| 473 | +"the code by moving slots into the :c:type:`PySlot` array, and converting the " |
| 474 | +"definitions to :c:macro:`PySlot_DATA` and :c:macro:`PySlot_FUNC`:" |
| 475 | +msgstr "" |
| 476 | + |
| 477 | +msgid "" |
| 478 | +"static PySlot my_slot_array[] = {\n" |
| 479 | +" ...\n" |
| 480 | +" PySlot_DATA(Py_mod_gil, Py_MOD_GIL_NOT_USED),\n" |
| 481 | +" PySlot_DATA(Py_mod_multiple_interpreters,\n" |
| 482 | +" Py_MOD_PER_INTERPRETER_GIL_SUPPORTED)\n" |
| 483 | +" PySlot_FUNC(Py_mod_create, my_module_create),\n" |
| 484 | +" PySlot_FUNC(Py_mod_exec, my_module_exec),\n" |
| 485 | +" PySlot_END\n" |
| 486 | +"};" |
| 487 | +msgstr "" |
| 488 | + |
| 489 | +msgid "" |
| 490 | +"If you do this, delete the original :c:type:`PyModuleDef_Slot` array and its " |
| 491 | +"``Py_mod_slots`` entry." |
| 492 | +msgstr "" |
| 493 | + |
390 | 494 | msgid "Associated ``PyModuleDef``" |
391 | 495 | msgstr "" |
392 | 496 |
|
@@ -608,8 +712,8 @@ msgid "" |
608 | 712 | msgstr "" |
609 | 713 |
|
610 | 714 | msgid "" |
611 | | -"then ``Py_TYPE(obj)`` is ``YourCustomClass``, and the underlying memory may " |
612 | | -"look like this:" |
| 715 | +"then ``Py_TYPE(obj)`` is ``Sub``, and the underlying memory may look like " |
| 716 | +"this:" |
613 | 717 | msgstr "" |
614 | 718 |
|
615 | 719 | msgid "" |
|
0 commit comments