This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients Peter.Norvig, cvrebert, docs@python, ezio.melotti, mark.dickinson, r.david.murray, rhettinger, terry.reedy, wolma
Date 2016-11-29.08:30:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1480408225.72.0.659679620715.issue14845@psf.upfronthosting.co.za>
In-reply-to
Content
@wolma: I don't think PEP 479 is relevant here: we're not raising StopIteration inside a generator function, which is the situation that PEP 479 covers. The behaviour in 3.6 matches that originally reported:

Python 3.6.0b3 (default, Nov  2 2016, 08:15:32) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> def five(x):
...     for _ in range(5):
...         yield x
... 
>>> F = five('x')
>>> [next(F) for _ in range(10)]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 1, in <listcomp>
StopIteration
>>> F = five('x')
>>> list(next(F) for _ in range(10))
['x', 'x', 'x', 'x', 'x']
History
Date User Action Args
2016-11-29 08:30:25mark.dickinsonsetrecipients: + mark.dickinson, rhettinger, terry.reedy, ezio.melotti, r.david.murray, cvrebert, docs@python, Peter.Norvig, wolma
2016-11-29 08:30:25mark.dickinsonsetmessageid: <1480408225.72.0.659679620715.issue14845@psf.upfronthosting.co.za>
2016-11-29 08:30:25mark.dickinsonlinkissue14845 messages
2016-11-29 08:30:25mark.dickinsoncreate