Andres Tuells atuells at
Fri Nov 30 18:34:03 CET 2001

What is:
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:
    self.notify(subscriber, message)

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, but I don't now how to contribute to python code.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list