10 Dec
2014
10 Dec
'14
7:14 p.m.
On Wed, Dec 10, 2014, at 07:36, Oscar Benjamin wrote:
Many iterators perform other kinds of exception handling without allowing that to fall through and many iterators catch StopIteration from child iterators without reraising it. This has never lead anyone to suggest that such iterators are not true iterators in any way.
The problem isn't what they do when the child iterator raises StopIteration. That's always been well-defined as "treat that particular child iterator as having ended" and behave however the function wants to treat that case (e.g. chain moves on to the next argument). The question is what they should do when *one of their other inputs* (such as a map or filter function) raises StopIteration.