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
Use a callback function passed to second argument of a weakref.
This code should function:
import weakref class weakRefList(list): def addReference(self, obj): self._references.append(weakref.proxy(obj, self.remove))