Conditional operator in Python?

Erik Max Francis max at alcyone.com
Sat Mar 31 21:04:40 EST 2001


Okay, okay, but I still have to ask.

Why isn't there a conditional operator (a ? b : c) in Python?  2.0 now
has augmented assignments, and the FAQ even acknowledges that the
conditional operator is sometimes quite convenient and gives some (very
awkward) Python alternatives.

I've been reading comp.lang.python for a while (since just before 2.0
shipped) and I can't really remember much discussion about it.  Is it a
perennial request and I'm just missing it?

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ I sidestep the either
\__/ or choices of logic and choose both. | Ken Feit
    Product's Quake III Arena Tips / http://www.bosskey.net/
 Tips and tricks from the absolute beginner to the Arena Master.



More information about the Python-list mailing list