类型对象

type PyTypeObject
属于 Limited API (as an opaque struct).

The C structure of the objects used to describe built-in types.

PyTypeObject PyType_Type
属于 稳定 ABI (应用程序二进制接口) .

This is the type object for type objects; it is the same object as type 在 Python 层。

int PyType_Check ( PyObject * o )

Return non-zero if the object o is a type object, including instances of types derived from the standard type object. Return 0 in all other cases. This function always succeeds.

int PyType_CheckExact ( PyObject * o )

Return non-zero if the object o is a type object, but not a subtype of the standard type object. Return 0 in all other cases. This function always succeeds.

unsigned int PyType_ClearCache ( )
属于 稳定 ABI (应用程序二进制接口) .

Clear the internal lookup cache. Return the current version tag.

unsigned long PyType_GetFlags ( PyTypeObject * type )
属于 稳定 ABI (应用程序二进制接口) .

返回 tp_flags member of type . This function is primarily meant for use with Py_LIMITED_API ; the individual flag bits are guaranteed to be stable across Python releases, but access to tp_flags itself is not part of the limited API .

Added in version 3.2.

3.4 版改变: The return type is now unsigned long 而不是 long .