[Python-bugs-list] [ python-Bugs-637941 ] __getstate__() documentation is vague

noreply@sourceforge.net noreply@sourceforge.net
Thu, 14 Nov 2002 08:24:50 -0800


Bugs item #637941, was opened at 2002-11-13 14:26
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=637941&group_id=5470

Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jeremy Hylton (jhylton)
Assigned to: Fred L. Drake, Jr. (fdrake)
>Summary: __getstate__() documentation is vague

Initial Comment:
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.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=637941&group_id=5470