Save/Store whole class (or another object) in a file

Fredrik Lundh fredrik at pythonware.com
Wed Oct 18 10:40:10 EDT 2006


alexLIGO at googlemail.com wrote:

> thanks for the reply,but unfortunately this does not work with the type
> of classes I am dealing with. When trying to pickle the class I get the
> following error:
>
>  File "/usr/lib/python2.4/copy_reg.py", line 76, in _reduce_ex
>     raise TypeError("a class that defines __slots__ without "
> TypeError: a class that defines __slots__ without defining __getstate__
> cannot be pickled
>
> So there is something missing in this class?

did you remember to read the error message before posting ?

</F> 






More information about the Python-list mailing list