[Boost.Python] Using Inheritance *and* Virtual Functions in a Python Binding
Hi,
I can't seem to get inheritance and virtual functions to work together
in a simple python binding:
#include
import test dir(test.__Base) [<built-ins>, 'nonVirtualFunc'] dir(test.Base) [<built-ins>, 'virtualFunc'] dir(test.Derived) [<built-ins>, 'virtualFunc']
Without using BaseWrap to do the virtual functions:
dir(test.Derived) [<built-ins>, 'nonVirtualFunc', 'virtualFunc']
It seems that by using the boost python wrapper, I now lose any inherited functions, and the nonVirtualFunc does not get defined in the subclasses. I may be going about this in the wrong way, but is there a way of using inheritance and virtual functions together? Thanks, Dan
participants (1)
-
Dan Bailey