PEP 308: Pep Update
peter at engcorp.com
Thu Feb 13 15:31:48 CET 2003
Raymond Hettinger wrote:
> Amended the PEP to reflect some convergence on the newsgroup:
> The leading options on the table are:
> * (if <cond>: <expr1> else: >expr2>)
> * <cond> then <expr1> else <expr2>
> * <cond> ? <expr1> : <expr2>
> * no change
My main problem with some of the proposals, including the one
above with "then", is that they do not seem to me to suggest that
there is a condition and a selection. In my mind, to do that
requires a question to be asked, as in "if" or the C-like "?".
The word "then" by itself has merely a connotation of sequential
time, so that "A then B" implies that both A and B will happen
in some way, with B following A in time.
Without it's partner "if", "then" fails to convey the question
that is being asked.
I also have a mild concern about the first contender listed above,
because in my mind the colons are for introducing blocks, while
in the above they are "overloaded" merely to help the syntax be
unambiguous (I assume), or for some other reason not involving
I think I could live with that, although at this point I'm starting
to think that only Guido's original ("backwards") suggestion is
elegant, though still undesirable to me, so I'm now favouring
the final option above again... sigh.
More information about the Python-list