In the file ExtensionsType.hxx, the following code
static bool check( PyObject *p )
{
// is p like me?
return p->ob_type == type_object();
}
needs to be changed to the following to handled derived classes
static bool check( PyObject p )
{
return PyObject_IsInstance(p, (type())) ? true : false;
}
This allows the following code to work when a class defined in a py file is derived from a c++ new style class Py::PythonClassObject<dlPyProgress> pyProgress(obj); return &pyProgress.getCxxObject()->m_Progress; Without the change the Py::PythonClassObject line throws an exception
Thanks for the report.
Please see r340 that fixes this issue.
You will see that I built on your solution and added test code.
Note: PyObject_IsInstance can return 1, 0 or -1