[Python-Dev] Trinary Operators

Andrew Koenig ark@research.att.com
Thu, 6 Feb 2003 12:07:31 -0500 (EST)


Guido> I think I've seen the suggestion

Guido>     x = (y if y>z else z)

Guido> :-)

That's not bad, even though it looks Perlish :-)

It has the advantage of looking like a list comprehension.

I presume the parentheses would be mandatory.