23 Mar
2009
23 Mar
'09
12:49 a.m.
Nick Coghlan wrote:
All I'm saying is that if GeneratorExit doesn't get passed down then neither should SystemExit nor KeyboardInterrupt
That would violate the inlining principle, though. An inlined generator is going to get all exceptions regardless of what they inherit from.
, while if the latter two *do* get passed down, then so should GeneratorExit.
Whereas that would mean a shared subiterator would get prematurely finalized when closing the delegating generator. So there seems to be no choice about this -- we must pass on all exceptions except GeneratorExit, and we must *not* pass on GeneratorExit itself. -- Greg