atuells at integralab.com
Fri Nov 30 18:34:03 CET 2001
Python implementation of weaklist: list whose entries are
weak references, and are removed when the original object is
garbage collected. They are useful for example when you want a
publisher/subscriber list. Subscriber are authomatically removed
from the publisher list when they are gc (and can be gc).
You can do:
for subscriber in weaklist_subscribers:
If a subscriber is gc while the for is running, then it will be
removed also be removed from the weak_list. WeakList has
an iterator that constains a weaklist.
I think that WeakList place is inside weakref.py, but I don't now how to contribute to python code.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list