Pickling and unpickling inherited attributes
Alex
OurLab at gmail.com
Tue Nov 1 08:21:55 EST 2005
Thanks to both Alex Martelli and Steve Holden.. We need __slots__ for
other reasons, too long to explain, but basically to prevent assignment
of extra attributes.
I ended up changing child classes this way:
def __getstate__(self):
return(Parent.__getstate__(self), self.C)
def __setstate__(self, data):
Parent.__setstate__(self, data[0])
self.C=data[1:]
This seems to work fine.
More information about the Python-list
mailing list