Hi Victor,
Thanks for the precise explanation!
The only question I have is: I still could not find frame.f_frame.f_state like you suggested. I saw below in 3.11.a07 changelog:
Remove the
f_statefield from the _PyInterpreterFrame struct. Add theownerfield to the _PyInterpreterFrame struct to make ownership explicit to simplify clearing and deallocing frames and generators.