2
cdef extern from "Python.h":
3
# The C structure of the objects used to describe built-in types.
5
############################################################################
7
############################################################################
9
ctypedef class __builtin__.type [object PyTypeObject]:
12
# PyObject* PyType_Type
13
# This is the type object for type objects; it is the same object
14
# as type and types.TypeType in the Python layer.
16
bint PyType_Check(object o)
17
# Return true if the object o is a type object, including
18
# instances of types derived from the standard type object. Return
19
# false in all other cases.
21
bint PyType_CheckExact(object o)
22
# Return true if the object o is a type object, but not a subtype
23
# of the standard type object. Return false in all other
26
void PyType_Modified(type type)
27
# Invalidate the internal lookup cache for the type and all of its
28
# subtypes. This function must be called after any manual modification
29
# of the attributes or base classes of the type.
31
bint PyType_HasFeature(object o, int feature)
32
# Return true if the type object o sets the feature feature. Type
33
# features are denoted by single bit flags.
35
bint PyType_IS_GC(object o)
36
# Return true if the type object includes support for the cycle
37
# detector; this tests the type flag Py_TPFLAGS_HAVE_GC.
39
bint PyType_IsSubtype(type a, type b)
40
# Return true if a is a subtype of b.
42
object PyType_GenericAlloc(object type, Py_ssize_t nitems)
43
# Return value: New reference.
45
object PyType_GenericNew(type type, object args, object kwds)
46
# Return value: New reference.
48
bint PyType_Ready(type type) except -1
49
# Finalize a type object. This should be called on all type
50
# objects to finish their initialization. This function is
51
# responsible for adding inherited slots from a type's base
52
# class. Return 0 on success, or return -1 and sets an exception