Message281970
@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'] |
|
Date |
User |
Action |
Args |
2016-11-29 08:30:25 | mark.dickinson | set | recipients:
+ mark.dickinson, rhettinger, terry.reedy, ezio.melotti, r.david.murray, cvrebert, docs@python, Peter.Norvig, wolma |
2016-11-29 08:30:25 | mark.dickinson | set | messageid: <1480408225.72.0.659679620715.issue14845@psf.upfronthosting.co.za> |
2016-11-29 08:30:25 | mark.dickinson | link | issue14845 messages |
2016-11-29 08:30:25 | mark.dickinson | create | |
|