List comprehension confusion...

Erik Max Francis max at
Mon Feb 3 02:16:34 CET 2003

Afanasiy wrote:

> Replies to this question relating to convenience led
> me to look for something like C's ternary ? operator.
> Does something like that exist in Python?

FAQ:  No.  There are syntaxes that come close but have defects; the
closer you come to the full functionality of a true conditional operator
in Python, the further you get from readability, thus defeating the

 Erik Max Francis / max at /
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ The quickest way of ending a war is to lose it.
\__/ George Orwell
    REALpolitik /
 Get your own customized newsfeed online in realtime ... for free!

More information about the Python-list mailing list