PEP 308: Pep Update

John Roth johnroth at ameritech.net
Thu Feb 13 13:28:21 EST 2003


"Raymond Hettinger" <vze4rx4y at verizon.net> wrote in message
news:6qH2a.32424$F25.27498 at nwrddc02.gnilink.net...
> Amended the PEP to reflect some convergence on the newsgroup:
>
> * Listed the downsides of the current proposal.
>
> * Listed why '<cond> then <expr1> else <expr2>' is starting to
>    be preferred over '<cond> and <expr1> or <expr2>'.
>
> * After BDFL comments, I withdrew my c??a||b syntax
>    and deleted the rejected c?a!b syntax.  The remaining
>    punctuation based contender is c?a:b.
>
> * After BDFL rejection of non-short-circuiting options,
>    advocacy dropped sharply.  Removed it from the list of
>    contenders.
>
> The leading options on the table are:
>
> *     (if <cond>: <expr1> else: >expr2>)
> *     <cond> then <expr1> else <expr2>
> *     <cond> ? <expr1> : <expr2>
> *     no change

On the gripping hand (I've already made two comments,
so I need a third hand) I find I prefer:

* (if <cond> then <exp> elif <exp> else <exp>)

It gives a sentinel on the left that tells exactly what's coming
"(if", and it gets rid of the annoying colons. It also adds in
the elif option.

John Roth
>
>
> Raymond Hettinger
>
>






More information about the Python-list mailing list