pickling class instances with __slots__
OurLab at gmail.com
Sat Oct 29 05:54:04 CEST 2005
I would greatly appreciate an advice on the following matter that was
very much discussed circa 2002 but in all this discussion I could not
find the final answer with a code example. Neither I can find it in
I have a series of new classes with child-parent relationship and each
has unique __slots__. They don't have __dict__ . I need to be able to
pickle and unpickle them. As far as I could understand, I need to
provide __getstate__ and __setstate__ methods for each class. Is
there a universally accepted code for each method? If so, what is it?
If there is no standard, what works?
More information about the Python-list