[Numpy-discussion] pickling ufuncs?
Sun Feb 11 23:19:52 CST 2007
I recently noticed that we can't pickle ufuncs (like sin, ...). Is
there any technical reason this doesn't work, or is it in the category
of 'just needs to be done...'
FYI, I noticed that it didn't work on the old Numeric either.
Python 2.4.3 - Enthought Edition 1.0.0 (#69, Aug 2 2006, 12:09:59) [MSC
32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pickle
>>> import numpy
>>> import math
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "C:\Python24\lib\pickle.py", line 1386, in dumps
Pickler(file, protocol, bin).dump(obj)
File "C:\Python24\lib\pickle.py", line 231, in dump
File "C:\Python24\lib\pickle.py", line 313, in save
rv = reduce(self.proto)
File "C:\Python24\lib\copy_reg.py", line 69, in _reduce_ex
raise TypeError, "can't pickle %s objects" % base.__name__
TypeError: can't pickle ufunc objects
More information about the Numpy-discussion