performance of tuple-less Python?
nascheme at enme.ucalgary.ca
Tue Nov 30 09:14:36 CET 1999
Phil Hunt <philh at vision25.demon.co.uk> wrote:
>In article <1268226961-30285235 at hypernet.com>
> gmcm at hypernet.com "Gordon McMillan" writes:
>> They're only redundant if the concept of mutability is
>> meaningless. A reference-based language without a concept
>> of mutability would be, um, an adventure.
Some values should be immutable. Consider if integers in Python
were mutable. You store a reference to 1 and somewhere else the
value of 1 is changed to 2. Is that not a problem? Also, you
can not (efficiently) implement hash tables.
Maybe you mean that mutability is not required. That would be an
interesting language. How to you accomplish anything? Sometimes
you want mutability and sometimes you don't. That is why both
tuples and lists exist.
BTW, my example about changing the value of None is not really
the same thing. I re-bound the global variable None to a new
value. That is not the same as modifying the value of None.
More information about the Python-list