9 Oct
2012
9 Oct
'12
3:34 p.m.
On 09.10.12 10:51, Greg Ewing wrote:
Where we seem to disagree is on whether returning a value with StopIteration is part of the iterator protocol or the generator protocol.
Is a generator expression work with the iterator protocol or the generator protocol? A generator expression eats a value with StopIteration:
def G(): ... return 42 ... yield ... next(x for x in G()) Traceback (most recent call last): File "<stdin>", line 1, in <module> StopIteration
Is it a bug?