Case-sensitivity: why -- or why not? (was Re: Damnation!)

Martijn Faassen m.faassen at vet.uu.nl
Tue May 23 06:18:18 EDT 2000


Moshe Zadka <moshez at math.huji.ac.il> wrote:
> On 22 May 2000, Martijn Faassen wrote:

>> The truth of the matter is that, irrespective of whether or
>> not a language is indentation sensitive or not, using inconsistent
>> indentation is an extraordinarily bad idea, and
>> would be extremely poor engineering practice.
>> 
>> Since Python enforces the indentation issue, but the same philosophy
>> it ought to enforce the case issue. And does. :)

> Perhaps the behaviour should be case-consistent but not
> case-differentiating. I probably managed to lose everyone, so let me
> explain:

>>>> A=1
>>>> a
> Traceback (innermost last):
>   File "<stdin>", line 1, in ?
> NameError: a
>>>> a=1
> Traceback (innermost last):
>   File "<stdin>", line 1, in ?
> NameError: A already exists

> (Thanks for Guido for giving me a copy of the binaries of 2003 Python.
> This is without the --readable-error-messages switch)

While that would throw out the niceness of things like:

   foo = Foo()

It would be better than the case insensitive alternative. I think the
point here is that we're already using case to distinguish between
two different things (class versus instance, also between constant
and non-constant), and we'd lose that ability then. Also, I don't think 
this would help a lot in the newbie example. Your example might confuse
newbies even more. ("I'm trying to assign to A and now I can't because A
already exists?")

Regards,

Martijn
-- 
History of the 20th Century: WW1, WW2, WW3?
No, WWW -- Could we be going in the right direction?



More information about the Python-list mailing list