On Oct 1, 10:01 pm, Dan Barbus <[EMAIL PROTECTED]> wrote: > On Oct 2, 7:54 am, Dan Barbus <[EMAIL PROTECTED]> wrote: > > > > > def getItemById(id): > > return _itemsById[id] > > I just saw that this won't compile. Still, ignoring this, I thing the > purpose of the code is pretty clear. > > Thanks for any feedback.
Check the weakref module, you can create a WeakValueDictionary which will not increment the refcount of the value, and will return None after it's been garbage collected. -- http://mail.python.org/mailman/listinfo/python-list