[Edu-sig] On case sensitivity

Guido van Rossum guido@python.org
Fri, 04 Feb 2000 11:22:53 -0500


Randy is not on the list, but I've forwarded your mail to him.

> I assume that the IDE would search lexically for variables in order to
> enforce consistency?

Actually, I want to create an IDE that is sufficiently aware of the
syntax that it can tell assignment from use in most cases.

> How would it search the module system?

It would parse the module source code (caching results to make the
time expenditure acceptable).  For extension modules it could simply
import the module and report the names it defines.  We may also create
special interface description files in a dialect of Python to describe
extensions; the work being done in the Python type-sig on optional
static typing is relevant here.

> The dynamic
> nature of python makes this problem intractable in general:
> 
> # pathological case
> 
> a = raw_input('Select module: ')
> if a=='foo':
>   from foo import *
> elif a=='bar':
>   from bar import *
> else:
>   from foobar import *
> 
> # at this point the correct case of every
> # identifier is basically up in the air

This is not very common (usually the from M import * is executed
unconditionally) so it will rarely be a problem.  The IDE could always
compute a worst case outcome.

> I know this seems a little far-fetched, but the standard libraries actually
> do this sort of thing.

Where?

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