Proposed PEP for a Conditional Expression

Rainer Deyke root at rainerdeyke.com
Thu Sep 13 01:31:45 EDT 2001


"Terry Reedy" <tjreedy at home.com> wrote in message
news:OsUn7.4220$5A3.1585645 at news1.rdc2.pa.home.com...
>
> "Greg Ewing" <greg at cosc.canterbury.ac.nz> wrote in message
> news:3BA00239.DECE6412 at cosc.canterbury.ac.nz...
> > "Terry Reedy" <tjreedy at home.com>:
> >
> > > I agree that the above is backwards.
> > > <cond> if <expr> else <expr>
> >
> > No! That sounds way too much like Forth!
>
> It is exactly like C, whose ? : equivalent is the impetus for the
> proposed change.
> Of course, if you don't like the form of C's conditional expressions,
> you won't like its translation into Python.

C's syntax doesn't overload an already existing keyword, and is therefore
arguably clearer.  None of the proposed keyword-overloading syntaxes mesh
well with list comprehensions.


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list