case sensitivity and XML
Michal Wallace (sabren)
sabren at manifestation.com
Sun May 21 03:47:00 EDT 2000
How's this:
1. By definition: For python to be case insensitive, the token {A}
must be the same as the token {a}.
2. Therefore:
x.A = 1
is the same as:
x.a = 1
where x is some kind of module or object.
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)
4. Therefore, the string, "A" must be equivalent to the string, "a".
5. Given: XML is a case-sensitive language.
6. By definition: In XML, "a" is different from "A"
7. Therefore: it is possible to have a meaningful xml tag such as:
<tag A="one thing" a="something else"/>
8. Assumption: In order to access this tag's attributes, we must
use a string with the name of an attribute.
9. Therefore: "A" must not equal "a", which contradicts [4].
10. Assumption: "A" cannot equal "a" and NOT equal "a" at the
same time.
11. Given the above, a case-insensitive python cannot parse all
XML documents.
-----
Does anyone disagree with the conclusion in line 4? Can we have a case
insensitive Python without case-insensitive string comparisons?
If you don't buy the assumption in line 8, I'd like to see your
XML library! :)
If you don't buy the assumption in line 10, then would you introduce
a separate operator for case (in)sensitive string matching?
-----
Another argument has to do with Java. In java, X and x are different. What
does that mean for a case insensitive JPython? That we can only script
SOME java objects reliably?
Cheers,
- Michal
-------------------------------------------------------------------------
http://www.manifestation.com/ http://www.linkwatcher.com/metalog/
-------------------------------------------------------------------------
More information about the Python-list
mailing list