C++ and Python

Lyle Johnson jlj at cfdrc.com
Fri Jun 25 08:29:16 EDT 1999


Joel,

This is indeed a tricky area. I recommend you start by reading this paper,
several times:

    http://www.python.org/workshops/1995-12/papers/ahlstrom1.html

Then to see this implemented in a real extension, take a look at WPY itself,
wxPython or FXPy (and probably others?).

Good luck,

Lyle

Joel Davis wrote:

> I am trying to wrap a bunch of c++ classes so that virtual methods in
> derived classes can be written in python, and still callable from c++,
>
> SWIG and friends seem to be one-way, they let you subclass a C++ class
> in python via shadow classes or fancy extention types, but the
> subclasses behavior only shows up on the python side. I am trying to add
> the ability to mix python derived classes into a large c++ application.
>
> I guess what I'm asking is, the ORA Python book says (p626), "it's also
> possible to route C++ virtual method calls back down to methods in a
> python subclass, but it may require a stub-class on the C++ side of the
> interface, too (this is left as a Exercise to the Reader)." Are there
> any tools to help make this easier, or any good examples of this?
>
> thanks,
> joel
> --
> ----------------------------------------------------------------
>                                                 joeld at anisci.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/19990625/e23f07f3/attachment.html>


More information about the Python-list mailing list