Mailing List Archive

python/dist/src/Doc/lib libpickle.tex,1.34,1.35
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv19196/Doc/lib

Modified Files:
libpickle.tex
Log Message:
Add Pickler.clear_memo() so the pickle and cPickle modules are more similar.

Index: libpickle.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libpickle.tex,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** libpickle.tex 22 Mar 2002 22:16:03 -0000 1.34
--- libpickle.tex 1 May 2002 20:33:53 -0000 1.35
***************
*** 238,245 ****
method is useful when re-using picklers.

! \strong{Note:} \method{clear_memo()} is only available on the picklers
! created by \module{cPickle}. In the \module{pickle} module, picklers
! have an instance variable called \member{memo} which is a Python
! dictionary. So to clear the memo for a \module{pickle} module
pickler, you could do the following:

--- 238,246 ----
method is useful when re-using picklers.

! \begin{notice}
! Prior to Python 2.3, \method{clear_memo()} was only available on the
! picklers created by \refmodule{cPickle}. In the \module{pickle} module,
! picklers have an instance variable called \member{memo} which is a
! Python dictionary. So to clear the memo for a \module{pickle} module
pickler, you could do the following:

***************
*** 247,250 ****
--- 248,255 ----
mypickler.memo.clear()
\end{verbatim}
+
+ Code that does not need to support older versions of Python should
+ simply use \method{clear_memo()}.
+ \end{notice}
\end{methoddesc}