conditional expressions

Greg Ewing see_reply_address at something.invalid
Tue Sep 24 22:30:57 EDT 2002


thp at cs.ucr.edu wrote:

> But why use grotesque hacks in the first place?  "a ? b : c" is a
> well-established syntax for conditional expressions.  Why doesn't
> Python simply adopt it?


I believe because Guido (a) thinks it's ugly and (b) doesn't
think it would add enough to the language to be worth
including.

Personally, I rather like

    a if b else c

but Guido doesn't like that either, unfortunately.

Perhaps I'll slip it into Pyrex when no-one's looking...:-)

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg




More information about the Python-list mailing list