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

Erik Max Francis max at alcyone.com
Sat Feb 8 00:05:13 EST 2003


Andrew Dalke wrote:

> Though in most cases I can find in C, the short-circuiting doesn't
> change anything except improve performance slightly.  Very few
> cases use the
> 
>     a ? f() : g()
> 
> idiom.  So while what you say is true, it isn't a very strong
> requirement
> for most real-life cases.

The point is, if you _are_ going to admit a true conditional expression
syntax into the language, it damn sure better do short circuiting. 
There's absolutely no reason not to, even if in practice it is used
rarely.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ The doors of Heaven and Hell are adjacent and identical.
\__/ Nikos Kazantzakis
    Bosskey.net: Return to Wolfenstein / http://www.bosskey.net/rtcw/
 A personal guide to Return to Castle Wolfenstein.




More information about the Python-list mailing list