case sensitivity and XML

Paul Prescod paul at prescod.net
Tue May 23 21:37:03 CEST 2000


"Michal Wallace (sabren)" wrote:
> 
> How's this:
> 
> 1. By definition: For python to be case insensitive, the token {A}
>    must be the same as the token {a}.

True.

> 2. Therefore:
>         x.A = 1
>    is the same as:
>         x.a = 1
>
>    where x is some kind of module or object.

True.

> 3. Therefore:
>         x.__dict__["A"] = 1
>    is the same as:
>         x.__dict__["a"] = 1
> 
>    And/Or:
>         setattr(object, "A", 1)
>    is the same as:
>         setattr(object, "a", 1)

False. x.__getattr__ can do the case normalization. If you start messing
with the underlying dictionaries you don't get the special behavior.
Objects already do "funny things" in the "." syntax that you don't get
when you go directly to the dictionary.

> 4. Therefore, the string, "A" must be equivalent to the string, "a".

Also not true. How do you get from "setattr might do case-insensitive
setting" to "A"=="a" everywhere.
-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for himself
Just how compassionate can a Republican get before he has to leave the 
GOP and join Vegans for Global Justice? ... One moment, George W. Bush
is holding a get-to-know-you meeting with a bunch of gay Republicans.
The next he is holding forth on education or the environment ... It is
enough to make a red-blooded conservative choke on his spotted-owl
drumstick.     - April 29th, Economist






More information about the Python-list mailing list