This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Subclassing WeakValueDictionary impossib
Type: Stage:
Components: Interpreter Core Versions:
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: theller
Priority: normal Keywords:

Created on 2002-07-11 14:04 by theller, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Messages (1)
msg11535 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2002-07-11 14:04
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__ ;-(
History
Date User Action Args
2022-04-10 16:05:29adminsetgithub: 36877
2002-07-11 14:04:12thellercreate