For review: PEP 308 - If-then-else expression
Ebo
NOSPAMebo at unicornDOTdemonDOTnl
Fri Feb 7 14:13:12 EST 2003
> Examples of how this works out:
>
> x if C else y if D else z <==> x if C else (y if D else z)
> x or y if C else z <==> (x or y) if C else z
> x if C else y or z <==> x if C else (y or z)
> lambda: x if C else y <==> lambda: (x if C else y)
> x if C else lambda: y <==> SyntaxError
> x if C else y, z <==> (x if C else y), z
> x, y if C else z <==> x, (y if C else z)
>
Hi all,
Allthough I think this form of if statements could be
useful in some cases, I seriously doubt whether Python
really _needs_ this _feature_.
Apart from this construct looks rather unpythonic.
So, unless some really good arguments come along, I'd
vote nay...
$0.02
E.
More information about the Python-list
mailing list