A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-November/137054.html below:

Change StopIteration handling inside generators

[Python-Dev] PEP 479: Change StopIteration handling inside generators [Python-Dev] PEP 479: Change StopIteration handling inside generatorsChris Angelico rosuav at gmail.com
Sat Nov 22 23:23:20 CET 2014
On Sun, Nov 23, 2014 at 8:03 AM, Ron Adam <ron3200 at gmail.com> wrote:
>> Making comprehensions work more like generator expressions
>> would, IMO, imply making the same change to all for loops: having a
>> StopIteration raised by the body of the loop quietly terminate the
>> loop.
>
>
> I'm not suggesting making any changes to generator expressions or for loops
> at all.  They would continue to work like they currently do.

But if you're suggesting making list comps react to StopIteration
raised by their primary expressions, then to maintain the
correspondence between a list comp and its expanded form, for loops
would have to change too. Or should that correspondence be broken, in
that single-expression loop constructs become semantically different
from statement loop constructs?

ChrisA
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4