Stefan Behnel wrote: > Dag Sverre Seljebotn wrote: > >> The places where result_code is used during analysis should go anyway; >> > > I agree. It's not trivial in all cases, though. Cython has a couple of > optimisations and enhancements that rely on replacing a node by a > different one, which may then need a constant value at creation time in > some cases. The exception value that is used in CFuncDeclaratorNode to set > up the function type is one example that I'm currently trying to work > around. > > Another example is IntNode, which is expected to return a plain constant > result all the time, but actually requires the compile time code writer to > cache Python integers before it knows its result code. This would be > easier to solve if the pipeline went > > type annotation -> constant folding -> type analysis > > instead of the current > > type annotation and analysis -> constant folding > Is it impossible for constant folding to happen before type annotation? After all, the type should be hard-coded in the class for constants? (Or at least, a seperate "type constants" phase first is much easier than a full refactor here.)
Dag Sverre _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
