Clarify __reduce__ and classic classes more.
This commit is contained in:
parent
50955157ae
commit
e5c7b99c0b
|
@ -145,8 +145,9 @@ Extended __reduce__ API
|
|||
IMPORTANT: while a classic class can implement a __reduce__()
|
||||
method, pickling its instances ignores the method, so that a classic
|
||||
class cannot provide __reduce__ functionality in the sense intended
|
||||
here. A classic class must use __getinitargs__ and/or __gestate__
|
||||
to customize pickling. These are described below.
|
||||
here. (The copy_reg dispatch table is not consulted for classic
|
||||
classes either.) A classic class must use __getinitargs__ and/or
|
||||
__gestate__ to customize pickling. These are described below.
|
||||
|
||||
__reduce__ must return either a string or a tuple. If it returns
|
||||
a string, this is an object whose state is not to be pickled, but
|
||||
|
|
Loading…
Reference in New Issue