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

Roman Yakovenko roman.yakovenko at gmail.com
Thu Apr 19 07:52:26 CEST 2007

On 4/19/07, Rocketman at JSC <snemeth at houston.rr.com> wrote:
> Has anyone figured out how to do this?

I recently spent some time on this issue. I was supposed to expose library
defined exceptions and make them play well with "try-except" functionality.
I found that it is not possible to create Python class which derives from
Boost.Python exposed class and Exception. I've got TypeError: "Error when
calling the metaclass bases multiple bases have instance lay-out conflict".
So I doubt this issue could be solved on C++ level too. Fortunately I found
pretty simple( for my case ) work around:
. The page also contains full source code and unit tests.

Let me know if this helped you.

Roman Yakovenko
C++ Python language binding
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20070419/948abf71/attachment.htm>

More information about the Cplusplus-sig mailing list