[Python-ideas] Make all keywords legal as an identifier

Cameron Simpson cs at zip.com.au
Tue Apr 26 09:43:30 CEST 2011


On 25Apr2011 22:33, haael <haael at interia.pl> wrote:
| @ Mike Graham
| >>Of course, if a keyword is not preceded by a dot, it would be treated as a
| >>reserved word, just like now.
| >>>with = 3  # syntax error
| >I don't see how this is a real improvement over the current
| >convention, to add a trailing underscore, so that programs really
| >needing to use the name "with" would use "with_". [...]
| But the trailing underscore is treated as a part of an identifier,
| while the preceding dot is not. This is important if I want to have
| an identifier named exactly "with", with no other characters (no pun
| itended).
| 
| As I said, I want sometimes to import some non-Python namespace,
| i.e. a Pascal program. If all identifiers are allowed, there would
| never be a clash of reserved words.

Does your proposal help with non-Python namespaces with different
identifier rules? I know this is a little snarky, but I've certainly
seen real world stuff with "$" as a valid identifier character.

Cheers,
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

But then, I'm only 50. Things may well get a bit much for me when I
reach the gasping heights of senile decrepitude of which old Andy
Woodward speaks with such feeling.
        - Chris Malcolm, cam at uk.ac.ed.aifh, DoD #205



More information about the Python-ideas mailing list