"as" keyword woes

Aaron Brady castironpi at gmail.com
Tue Dec 9 11:30:26 EST 2008


On Dec 9, 8:28 am, MRAB <goo... at mrabarnett.plus.com> wrote:
snip
> In some languages (I think Delphi is one of them - it's been a while!)
> some words which would normally be identifiers have a special meaning in
> certain contexts, but the syntax precludes any ambiguity, and not in a
> difficult way. "as" in Python was one of those.
>
> I certainly wouldn't want something like PL/I, where "IF", "THEN" and
> "ELSE" could be identifiers, so you could have code like:
>
>      IF IF = THEN THEN
>          THEN = ELSE;
>      ELSE
>          ELSE = IF;
>
> See http://en.wikipedia.org/wiki/PL/I_(programming_language).
snip

The following are semantically equivalent:

I certainly wouldn't want something like PL/I, where "IF", "THEN" and
"ELSE" could be identifiers.

I wouldn't want something like PL/I, where "IF", "THEN" and "ELSE"
could be identifiers.

That is, 'certainly' doesn't change the meaning of your statement
any.  You wouldn't want it, but King George III didn't want the
American Revolution.

You wouldn't want it.  What does that mean for me (the generic
reader), and Python?  What can I learn from that fact?




More information about the Python-list mailing list