File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -412,13 +412,19 @@ \subsubsection{Pickling and unpickling normal class
412412\method {__setstate__()}, it is called with the unpickled
413413state\footnote {These methods can also be used to implement copying
414414class instances.}. If there is no \method {__setstate__()} method, the
415- pickled object must be a dictionary and its items are assigned to the
415+ pickled state must be a dictionary and its items are assigned to the
416416new instance's dictionary. If a class defines both
417417\method {__getstate__()} and \method {__setstate__()}, the state object
418418needn't be a dictionary and these methods can do what they
419- want\footnote {This protocol is also used by the shallow and deep
419+ want. \footnote {This protocol is also used by the shallow and deep
420420copying operations defined in the
421- \refmodule {copy} module.}.
421+ \refmodule {copy} module.}
422+
423+ \begin {notice }[warning]
424+ For new-style classes, if \method {__getstate__()} returns a false
425+ value, the \method {__setstate__()} method will not be called.
426+ \end {notice }
427+
422428
423429\subsubsection {Pickling and unpickling extension types }
424430
You can’t perform that action at this time.
0 commit comments