[C++-sig] Supplying a Python base class when wrapping a C++ class...

Alex Mohr amohr at pixar.com
Wed Nov 1 19:02:41 CET 2006


I'd like to wrap a C++ class and have the generated python wrapper class 
derive from a Python class.

I know I can use bases<> to have my wrapped class derive from the class 
objects associated with the C++ types I specify in bases<>, but in this 
instance, I want to derive my wrapper class from a Python class that was 
not generated by boost.python.

 From looking at the code, it seems like it would be some work to add 
this capability.  (Is anyone working on something like this?)

As a workaround, does anyone know a way that I could perhaps hack this 
in after the Python class is created?  That is, can I change the Python 
base classes of a Python class at runtime?

Thanks,

Alex



More information about the Cplusplus-sig mailing list