diff options
author | Georg Brandl <georg@python.org> | 2005-07-02 10:44:32 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2005-07-02 10:44:32 (GMT) |
commit | 376e6227b4a9e5d9501ab7ab8fce34b2f449afb1 (patch) | |
tree | 2b81b9e669b714828442b017143af3acf6d14b6a /Doc/lib | |
parent | 1c330eb9eb961b207d7d86b3dd7ebfd580645a4b (diff) | |
download | cpython-376e6227b4a9e5d9501ab7ab8fce34b2f449afb1.zip cpython-376e6227b4a9e5d9501ab7ab8fce34b2f449afb1.tar.gz cpython-376e6227b4a9e5d9501ab7ab8fce34b2f449afb1.tar.bz2 |
bug [ 1228904 ] weakref example broken
Diffstat (limited to 'Doc/lib')
-rw-r--r-- | Doc/lib/libweakref.tex | 7 |
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): |