Ok, it does work as expected if class Base has got at least one virtual member:
from shared_ptr_inheritance import * type( base1() ) -> Base type( base2() ) -> Derived type( derived1() ) -> Derived type( base3( derived1() ) ) -> Derived type( derived2( base2() ) ) -> Derived Anyhow it looks like this doesn't depend on py++: py++ always generates the same boost::python code no matter of destructor's virtuality. ...What if I cannot add a virtual function to the class Base? On Sun, Mar 21, 2010 at 6:11 AM, Roman Yakovenko <roman.yakove...@gmail.com> wrote: > On Sun, Mar 21, 2010 at 4:07 AM, peoro <peoro.n...@gmail.com> wrote: >> Yes, having all of the objects at their most-derived type would be >> what I need, but it's not what happens. >> >> I posted a piece of C++ code that shows what I do (I exported it using >> py++ without any further modification): all of the pointers my >> functions return are wrapped in boost::shared_ptr's, but from Python I >> see them at the "derivation level" they were when I passed them to >> python the first time (look at the summarized output in my previous >> message)... > > Can you check your code, but with the following class definition > > class Base { > public: > virtual ~Base(){} > }; > > class Derived : public Base { }; > > > -- > Roman Yakovenko > C++ Python language binding > http://www.language-binding.net/ > _______________________________________________ > Cplusplus-sig mailing list > Cplusplus-sig@python.org > http://mail.python.org/mailman/listinfo/cplusplus-sig > _______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig