Class and Instance Objects¶
Note that the class objects described here represent old-style classes, which will go away in Python 3. When creating new types for extension modules, you will want to work with type objects (section Type Objects).
-
type
PyClassObject
¶ The C structure of the objects used to describe built-in classes.
-
PyObject *
PyClass_Type
¶ This is the type object for class objects; it is the same object as
types.ClassType
in the Python layer.
-
int
PyClass_Check
(PyObject *o)¶ Return true if the object o is a class object, including instances of types derived from the standard class object. Return false in all other cases.
-
int
PyClass_IsSubclass
(PyObject *klass, PyObject *base)¶ Return true if klass is a subclass of base. Return false in all other cases.
There are very few functions specific to instance objects.
-
PyTypeObject
PyInstance_Type
¶ Type object for class instances.