@@ -924,27 +924,30 @@ msgid ""
924924"As you can see, the source code closely resembles the :class:`Custom` "
925925"examples in previous sections. We will break down the main differences "
926926"between them. ::"
927- msgstr ""
927+ msgstr "如你所见,此源代码与之前小节中的 :class:`Custom` 示例非常相似。 我们将逐一讲解它们之间的主要区别。 :: "
928928
929929#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/extending/newtypes_tutorial.rst:828
930930msgid ""
931931"The primary difference for derived type objects is that the base type's "
932932"object structure must be the first value. The base type will already "
933933"include the :c:func:`PyObject_HEAD` at the beginning of its structure."
934934msgstr ""
935+ "派生类型对象的主要差异在于基类型的对象结构体必须是第一个值。 基类型将已经在其结构体的开头包括了 :c:func:`PyObject_HEAD`。"
935936
936937#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/extending/newtypes_tutorial.rst:832
937938msgid ""
938939"When a Python object is a :class:`SubList` instance, its ``PyObject *`` "
939940"pointer can be safely cast to both ``PyListObject *`` and ``SubListObject "
940941"*``::"
941942msgstr ""
943+ "当一个 Python 对象是 :class:`SubList` 的实例时,它的 ``PyObject *`` 指针可以被安全地强制转换为 "
944+ "``PyListObject *`` 和 ``SubListObject *``::"
942945
943946#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/extending/newtypes_tutorial.rst:844
944947msgid ""
945948"We see above how to call through to the :attr:`__init__` method of the base "
946949"type."
947- msgstr ""
950+ msgstr "我们可以在上面看到如何调用至基类型的 :attr:`__init__` 方法。 "
948951
949952#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/extending/newtypes_tutorial.rst:847
950953msgid ""
@@ -955,6 +958,11 @@ msgid ""
955958":c:member:`~PyTypeObject.tp_alloc`, but let the base class handle it by "
956959"calling its own :c:member:`~PyTypeObject.tp_new`."
957960msgstr ""
961+ "这个模式在编写具有自定义 :c:member:`~PyTypeObject.tp_new` 和 "
962+ ":c:member:`~PyTypeObject.tp_dealloc` 成员的类型时很重要。 "
963+ ":c:member:`~PyTypeObject.tp_new` 处理句柄不应为具有 "
964+ ":c:member:`~PyTypeObject.tp_alloc` 的对象实际分配内存,而是让基类通过调用自己的 "
965+ ":c:member:`~PyTypeObject.tp_new` 来处理它。"
958966
959967#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/extending/newtypes_tutorial.rst:853
960968msgid ""
0 commit comments