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

Erik Max Francis max at alcyone.com
Sun Feb 9 23:31:08 EST 2003


Samuele Pedroni wrote:

> statements are not expressions.

Y'know, colons already can appear in expressions.  Ever heard of
lambdas?

> For example the : in else: is absolutely spurious for the expression
> case.

It's not for the `if C:' portion, the alternative of which is to add an
extra keyword (like `then'), which already has huge inertia pushing
against it.

	if C: x else: y

reads left-to-right, requires no new keywords or punctuation, is
unambiguous, and is totally analogous to the if...else statement and
thus is crystal clear.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ She glanced at her watch ... It was 9:23.
\__/ James Clavell
    Bosskey.net: Quake III Arena / http://www.bosskey.net/q3a/
 A personal guide to Quake III Arena.




More information about the Python-list mailing list