Thanks Jim, but I still cannot get it to work. I now have it defined as:

   def("get_a_or_b_instance", get_a_or_b_instance);
   class_<A, boost::shared_ptr<A> >("A", init<>())
       ;
   class_<B, boost::shared_ptr<B>, bases<A> >("B", init<>())
       ;

(note I change your example line from "bases<B>" to "bases<A>")

I tried it with and without:

   register_ptr_to_python< boost::shared_ptr<B> >();

But from Python whenever I call:

   type(app.get_a_or_b_instance(True))

I always get back:

   <class 'app.A'>

Any other ideas?

Matt
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to