[issue17807] Generator cleanup without tp_del

Nick Coghlan report at bugs.python.org
Sun Apr 21 06:44:58 CEST 2013


Nick Coghlan added the comment:

Just a couple of minor comments on review. Everything else I looked for (including the path where a generator failing to stop during frame deallocation leads to reporting an unraisable exception) seemed fine.

One aspect I find interesting is that we've had other patches which proposed reducing the level of poking around generators needed to do inside frame objects by moving (some of) that state to the generators. This patch goes the other way, by moving the related cleanup functionality into the frame objects.

I think that's actually a reasonable option - the frame is always going to be involved at some point in order to actually execute the cleanup code, so our only real chance to break the cycle is to eliminate the generator's involvement.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17807>
_______________________________________


More information about the Python-bugs-list mailing list