Label-Value (was: Re: Inheriting the @ sign from Ruby)

Remco Gerlich scarblac at pino.selwerd.nl
Wed Dec 13 01:19:34 CET 2000


Erno Kuusela <erno-news at erno.iki.fi> wrote in comp.lang.python:
> In article <slrn93cotl.80c.scarblac at pino.selwerd.nl>,
> scarblac at pino.selwerd.nl (Remco Gerlich) writes:
> 
> | Integers, longs, complex numbers, strings, functions, tuples, types, floats
> | and None are immutable. Most of these are obvious; the number 3 is the
> | number 3, why would you change that?!
> 
> it is easy to think that when you know how things work in python.
> but, you could just as easily say, "a list containing the numbers 1, 2 and
> 3 is a list of 1, 2 and 3, why would you change that?!"

Yes, I realized that and therefore said "most of these...".

And it felt obvious at the time, a tuple is something I know from math
just like an integer, and a list is a pragmatic changing thingy that you
want to be able to change. But there have been a few other posts in the
thread that have made it less obvious, and I now see that a mutable int
can be useful; something like a UserInteger class besides the normal ints.
And integer literals would always be the immutable type so that 2+2 is
always 4, of course.

I'm now thinking that a mutable list type shouldn't have a literal, but
always be built from the immutable literal (since literals are by themselves
immutable, so a literal for a mutable type is strange). 
Isn't that what Perl does?! (just an idea, i'm not saying that this
is a good idea ;)).

But I still feel that the current Python situation is rather simple, and
that it only looks complicated when people try to fit concepts from other
languages to it or when people like me try to explain it too much :).

-- 
Remco Gerlich



More information about the Python-list mailing list