[pypy-dev] Can't pickle a numpy object?
coolbutuseless at gmail.com
Thu Oct 6 06:55:28 CEST 2011
I'm new to pypy and trying it out on some numerical projects and the speed
of pypy+numpy is about 4x faster than cpython+numpy. Pretty impressive!
However, I want to pickle some of my numpy objects and I get the
error: TypeError: can't pickle numarray objects (full error is included
I realise that the numpy implementation in pypy is currently a
proof-of-concept, and so I was wondering what I would have to change to get
numarray's to be pickle-able. As simple as adding a something like a
__pickle__ method to numarray? Or is the problem deeper than that?
>>>> import pickle, numpy
>>>> a = numpy.array([1,2,3])
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Users/mike/pypy-1.6/lib-python/modified-2.7/pickle.py", line 1423,
File "/Users/mike/pypy-1.6/lib-python/modified-2.7/pickle.py", line 224,
File "/Users/mike/pypy-1.6/lib-python/modified-2.7/pickle.py", line 306,
rv = reduce(self.proto)
File "/Users/mike/pypy-1.6/lib-python/2.7/copy_reg.py", line 70, in
raise TypeError, "can't pickle %s objects" % base.__name__
TypeError: can't pickle numarray objects
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pypy-dev