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

Jeremy Fincher tweedgeezer at hotmail.com
Fri Feb 7 22:47:16 EST 2003


Andrew Koenig <ark at research.att.com> wrote in message news:<yu994r7ffz1y.fsf at europa.research.att.com>...
> To get around it, you have to write something like
> 
>         (<cond> and [expr1] or [expr2])[0]
> 
> which is truly obscure.

I'm willing to be forced to read (or use) that pattern if it means
that in 99.9% of all other circumstances I can read a simple
if/elif/else statement.  There aren't very many situations in which I
truly need a conditional expression, and that code above suffices for
those extremely few situations.

One of Python's best features is that it's simple, easy to learn, and
consistent.  This proposal sacrifices consistency for a *very*
marginal improvement in expressivity.  I'm like -1,000,000 on the idea
of a conditional expression :)

Jeremy




More information about the Python-list mailing list