ANNOUNCE: WeakList
M.-A. Lemburg
mal at lemburg.com
Fri Nov 30 18:09:29 EST 2001
> Andres Tuells wrote:
>
> 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 weakref.py, but I don't now how
> to contribute to python code.
Try by uploading your patch to SourceForge as first step :-)
--
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Consulting & Company: http://www.egenix.com/
Python Software: http://www.lemburg.com/python/
More information about the Python-list
mailing list