How to get PyTypeObject from PyObject?

chris cgrebeld at gmail.com
Mon Aug 25 17:00:25 EDT 2008


I want to check the type of an object, right now I am doing
strcmp( object->ob_type->tp_name, "MyClass")

Which seems slow, is there a way I can find the pointer to the global
PyTypeObject for MyClass, and then just call PyObject_TypeCheck?

Thanks




More information about the Python-list mailing list