List comprehension confusion...

Erik Max Francis max at alcyone.com
Sun Feb 2 20:16:34 EST 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
purpose.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ 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 / http://www.realpolitik.com/
 Get your own customized newsfeed online in realtime ... for free!




More information about the Python-list mailing list