How to use list as key of dictionary?

Michael Wronna mike at gmx.net
Tue Nov 6 11:15:17 CET 2007



On Tue, 6 Nov 2007, Boris Borcic wrote:

>> We know that list cannot be used as key of dictionary.
> Yeah, but do we know why ?

I think, because lists are mutable and a key of a dictionary
MUST be unmutable, not to crash the dictionary by accidently
changing one of its keys!

Mike



More information about the Python-list mailing list