[Python-checkins] python/dist/src/Doc/lib libpickle.tex,1.33.6.1,1.33.6.2
fdrake@users.sourceforge.net
fdrake@users.sourceforge.net
Tue, 26 Nov 2002 21:26:27 -0800
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv24235
Modified Files:
Tag: release22-maint
libpickle.tex
Log Message:
Clarify the interpretation of the __getstate__() return value for
new-style classes.
Closes SF bug #637941.
Index: libpickle.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libpickle.tex,v
retrieving revision 1.33.6.1
retrieving revision 1.33.6.2
diff -C2 -d -r1.33.6.1 -r1.33.6.2
*** libpickle.tex 6 Oct 2002 02:24:00 -0000 1.33.6.1
--- libpickle.tex 27 Nov 2002 05:26:24 -0000 1.33.6.2
***************
*** 407,417 ****
state\footnote{These methods can also be used to implement copying
class instances.}. If there is no \method{__setstate__()} method, the
! pickled object must be a dictionary and its items are assigned to the
new instance's dictionary. If a class defines both
\method{__getstate__()} and \method{__setstate__()}, the state object
needn't be a dictionary and these methods can do what they
! want\footnote{This protocol is also used by the shallow and deep
copying operations defined in the
! \refmodule{copy} module.}.
\subsubsection{Pickling and unpickling extension types}
--- 407,423 ----
state\footnote{These methods can also be used to implement copying
class instances.}. If there is no \method{__setstate__()} method, the
! pickled state must be a dictionary and its items are assigned to the
new instance's dictionary. If a class defines both
\method{__getstate__()} and \method{__setstate__()}, the state object
needn't be a dictionary and these methods can do what they
! want.\footnote{This protocol is also used by the shallow and deep
copying operations defined in the
! \refmodule{copy} module.}
!
! \begin{notice}[warning]
! For new-style classes, if \method{__getstate__()} returns a false
! value, the \method{__setstate__()} method will not be called.
! \end{notice}
!
\subsubsection{Pickling and unpickling extension types}