Stefan Behnel wrote: > Hi, > > quick update: > > Stefan Behnel wrote: >> My fix would be to handle future division in the parser (instead of code >> generation, as it is now), and to let the parser directly replace "/" by >> "//" when future division is *not* enabled, so that the "/" operator can >> always have true division semantics when it appears inside the parse tree. > > That won't work, since "/" and "//" do different things to integers and > floats. So this can't be decided before the type analysis phase, which runs > after the constant folding phase... > > I guess all we can do for now is to ignore "/" during constant folding and > then handle it when we know the operand types...
Why is compile time folding done before expression analysis? It would seem sensible that as compile time folding shouldn't affect semantics (? at least expression type semantics?) it can just as well be done after expression analysis. (I think there was a reason but I forgot.) -- Dag Sverre _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
