8
8
msgstr ""
9
9
"Project-Id-Version : Python 3.12\n "
10
10
"Report-Msgid-Bugs-To : \n "
11
- "POT-Creation-Date : 2023-08-09 00:03+0000\n "
11
+ "POT-Creation-Date : 2023-08-23 00:03+0000\n "
12
12
"PO-Revision-Date : 2018-05-23 14:32+0000\n "
13
13
"Last-Translator : Adrian Liaw <adrianliaw2000@gmail.com>\n "
14
14
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
@@ -373,27 +373,27 @@ msgid ""
373
373
"*value* pointer of this slot must point to a function of the signature:"
374
374
msgstr ""
375
375
376
- #: ../../c-api/module.rst:342
376
+ #: ../../c-api/module.rst:343
377
377
msgid ""
378
378
"The function receives a :py:class:`~importlib.machinery.ModuleSpec` "
379
379
"instance, as defined in :PEP:`451`, and the module definition. It should "
380
380
"return a new module object, or set an error and return ``NULL``."
381
381
msgstr ""
382
382
383
- #: ../../c-api/module.rst:347
383
+ #: ../../c-api/module.rst:348
384
384
msgid ""
385
385
"This function should be kept minimal. In particular, it should not call "
386
386
"arbitrary Python code, as trying to import the same module again may result "
387
387
"in an infinite loop."
388
388
msgstr ""
389
389
390
- #: ../../c-api/module.rst:351
390
+ #: ../../c-api/module.rst:352
391
391
msgid ""
392
392
"Multiple ``Py_mod_create`` slots may not be specified in one module "
393
393
"definition."
394
394
msgstr ""
395
395
396
- #: ../../c-api/module.rst:354
396
+ #: ../../c-api/module.rst:355
397
397
msgid ""
398
398
"If ``Py_mod_create`` is not specified, the import machinery will create a "
399
399
"normal module object using :c:func:`PyModule_New`. The name is taken from "
@@ -402,7 +402,7 @@ msgid ""
402
402
"through symlinks, all while sharing a single module definition."
403
403
msgstr ""
404
404
405
- #: ../../c-api/module.rst:360
405
+ #: ../../c-api/module.rst:361
406
406
msgid ""
407
407
"There is no requirement for the returned object to be an instance of :c:type:"
408
408
"`PyModule_Type`. Any type can be used, as long as it supports setting and "
@@ -412,107 +412,107 @@ msgid ""
412
412
"``Py_mod_create``."
413
413
msgstr ""
414
414
415
- #: ../../c-api/module.rst:369
415
+ #: ../../c-api/module.rst:370
416
416
msgid ""
417
417
"Specifies a function that is called to *execute* the module. This is "
418
418
"equivalent to executing the code of a Python module: typically, this "
419
419
"function adds classes and constants to the module. The signature of the "
420
420
"function is:"
421
421
msgstr ""
422
422
423
- #: ../../c-api/module.rst:376
423
+ #: ../../c-api/module.rst:378
424
424
msgid ""
425
425
"If multiple ``Py_mod_exec`` slots are specified, they are processed in the "
426
426
"order they appear in the *m_slots* array."
427
427
msgstr ""
428
428
429
- #: ../../c-api/module.rst:381
429
+ #: ../../c-api/module.rst:383
430
430
msgid "Specifies one of the following values:"
431
431
msgstr ""
432
432
433
- #: ../../c-api/module.rst:385
433
+ #: ../../c-api/module.rst:389
434
434
msgid "The module does not support being imported in subinterpreters."
435
435
msgstr ""
436
436
437
- #: ../../c-api/module.rst:389
437
+ #: ../../c-api/module.rst:393
438
438
msgid ""
439
439
"The module supports being imported in subinterpreters, but only when they "
440
440
"share the main interpreter's GIL. (See :ref:`isolating-extensions-howto`.)"
441
441
msgstr ""
442
442
443
- #: ../../c-api/module.rst:395
443
+ #: ../../c-api/module.rst:399
444
444
msgid ""
445
445
"The module supports being imported in subinterpreters, even when they have "
446
446
"their own GIL. (See :ref:`isolating-extensions-howto`.)"
447
447
msgstr ""
448
448
449
- #: ../../c-api/module.rst:399
449
+ #: ../../c-api/module.rst:403
450
450
msgid ""
451
451
"This slot determines whether or not importing this module in a "
452
452
"subinterpreter will fail."
453
453
msgstr ""
454
454
455
- #: ../../c-api/module.rst:402
455
+ #: ../../c-api/module.rst:406
456
456
msgid ""
457
457
"Multiple ``Py_mod_multiple_interpreters`` slots may not be specified in one "
458
458
"module definition."
459
459
msgstr ""
460
460
461
- #: ../../c-api/module.rst:405
461
+ #: ../../c-api/module.rst:409
462
462
msgid ""
463
463
"If ``Py_mod_multiple_interpreters`` is not specified, the import machinery "
464
464
"defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED``."
465
465
msgstr ""
466
466
467
- #: ../../c-api/module.rst:410
467
+ #: ../../c-api/module.rst:414
468
468
msgid "See :PEP:`489` for more details on multi-phase initialization."
469
469
msgstr ""
470
470
471
- #: ../../c-api/module.rst:413
471
+ #: ../../c-api/module.rst:417
472
472
msgid "Low-level module creation functions"
473
473
msgstr ""
474
474
475
- #: ../../c-api/module.rst:415
475
+ #: ../../c-api/module.rst:419
476
476
msgid ""
477
477
"The following functions are called under the hood when using multi-phase "
478
478
"initialization. They can be used directly, for example when creating module "
479
479
"objects dynamically. Note that both ``PyModule_FromDefAndSpec`` and "
480
480
"``PyModule_ExecDef`` must be called to fully initialize a module."
481
481
msgstr ""
482
482
483
- #: ../../c-api/module.rst:422
483
+ #: ../../c-api/module.rst:426
484
484
msgid ""
485
485
"Create a new module object, given the definition in *def* and the ModuleSpec "
486
486
"*spec*. This behaves like :c:func:`PyModule_FromDefAndSpec2` with "
487
487
"*module_api_version* set to :c:macro:`PYTHON_API_VERSION`."
488
488
msgstr ""
489
489
490
- #: ../../c-api/module.rst:430
490
+ #: ../../c-api/module.rst:434
491
491
msgid ""
492
492
"Create a new module object, given the definition in *def* and the ModuleSpec "
493
493
"*spec*, assuming the API version *module_api_version*. If that version does "
494
494
"not match the version of the running interpreter, a :exc:`RuntimeWarning` is "
495
495
"emitted."
496
496
msgstr ""
497
497
498
- #: ../../c-api/module.rst:437
498
+ #: ../../c-api/module.rst:441
499
499
msgid ""
500
500
"Most uses of this function should be using :c:func:`PyModule_FromDefAndSpec` "
501
501
"instead; only use this if you are sure you need it."
502
502
msgstr ""
503
503
504
- #: ../../c-api/module.rst:444
504
+ #: ../../c-api/module.rst:448
505
505
msgid "Process any execution slots (:c:data:`Py_mod_exec`) given in *def*."
506
506
msgstr ""
507
507
508
- #: ../../c-api/module.rst:450
508
+ #: ../../c-api/module.rst:454
509
509
msgid ""
510
510
"Set the docstring for *module* to *docstring*. This function is called "
511
511
"automatically when creating a module from ``PyModuleDef``, using either "
512
512
"``PyModule_Create`` or ``PyModule_FromDefAndSpec``."
513
513
msgstr ""
514
514
515
- #: ../../c-api/module.rst:459
515
+ #: ../../c-api/module.rst:463
516
516
msgid ""
517
517
"Add the functions from the ``NULL`` terminated *functions* array to "
518
518
"*module*. Refer to the :c:type:`PyMethodDef` documentation for details on "
@@ -524,132 +524,132 @@ msgid ""
524
524
"``PyModule_FromDefAndSpec``."
525
525
msgstr ""
526
526
527
- #: ../../c-api/module.rst:471
527
+ #: ../../c-api/module.rst:475
528
528
msgid "Support functions"
529
529
msgstr ""
530
530
531
- #: ../../c-api/module.rst:473
531
+ #: ../../c-api/module.rst:477
532
532
msgid ""
533
533
"The module initialization function (if using single phase initialization) or "
534
534
"a function called from a module execution slot (if using multi-phase "
535
535
"initialization), can use the following functions to help initialize the "
536
536
"module state:"
537
537
msgstr ""
538
538
539
- #: ../../c-api/module.rst:480
539
+ #: ../../c-api/module.rst:484
540
540
msgid ""
541
541
"Add an object to *module* as *name*. This is a convenience function which "
542
542
"can be used from the module's initialization function."
543
543
msgstr ""
544
544
545
- #: ../../c-api/module.rst:483
545
+ #: ../../c-api/module.rst:487
546
546
msgid ""
547
547
"On success, return ``0``. On error, raise an exception and return ``-1``."
548
548
msgstr ""
549
549
550
- #: ../../c-api/module.rst:485
550
+ #: ../../c-api/module.rst:489
551
551
msgid ""
552
552
"Return ``NULL`` if *value* is ``NULL``. It must be called with an exception "
553
553
"raised in this case."
554
554
msgstr ""
555
555
556
- #: ../../c-api/module.rst:488 ../../c-api/module.rst:537
556
+ #: ../../c-api/module.rst:492 ../../c-api/module.rst:541
557
557
msgid "Example usage::"
558
558
msgstr ""
559
559
"用法範例:\n"
560
560
"\n"
561
561
"::"
562
562
563
- #: ../../c-api/module.rst:502 ../../c-api/module.rst:555
563
+ #: ../../c-api/module.rst:506 ../../c-api/module.rst:559
564
564
msgid ""
565
565
"The example can also be written without checking explicitly if *obj* is "
566
566
"``NULL``::"
567
567
msgstr ""
568
568
569
- #: ../../c-api/module.rst:514 ../../c-api/module.rst:571
569
+ #: ../../c-api/module.rst:518 ../../c-api/module.rst:575
570
570
msgid ""
571
571
"Note that ``Py_XDECREF()`` should be used instead of ``Py_DECREF()`` in this "
572
572
"case, since *obj* can be ``NULL``."
573
573
msgstr ""
574
574
575
- #: ../../c-api/module.rst:522
575
+ #: ../../c-api/module.rst:526
576
576
msgid ""
577
577
"Similar to :c:func:`PyModule_AddObjectRef`, but steals a reference to "
578
578
"*value* on success (if it returns ``0``)."
579
579
msgstr ""
580
580
581
- #: ../../c-api/module.rst:525
581
+ #: ../../c-api/module.rst:529
582
582
msgid ""
583
583
"The new :c:func:`PyModule_AddObjectRef` function is recommended, since it is "
584
584
"easy to introduce reference leaks by misusing the :c:func:"
585
585
"`PyModule_AddObject` function."
586
586
msgstr ""
587
587
588
- #: ../../c-api/module.rst:531
588
+ #: ../../c-api/module.rst:535
589
589
msgid ""
590
590
"Unlike other functions that steal references, ``PyModule_AddObject()`` only "
591
591
"releases the reference to *value* **on success**."
592
592
msgstr ""
593
593
594
- #: ../../c-api/module.rst:534
594
+ #: ../../c-api/module.rst:538
595
595
msgid ""
596
596
"This means that its return value must be checked, and calling code must :c:"
597
597
"func:`Py_DECREF` *value* manually on error."
598
598
msgstr ""
599
599
600
- #: ../../c-api/module.rst:577
600
+ #: ../../c-api/module.rst:581
601
601
msgid ""
602
602
"Add an integer constant to *module* as *name*. This convenience function "
603
603
"can be used from the module's initialization function. Return ``-1`` on "
604
604
"error, ``0`` on success."
605
605
msgstr ""
606
606
607
- #: ../../c-api/module.rst:584
607
+ #: ../../c-api/module.rst:588
608
608
msgid ""
609
609
"Add a string constant to *module* as *name*. This convenience function can "
610
610
"be used from the module's initialization function. The string *value* must "
611
611
"be ``NULL``-terminated. Return ``-1`` on error, ``0`` on success."
612
612
msgstr ""
613
613
614
- #: ../../c-api/module.rst:591
614
+ #: ../../c-api/module.rst:595
615
615
msgid ""
616
616
"Add an int constant to *module*. The name and the value are taken from "
617
617
"*macro*. For example ``PyModule_AddIntMacro(module, AF_INET)`` adds the int "
618
618
"constant *AF_INET* with the value of *AF_INET* to *module*. Return ``-1`` on "
619
619
"error, ``0`` on success."
620
620
msgstr ""
621
621
622
- #: ../../c-api/module.rst:599
622
+ #: ../../c-api/module.rst:603
623
623
msgid "Add a string constant to *module*."
624
624
msgstr ""
625
625
626
- #: ../../c-api/module.rst:603
626
+ #: ../../c-api/module.rst:607
627
627
msgid ""
628
628
"Add a type object to *module*. The type object is finalized by calling "
629
629
"internally :c:func:`PyType_Ready`. The name of the type object is taken from "
630
630
"the last component of :c:member:`~PyTypeObject.tp_name` after dot. Return "
631
631
"``-1`` on error, ``0`` on success."
632
632
msgstr ""
633
633
634
- #: ../../c-api/module.rst:613
634
+ #: ../../c-api/module.rst:617
635
635
msgid "Module lookup"
636
636
msgstr ""
637
637
638
- #: ../../c-api/module.rst:615
638
+ #: ../../c-api/module.rst:619
639
639
msgid ""
640
640
"Single-phase initialization creates singleton modules that can be looked up "
641
641
"in the context of the current interpreter. This allows the module object to "
642
642
"be retrieved later with only a reference to the module definition."
643
643
msgstr ""
644
644
645
- #: ../../c-api/module.rst:619
645
+ #: ../../c-api/module.rst:623
646
646
msgid ""
647
647
"These functions will not work on modules created using multi-phase "
648
648
"initialization, since multiple such modules can be created from a single "
649
649
"definition."
650
650
msgstr ""
651
651
652
- #: ../../c-api/module.rst:624
652
+ #: ../../c-api/module.rst:628
653
653
msgid ""
654
654
"Returns the module object that was created from *def* for the current "
655
655
"interpreter. This method requires that the module object has been attached "
@@ -658,18 +658,18 @@ msgid ""
658
658
"to the interpreter state yet, it returns ``NULL``."
659
659
msgstr ""
660
660
661
- #: ../../c-api/module.rst:631
661
+ #: ../../c-api/module.rst:635
662
662
msgid ""
663
663
"Attaches the module object passed to the function to the interpreter state. "
664
664
"This allows the module object to be accessible via :c:func:"
665
665
"`PyState_FindModule`."
666
666
msgstr ""
667
667
668
- #: ../../c-api/module.rst:634
668
+ #: ../../c-api/module.rst:638
669
669
msgid "Only effective on modules created using single-phase initialization."
670
670
msgstr ""
671
671
672
- #: ../../c-api/module.rst:636
672
+ #: ../../c-api/module.rst:640
673
673
msgid ""
674
674
"Python calls ``PyState_AddModule`` automatically after importing a module, "
675
675
"so it is unnecessary (but harmless) to call it from module initialization "
@@ -680,15 +680,15 @@ msgid ""
680
680
"state updates)."
681
681
msgstr ""
682
682
683
- #: ../../c-api/module.rst:644 ../../c-api/module.rst:655
683
+ #: ../../c-api/module.rst:648 ../../c-api/module.rst:659
684
684
msgid "The caller must hold the GIL."
685
685
msgstr ""
686
686
687
- #: ../../c-api/module.rst:646
687
+ #: ../../c-api/module.rst:650
688
688
msgid "Return 0 on success or -1 on failure."
689
689
msgstr ""
690
690
691
- #: ../../c-api/module.rst:652
691
+ #: ../../c-api/module.rst:656
692
692
msgid ""
693
693
"Removes the module object created from *def* from the interpreter state. "
694
694
"Return 0 on success or -1 on failure."
0 commit comments