Clarify __reduce__ and classic classes more.

This commit is contained in:
Guido van Rossum 2003-02-10 21:34:28 +00:00
parent 50955157ae
commit e5c7b99c0b
1 changed files with 3 additions and 2 deletions

View File

@ -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