[Python-bugs-list] [ python-Bugs-580107 ] Subclassing WeakValueDictionary impossib
noreply@sourceforge.net
noreply@sourceforge.net
Thu, 11 Jul 2002 07:04:12 -0700
Bugs item #580107, was opened at 2002-07-11 16:04
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=580107&group_id=5470
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Thomas Heller (theller)
Assigned to: Nobody/Anonymous (nobody)
Summary: Subclassing WeakValueDictionary impossib
Initial Comment:
I'm trying to subclass weakref.WeakValueDictionary, so
that it can send notifications when keys are removed.
I subclassed it and implemented a new __delitem__
method, but unfortunately this is not called because
WeakValueDictionary manipulates UserDict's data
member directly (in __makeremove), without calling the
__delitem__ method.
Inspection of the sources shows that this is also the
case in other methods as well...
I finally overrided __makeremovemethod _and_
__delitem__ ;-(
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=580107&group_id=5470