Are you all certain that this mapping from a generator expression to a foor 
loop isn't just a happy coincidence?
After all, the generator statement is just a generalization of the list 
comprehension and that doesn't map quite so directly.

I have always taken both expressions at face value, and not tried to map them 
into something else.  Why should you, since they are designed to match the 
grammar of the english language and make perfect sense if you read them as you 
would a herring recipe.
The suggested "while" keyword expands on this easy to understand theme, and the 
fact that it doesn't fit a mapping that was probably never intentional 
shouldn't detract from that.

K


-----Original Message-----
From: python-dev-bounces+kristjan=ccpgames....@python.org 
[mailto:python-dev-bounces+kristjan=ccpgames....@python.org] On Behalf Of Terry 
Reedy
Sent: 19. janúar 2009 17:52
To: python-dev@python.org
Subject: Re: [Python-Dev] PEP 3142: Add a "while" clause to generator 
expressions


The other, posted by Steven Bethard, is that it fundamentally breaks the 
current semantics of abbreviating (except for iteration variable 
scoping) an 'equivalent' for loop.  This should have been listed in the 
PEP under Objections (or whatever the section.  I did not bother to 
second his objection there but will now.

-1

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to