summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libweakref.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/lib/libweakref.tex')
-rw-r--r--Doc/lib/libweakref.tex6
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/lib/libweakref.tex b/Doc/lib/libweakref.tex
index 617540b..2f8ade0 100644
--- a/Doc/lib/libweakref.tex
+++ b/Doc/lib/libweakref.tex
@@ -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 @@ this pattern:
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 @@ class ExtendedRef(weakref.ref):
"""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)