[C++-sig] Nesting classes in boost::python

Roman Yakovenko roman.yakovenko at gmail.com
Wed Jun 4 20:12:47 CEST 2008

On Wed, Jun 4, 2008 at 6:36 PM, Hans Meine
<meine at informatik.uni-hamburg.de> wrote:
> Am Mittwoch, 04. Juni 2008 17:31:22 schrieb Hans Meine:
>> The only reason why I could imagine that py++ does not do so is that AFAIK
>> this breaks pickling (and possibly more things?), since Foo.Bar.__name__
>> is "Bar" in Python, which does not allow the pickle module to locate the
>> class correctly. :-(
> Stupid me - I already pondered this in the past, experimented, and came to
> realize that this is not a BPL bug, but holds the same for pure Python. :-(
> Nevertheless, one could at least add a switch to py++ for optionally nesting
> classes, no?

I don't understand you - Py++ perfectly supports nested classes, no
user action is needed.

I attach example: C++ code and generated code.

Roman Yakovenko
C++ Python language binding
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1.h
Type: text/x-chdr
Size: 2138 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20080604/e5d5a889/attachment.h>

More information about the Cplusplus-sig mailing list