diff Doc/lib/libweakref.tex @ 35195:7804bbb26492 2.4

backport doctest for weakref examples
author Georg Brandl <georg@python.org>
date Sat, 02 Jul 2005 19:09:42 +0000
parents 8f7e47a0aaca
children 963a98d8fe2e
line wrap: on
line diff
--- a/Doc/lib/libweakref.tex	Sat Jul 02 18:38:12 2005 +0000
+++ b/Doc/lib/libweakref.tex	Sat Jul 02 19:09:42 2005 +0000
@@ -10,6 +10,8 @@
 
 \versionadded{2.1}
 
+% When making changes to the examples in this file, be sure to update
+% Lib/test/test_weakref.py::libreftest too!
 
 The \module{weakref} module allows the Python programmer to create
 \dfn{weak references} to objects.
@@ -228,7 +230,7 @@
 o = r()
 if o is None:
     # referent has been garbage collected
-    print "Object has been allocated; can't frobnicate."
+    print "Object has been deallocated; can't frobnicate."
 else:
     print "Object is still live!"
     o.do_something_useful()
@@ -265,7 +267,7 @@
         """Return a pair containing the referent and the number of
         times the reference has been called.
         """
-        ob = super(ExtendedRef, self)()
+        ob = super(ExtendedRef, self).__call__()
         if ob is not None:
             self.__counter += 1
             ob = (ob, self.__counter)