Stefan Behnel, 13.12.2010 06:37:
> Vitja Makarov, 12.12.2010 20:23:
>> What do you think about GeneratorWrapperNode?
>
> It seems ok. I'll give it a deeper look ASAP.

Actually, after looking through it, I think it's an ugly hack. It tries to 
hide the fact that the DefNode does the wrong thing for the two faces of 
generators, and that the current implementation does not build a separate 
node at transform time that does the right thing instead. IMHO, two nodes 
are needed. A CFuncDefNode (or a subtype) that writes out the generator C 
function with the right signature and the original body, and the original 
DefNode (with the original signature) that has its body replaced by the 
necessary generator setup code. That's basically why the original CEP 
proposed to split the DefNode implementation *before* going for generators. 
Would have made this easier.

Stefan
_______________________________________________
Cython-dev mailing list
Cython-dev@codespeak.net
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to