PEP 308 - ternary operator
Erik Max Francis
max at alcyone.com
Tue Feb 11 03:29:19 EST 2003
Jim Jinkins wrote:
> My preference for an immediate-if operator is the traditional '?' from
> C:
>
> cond ? expr1 : expr2
...
> If this is not acceptable my second choice is a functional form:
> iif(cond, expr1, expr2)
>
> This is not a function, it is a built-in macro.
Both of these forms have been explicitly rejected by the BDFL, although
for different reasons; check the current state of the PEP.
--
Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/ \ I always entertain great hopes.
\__/ Robert Frost
REALpolitik / http://www.realpolitik.com/
Get your own customized newsfeed online in realtime ... for free!
More information about the Python-list
mailing list