> typeobject.c:PyType_GenericAlloc has this: > > if (type->tp_flags & Py_TPFLAGS_HEAPTYPE) > Py_INCREF(type); > > Where is the corresponding DECREF? At the bottom of subtype_dealloc(): /* Can't reference self beyond this point */ if (type->tp_flags & Py_TPFLAGS_HEAPTYPE) { Py_DECREF(type); } --Guido van Rossum (home page: http://www.python.org/~guido/)