For review: PEP 308 - If-then-else expression

Andrew Koenig ark at
Sat Feb 8 03:21:40 CET 2003

Skip> Well understood.  It's a 90% solution, and for the other 10%
Skip> where I'd have to resort to something like

Andrew> (<cond> and [expr1] or [expr2])[0]

Skip> I punt and use an if statement.

The contexts in which I would like to be able to use an if-expression
are precisely those, such as function arguments and lambda expressions,
where if statements aren't allowed.

Andrew Koenig, ark at,

More information about the Python-list mailing list