[Python-checkins] CVS: python/dist/src/Doc/lib libweakref.tex,1.10,1.11
Fred L. Drake
fdrake@users.sourceforge.net
Thu, 02 Aug 2001 20:50:30 -0700
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv19160/lib
Modified Files:
libweakref.tex
Log Message:
Fix some of the example code; the reference objects do not support a
get() method; just calling them is sufficient. (There was a get() method
for this in an early version of the implementation.)
Reported by Mats Wichmann.
Index: libweakref.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libweakref.tex,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** libweakref.tex 2001/06/29 16:25:07 1.10
--- libweakref.tex 2001/08/03 03:50:28 1.11
***************
*** 152,161 ****
Testing that a weak reference object is still live should be done
! using the expression \code{\var{ref}.get() is not None}. Normally,
application code that needs to use a reference object should follow
this pattern:
\begin{verbatim}
! o = ref.get()
if o is None:
# referent has been garbage collected
--- 152,161 ----
Testing that a weak reference object is still live should be done
! using the expression \code{\var{ref}() is not None}. Normally,
application code that needs to use a reference object should follow
this pattern:
\begin{verbatim}
! o = ref()
if o is None:
# referent has been garbage collected
***************
*** 191,195 ****
def id2obj(id):
! return _id2obj_dict.get(id)
\end{verbatim}
--- 191,195 ----
def id2obj(id):
! return _id2obj_dict(id)
\end{verbatim}