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

Andrew Koenig ark at research.att.com
Thu Feb 13 09:37:55 EST 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 research.att.com, http://www.research.att.com/info/ark




More information about the Python-list mailing list