9 Oct
2012
9 Oct
'12
12:51 a.m.
Oscar Benjamin wrote:
They do provide the same kind of iterator in the sense that they reproduce the properties of the object *in so far as it is an iterator* by yielding the same values.
I think we agree on that. Where we seem to disagree is on whether returning a value with StopIteration is part of the iterator protocol or the generator protocol. To my mind it's part of the generator protocol, and as such, itertools functions are not under any obligation to support it. -- Greg