For review: PEP 308 - If-then-else expression
Erik Max Francis
max at alcyone.com
Mon Feb 10 00:22:53 EST 2003
Samuele Pedroni wrote:
> you should see the ambiguity.
It's not ambiguous in the parser sense. Since what immediately follows
the `if' keyword in an if statement is an expression, the second `if'
clearly starts a conditional operator, not another if statement (I mean,
how could it?)
It's only "ambiguous" in the sense of being deliberately obtuse that
someone would use a conditional operator in the conditional expression
of an if statement (say that three times fast). The same is true in any
language with conditional operators; crappy code is crappy code.
--
Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/ \ She glanced at her watch ... It was 9:23.
\__/ James Clavell
Bosskey.net: Quake III Arena / http://www.bosskey.net/q3a/
A personal guide to Quake III Arena.
More information about the Python-list
mailing list