[Chicago] 2 unique keys in a python dict?

Massimo Di Pierro mdipierro at cs.depaul.edu
Thu Oct 9 17:43:20 CEST 2008


A key can be a tuple

me['key1','key2']='value'


On Oct 9, 2008, at 10:40 AM, Lukasz Szybalski wrote:

> Hello,
> Is it possible to have multiple keys in a python dictionary?
>
> Normally its only 1 key, and I need to have 2 dictionaries and somehow
> manage the uniqueness.
> me={}
> me['First']='Lucas'
> me['Last']='szybalski'
>
> I would like to get 2 keys? Is there something similar to dict that
> would have the property that 2 or more keys are unique?
> me= ?
>
>
> Thanks,
> Lucas
>
>
> --
> Python and OpenOffice documents and templates
> http://lucasmanual.com/mywiki/OpenOffice
> Fast and Easy Backup solution with Bacula
> http://lucasmanual.com/mywiki/Bacula
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> http://mail.python.org/mailman/listinfo/chicago



More information about the Chicago mailing list