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

Erik Max Francis max at
Sun Feb 9 09:04:00 CET 2003

Michele Simionato wrote:

> Interesting. I would accept this or the "when" proposal. But I am not
> sure if other Pythonistas would like a new special symbol "->" only
> used in the
> ternary operator. Maybe you should think of other case of use for
> "->".

Since the ? : form is declared unusable by fiat (and I must say I agree,
it overloads the use of the colon too much), it seems only reasonable
that the two intervening things in the ternary conditional operator be
keywords, and both be keywords.  Having one a symbol (whether already
used in the language or not) and the other a keyword (whether already
used or not) seems unclear.

 Erik Max Francis / max at /
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Always forgive your enemies -- nothing annoys them so much.
\__/ Oscar Wilde Quake III Arena /
 A personal guide to Quake III Arena.

More information about the Python-list mailing list