Lists vs tuples (newbie)

Hendrik van Rooyen mail at microcorp.co.za
Wed May 23 06:13:34 EDT 2007


"Duncan Booth" <d....b...h at invalid.invalid> wrote:


> "Hendrik van Rooyen" <mail at microcorp.co.za> wrote:
> 
> > Aside from the hashing issue, there is nothing that a tuple can do
> > that can't be done as well or better by a list.
> 
> There are a few other cases where you have to use a tuple, for example in a 
> try..except statement the exception specification must be an exception to 
> be caught or a tuple of exception specifications: a list won't work to 
> catch multiple exceptions.

Esoteric - But I stand corrected...

any other "must use a tuple's " ?

Seems they all fall into a class that can be described as required by the
language - I was thinking data.

- Hendrik




More information about the Python-list mailing list