Lists and Tuples

Michael Hudson mwh at python.net
Fri Dec 5 07:46:48 EST 2003


Dennis Lee Bieber <wlfraed at ix.netcom.com> writes:

> Jeff Wagner fed this fish to the penguins on Thursday 04 December 2003 
> 21:19 pm:
> 
> > tuple. So, what's the difference and why choose one over the other?
> >
>         A tuple can be the key for a dictionary, a list can't.
> 
> 
>         Not sure of a tuple containing a list, though...

Nope.  A tuple is hashable iff all of its elements are.

Cheers,
mwh

-- 
  Now this is what I don't get.  Nobody said absolutely anything
  bad about anything.  Yet it is always possible to just pull
  random flames out of ones ass.
         -- http://www.advogato.org/person/vicious/diary.html?start=60




More information about the Python-list mailing list