list vs tuple

Mark Pilgrim f8dy at
Wed Mar 28 20:18:00 CEST 2001

"Aahz Maruch" <aahz at> wrote in message
news:99stcb$483$1 at
> In article <hGlw6.782$p5.3210 at>,
> deadmeat <root@[]> wrote:
> >
> >Whats the practical difference between a list[] and a tuple() ?
> As someone said, tuples are immutable.  This leads to useful
> functionality, such as being able to easily use tuples as keys in
> dictionaries (ditto strings).

It was my understanding that only tuples containing immutable objects could
be used as dictionary keys.  For instance, (1,2,3) can be, and ("a","b","c")
can be, but ([1,2,3], ["a","b","c"]) can not, because the underlying objects
could mutate and cause problems.  (Wow, that sounds like a bad sci-fi
movie.)  Is this true?

You're smart; why haven't you learned Python yet?

More information about the Python-list mailing list