[Python-ideas] Change how Generator Expressions handle StopIteration
Antoine Pitrou
solipsis at pitrou.net
Thu Nov 6 22:45:37 CET 2014
On Thu, 6 Nov 2014 10:54:51 -0800
Guido van Rossum <guido at python.org> wrote:
>
> If I had had the right foresight, I would have made it an error to
> terminate a generator with a StopIteration, probably by raising another
> exception chained to the StopIteration (so the traceback shows the place
> where the StopIteration escaped).
>
> The question at hand is if we can fix this post-hoc, using clever tricks
> and (of course) a deprecation period.
Is there any point in fixing it? Who relies on such borderline cases?
Regards
Antoine.
More information about the Python-ideas
mailing list