[Python-Dev] Re: Virtual machine bleeds into generator implementation?

2020-04-26 Thread Guido van Rossum
It looks it is using this to save a separate, explicit bit that says "we left this frame by yielding rather than by returning". Note that f_stacktop is cleared when the frame is re-entered: stack_pointer = f->f_stacktop; assert(stack_pointer != NULL); f->f_stacktop = NULL; /*

[Python-Dev] Virtual machine bleeds into generator implementation?

2020-04-26 Thread Skip Montanaro
This is more an observation and question than anything else, but perhaps it will stimulate some ideas from the experts. Consider this trivial generator function: def gen(a): yield a When the YIELD_VALUE instruction is executed, it executes (in the non-async case): retval =

[Python-Dev] Re: PEP 554 for 3.9 or 3.10?

2020-04-26 Thread Carl Shapiro
On Tue, Apr 21, 2020 at 7:33 AM Victor Stinner wrote: > IMHO it's worth it to explore the subinterpreters approach. I don't > think that it's going to be a major maintenance burden: the code is > already written and tests. The PEP is only about adding a public > Python API. While this PEP may