When are immutable tuples *essential*? Why can't you just use lists *everywhere* instead?

Luis M. González luismgz at gmail.com
Fri Apr 20 13:13:26 EDT 2007


On Apr 20, 2:06 pm, "seber... at spawar.navy.mil"
<seber... at spawar.navy.mil> wrote:
> Please help me think of an example where immutable tuples are
> essential.
>
> It seems that everywhere a tuple is used one could just as easily use
> a list instead.
>
> chris


I don't remember exactly where I read about it, but Guido said once
that tuples are being kept mainly for historical reasons.
This is what Python uses internally from the beginning and it's just
an implementation detail that makes sense in some contexts.
Although I guess you can ignore them and use only lists instead if you
want..

luis




More information about the Python-list mailing list