@@ -97,6 +97,15 @@ Type Objects
9797 from a type's base class. Return ``0 `` on success, or return ``-1 `` and sets an
9898 exception on error.
9999
100+ .. note ::
101+ If some of the base classes implements the GC protocol and the provided
102+ type does not include the :const: `Py_TPFLAGS_HAVE_GC ` in its flags, then
103+ the GC protocol will be automatically implemented from its parents. On
104+ the contrary, if the type being created does include
105+ :const: `Py_TPFLAGS_HAVE_GC ` in its flags then it **must ** implement the
106+ GC protocol itself by at least implementing the
107+ :c:member: `~PyTypeObject.tp_traverse ` handle.
108+
100109.. c :function :: void * PyType_GetSlot (PyTypeObject *type, int slot)
101110
102111 Return the function pointer stored in the given slot. If the
@@ -168,13 +177,6 @@ The following functions and structs are used to create
168177 The associated module is not inherited by subclasses; it must be specified
169178 for each class individually.
170179
171- If some of the bases in *bases * implements the GC protocol and the type being
172- created does not include the :const: `Py_TPFLAGS_HAVE_GC ` in the flags included in
173- *spec *, then the GC protocol will be automatically implemented from its parents. On
174- the contrary, if the type being created does include :const: `Py_TPFLAGS_HAVE_GC ` in
175- its flags then it *must * implement the GC protocol itself by at least including a slot
176- for :c:member: `~PyTypeObject.tp_traverse ` in *spec *.
177-
178180 This function calls :c:func: `PyType_Ready ` on the new type.
179181
180182 .. versionadded :: 3.9
0 commit comments