@@ -798,12 +798,14 @@ msgid ""
798
798
"needs to fill two additional slots and to enable a flag that enables these "
799
799
"slots:"
800
800
msgstr ""
801
+ "要允许一个参加引用循环的 :class:`Custom` 实例被循环 GC 正确地删除并回收,我们的 :class:`Custom` "
802
+ "类型需要填充两个额外槽位并增加启用这些槽位的旗标:"
801
803
802
804
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/extending/newtypes_tutorial.rst:696
803
805
msgid ""
804
806
"First, the traversal method lets the cyclic GC know about subobjects that "
805
807
"could participate in cycles::"
806
- msgstr ""
808
+ msgstr "首先,遍历方法让循环 GC 知道能够参加循环的子对象:: "
807
809
808
810
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/extending/newtypes_tutorial.rst:716
809
811
msgid ""
@@ -813,19 +815,25 @@ msgid ""
813
815
"argument *arg* passed to the traversal method. It returns an integer value "
814
816
"that must be returned if it is non-zero."
815
817
msgstr ""
818
+ "对于每个能够参加循环的子对象,我们需要调用 :c:func:`visit` 函数,向它传入该遍历方法。 :c:func:`visit` "
819
+ "函数接受该子对象作为参数并接受传给遍历方法的额外参数 *arg*。 它返回一个必须在非零时返回的整数值。"
816
820
817
821
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/extending/newtypes_tutorial.rst:722
818
822
msgid ""
819
823
"Python provides a :c:func:`Py_VISIT` macro that automates calling visit "
820
824
"functions. With :c:func:`Py_VISIT`, we can minimize the amount of "
821
825
"boilerplate in ``Custom_traverse``::"
822
826
msgstr ""
827
+ "Python 提供了一个可自动调用 visit 函数的 :c:func:`Py_VISIT` 宏。 使用 "
828
+ ":c:func:`Py_VISIT`,我们可以最小化 ``Custom_traverse`` 中的准备工作量::"
823
829
824
830
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/extending/newtypes_tutorial.rst:735
825
831
msgid ""
826
832
"The :c:member:`~PyTypeObject.tp_traverse` implementation must name its "
827
833
"arguments exactly *visit* and *arg* in order to use :c:func:`Py_VISIT`."
828
834
msgstr ""
835
+ ":c:member:`~PyTypeObject.tp_traverse` 实现必须将其参数准确命名为 *visit* 和 *arg* 以便使用 "
836
+ ":c:func:`Py_VISIT`。"
829
837
830
838
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/extending/newtypes_tutorial.rst:738
831
839
msgid ""
0 commit comments