Mark Dickinson added the comment:
@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']
----------
nosy: +mark.dickinson
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue14845>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com