[C++-sig] Re: [boost] mirroring class instances between c++ and python
david.abrahams at rcn.com
Sat Jun 1 22:56:00 CEST 2002
Please post followups to the C++-sig (c++-sig at python.org).
----- Original Message -----
From: "David GD Wilson" <firestar at thenorth.org>
> I am hoping someone has managed to get this problem working before and
> can give me some pointers as to how to accomplish the task.
> What I am trying to do is have a class in C++ that is mirrored in
> python. This means that each instance of a class that is created will
> have a python class created along with it and that python instance can
> call into the c++ instance and vice versa.
That's the normal case for classes which have overridable virtual functions
as described at http://www.boost.org/libs/python/doc/overriding.html.
Why not just use class_builder<CTest,CTest>?
Every constructor you expose must have a hidden initial PyObject* parameter
not described in the parameters to constructor<...>, so:
CTest(PyObject* self, Arg1 a1, Arg2 a2...)
More information about the Cplusplus-sig