"?:", "a and b or c" or "iif"

Tim Peters tim_one at email.msn.com
Wed May 26 11:28:15 EDT 1999


[Thomas Wouters]
> ...
> Wait, wait. What's wrong with using 
>
> x and a or b
>
> for constructs similar to '?:' ?

FAQ 4.16. Is there an equivalent of C's "?:" ternary operator?

http://grail.cnri.reston.va.us/cgi-bin/faqw.py?req=show&file=faq04.016.htp

(x and [a] or [b])[0]-ly y'rs  - tim






More information about the Python-list mailing list