[issue43683] Handle generator (and coroutine) state in the bytecode.

Mark Shannon report at bugs.python.org
Wed Oct 27 07:03:05 EDT 2021


Mark Shannon <mark at hotpy.org> added the comment:

Just to be clear, it is the behavior change that should be reverted, not necessarily the new bytecode.

In fact we should probably push on with (2) and add an exception handler wrapping the whole generator except the GEN_START. That way a GEN_START exception will not clear the generator.
GEN_START might need to do a bit of trickery like setting lasti back to -1.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43683>
_______________________________________


More information about the Python-bugs-list mailing list