Dictionaries with invalid key?

Oleg Broytmann phd at emerald.netskate.ru
Mon Sep 6 09:20:42 EDT 1999


On Mon, 6 Sep 1999, Gerhard W. Gruber wrote:
> Usually a dictionary conists of a key and a value. I thought that keys
> are strings. Now I wrote some code that managed to create a key that is
> a number instead of a string. Is this a bug or is this ok?

   Dictionary's key may be any immutable object. Tuple, for example.

> -- 
> bye,
>    Gerhard
> email: sparhawk at eunet.at
>        g.gruber at xsoft.co.at

Oleg.
---- 
    Oleg Broytmann        Netskate/Inter.Net.Ru        phd at emerald.netskate.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list