Case sensitivity

A. Lloyd Flanagan alloydflanagan at attbi.com
Mon Feb 24 17:35:46 EST 2003


mwilson at the-wire.com (Mel Wilson) wrote in message news:<GQ6U+ks/KveM089yn at the-wire.com>...
> 
>    Not that I know, but:  If Python names were case
> insensitive, then Python's dictionaries.. the ones returned
> by `locals()` and `globals()` for instance.. would have to
> do case insensitive lookups.  This would put them out of
> sync with other dictionaries, notably the ones people might
> use in `exec .. in` statements or calls to `eval`.  Unless
> string comparisons were changed to be case-insensitive..
> 

Worse, it seems to me that the hash function for dictionary lookup
would have to be slower/more complex.  That has major performance
implications for Python, since so much of the 'plumbing' is
implemented as dictionary lookups.

OTOH, I like the idea of forbidding variable names that differ only in
case, seems to me it would eliminate silly mistakes and could be
enforced on the 'compile'.




More information about the Python-list mailing list