[ale] python pickle data types

Jim Popovitch yahoo at jimpop.com
Thu Oct 25 01:39:34 EDT 2007


On Thu, 2007-10-25 at 00:17 -0400, Matt Kubilus wrote:
> It's not that you are pickling a non-standard data type.  You should
> be able to pickle pretty much any *python* object.
> 
> It appears that python has no way of knowing what is inside
> private/protected parts of C/C++ extension classes.  This kind of
> makes sense.  It appears you may have to either add something to the C
> class or extend it in python.  This is what a cursory glances shows:
> 
> http://osdir.com/ml/programming.swig/2003-03/msg00061.html
> 
> An alternate method may be to extract the data parts from the object
> and create a method that can load & save this data.  I'm making the
> assumption that there is some kind of useful interface to these
> classes.  I'm not really sure what you are doing, so I'm going out on
> a limb here.

Thanks Matt,

I wanted to avoid the class extension route, but it seems that is what
it is going to take.  What I have is a 3rd party library that has
functions that use a struct of 2 doubles to pass data around.  I'll try
writing a class definition and passing that around in my python code.

Thx,

-Jim P. 




More information about the Ale mailing list