bukzor:
> You need to use two dictionaries. Here's a class that someone's
> written that wraps it up into a single dict-like object for you:
> http://www.faqts.com/knowledge_base/view.phtml/aid/4376

It contains code like:

try:
    del self.data[item]
except KeyError:
    pass

Exceptions are useful in python, but with dictionaries this is
probably faster (and shorter), even if it may perform two lookups:

if item in self.data:
    del self.data[item]

Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to