Re: Generators in C code

2007-05-14 Thread Gabriel Genellina
En Tue, 15 May 2007 02:12:40 -0300, Raymond Hettinger <[EMAIL PROTECTED]> escribió: >> I feel I'm out of luck, but if someone could point some way to write a >> generator in C, I'be very grateful! > > Perhaps the code in the itertools module will provide a good example > -- they behave like gene

Re: Generators in C code

2007-05-14 Thread Raymond Hettinger
On May 14, 9:55 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > I feel I'm out of luck, but if someone could point some way to write a > generator in C, I'be very grateful! Perhaps the code in the itertools module will provide a good example -- they behave like generators in many respects e

Generators in C code

2007-05-14 Thread 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) wa