23 Mar
2009
23 Mar
'09
11:07 p.m.
Bruce Frederiksen wrote:
But non-generators don't have a close (or throw) method. They lack the concept of "finalization".
Any object could require explicit finalization in the absence of refcounting, so "close" isn't peculiar to generators.
Should the delegating generator, then, be calling close rather throw for GeneratorExit so that the RuntimeError is raised closer to cause of the exception? Or does this violate the "inlining" goal of the current PEP?
Yes, it would violate the inlining principle. -- Greg