Help understanding the decisions *behind* python?

Michiel Overtoom motoom at xs4all.nl
Mon Jul 20 13:17:19 EDT 2009


Phillip wrote:

> Specifically the "differences" between lists and tuples have us
> confused and have caused many "discussions" in the office. We
> understand that lists are mutable and tuples are not, but we're a
> little lost as to why the two were kept separate from the start. They
> both perform a very similar job as far as we can tell.

Yes, but because of their immutability you can use tuples as dictionary 
keys (only if they contain immutable objects).
Lists can't be used as dictionary keys.

Greetings,

-- 
"The ability of the OSS process to collect and harness
the collective IQ of thousands of individuals across
the Internet is simply amazing." - Vinod Valloppillil
http://www.catb.org/~esr/halloween/halloween4.html



More information about the Python-list mailing list