
Hi, Is it possible to register to-python converters for polymorphic types held in shared_ptr? This does not seem to work for me. I have a virtual base class Object, and derived classes TypedAttribute<T> (with method 'value()' that returns a simple type - float, int etc). My boost.python registration code looks like so: template<typename Attrib> struct typed_attrib_topython { static PyObject* convert(const Attrib& a) { return bp::incref(bp::object(a.value()).ptr()); } }; template<typename T> struct TypedAttribBind { typedef TypedAttribute<T> attrib_t; TypedAttribBind() { boost::python::to_python_converter<attrib_t, typed_attrib_topython<attrib_t> >(); } }; However this doesn't work. I have other bound functions that return a boost::python::object(boost::shared_ptr<Object>), but these do not get converted. Am I misunderstanding to-python conversion? Should I expect this to work on polymorphic types? thanks in advance, Allan