25 Mar
2009
25 Mar
'09
11:40 p.m.
Greg Ewing wrote:
Jacob Holm wrote:
It fails to handle the case where the throw raises a StopIteration (or there is no throw method and the thrown exception is a StopIteration).
No, I think it does the right thing in that case. By the inlining principle, the StopIteration should be thrown in like anything else, and if it propagates back out, it should stop the delegating generator, *not* the subiterator.
But if you throw another exception and it is converted to a StopIteration by the subiterator, this should definitely stop the subiterator and get a return value. Or? - Jacob