H
harold fellermann
Hi all,
I have a problem pickling an extension class. As written in the
Extending/Embedding Manual, I
provided a function __reduce__ that returns the appropreate tuple. This
seams to work fine,
but I still cannot pickle because of the following error:
Traceback (most recent call last):
File "pickle_test.py", line 5, in ?
pickle.dump(g,file("test","w"))
File "/sw/lib/python2.4/pickle.py", line 1382, in dump
Pickler(file, protocol, bin).dump(obj)
File "/sw/lib/python2.4/pickle.py", line 231, in dump
self.save(obj)
File "/sw/lib/python2.4/pickle.py", line 338, in save
self.save_reduce(obj=obj, *rv)
File "/sw/lib/python2.4/pickle.py", line 414, in save_reduce
save(func)
File "/sw/lib/python2.4/pickle.py", line 293, in save
f(self, obj) # Call unbound method with explicit self
File "/sw/lib/python2.4/pickle.py", line 760, in save_global
raise PicklingError(
['Dir', 'Neighbors', 'PeriodicGrid', 'PeriodicPos', '__doc__',
'__file__', '__name__', 'refcount']<type 'hyper.PeriodicGrid'>
So pickle complains about the class PeriodicGrid not being found in the
module hyper, but a dir()
proves that python can find it. Has anyone an idea what's going wrong
here?
Any help appreceated,
- harold -
I have a problem pickling an extension class. As written in the
Extending/Embedding Manual, I
provided a function __reduce__ that returns the appropreate tuple. This
seams to work fine,
but I still cannot pickle because of the following error:
Traceback (most recent call last):
File "pickle_test.py", line 5, in ?
pickle.dump(g,file("test","w"))
File "/sw/lib/python2.4/pickle.py", line 1382, in dump
Pickler(file, protocol, bin).dump(obj)
File "/sw/lib/python2.4/pickle.py", line 231, in dump
self.save(obj)
File "/sw/lib/python2.4/pickle.py", line 338, in save
self.save_reduce(obj=obj, *rv)
File "/sw/lib/python2.4/pickle.py", line 414, in save_reduce
save(func)
File "/sw/lib/python2.4/pickle.py", line 293, in save
f(self, obj) # Call unbound method with explicit self
File "/sw/lib/python2.4/pickle.py", line 760, in save_global
raise PicklingError(
['Dir', 'Neighbors', 'PeriodicGrid', 'PeriodicPos', '__doc__',
'__file__', '__name__', 'refcount']<type 'hyper.PeriodicGrid'>
So pickle complains about the class PeriodicGrid not being found in the
module hyper, but a dir()
proves that python can find it. Has anyone an idea what's going wrong
here?
Any help appreceated,
- harold -