From 376e6227b4a9e5d9501ab7ab8fce34b2f449afb1 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 2 Jul 2005 10:44:32 +0000 Subject: [PATCH] bug [ 1228904 ] weakref example broken --- Doc/lib/libweakref.tex | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Doc/lib/libweakref.tex b/Doc/lib/libweakref.tex index c76684bf027..617540b048e 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):