On Wed, 12 Nov 2008 11:00:26 +0800, scsoce wrote:
got a exception: "a class that defines __slots__ without defining
__getstate__ cannot be pickled "
why?
Because in the absence of any other information, the default
way of pickling an object is to save the contents of its
__dict__. But an object with __slots__ doesn't necessarily
have a __dict__, and even if it does, it doesn't include
the contents of the slots. So you need to tell pickle how to
deal with it by defining __getstate__ and __setstate__ methods.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list