[Python-Dev] Adding a conditional expression in Py3.0

Guido van Rossum guido at python.org
Wed Sep 21 21:05:53 CEST 2005

I think a recap of past arguments is useful. Me-too votes are not. i
will read everything and pick a syntax and that's it. We can do it in
Python 2.5.

On 9/21/05, Terry Reedy <tjreedy at udel.edu> wrote:
> Guido:
> When you invited resumed discussion, did you intend to proceed from where
> the revised PEP left off (with a few variations on the table), or to start
> over from point zero (with potentially anything and everything on the
> table).  In particular, do we need to rehash the reasons for rejection of
> the backwards if-else proposal that a few seem to wish to resurrect?
> Many people, perhaps most, including me, read
> exp1 if exp2 else exp3 # as
> cond if etrue else efalse # in direct analogy with
> cond ?  etrue :     efalse # from C
> I mentally read ?: in C as if/else!  It took a few readings of the proposal
> to even realize that it the order flipped.
> There there is the obvious analogy with Python's
> if cond: etrue
> else:      efalse
> with 'if' moved over to the first : position (and the : then removed) but
> with 'else' still between the alternatives (and the second : also removed).
> Then there are conditional functions, in various languages, iff(cond,
> etrue, efalse), which as far as I know always have the expressions in that
> order.
> Need I continue?  Or is the dead still dead?
> Terry J. Reedy
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list