Message 130586 - Python tracker (original) (raw)
Also, the peephole optimizer was developed before the AST branch was added to Python. Constant folding more properly belongs at the AST level, not in the peepholer itself. Our strategy is to move as much as possible into an AST optimizer and to stop building out the peephole optimizer.
Who is working on this "strategy"? Until someone takes it to task to implement the "correct pattern", I think iterative improvement of the peepholer is a reasonable thing.