[Python-Dev] Trinary Operators (original) (raw)

Andrew Koenig ark@research.att.com
Thu, 6 Feb 2003 13:27:35 -0500 (EST)


Guido> Maybe I should write a PEP and let the folks in c.l.py vote on it, Guido> just for fun. (I expect to get about as many yes votes as no votes. :-)

You might consider correlating votes with people who like lambda, because that's where I think the feature is really useful.

Which implies, by the way, that parentheses shouldn't be mandatory in the following context:

(lambda x, y, z: y if x else z)

Or, for that matter, in

(lambda x, y, z: f(x, y if x else z))