Pickling gotcha

George Sakkis george.sakkis at gmail.com
Thu Jun 15 21:17:31 EDT 2006


I stumbled on some weird pickling behavior that after some non-trivial
debugging time turned out to be caused by __getstate__ returning an
empty dict for some instances. As I found digging through the docs
(http://pythondoc.kldp.net/lib/pickle-inst.html), surprisingly
__setstate__ is not called nor new style instances if __getstate__
returns a false valse, without any further justification. Any pointers
on the rationale for making a special case just out of the blue ?

George




More information about the Python-list mailing list