Vitja Makarov, 12.12.2010 20:23:
> I've cleaned generators stuff a little:
>
>   * Turn YieldNodeCollector into TreeVisitor

I think that's ok. It's a bit redundant with the tree traversal that 
happens anyway, but it also keeps the code more compact and makes it more 
understandable.

BTW, please start using error test cases. That would easily have caught the 
obvious reporting bug in visit_ReturnStatNode.


>   * Merge MarkClosureVisitor and MarkGeneratorVisitor

That looks much better.


>   * Rename stuff from CyGenerator to __Pyx_Generator

Thanks. However, the following doesn't seem to have an effect, does it?

-        entry.cname = 'CyGenerator'
+        entry.cname = 'Generator'

If that's the only place where that cname is used, I'd guess that it should 
better be dropped.


>   * Move ClosureTempAllocator to Code.py

I still think that the reference should live in FunctionState so that it 
goes out of scope automatically. It shouldn't live longer than the function.


> It seems that there is no major issues with generators, refleaks and so on.

I'm not so sure about the ref-counting yet. I'll have to think it through a 
bit more, but it currently feels a bit funny. (That doesn't mean it's 
wrong, just that I'm not sure it's the way it should be)


> So now is time to add support for genexps and code cleanup.

Absolutely. :)


> What do you think about GeneratorWrapperNode?

It seems ok. I'll give it a deeper look ASAP.

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

Reply via email to