[Pyrex] nagging differences / implementing generators

Bob Ippolito bob at redivi.com
Fri May 7 05:56:50 CEST 2004


On May 6, 2004, at 10:48 PM, Greg Ewing wrote:

> Bob Ippolito <bob at redivi.com>:
>
>> You also have to capture the local variables of the function and put
>> them all on the heap...
>
> They would become C attributes of the behind-the-scenes extension type
> being used to implement the generator-iterator.

Of course, but then you have to change the code generator to use 
gen->locals->var instead of just var when compiling a generator.

Speaking of Stackless, it would be *awesome* to have a Pyrex mode that 
spits out stackless-soft-switching compatible code (which wouldn't be 
much different than generators), it's a pain in the butt to write the C 
code by hand..

-bob





More information about the Pyrex mailing list