PEP 308: Precendence of "a then b else c"
johnroth at ameritech.net
Thu Feb 13 14:27:49 CET 2003
My newsreader seems to have quit putting >s in the margins. Sigh.
"Harvey Thomas" <hst at empolis.co.uk> wrote in message
news:mailman.1045137465.10272.python-list at python.org...
With some proposals put forward there is possibility for confusion if
colons, particularly as in else: are used as I can imagine it's not
always going to be clear whether a code fragment is part of an
if/elif/else statement construct or a conditional expression.
The proposal on the table requires parenthesis around the entire figure:
(if <condition>: <expression> else: <expression)
There is no ambiguity.
More information about the Python-list