[Python-Dev] C new-style classes and GC

Guido van Rossum guido@python.org
Fri, 16 May 2003 14:23:51 -0400


> There are dozens of objects in Python that do not call tp_free.  For
> example, range object's have a tp_dealloc that is set to PyObject_Del().
> Should we change those?  Or should we say that it's okay to call
> PyObject_Del() and PyObject_GC_Del() from objects that are not intended
> to be subclassed?

If those types don't have the Py_TPFLAGS_BASETYPE flag set, they're
okay.  Otherwise they should be fixed.

--Guido van Rossum (home page: http://www.python.org/~guido/)