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

Erik Max Francis max at
Sun Feb 9 09:06:13 CET 2003

Roy Smith wrote:

> It seems to me we're getting very close to "let's take some arbitrary
> code and turn it into an expression", which is essentially what a
> lambda
> is.  I'm not particularly fond of lambdas, but given that we have
> them,
> I don't really see the point of having two versions of them.

Lambdas can't turn statements into expressions.  (Mind you, I'm not sure
I'm all that thrilled with my suggestion either, I was merely putting it
out for public consumption.)

I have no problem steering the direction, as some others have suggested,
into a more general construct for multiway or lazy evaluation, with the
conditional operator as a degenerate case.

> I guess deep down, my real objection to all this is that it blurs the
> line between statements and expressions.

So what did you think of the introduction of list comprehensions?  How
about generators?  Same "blurring" going on there.

 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