how to keep collection of existing instances and return one on instantiation

marduk usenet at
Wed Oct 5 22:08:46 CEST 2005

On Wed, 2005-10-05 at 19:24 +0200, Peter Otten wrote:
> Use a weakref.WeakValueDictionary as the cache instead of a normal
> dict.
> Peter 

Thanks for the reference to the weakref module.  Until now I've never
had a use for it, but it sounds like what I'm looking for.


More information about the Python-list mailing list