I was told that I can extract reference to base class from any boost::python::object
.
The simple code looks like:
// c++:
class Base {};
// Export Base into python module
// python:
class Der(Base):
pass
//c++:
boost::python::object obj; // It points to some Der class object made from python
boost::shared_ptr<Object> temp = extract< boost::shared_ptr<Object> >(obj);
The last line fails with:
TypeError: No registered converter was able to produce a C++ rvalue of type boost::shared_ptr from this Python object of type Der
Is it possible to extract pointer for Base
class?