[C++-sig] Copying objects derived in python from C++?

Mark Williams mark at image-engine.com
Fri Jun 8 19:04:44 CEST 2007


Hans Meine wrote:
> Am Donnerstag, 07. Juni 2007 02:48:34 schrieb Mark Williams:
>   
>> Thanks, this certainly seems to be the case. If I add
>> ".enable_pickling()" to my Base class definition, then the example I
>> posted works as expected. However, if I then modify the Derived class
>> constructor so that it takes an argument, e.g.:
>>
>> [...]
>> TypeError: __init__() takes exactly 2 arguments (1 given)
>>     
>
> How about adding pickle functions (i.e. __getinitargs__) to Derived, then?
>
>   
Thanks. That was the missing step.

Mark



More information about the Cplusplus-sig mailing list