From: Georg Brandl Date: Sat, 2 Jul 2005 10:44:32 +0000 (+0000) Subject: bug [ 1228904 ] weakref example broken X-Git-Tag: v2.5a0~1623 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=376e6227b4a9e5d9501ab7ab8fce34b2f449afb1;p=thirdparty%2FPython%2Fcpython.git bug [ 1228904 ] weakref example broken --- diff --git a/Doc/lib/libweakref.tex b/Doc/lib/libweakref.tex index c76684bf027b..617540b048e7 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):