
March 21, 2009
10:43 p.m.
Jacob Holm wrote:
# This causes a StopIteration in iterator.next(). After grabbing # the value in the "except StopIteration" clause of the PEP # expansion, the "finally" clause calls iterator.close().
Okay, I see what you mean now. That's a bug in the expansion. Once an iterator has raised StopIteration, it has presumably already finalized itself, so calling its close() method shouldn't be necessary, and I hadn't intended that it should be called in that case. I'll update the PEP accordingly. -- Greg