Bozo __getstate__ is gone.
This commit is contained in:
parent
1857c40946
commit
ae56c6a44c
14
pep-0307.txt
14
pep-0307.txt
|
@ -389,10 +389,10 @@ Case 2: pickling new-style class instances using protocols 0 or 1
|
||||||
that is zero, or an empty sequence or mapping), this state is not
|
that is zero, or an empty sequence or mapping), this state is not
|
||||||
pickled and __setstate__ will not be called at all.
|
pickled and __setstate__ will not be called at all.
|
||||||
|
|
||||||
Note that this strategy ignores slots. New-style classes that
|
Note that this strategy ignores slots. Instances of new-style
|
||||||
define slots and don't define __getstate__ in the same class that
|
classes that have slots but no __getstate__ method cannot be
|
||||||
defines the slots automatically have a __getstate__ method added
|
pickled by protocols 0 and 1; the code explicitly checks for
|
||||||
that raises TypeError.
|
this condition.
|
||||||
|
|
||||||
|
|
||||||
Case 3: pickling new-style class instances using protocol 2
|
Case 3: pickling new-style class instances using protocol 2
|
||||||
|
@ -441,12 +441,6 @@ Case 3: pickling new-style class instances using protocol 2
|
||||||
None and whose second item is a dictionary mapping slot names
|
None and whose second item is a dictionary mapping slot names
|
||||||
to slot values described in the previous bullet.
|
to slot values described in the previous bullet.
|
||||||
|
|
||||||
Note that new-style classes that define slots and don't define
|
|
||||||
__getstate__ in the same class that defines the slots
|
|
||||||
automatically have a __getstate__ method added that raises
|
|
||||||
TypeError. Protocol 2 ignores this __getstate__ method
|
|
||||||
(recognized by the specific text of the error message).
|
|
||||||
|
|
||||||
The __setstate__ method
|
The __setstate__ method
|
||||||
|
|
||||||
The __setstate__ should take one argument; it will be called
|
The __setstate__ should take one argument; it will be called
|
||||||
|
|
Loading…
Reference in New Issue