PEP-0315--Enhanced While Loop: An idea for an alternative syntax

Paul Rubin http
Thu Feb 19 04:41:48 EST 2004


Erik Max Francis <max at alcyone.com> writes:
> > What do you mean by "return value"?  Only functoins have return
> > values.  It's just a value, not a return value.
> 
> You know very well what he means, you're just being difficult at this
> point.

No, I think he's preoccupied with distinctions that aren't there.
He said

> x = 1 (or x := 1) looks to me like a statement that sets x to 1, not
> an expression.  I wouldn't expect any return value, if my mind hadn't
> been corrupted by C.

but of course from my Lisper's point of view, the whole idea that a
statement and an expression are fundamentally different things is
itself a sign of a corrupted mind.  I'm not willing to accept the
notion that the way C does it is the one that's "corrupt".  C was
phenomenally successful despite its warts, because it was conducive to
an easy, fluid coding style, just like Python sometimes aspires to.
Assignment expressions were an aspect of that conduciveness.  Python
itself has this really odd mixture of wonderful fluidity (I love list
comprehensions), and completely unnecessary, almost Calvinistic
moralizing over semi-trivial issues like assignment expressions, while
still leaving plenty of naked razor blades (unchecked exceptions, the
crazy scoping system, lack of protection on class attributes, etc.)
for the programmer to slash himself with.

> What you're suggesting has been proposed, time and time again.  And it
> has been shot down, time and time again.

I'm unmoved by that observation.  We've seen it plenty of times
before, that the need for something in Python was recognized for a
long long time, but shot down repeatedly before finally being fixed
(look at 'a += b').  Maybe this will be the same.



More information about the Python-list mailing list