@@ -12,10 +12,10 @@ other objects, or which only store references to atomic types (such as numbers
1212or strings), do not need to provide any explicit support for garbage
1313collection.
1414
15- To create a container type, the :attr: ` tp_flags ` field of the type object must
15+ To create a container type, the :c:member: ` ~PyTypeObject. tp_flags ` field of the type object must
1616include the :const: `Py_TPFLAGS_HAVE_GC ` and provide an implementation of the
17- :attr: ` tp_traverse ` handler. If instances of the type are mutable, a
18- :attr: ` tp_clear ` implementation must also be provided.
17+ :c:member: ` ~PyTypeObject. tp_traverse ` handler. If instances of the type are mutable, a
18+ :c:member: ` ~PyTypeObject. tp_clear ` implementation must also be provided.
1919
2020
2121.. data :: Py_TPFLAGS_HAVE_GC
@@ -57,7 +57,7 @@ Constructors for container types must conform to two rules:
5757 Adds the object *op * to the set of container objects tracked by the
5858 collector. The collector can run at unexpected times so objects must be
5959 valid while being tracked. This should be called once all the fields
60- followed by the :attr: ` tp_traverse ` handler become valid, usually near the
60+ followed by the :c:member: ` ~PyTypeObject. tp_traverse ` handler become valid, usually near the
6161 end of the constructor.
6262
6363
@@ -86,28 +86,28 @@ rules:
8686 Remove the object *op * from the set of container objects tracked by the
8787 collector. Note that :c:func: `PyObject_GC_Track ` can be called again on
8888 this object to add it back to the set of tracked objects. The deallocator
89- (:attr: ` tp_dealloc ` handler) should call this for the object before any of
90- the fields used by the :attr:` tp_traverse` handler become invalid.
89+ (:c:member: ` ~PyTypeObject. tp_dealloc ` handler) should call this for the object before any of
90+ the fields used by the :c:member:`~PyTypeObject. tp_traverse` handler become invalid.
9191
9292
9393.. c:function:: void _PyObject_GC_UNTRACK(PyObject *op)
9494
9595 A macro version of :c:func: `PyObject_GC_UnTrack `. It should not be used for
9696 extension modules.
9797
98- The :attr: ` tp_traverse ` handler accepts a function parameter of this type:
98+ The :c:member: ` ~PyTypeObject. tp_traverse ` handler accepts a function parameter of this type:
9999
100100
101101.. c :type :: int (*visitproc)(PyObject *object, void *arg)
102102
103- Type of the visitor function passed to the :attr: ` tp_traverse ` handler.
103+ Type of the visitor function passed to the :c:member: ` ~PyTypeObject. tp_traverse ` handler.
104104 The function should be called with an object to traverse as *object * and
105- the third parameter to the :attr: ` tp_traverse ` handler as *arg *. The
105+ the third parameter to the :c:member: ` ~PyTypeObject. tp_traverse ` handler as *arg *. The
106106 Python core uses several visitor functions to implement cyclic garbage
107107 detection; it's not expected that users will need to write their own
108108 visitor functions.
109109
110- The :attr: ` tp_traverse ` handler must have the following type:
110+ The :c:member: ` ~PyTypeObject. tp_traverse ` handler must have the following type:
111111
112112
113113.. c :type :: int (*traverseproc)(PyObject *self, visitproc visit, void *arg)
@@ -119,15 +119,15 @@ The :attr:`tp_traverse` handler must have the following type:
119119 object argument. If *visit * returns a non-zero value that value should be
120120 returned immediately.
121121
122- To simplify writing :attr: ` tp_traverse ` handlers, a :c:func: `Py_VISIT ` macro is
123- provided. In order to use this macro, the :attr: ` tp_traverse ` implementation
122+ To simplify writing :c:member: ` ~PyTypeObject. tp_traverse ` handlers, a :c:func: `Py_VISIT ` macro is
123+ provided. In order to use this macro, the :c:member: ` ~PyTypeObject. tp_traverse ` implementation
124124must name its arguments exactly *visit * and *arg *:
125125
126126
127127.. c :function :: void Py_VISIT (PyObject *o)
128128
129129 Call the *visit * callback, with arguments *o * and *arg *. If *visit * returns
130- a non-zero value, then return it. Using this macro, :attr: ` tp_traverse `
130+ a non-zero value, then return it. Using this macro, :c:member: ` ~PyTypeObject. tp_traverse `
131131 handlers look like::
132132
133133 static int
@@ -138,7 +138,7 @@ must name its arguments exactly *visit* and *arg*:
138138 return 0;
139139 }
140140
141- The :attr: ` tp_clear ` handler must be of the :c:type: `inquiry ` type, or *NULL *
141+ The :c:member: ` ~PyTypeObject. tp_clear ` handler must be of the :c:type: `inquiry ` type, or *NULL *
142142if the object is immutable.
143143
144144
0 commit comments