Hello, On Sun, 26 Apr 2020 19:51:18 -0700 Skip Montanaro <skip.montanaro@gmail.com> wrote: []
I think it's worse that this though, as it seems that in gen_send_ex() it actually pushes a value onto the stack. That can't be solved by simply adding a state attribute to the generator object struct.
At the higher level, "it doesn't push value on stack", it "sets value of the yield operator to return". CPython uses stack slots to keep data, so puts it in a stack slot, you use registers, so would put it in a ("return value") register. Overall, that seems like minor patching detail comparing to patching which would be required to implement register-based calling convention for functions. -- Best regards, Paul mailto:pmiscml@gmail.com