summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2005-07-02 10:44:38 (GMT)
committerGeorg Brandl <georg@python.org>2005-07-02 10:44:38 (GMT)
commit6259594fee53a0c4266f103f7c07b2ad5552236d (patch)
treef3313d35c782d1a87fb7e59644154e7d1564955b
parentea044d1984ff5d70c03fdf065cff7cdc69151668 (diff)
downloadcpython-6259594fee53a0c4266f103f7c07b2ad5552236d.zip
cpython-6259594fee53a0c4266f103f7c07b2ad5552236d.tar.gz
cpython-6259594fee53a0c4266f103f7c07b2ad5552236d.tar.bz2
backport bug [ 1228904 ] weakref example broken
-rw-r--r--Doc/lib/libweakref.tex7
1 files changed, 2 insertions, 5 deletions
diff --git a/Doc/lib/libweakref.tex b/Doc/lib/libweakref.tex
index c76684b..617540b 100644
--- a/Doc/lib/libweakref.tex
+++ b/Doc/lib/libweakref.tex
@@ -255,13 +255,10 @@ returned when the referent is accessed:
import weakref
class ExtendedRef(weakref.ref):
- def __new__(cls, ob, callback=None, **annotations):
- weakref.ref.__new__(cls, ob, callback)
- self.__counter = 0
-
def __init__(self, ob, callback=None, **annotations):
super(ExtendedRef, self).__init__(ob, callback)
- for k, v in annotations:
+ self.__counter = 0
+ for k, v in annotations.iteritems():
setattr(self, k, v)
def __call__(self):