[3.10] bpo-44263: Mention PyType_Ready in the gc protocol warning (GH-26445) by miss-islington · Pull Request #26446 · python/cpython
.. note:: If some of the base classes implements the GC protocol and the provided type does not include the :const:`Py_TPFLAGS_HAVE_GC` in its flags, then the GC protocol will be automatically implemented from its parents. On the contrary, if the type being created does include :const:`Py_TPFLAGS_HAVE_GC` in its flags then it **must** implement the GC protocol itself by at least implementing the :c:member:`~PyTypeObject.tp_traverse` handle.
.. c:function:: void* PyType_GetSlot(PyTypeObject *type, int slot)
Return the function pointer stored in the given slot. If the
If some of the bases in *bases* implements the GC protocol and the type being created does not include the :const:`Py_TPFLAGS_HAVE_GC` in the flags included in *spec*, then the GC protocol will be automatically implemented from its parents. On the contrary, if the type being created does include :const:`Py_TPFLAGS_HAVE_GC` in its flags then it *must* implement the GC protocol itself by at least including a slot for :c:member:`~PyTypeObject.tp_traverse` in *spec*.
This function calls :c:func:`PyType_Ready` on the new type.
.. versionadded:: 3.9