@@ -2263,6 +2263,12 @@ msgid ""
22632263"obvious, and there's rarely a good reason to avoid implementing "
22642264":c:member:`~PyTypeObject.tp_clear`."
22652265msgstr ""
2266+ ":c:member:`~PyTypeObject.tp_clear` 成员函数被用来打破垃圾回收器在循环垃圾中检测到的循环引用。 总的来说,系统中的所有"
2267+ " :c:member:`~PyTypeObject.tp_clear` 函数必须合到一起以打破所有引用循环。 "
2268+ "这是个微妙的问题,并且如有任何疑问都需要提供 :c:member:`~PyTypeObject.tp_clear` 函数。 例如,元组类型不会实现 "
2269+ ":c:member:`~PyTypeObject.tp_clear` 函数,因为有可能证明完全用元组是不会构成循环引用的。 因此其他类型的 "
2270+ ":c:member:`~PyTypeObject.tp_clear` 函数必须足以打破任何包含元组的循环。 这不是立即能明确的,并且很少会有避免实现 "
2271+ ":c:member:`~PyTypeObject.tp_clear` 的适当理由。"
22662272
22672273#: ../../c-api/typeobj.rst:1284
22682274msgid ""
@@ -2271,6 +2277,8 @@ msgid ""
22712277"and set its pointers to those members to ``NULL``, as in the following "
22722278"example::"
22732279msgstr ""
2280+ ":c:member:`~PyTypeObject.tp_clear` 的实现应当丢弃实例指向其成员的可能为 Python "
2281+ "对象的引用,并将指向这些成员的指针设为 ``NULL``,如下面的例子所示::"
22742282
22752283#: ../../c-api/typeobj.rst:1298
22762284msgid ""
@@ -2568,33 +2576,36 @@ msgstr ""
25682576msgid ""
25692577"This field is not inherited by subtypes (members are inherited through a "
25702578"different mechanism)."
2571- msgstr ""
2579+ msgstr "该字段不会被子类型所继承(成员是通过不同的机制来继承的)。 "
25722580
25732581#: ../../c-api/typeobj.rst:1498
25742582msgid ""
25752583"An optional pointer to a static ``NULL``-terminated array of "
25762584":c:type:`PyGetSetDef` structures, declaring computed attributes of instances"
25772585" of this type."
25782586msgstr ""
2587+ "一个可选的指向 :c:type:`PyGetSetDef` 结构体的以 ``NULL`` 结束的静态数组的指针,它声明了此类型的实例中被计算出的属性。"
25792588
25802589#: ../../c-api/typeobj.rst:1501
25812590msgid ""
25822591"For each entry in the array, an entry is added to the type's dictionary (see"
25832592" :c:member:`~PyTypeObject.tp_dict` below) containing a getset descriptor."
25842593msgstr ""
2594+ "对于该数组中的每一项,都会向类型的字典 (参见下面的 :c:member:`~PyTypeObject.tp_dict`) "
2595+ "添加一个包含读写描述器的条目。"
25852596
25862597#: ../../c-api/typeobj.rst:1506
25872598msgid ""
25882599"This field is not inherited by subtypes (computed attributes are inherited "
25892600"through a different mechanism)."
2590- msgstr ""
2601+ msgstr "该字段不会被子类型所继承(被计算属性是通过不同的机制来继承的)。 "
25912602
25922603#: ../../c-api/typeobj.rst:1512
25932604msgid ""
25942605"An optional pointer to a base type from which type properties are inherited."
25952606" At this level, only single inheritance is supported; multiple inheritance "
25962607"require dynamically creating a type object by calling the metatype."
2597- msgstr ""
2608+ msgstr "一个可选的指向类型特征属性所继承的基类型的指针。 在这个层级上,只支持单继承;多重继承需要通过调用元类型动态地创建类型对象。 "
25982609
25992610#: ../../c-api/typeobj.rst:1520
26002611msgid ""
@@ -2603,6 +2614,8 @@ msgid ""
26032614" like :c:func:`PyType_GenericNew`, with implicit conversion to a pointer, "
26042615"are valid C99 address constants."
26052616msgstr ""
2617+ "槽位初始化需要遵循初始化全局变量的规则。 C99 要求初始化器为“地址常量”。 隐式转换为指针的函数指示器如 "
2618+ ":c:func:`PyType_GenericNew` 都是有效的 C99 地址常量。"
26062619
26072620#: ../../c-api/typeobj.rst:1525
26082621msgid ""
@@ -2616,7 +2629,7 @@ msgstr ""
26162629msgid ""
26172630"Consequently, :c:member:`~PyTypeObject.tp_base` should be set in the "
26182631"extension module's init function."
2619- msgstr ""
2632+ msgstr "因此,应当在扩展模块的初始化函数中设置 :c:member:`~PyTypeObject.tp_base`。 "
26202633
26212634#: ../../c-api/typeobj.rst:1536
26222635msgid "This field is not inherited by subtypes (obviously)."
0 commit comments