Issue 637941: getstate() documentation is vague (original) (raw)
If you write a getstate / setstate pair for a new-style type so that it can be pickled, the reduce code for new-style types imposes extra restrictions on the getstate / setstate pair. Specifically, the setstate method will be called only if the object returned by getstate is not false. The reconstructor code uses the variable "dict" for the getstate result. This suggests that it must be a dict, although I can't tell if that is actually true. If it is an empty dict, setstate won't be called.