Dictionary bidirectional

bukzor workitharder at gmail.com
Sun Jul 13 20:39:01 EDT 2008


On Jul 13, 4:21 pm, Kless <jonas.... at googlemail.com> wrote:
> I need a dictionary where get the result from a 'key' (on left), but
> also from a 'value' (on right), how to get it?
>
> I know that dictionaries aren't bidirectional, but is there any way
> without use two dictionaries?
>
> Thanks in advance!

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



More information about the Python-list mailing list