Why are tuples immutable?

Fredrik Lundh fredrik at pythonware.com
Wed Dec 22 03:30:38 EST 2004


Antoon Pardon wrote:

>> and to temporarily refer back to the top of this thread, do all this without
>> any performance impact, compared to the current implementation.
>>
> Why should that be? This originated when someone argued that lists could
> easily be resorted and reheapified.

from the original post (by someone else):

    The way I see it is that if we enable __setitem__ for tuples there
    doesn't seem to be any performance penalty if the users don't use it
    (aka, python performance independent of tuple mutability).

to which you later added:

    The performace gained by using tuples as keys in dictionaries is
    entirely illusional.

etc.  am I the only one one this list that can hold more than one post in my
head and chew gum at the same time?

</F> 






More information about the Python-list mailing list