In C/C++, I want to see if a PyObject
is an instance. Unfortunately, the PyInstance_Check
macro doesn't work with new-style classes.
So, according to forums posts that I read, PyObject_IsInstance
could solve the problem. However, all the examples that I have found are demonstrating comparisons with built-in types, like ints and strings.
I want to know how I can construct a PyObject that represents a class of a type, so I can pass it to the second argument of PyObject_IsInstance
. Can you help me?