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

Christos TZOTZIOY Georgiou DLNXPEGFQVEB at spammotel.com
Fri Feb 7 21:28:09 EST 2003


On Fri, 07 Feb 2003 12:14:40 -0500, rumours say that Guido van Rossum
<guido at python.org> might have written:

>    The proposed syntax is as follows:
>
>        <expression1> if <condition> else <expression2>

I'm +0 on ternary expressions, however I don't like the condition in the
middle.  If adding a keyword is ok, what about:

<condition> then <expression1> else <expression2>

I believe it's easy to consider 'then' as a keyword only in such a case,
like as; ie. it jumps at the end of an expression without any operators
between it and the previous expression; this way, old programs don't
break even if using 'then' as a keyword.
-- 
TZOTZIOY, I speak England very best,
Real email address: 'dHpvdEBzaWwtdGVjLmdy\n'.decode('base64')




More information about the Python-list mailing list