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

Antoon Pardon apardon at forel.vub.ac.be
Mon Apr 23 05:36:15 EDT 2007


On 2007-04-20, Gabriel Genellina <gagsl-py2 at yahoo.com.ar> wrote:
> En Fri, 20 Apr 2007 15:28:51 -0300, Bjoern Schliessmann  
><usenet-mail-0306.20.chr0n0ss at spamgourmet.com> escribió:
>
>> Luis M. González wrote:
>>
>>> I don't remember exactly where I read about it, but Guido said
>>> once that tuples are being kept mainly for historical reasons.
>>
>> Weren't tuples added when lists already existed?
>
> Both listobject.c and tupleobject.c appear to had been checked in at the  
> same time:
>
> Revision 2167 - (view) (download) (as text) - [select for diffs]
> Added Sun Oct 14 12:07:46 1990 UTC (16 years, 6 months ago) by guido
> File length: 4965 byte(s)
> Initial revision
>
> And that's before the earliest tagged release I could find on svn, Python  
> 0.98

But this doesn't contradict the supposed comment from guido. One can
add something later and come to the conclusion that it would have been
better not included but that in the mean time too much depend on it
to remove it. That seems a perfect description of keeping something
for historical reasons.

So it is possible that one keeps something for historical reasons
that is more recent than something one keeps for design reasons.

-- 
Antoon Pardon



More information about the Python-list mailing list