66msgstr ""
77"Project-Id-Version : Python 3.13\n "
88"Report-Msgid-Bugs-To : \n "
9- "POT-Creation-Date : 2025-04-03 00:14 +0000\n "
9+ "POT-Creation-Date : 2025-06-20 00:15 +0000\n "
1010"PO-Revision-Date : 2015-12-09 17:51+0000\n "
1111"Last-Translator : Liang-Bo Wang <me@liang2.tw>\n "
1212"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
@@ -301,40 +301,47 @@ msgid ""
301301"type:`PyCMethod` calling convention."
302302msgstr ""
303303
304- #: ../../c-api/type.rst:274
304+ #: ../../c-api/type.rst:270
305+ msgid ""
306+ "The returned reference is :term:`borrowed <borrowed reference>` from *type*, "
307+ "and will be valid as long as you hold a reference to *type*. Do not release "
308+ "it with :c:func:`Py_DECREF` or similar."
309+ msgstr ""
310+
311+ #: ../../c-api/type.rst:278
305312msgid "Attempt to assign a version tag to the given type."
306313msgstr ""
307314
308- #: ../../c-api/type.rst:276
315+ #: ../../c-api/type.rst:280
309316msgid ""
310317"Returns 1 if the type already had a valid version tag or a new one was "
311318"assigned, or 0 if a new tag could not be assigned."
312319msgstr ""
313320
314- #: ../../c-api/type.rst:283
321+ #: ../../c-api/type.rst:287
315322msgid "Creating Heap-Allocated Types"
316323msgstr ""
317324
318- #: ../../c-api/type.rst:285
325+ #: ../../c-api/type.rst:289
319326msgid ""
320327"The following functions and structs are used to create :ref:`heap types "
321328"<heap-types>`."
322329msgstr ""
323330
324- #: ../../c-api/type.rst:290
331+ #: ../../c-api/type.rst:294
325332msgid ""
326333"Create and return a :ref:`heap type <heap-types>` from the *spec* (see :c:"
327334"macro:`Py_TPFLAGS_HEAPTYPE`)."
328335msgstr ""
329336
330- #: ../../c-api/type.rst:293
337+ #: ../../c-api/type.rst:297
331338msgid ""
332339"The metaclass *metaclass* is used to construct the resulting type object. "
333340"When *metaclass* is ``NULL``, the metaclass is derived from *bases* (or "
334341"*Py_tp_base[s]* slots if *bases* is ``NULL``, see below)."
335342msgstr ""
336343
337- #: ../../c-api/type.rst:297
344+ #: ../../c-api/type.rst:301
338345msgid ""
339346"Metaclasses that override :c:member:`~PyTypeObject.tp_new` are not "
340347"supported, except if ``tp_new`` is ``NULL``. (For backwards compatibility, "
@@ -343,7 +350,7 @@ msgid ""
343350"deprecated and in Python 3.14+ such metaclasses will not be supported.)"
344351msgstr ""
345352
346- #: ../../c-api/type.rst:304
353+ #: ../../c-api/type.rst:308
347354msgid ""
348355"The *bases* argument can be used to specify base classes; it can either be "
349356"only one class or a tuple of classes. If *bases* is ``NULL``, the "
@@ -352,7 +359,7 @@ msgid ""
352359"derives from :class:`object`."
353360msgstr ""
354361
355- #: ../../c-api/type.rst:310
362+ #: ../../c-api/type.rst:314
356363msgid ""
357364"The *module* argument can be used to record the module in which the new "
358365"class is defined. It must be a module object or ``NULL``. If not ``NULL``, "
@@ -361,11 +368,11 @@ msgid ""
361368"subclasses; it must be specified for each class individually."
362369msgstr ""
363370
364- #: ../../c-api/type.rst:317
371+ #: ../../c-api/type.rst:321
365372msgid "This function calls :c:func:`PyType_Ready` on the new type."
366373msgstr ""
367374
368- #: ../../c-api/type.rst:319
375+ #: ../../c-api/type.rst:323
369376msgid ""
370377"Note that this function does *not* fully match the behavior of calling :py:"
371378"class:`type() <type>` or using the :keyword:`class` statement. With user-"
@@ -374,84 +381,84 @@ msgid ""
374381"Specifically:"
375382msgstr ""
376383
377- #: ../../c-api/type.rst:326
384+ #: ../../c-api/type.rst:330
378385msgid ""
379386":py:meth:`~object.__new__` is not called on the new class (and it must be "
380387"set to ``type.__new__``)."
381388msgstr ""
382389
383- #: ../../c-api/type.rst:328
390+ #: ../../c-api/type.rst:332
384391msgid ":py:meth:`~object.__init__` is not called on the new class."
385392msgstr ""
386393
387- #: ../../c-api/type.rst:329
394+ #: ../../c-api/type.rst:333
388395msgid ":py:meth:`~object.__init_subclass__` is not called on any bases."
389396msgstr ""
390397
391- #: ../../c-api/type.rst:330
398+ #: ../../c-api/type.rst:334
392399msgid ":py:meth:`~object.__set_name__` is not called on new descriptors."
393400msgstr ""
394401
395- #: ../../c-api/type.rst:336
402+ #: ../../c-api/type.rst:340
396403msgid "Equivalent to ``PyType_FromMetaclass(NULL, module, spec, bases)``."
397404msgstr "等價於 ``PyType_FromMetaclass(NULL, module, spec, bases)``。"
398405
399- #: ../../c-api/type.rst:342
406+ #: ../../c-api/type.rst:346
400407msgid ""
401408"The function now accepts a single class as the *bases* argument and ``NULL`` "
402409"as the ``tp_doc`` slot."
403410msgstr ""
404411
405- #: ../../c-api/type.rst:347 ../../c-api/type.rst:364
412+ #: ../../c-api/type.rst:351 ../../c-api/type.rst:368
406413msgid ""
407414"The function now finds and uses a metaclass corresponding to the provided "
408415"base classes. Previously, only :class:`type` instances were returned."
409416msgstr ""
410417
411- #: ../../c-api/type.rst:350 ../../c-api/type.rst:367 ../../c-api/type.rst:383
418+ #: ../../c-api/type.rst:354 ../../c-api/type.rst:371 ../../c-api/type.rst:387
412419msgid ""
413420"The :c:member:`~PyTypeObject.tp_new` of the metaclass is *ignored*. which "
414421"may result in incomplete initialization. Creating classes whose metaclass "
415422"overrides :c:member:`~PyTypeObject.tp_new` is deprecated and in Python 3.14+ "
416423"it will be no longer allowed."
417424msgstr ""
418425
419- #: ../../c-api/type.rst:358
426+ #: ../../c-api/type.rst:362
420427msgid "Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, bases)``."
421428msgstr "等價於 ``PyType_FromMetaclass(NULL, NULL, spec, bases)``。"
422429
423- #: ../../c-api/type.rst:375
430+ #: ../../c-api/type.rst:379
424431msgid "Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, NULL)``."
425432msgstr "等價於 ``PyType_FromMetaclass(NULL, NULL, spec, NULL)``。"
426433
427- #: ../../c-api/type.rst:379
434+ #: ../../c-api/type.rst:383
428435msgid ""
429436"The function now finds and uses a metaclass corresponding to the base "
430437"classes provided in *Py_tp_base[s]* slots. Previously, only :class:`type` "
431438"instances were returned."
432439msgstr ""
433440
434- #: ../../c-api/type.rst:400
441+ #: ../../c-api/type.rst:404
435442msgid "Structure defining a type's behavior."
436443msgstr ""
437444
438- #: ../../c-api/type.rst:404
445+ #: ../../c-api/type.rst:408
439446msgid "Name of the type, used to set :c:member:`PyTypeObject.tp_name`."
440447msgstr ""
441448
442- #: ../../c-api/type.rst:408
449+ #: ../../c-api/type.rst:412
443450msgid ""
444451"If positive, specifies the size of the instance in bytes. It is used to set :"
445452"c:member:`PyTypeObject.tp_basicsize`."
446453msgstr ""
447454
448- #: ../../c-api/type.rst:411
455+ #: ../../c-api/type.rst:415
449456msgid ""
450457"If zero, specifies that :c:member:`~PyTypeObject.tp_basicsize` should be "
451458"inherited."
452459msgstr ""
453460
454- #: ../../c-api/type.rst:414
461+ #: ../../c-api/type.rst:418
455462msgid ""
456463"If negative, the absolute value specifies how much space instances of the "
457464"class need *in addition* to the superclass. Use :c:func:"
@@ -461,17 +468,17 @@ msgid ""
461468"requirements."
462469msgstr ""
463470
464- #: ../../c-api/type.rst:424
471+ #: ../../c-api/type.rst:428
465472msgid "Previously, this field could not be negative."
466473msgstr ""
467474
468- #: ../../c-api/type.rst:428
475+ #: ../../c-api/type.rst:432
469476msgid ""
470477"Size of one element of a variable-size type, in bytes. Used to set :c:member:"
471478"`PyTypeObject.tp_itemsize`. See ``tp_itemsize`` documentation for caveats."
472479msgstr ""
473480
474- #: ../../c-api/type.rst:432
481+ #: ../../c-api/type.rst:436
475482msgid ""
476483"If zero, :c:member:`~PyTypeObject.tp_itemsize` is inherited. Extending "
477484"arbitrary variable-sized classes is dangerous, since some types use a fixed "
@@ -480,154 +487,154 @@ msgid ""
480487"only possible in the following situations:"
481488msgstr ""
482489
483- #: ../../c-api/type.rst:439
490+ #: ../../c-api/type.rst:443
484491msgid ""
485492"The base is not variable-sized (its :c:member:`~PyTypeObject.tp_itemsize`)."
486493msgstr ""
487494
488- #: ../../c-api/type.rst:441
495+ #: ../../c-api/type.rst:445
489496msgid ""
490497"The requested :c:member:`PyType_Spec.basicsize` is positive, suggesting that "
491498"the memory layout of the base class is known."
492499msgstr ""
493500
494- #: ../../c-api/type.rst:443
501+ #: ../../c-api/type.rst:447
495502msgid ""
496503"The requested :c:member:`PyType_Spec.basicsize` is zero, suggesting that the "
497504"subclass does not access the instance's memory directly."
498505msgstr ""
499506
500- #: ../../c-api/type.rst:446
507+ #: ../../c-api/type.rst:450
501508msgid "With the :c:macro:`Py_TPFLAGS_ITEMS_AT_END` flag."
502509msgstr ""
503510
504- #: ../../c-api/type.rst:450
511+ #: ../../c-api/type.rst:454
505512msgid "Type flags, used to set :c:member:`PyTypeObject.tp_flags`."
506513msgstr ""
507514
508- #: ../../c-api/type.rst:452
515+ #: ../../c-api/type.rst:456
509516msgid ""
510517"If the ``Py_TPFLAGS_HEAPTYPE`` flag is not set, :c:func:"
511518"`PyType_FromSpecWithBases` sets it automatically."
512519msgstr ""
513520
514- #: ../../c-api/type.rst:457
521+ #: ../../c-api/type.rst:461
515522msgid ""
516523"Array of :c:type:`PyType_Slot` structures. Terminated by the special slot "
517524"value ``{0, NULL}``."
518525msgstr ""
519526
520- #: ../../c-api/type.rst:460
527+ #: ../../c-api/type.rst:464
521528msgid "Each slot ID should be specified at most once."
522529msgstr ""
523530
524- #: ../../c-api/type.rst:470
531+ #: ../../c-api/type.rst:474
525532msgid ""
526533"Structure defining optional functionality of a type, containing a slot ID "
527534"and a value pointer."
528535msgstr ""
529536
530- #: ../../c-api/type.rst:475
537+ #: ../../c-api/type.rst:479
531538msgid "A slot ID."
532539msgstr ""
533540
534- #: ../../c-api/type.rst:477
541+ #: ../../c-api/type.rst:481
535542msgid ""
536543"Slot IDs are named like the field names of the structures :c:type:"
537544"`PyTypeObject`, :c:type:`PyNumberMethods`, :c:type:`PySequenceMethods`, :c:"
538545"type:`PyMappingMethods` and :c:type:`PyAsyncMethods` with an added ``Py_`` "
539546"prefix. For example, use:"
540547msgstr ""
541548
542- #: ../../c-api/type.rst:483
549+ #: ../../c-api/type.rst:487
543550msgid "``Py_tp_dealloc`` to set :c:member:`PyTypeObject.tp_dealloc`"
544551msgstr ""
545552
546- #: ../../c-api/type.rst:484
553+ #: ../../c-api/type.rst:488
547554msgid "``Py_nb_add`` to set :c:member:`PyNumberMethods.nb_add`"
548555msgstr ""
549556
550- #: ../../c-api/type.rst:485
557+ #: ../../c-api/type.rst:489
551558msgid "``Py_sq_length`` to set :c:member:`PySequenceMethods.sq_length`"
552559msgstr ""
553560
554- #: ../../c-api/type.rst:487
561+ #: ../../c-api/type.rst:491
555562msgid ""
556563"The following “offset” fields cannot be set using :c:type:`PyType_Slot`:"
557564msgstr ""
558565
559- #: ../../c-api/type.rst:489
566+ #: ../../c-api/type.rst:493
560567msgid ""
561568":c:member:`~PyTypeObject.tp_weaklistoffset` (use :c:macro:"
562569"`Py_TPFLAGS_MANAGED_WEAKREF` instead if possible)"
563570msgstr ""
564571
565- #: ../../c-api/type.rst:491
572+ #: ../../c-api/type.rst:495
566573msgid ""
567574":c:member:`~PyTypeObject.tp_dictoffset` (use :c:macro:"
568575"`Py_TPFLAGS_MANAGED_DICT` instead if possible)"
569576msgstr ""
570577":c:member:`~PyTypeObject.tp_dictoffset`\\ (如果可能,請改用 :c:macro:"
571578"`Py_TPFLAGS_MANAGED_DICT`)"
572579
573- #: ../../c-api/type.rst:493
580+ #: ../../c-api/type.rst:497
574581msgid ""
575582":c:member:`~PyTypeObject.tp_vectorcall_offset` (use "
576583"``\" __vectorcalloffset__\" `` in :ref:`PyMemberDef <pymemberdef-offsets>`)"
577584msgstr ""
578585":c:member:`~PyTypeObject.tp_vectorcall_offset`\\ (請用 :ref:`PyMemberDef "
579586"<pymemberdef-offsets>` 中的 ``\" __vectorcalloffset__\" ``)"
580587
581- #: ../../c-api/type.rst:497
588+ #: ../../c-api/type.rst:501
582589msgid ""
583590"If it is not possible to switch to a ``MANAGED`` flag (for example, for "
584591"vectorcall or to support Python older than 3.12), specify the offset in :c:"
585592"member:`Py_tp_members <PyTypeObject.tp_members>`. See :ref:`PyMemberDef "
586593"documentation <pymemberdef-offsets>` for details."
587594msgstr ""
588595
589- #: ../../c-api/type.rst:503
596+ #: ../../c-api/type.rst:507
590597msgid "The following fields cannot be set at all when creating a heap type:"
591598msgstr ""
592599
593- #: ../../c-api/type.rst:505
600+ #: ../../c-api/type.rst:509
594601msgid ""
595602":c:member:`~PyTypeObject.tp_vectorcall` (use :c:member:`~PyTypeObject."
596603"tp_new` and/or :c:member:`~PyTypeObject.tp_init`)"
597604msgstr ""
598605
599- #: ../../c-api/type.rst:509
606+ #: ../../c-api/type.rst:513
600607msgid ""
601608"Internal fields: :c:member:`~PyTypeObject.tp_dict`, :c:member:`~PyTypeObject."
602609"tp_mro`, :c:member:`~PyTypeObject.tp_cache`, :c:member:`~PyTypeObject."
603610"tp_subclasses`, and :c:member:`~PyTypeObject.tp_weaklist`."
604611msgstr ""
605612
606- #: ../../c-api/type.rst:516
613+ #: ../../c-api/type.rst:520
607614msgid ""
608615"Setting :c:data:`Py_tp_bases` or :c:data:`Py_tp_base` may be problematic on "
609616"some platforms. To avoid issues, use the *bases* argument of :c:func:"
610617"`PyType_FromSpecWithBases` instead."
611618msgstr ""
612619
613- #: ../../c-api/type.rst:521
620+ #: ../../c-api/type.rst:525
614621msgid "Slots in :c:type:`PyBufferProcs` may be set in the unlimited API."
615622msgstr ""
616623
617- #: ../../c-api/type.rst:524
624+ #: ../../c-api/type.rst:528
618625msgid ""
619626":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs."
620627"bf_releasebuffer` are now available under the :ref:`limited API <limited-c-"
621628"api>`."
622629msgstr ""
623630
624- #: ../../c-api/type.rst:531
631+ #: ../../c-api/type.rst:535
625632msgid ""
626633"The desired value of the slot. In most cases, this is a pointer to a "
627634"function."
628635msgstr ""
629636
630- #: ../../c-api/type.rst:534
637+ #: ../../c-api/type.rst:538
631638msgid "Slots other than ``Py_tp_doc`` may not be ``NULL``."
632639msgstr ""
633640
0 commit comments