Case sensitivity

Tim Churches tchur at optushome.com.au
Fri Feb 21 11:07:28 EST 2003


On Behalf Of David Mertz
> In most of those languages, I used almost exactly the same casing
> conventions I now do with Python.  'MAX' was intended as a
> constant in any case.  Likewise, 'MyClass' was a class, and
'myinstance'
> an instance.  Admittedly, in a case-insensitive language, you cannont
> also have a 'max' variable when you have a 'MAX' constant.  But doing
> that is mostly bad practice anyway.

David's use of quotes around object names raises another, moot,
question: if keywords and names were made case-insensitive, should
literal strings be made case-insensitive as well - for example, should
'max' == 'MAX' return True? I hope everyone agrees definitely not. I
challenge anyone arguing in favour of case-insensitivity for Python to
produce a succinct explanation for beginners of why names and keywords
are case-insensitive and why literals are not.

Of course, if literal string comparisons were case-insensitive, then
that implies that all string comparisons should be case-insensitive.
Follow that line of thinking a bit further and the fabric of the known
Universe starts to unravel...

tIM c








More information about the Python-list mailing list