typedef struct _object {
_PyObject_HEAD_EXTRA
Py_ssize_t ob_refcnt;
PyTypeObject *ob_type;
} PyObject;
Py_TRACE_REFS is defined when compiing the sources, the macro _PyObject_HEAD_EXTRA is used to dfine a doubly-linked list of all live heap objects. If Py_TRACE_REFS is not defined, _PyObject_HEAD_EXTRA evaluates to nothing. typedef struct {
PyObject ob_base;
Py_ssize_t ob_size; /* Number of items in variable part */
} PyVarObject;
typedef struct{
int slot; /* slot id, see below */
void *pfunc; /* function pointer */
} PyType_Slot;
typedef struct{
const char* name;
int basicsize;
int itemsize;
unsigned int flags;
PyType_Slot *slots; /* terminated by slot==0. */
} PyType_Spec;