For review: PEP 308 - If-then-else expression

Samuele Pedroni pedronis at bluewin.ch
Mon Feb 10 00:55:29 EST 2003


"Erik Max Francis" <max at alcyone.com> ha scritto nel messaggio
news:3E47372D.D683B8B6 at alcyone.com...
> 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.

the context was "editor-accident :-)"[hk]






More information about the Python-list mailing list