[issue26297] Move constant folding to AST level

STINNER Victor report at bugs.python.org
Fri Feb 5 17:40:22 EST 2016


STINNER Victor added the comment:

Yury Selivanov added the comment:
> In fact I'm -1 on using any kind of flag to trigger optimizations on or off.  Those flags will only drive confusion.  If the optimizations are any good, people will simply start using the flag all the time.

Yeah, Guido calls this a missed optimization opportunity.

My only concern is:

> ast.Constant for tuples and frozensets has a limitation: it doesn't store the location of items (line number, column offset).

Is it a problem in practice? I didn't have time to investigate this.

Since the PEP 511 is still under discussion, I prefer to focus on the
PEP itself than this specific implementation detail ;-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26297>
_______________________________________


More information about the Python-bugs-list mailing list