case sensitivity redux (was Re: Language change and code breaks)

Guido van Rossum guido at zope.com
Tue Jul 31 13:25:29 EDT 2001


[Guido]
> > I then settled on a case-sensitive language with case-preserving
> > tools.  But now I think neither is worth fighting for.

[Alex]
> I guess that, as usual, you may well be right.  But then,
> we're now talking basically about something like some minor
> changes to IDLE's source code editor, aren't we?  Or to
> Emacs' python-mode, etc.  Surely there would be no fight
> necessary to add a "case-preserving switch" to such tools
> for optional use.  The only issue I can see is with modules
> (particularly in the standard libraries) that may _require_
> a programmer to enter the same identifier in more than one
> different case-mix.  Are there such cases today in Python's
> standard library?  I'm not sure.

Yes, there are plenty in the std lib, and plenty more in 3rd party
code.

Also, I think that doing a really good job may be tricky.  Just one
example:

class Foo:
    def foo(s): pass

The 'foo' attribute lives in a different namespace as the 'Foo' class
and so these should be accepted in the same program, even though

class C:
    def foo(s): pass
    def Foo(s): pass

isshould be invalid.

Another example:

FOO = 12

def f():
    foo = 21
    return foo

> Offhand, I can easily think of a few identifiers that
> do appear in different cases, e.g. fileinput (the module)
> vs FileInput (the class in module fileinput), but it would
> seem to me that those identifiers would not normally have
> to be entered with case being the *only* distinction (one
> would normally write fileinput.FileInput, so a reasonably
> smart tool might still be able to get the case right for
> each of the two identifiers - or is this requiring too
> much smarts from the tools?).  Maybe, if a _small_ fight
> is needed to ENABLE (as opposed to FORCE:-) use of a
> semi-smart, case-preserving tool, it MIGHT be worth it,
> if the fight be small enough...?

(I guess you're pointing out some of the same issues as I did
above. :-)

I agree it might be worth it, but I think doing a real good job
requires more type inference than I currently know how to do...

--Guido van Rossum (home page: http://www.python.org/~guido/)




More information about the Python-list mailing list