[beginner] What's wrong?

Dan Sommers dan at tombstonezero.net
Sun Apr 3 11:25:29 EDT 2016


On Sun, 03 Apr 2016 07:30:47 -0700, Rustom Mody wrote:

> So here are some examples to illustrate what I am saying:

[A vs a, A vs A, flag vs flag, etc.]

Are identifiers text or bytes? or something else entirely that takes
natural language rules and the appearance of the glyphs into account?

I, for one, am very happy that identifiers are more like bytes than like
they are like text.  The rules for equality for sequences of bytes are
well-defined and unambiguous.  The rules for equality for text are not.
Do I have to know the details of every human (and some non-human)
language, not to mention their typographical conventions (e.g.,
ligatures) just to determine whether two identifiers are the same?

Yes, it's marginally annoying, and a security hole waiting to happen,
than A and A often look very much alike.  It's also troubling that I, a
native English speaker with some knowledge of a random selection of
other languages, should know whether e and é are the same, or whether ij
and ij are the same, and that it might depend on the fonts that happen to
have been used to render them.

And where does it end?  If flag and flag are the same, then are Omega and
Ω the same?

In English (and many other languages), it is wrong to spell my first
name with an initial lower case letter.  Therefore, Dan and dan are not,
and should not be, the same identifier.

ObPython:  if my identifiers are case-insensitive, then what about the
language's keywords?  Can I spell class and for as Class and For?

I understand that in some use cases, flag and flag represent the same
English word, but please don't extend that to identifiers in my
software.

Dan



More information about the Python-list mailing list