PEP 308: Precendence of "a then b else c"

Andrew Koenig ark at
Thu Feb 13 15:37:55 CET 2003

John> The proposal on the table requires parenthesis around the entire figure:

John> (if <condition>: <expression> else: <expression)

John> There is no ambiguity.

There is no ambiguity with or without the parentheses.
The only question is whether the parser is up to it.
It's easy for a bottom-up parser but hard for a top-down parser.

Andrew Koenig, ark at,

More information about the Python-list mailing list