PEP 308: I liked the original proposal better

Erik Max Francis max at alcyone.com
Fri Feb 14 08:26:01 CET 2003


David Glass wrote:

> Although I am not sure any ternary operator is worth changing the
> language, I too believe the original proposal to be the most Pythonic
> and elegant.
> 
> x if C else y
> 
> doesn't stick out like
> 
> (if C: x else: y)
> 
> which, as a special case, requires parentheses.

It doesn't _require_ parentheses, but parentheses as a requirement are
part of the PEP.

Further, I'm not sure why "not sticking out" is a good requirement. 
Wouldn't you want something that's easy to spot and interpret, rather
than something which quietly blends in?

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Take the slow train / To my destination
\__/ Sandra St. Victor
    Bosskey.net / http://www.bosskey.net/
 A personal guide to online multiplayer first person shooters.




More information about the Python-list mailing list