44# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55#
66# Translators:
7- # Freesand Leo <[email protected] >, 202187# Pandaaaa906 <[email protected] >, 202198109# ppcfish <[email protected] >, 20211110# ruoyu zhang <[email protected] >, 202111+ 12+ # Freesand Leo <[email protected] >, 20211213#
1314#, fuzzy
1415msgid ""
@@ -17,7 +18,7 @@ msgstr ""
1718"Report-Msgid-Bugs-To : \n "
1819"POT-Creation-Date : 2021-08-05 13:13+0000\n "
1920"PO-Revision-Date : 2021-06-28 00:50+0000\n "
20- "Last-Translator : ruoyu zhang <ruoyu0088@gmail .com>, 2021\n "
21+ "Last-Translator : Freesand Leo <yuqinju@163 .com>, 2021\n "
2122"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2223"MIME-Version : 1.0\n "
2324"Content-Type : text/plain; charset=UTF-8\n "
@@ -39,6 +40,9 @@ msgid ""
3940"behave, so they are very important to the interpreter itself and to any "
4041"extension module that implements new types."
4142msgstr ""
43+ "也许 Python 对象系统中最重要的结构之一就是定义新类型的结构: :c:type:`PyTypeObject` 结构。 类型对象可以使用任何 "
44+ ":c:func:`PyObject_\\ *` 或 :c:func:`PyType_\\ *` 函数来处理,但不能提供大多数 Python "
45+ "应用程序所感兴趣的内容。 这些对象是对象行为的基础,所以它们对解释器本身或任何实现新类型的扩展模块都非常重要。"
4246
4347#: ../../c-api/typeobj.rst:16
4448msgid ""
@@ -49,21 +53,24 @@ msgid ""
4953"detail in this section. The fields will be described in the order in which "
5054"they occur in the structure."
5155msgstr ""
56+ "与大多数标准类型相比,类型对象相当大。这么大的原因是每个类型对象存储了大量的值,大部分是C函数指针,每个指针实现了类型功能的一小部分。本节将详细描述类型对象的字段。这些字段将按照它们在结构中出现的顺序进行描述。"
5257
5358#: ../../c-api/typeobj.rst:23
5459msgid ""
5560"In addition to the following quick reference, the :ref:`typedef-examples` "
5661"section provides at-a-glance insight into the meaning and use of "
5762":c:type:`PyTypeObject`."
5863msgstr ""
64+ "除了下面的快速参考,:ref:`typedef-examples` 小节提供了快速了解 :c:type:`PyTypeObject` "
65+ "的含义和用法的例子。"
5966
6067#: ../../c-api/typeobj.rst:29
6168msgid "Quick Reference"
6269msgstr "快速参考"
6370
6471#: ../../c-api/typeobj.rst:34
6572msgid "\" tp slots\" "
66- msgstr "\" tp 槽 \" "
73+ msgstr "\" tp_方法槽 \" "
6774
6875#: ../../c-api/typeobj.rst:40
6976msgid "PyTypeObject Slot [#slots]_"
@@ -615,40 +622,41 @@ msgid ""
615622"are for internal use only. \" <R>\" (as a prefix) means the field is required"
616623" (must be non-``NULL``)."
617624msgstr ""
625+ "小括号中的槽名表示它(实际上)已弃用。尖括号中的名称应该被视为只读的。方括号中的名称仅供内部使用。\" <R>\" (作为前缀)表示该字段是必需的(必须是非``NULL``)。"
618626
619627#: ../../c-api/typeobj.rst:156
620628msgid "Columns:"
621629msgstr "列:"
622630
623631#: ../../c-api/typeobj.rst:158
624632msgid "**\" O\" **: set on :c:type:`PyBaseObject_Type`"
625- msgstr ""
633+ msgstr "** \" O \" **: :c:type:`PyBaseObject_Type` 必须设置 "
626634
627635#: ../../c-api/typeobj.rst:160
628636msgid "**\" T\" **: set on :c:type:`PyType_Type`"
629- msgstr ""
637+ msgstr "** \" T \" **: :c:type:`PyType_Type` 必须设置 "
630638
631639#: ../../c-api/typeobj.rst:162
632640msgid "**\" D\" **: default (if slot is set to ``NULL``)"
633- msgstr ""
641+ msgstr "** \" D \" **: 默认设置(如果方法槽被设置为NULL) "
634642
635643#: ../../c-api/typeobj.rst:172
636644msgid "**\" I\" **: inheritance"
637- msgstr ""
645+ msgstr "** \" I \" **: 继承 "
638646
639647#: ../../c-api/typeobj.rst:181
640648msgid ""
641649"Note that some slots are effectively inherited through the normal attribute "
642650"lookup chain."
643- msgstr ""
651+ msgstr "注意,有些方法槽是通过普通属性查找链有效继承的。 "
644652
645653#: ../../c-api/typeobj.rst:187
646654msgid "sub-slots"
647- msgstr ""
655+ msgstr "子方法槽(方法域) "
648656
649657#: ../../c-api/typeobj.rst:193
650658msgid "Slot"
651- msgstr "槽 "
659+ msgstr "方法槽 "
652660
653661#: ../../c-api/typeobj.rst:193
654662msgid "special methods"
@@ -1169,6 +1177,8 @@ msgid ""
11691177":file:`Include/object.h`. For convenience of reference, this repeats the "
11701178"definition found there:"
11711179msgstr ""
1180+ ":c:type:`PyTypeObject` 的结构定义可以在 :file:`Include/object.h` 中找到。 "
1181+ "为了方便参考,此处复述了其中的定义:"
11721182
11731183#: ../../c-api/typeobj.rst:476
11741184msgid "PyObject Slots"
@@ -1183,6 +1193,10 @@ msgid ""
11831193":c:member:`~PyTypeObject.tp_itemsize`, which means that its instances (i.e. "
11841194"type objects) *must* have the :attr:`ob_size` field."
11851195msgstr ""
1196+ "type 对象结构扩展了 :c:type:`PyVarObject` 结构。 :attr:`ob_size` 字段用于动态类型 (由 "
1197+ ":func:`type_new` 创建,通常通过 class 语句来调用)。 注意 :c:data:`PyType_Type` (元类型) 会初始化 "
1198+ ":c:member:`~PyTypeObject.tp_itemsize`,这意味着它的实例 (即 type 对象) *必须* 具有 "
1199+ ":attr:`ob_size` 字段。"
11861200
11871201#: ../../c-api/typeobj.rst:487
11881202msgid ""
@@ -1193,6 +1207,9 @@ msgid ""
11931207"for :ref:`dynamically allocated type objects <heap-types>`, the instances "
11941208"*do* count as references."
11951209msgstr ""
1210+ "这是类型对象的引用计数,由 ``PyObject_HEAD_INIT`` 宏初始化为 ``1``。 请注意对于 :ref:`静态分配的类型对象 "
1211+ "<static-types>`,类型的实例 (对象的 :attr:`ob_type` 指回该类型) *不会* 被加入引用计数。 但对于 "
1212+ ":ref:`动态分配的类型对象 <heap-types>`,实例 *确实* 会被算作引用。"
11961213
11971214#: ../../c-api/typeobj.rst:494 ../../c-api/typeobj.rst:517
11981215#: ../../c-api/typeobj.rst:539 ../../c-api/typeobj.rst:553
@@ -1231,7 +1248,7 @@ msgstr ""
12311248#: ../../c-api/typeobj.rst:496 ../../c-api/typeobj.rst:555
12321249#: ../../c-api/typeobj.rst:599
12331250msgid "This field is not inherited by subtypes."
1234- msgstr ""
1251+ msgstr "子类型不继承此字段。 "
12351252
12361253#: ../../c-api/typeobj.rst:501
12371254msgid ""
0 commit comments