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

Samuele Pedroni pedronis at bluewin.ch
Sun Feb 9 23:32:41 EST 2003


"Andrew Koenig" <ark at research.att.com> ha scritto nel messaggio
news:yu998ywolquw.fsf at europa.research.att.com...
> Samuele> For example the : in else: is absolutely spurious for the
> Samuele> expression case.
>
> At present, "else" is always followed by ":", which means that the
> : is absolutely spurious in all cases.  I see no reason to change that.

let me put it this way: a ternary cond op for me should belong to the and/or
op family not mimick statements.

x if cond else y

is mostly OK,  but the order is wrong.

Again, my target would be something like:

cond KEYWORD x else y

or

cond KEYWORD1 x KEYWORD2 y

If the plan would be to find expression forms corresponding to all
statements then the criteria would be different.











More information about the Python-list mailing list