[C++-sig] static arrays to Python

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Mon Sep 29 17:29:37 CEST 2008


>    gateway   gateways[SSPS_MAX_GATEWAYS];


> we'd like to be able to use pickle to turn
> them into strings to send over the pipe.

You have to provide pickle support for your gateway type.
See http://www.boost.org/doc/libs/1_36_0/libs/python/doc/v2/pickle.html

What are the data members of your gateway type?

I often ended up using the simple __getinitargs__ approach, where you just have
to construct a tuple that works as an argument list for one of your constructors.

Ralf



More information about the Cplusplus-sig mailing list