G
Gabriel Genellina
Hi
I'd like to write a generator in C, callable from Python.
The only way to create a generator object I can see, is using
PyGen_New(frame) - and a frame object implies Python code, right? holding
global state and local variables and stack and a lot of stuff, so perhaps
there is no (easy) way I could write that in C code.
Or perhaps some way to execute a yield statement inside a C function?
Being able to resume execution at the same point later?
I feel I'm out of luck, but if someone could point some way to write a
generator in C, I'be very grateful!
I'd like to write a generator in C, callable from Python.
The only way to create a generator object I can see, is using
PyGen_New(frame) - and a frame object implies Python code, right? holding
global state and local variables and stack and a lot of stuff, so perhaps
there is no (easy) way I could write that in C code.
Or perhaps some way to execute a yield statement inside a C function?
Being able to resume execution at the same point later?
I feel I'm out of luck, but if someone could point some way to write a
generator in C, I'be very grateful!