Help understanding the decisions *behind* python?

Hendrik van Rooyen hendrik at microcorp.co.za
Wed Jul 22 08:36:29 CEST 2009


On Tuesday 21 July 2009 15:49:59 Inky 788 wrote:
> On Jul 20, 12:27 pm, Phillip B Oldham <phillip.old... at gmail.com>
>
> wrote:
> > [snip] 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.
>
> My guess is that it was probably for optimization reasons long ago.
> I've never heard a *good* reason why Python needs both.

The good reason is the immutability, which lets you use
a tuple as a dict key.  

- Hendrik



More information about the Python-list mailing list