Find a way to handle branch events in async for
#128534
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-feature
A feature request or enhancement
When instrumenting regular
for
loops, we instrument theFOR_ITER
instruction as theLEFT
branch and thePOP_ITER
instruction as theRIGHT
branch.This doesn't work for
async for
as it uses exceptions to exit the loop.Raising an exception is the documented behavior for exiting a [async] generator, so we will still need to generate an event for the exception being raised, much as we do in
INSTRUMENTED_END_FOR
as well as theBRANCH
events.The text was updated successfully, but these errors were encountered: