Re: Generators in C code
- From: "Gabriel Genellina" <gagsl-py2@xxxxxxxxxxxx>
- Date: Tue, 15 May 2007 02:57:35 -0300
En Tue, 15 May 2007 02:12:40 -0300, Raymond Hettinger <python@xxxxxxx> 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 generators in many respects except that you are
responsible for tracking state and jumping to an appropriate resume
point. Being C, it won't be as convenient as Python generators, but
should be able to translate any generator into equivalent C.
Oh, thanks for pointing that! (I didn't know the itertools module was written in C - I supposed it was a Python module).
After a brief reading, I think I'll use something similar to how tee and teedataobject store current state.
--
Gabriel Genellina
.
- References:
- Generators in C code
- From: Gabriel Genellina
- Re: Generators in C code
- From: Raymond Hettinger
- Generators in C code
- Prev by Date: Re: Interesting list Validity (True/False)
- Next by Date: removing spaces between 2 names
- Previous by thread: Re: Generators in C code
- Next by thread: ClientForm .click() oddity
- Index(es):