Skip to content

Commit 043a102

Browse files
sync with cpython 9a434858
1 parent ce8e1ba commit 043a102

File tree

4 files changed

+610
-524
lines changed

4 files changed

+610
-524
lines changed

c-api/allocation.po

+20-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ msgid ""
99
msgstr ""
1010
"Project-Id-Version: Python 3.13\n"
1111
"Report-Msgid-Bugs-To: \n"
12-
"POT-Creation-Date: 2024-11-06 00:13+0000\n"
12+
"POT-Creation-Date: 2025-03-18 00:14+0000\n"
1313
"PO-Revision-Date: 2022-10-16 15:35+0800\n"
1414
"Last-Translator: Matt Wang <[email protected]>\n"
1515
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -56,7 +56,14 @@ msgstr ""
5656
"化;呼叫者會擁有那個對於物件的唯一參照(物件的參照計數為一)。記憶體分配大小"
5757
"由 type 物件的 :c:member:`~PyTypeObject.tp_basicsize` 欄位來指定。"
5858

59-
#: ../../c-api/allocation.rst:41
59+
#: ../../c-api/allocation.rst:38
60+
msgid ""
61+
"Note that this function is unsuitable if *typeobj* has :c:macro:"
62+
"`Py_TPFLAGS_HAVE_GC` set. For such objects, use :c:func:`PyObject_GC_New` "
63+
"instead."
64+
msgstr ""
65+
66+
#: ../../c-api/allocation.rst:45
6067
msgid ""
6168
"Allocate a new Python object using the C structure type *TYPE* and the "
6269
"Python type object *typeobj* (``PyTypeObject*``). Fields not defined by the "
@@ -75,7 +82,14 @@ msgstr ""
7582
"於實現如 tuple 這種能夠在建立期間決定自己大小的物件是很實用的。將欄位的陣列嵌"
7683
"入到相同的記憶體分配中可以減少記憶體分配的次數,這提高了記憶體管理的效率。"
7784

78-
#: ../../c-api/allocation.rst:55
85+
#: ../../c-api/allocation.rst:56
86+
msgid ""
87+
"Note that this function is unsuitable if *typeobj* has :c:macro:"
88+
"`Py_TPFLAGS_HAVE_GC` set. For such objects, use :c:func:`PyObject_GC_NewVar` "
89+
"instead."
90+
msgstr ""
91+
92+
#: ../../c-api/allocation.rst:63
7993
msgid ""
8094
"Releases memory allocated to an object using :c:macro:`PyObject_New` or :c:"
8195
"macro:`PyObject_NewVar`. This is normally called from the :c:member:"
@@ -88,7 +102,7 @@ msgstr ""
88102
"handler 中呼叫。呼叫這個函式以後,物件的各欄位都不可以被存取,因為原本分配的"
89103
"記憶體已不再是一個有效的 Python 物件。"
90104

91-
#: ../../c-api/allocation.rst:64
105+
#: ../../c-api/allocation.rst:72
92106
msgid ""
93107
"Object which is visible in Python as ``None``. This should only be accessed "
94108
"using the :c:macro:`Py_None` macro, which evaluates to a pointer to this "
@@ -97,10 +111,10 @@ msgstr ""
97111
"這個物件像是 Python 中的 ``None``。它只應該透過 :c:macro:`Py_None` 巨集來存"
98112
"取,該巨集的拿到指向該物件的指標。"
99113

100-
#: ../../c-api/allocation.rst:71
114+
#: ../../c-api/allocation.rst:79
101115
msgid ":c:func:`PyModule_Create`"
102116
msgstr ":c:func:`PyModule_Create`"
103117

104-
#: ../../c-api/allocation.rst:72
118+
#: ../../c-api/allocation.rst:80
105119
msgid "To allocate and create extension modules."
106120
msgstr "分配記憶體和建立擴充模組。"

c-api/type.po

+34-32
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: 2024-12-01 15:01+0000\n"
9+
"POT-Creation-Date: 2025-03-18 00:14+0000\n"
1010
"PO-Revision-Date: 2015-12-09 17:51+0000\n"
1111
"Last-Translator: Liang-Bo Wang <[email protected]>\n"
1212
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -450,20 +450,22 @@ msgid ""
450450
"If negative, the absolute value specifies how much space instances of the "
451451
"class need *in addition* to the superclass. Use :c:func:"
452452
"`PyObject_GetTypeData` to get a pointer to subclass-specific memory reserved "
453-
"this way."
453+
"this way. For negative :c:member:`!basicsize`, Python will insert padding "
454+
"when needed to meet :c:member:`~PyTypeObject.tp_basicsize`'s alignment "
455+
"requirements."
454456
msgstr ""
455457

456-
#: ../../c-api/type.rst:418
458+
#: ../../c-api/type.rst:421
457459
msgid "Previously, this field could not be negative."
458460
msgstr ""
459461

460-
#: ../../c-api/type.rst:422
462+
#: ../../c-api/type.rst:425
461463
msgid ""
462464
"Size of one element of a variable-size type, in bytes. Used to set :c:member:"
463465
"`PyTypeObject.tp_itemsize`. See ``tp_itemsize`` documentation for caveats."
464466
msgstr ""
465467

466-
#: ../../c-api/type.rst:426
468+
#: ../../c-api/type.rst:429
467469
msgid ""
468470
"If zero, :c:member:`~PyTypeObject.tp_itemsize` is inherited. Extending "
469471
"arbitrary variable-sized classes is dangerous, since some types use a fixed "
@@ -472,154 +474,154 @@ msgid ""
472474
"only possible in the following situations:"
473475
msgstr ""
474476

475-
#: ../../c-api/type.rst:433
477+
#: ../../c-api/type.rst:436
476478
msgid ""
477479
"The base is not variable-sized (its :c:member:`~PyTypeObject.tp_itemsize`)."
478480
msgstr ""
479481

480-
#: ../../c-api/type.rst:435
482+
#: ../../c-api/type.rst:438
481483
msgid ""
482484
"The requested :c:member:`PyType_Spec.basicsize` is positive, suggesting that "
483485
"the memory layout of the base class is known."
484486
msgstr ""
485487

486-
#: ../../c-api/type.rst:437
488+
#: ../../c-api/type.rst:440
487489
msgid ""
488490
"The requested :c:member:`PyType_Spec.basicsize` is zero, suggesting that the "
489491
"subclass does not access the instance's memory directly."
490492
msgstr ""
491493

492-
#: ../../c-api/type.rst:440
494+
#: ../../c-api/type.rst:443
493495
msgid "With the :c:macro:`Py_TPFLAGS_ITEMS_AT_END` flag."
494496
msgstr ""
495497

496-
#: ../../c-api/type.rst:444
498+
#: ../../c-api/type.rst:447
497499
msgid "Type flags, used to set :c:member:`PyTypeObject.tp_flags`."
498500
msgstr ""
499501

500-
#: ../../c-api/type.rst:446
502+
#: ../../c-api/type.rst:449
501503
msgid ""
502504
"If the ``Py_TPFLAGS_HEAPTYPE`` flag is not set, :c:func:"
503505
"`PyType_FromSpecWithBases` sets it automatically."
504506
msgstr ""
505507

506-
#: ../../c-api/type.rst:451
508+
#: ../../c-api/type.rst:454
507509
msgid ""
508510
"Array of :c:type:`PyType_Slot` structures. Terminated by the special slot "
509511
"value ``{0, NULL}``."
510512
msgstr ""
511513

512-
#: ../../c-api/type.rst:454
514+
#: ../../c-api/type.rst:457
513515
msgid "Each slot ID should be specified at most once."
514516
msgstr ""
515517

516-
#: ../../c-api/type.rst:464
518+
#: ../../c-api/type.rst:467
517519
msgid ""
518520
"Structure defining optional functionality of a type, containing a slot ID "
519521
"and a value pointer."
520522
msgstr ""
521523

522-
#: ../../c-api/type.rst:469
524+
#: ../../c-api/type.rst:472
523525
msgid "A slot ID."
524526
msgstr ""
525527

526-
#: ../../c-api/type.rst:471
528+
#: ../../c-api/type.rst:474
527529
msgid ""
528530
"Slot IDs are named like the field names of the structures :c:type:"
529531
"`PyTypeObject`, :c:type:`PyNumberMethods`, :c:type:`PySequenceMethods`, :c:"
530532
"type:`PyMappingMethods` and :c:type:`PyAsyncMethods` with an added ``Py_`` "
531533
"prefix. For example, use:"
532534
msgstr ""
533535

534-
#: ../../c-api/type.rst:477
536+
#: ../../c-api/type.rst:480
535537
msgid "``Py_tp_dealloc`` to set :c:member:`PyTypeObject.tp_dealloc`"
536538
msgstr ""
537539

538-
#: ../../c-api/type.rst:478
540+
#: ../../c-api/type.rst:481
539541
msgid "``Py_nb_add`` to set :c:member:`PyNumberMethods.nb_add`"
540542
msgstr ""
541543

542-
#: ../../c-api/type.rst:479
544+
#: ../../c-api/type.rst:482
543545
msgid "``Py_sq_length`` to set :c:member:`PySequenceMethods.sq_length`"
544546
msgstr ""
545547

546-
#: ../../c-api/type.rst:481
548+
#: ../../c-api/type.rst:484
547549
msgid ""
548550
"The following “offset” fields cannot be set using :c:type:`PyType_Slot`:"
549551
msgstr ""
550552

551-
#: ../../c-api/type.rst:483
553+
#: ../../c-api/type.rst:486
552554
msgid ""
553555
":c:member:`~PyTypeObject.tp_weaklistoffset` (use :c:macro:"
554556
"`Py_TPFLAGS_MANAGED_WEAKREF` instead if possible)"
555557
msgstr ""
556558

557-
#: ../../c-api/type.rst:485
559+
#: ../../c-api/type.rst:488
558560
msgid ""
559561
":c:member:`~PyTypeObject.tp_dictoffset` (use :c:macro:"
560562
"`Py_TPFLAGS_MANAGED_DICT` instead if possible)"
561563
msgstr ""
562564
":c:member:`~PyTypeObject.tp_dictoffset`\\ (如果可能,請改用 :c:macro:"
563565
"`Py_TPFLAGS_MANAGED_DICT`)"
564566

565-
#: ../../c-api/type.rst:487
567+
#: ../../c-api/type.rst:490
566568
msgid ""
567569
":c:member:`~PyTypeObject.tp_vectorcall_offset` (use "
568570
"``\"__vectorcalloffset__\"`` in :ref:`PyMemberDef <pymemberdef-offsets>`)"
569571
msgstr ""
570572
":c:member:`~PyTypeObject.tp_vectorcall_offset`\\ (請用 :ref:`PyMemberDef "
571573
"<pymemberdef-offsets>` 中的 ``\"__vectorcalloffset__\"``)"
572574

573-
#: ../../c-api/type.rst:491
575+
#: ../../c-api/type.rst:494
574576
msgid ""
575577
"If it is not possible to switch to a ``MANAGED`` flag (for example, for "
576578
"vectorcall or to support Python older than 3.12), specify the offset in :c:"
577579
"member:`Py_tp_members <PyTypeObject.tp_members>`. See :ref:`PyMemberDef "
578580
"documentation <pymemberdef-offsets>` for details."
579581
msgstr ""
580582

581-
#: ../../c-api/type.rst:497
583+
#: ../../c-api/type.rst:500
582584
msgid "The following fields cannot be set at all when creating a heap type:"
583585
msgstr ""
584586

585-
#: ../../c-api/type.rst:499
587+
#: ../../c-api/type.rst:502
586588
msgid ""
587589
":c:member:`~PyTypeObject.tp_vectorcall` (use :c:member:`~PyTypeObject."
588590
"tp_new` and/or :c:member:`~PyTypeObject.tp_init`)"
589591
msgstr ""
590592

591-
#: ../../c-api/type.rst:503
593+
#: ../../c-api/type.rst:506
592594
msgid ""
593595
"Internal fields: :c:member:`~PyTypeObject.tp_dict`, :c:member:`~PyTypeObject."
594596
"tp_mro`, :c:member:`~PyTypeObject.tp_cache`, :c:member:`~PyTypeObject."
595597
"tp_subclasses`, and :c:member:`~PyTypeObject.tp_weaklist`."
596598
msgstr ""
597599

598-
#: ../../c-api/type.rst:510
600+
#: ../../c-api/type.rst:513
599601
msgid ""
600602
"Setting :c:data:`Py_tp_bases` or :c:data:`Py_tp_base` may be problematic on "
601603
"some platforms. To avoid issues, use the *bases* argument of :c:func:"
602604
"`PyType_FromSpecWithBases` instead."
603605
msgstr ""
604606

605-
#: ../../c-api/type.rst:515
607+
#: ../../c-api/type.rst:518
606608
msgid "Slots in :c:type:`PyBufferProcs` may be set in the unlimited API."
607609
msgstr ""
608610

609-
#: ../../c-api/type.rst:518
611+
#: ../../c-api/type.rst:521
610612
msgid ""
611613
":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs."
612614
"bf_releasebuffer` are now available under the :ref:`limited API <limited-c-"
613615
"api>`."
614616
msgstr ""
615617

616-
#: ../../c-api/type.rst:525
618+
#: ../../c-api/type.rst:528
617619
msgid ""
618620
"The desired value of the slot. In most cases, this is a pointer to a "
619621
"function."
620622
msgstr ""
621623

622-
#: ../../c-api/type.rst:528
624+
#: ../../c-api/type.rst:531
623625
msgid "Slots other than ``Py_tp_doc`` may not be ``NULL``."
624626
msgstr ""
625627

0 commit comments

Comments
 (0)