Cristiano Paris <frodo at theshire.org> wrote: > May be someone has faced this problem before and came up with some > obscure language feature to solve this elegantly :D Yes. Try using weak references. Specifically a weakref.WeakValueDictionary should meet your needs.