I\'m in need of a list of weak references that deletes items when they die. Currently the only way I have of doing this is to keep flushing the list (removing dead references ma
Why can't you just do it like this:
import weakref class WeakList(list): def append(self, item): list.append(self, weakref.ref(item, self.remove))
And then do similar for __iadd__, extend etc. Works for me.
__iadd__
extend