[issue11462] Peephole creates duplicate and unused constants

Eugene Toder report at bugs.python.org
Sat Mar 12 04:49:13 CET 2011

Eugene Toder <eltoder at gmail.com> added the comment:

Alexander, my patch does 2 optimizations: doesn't insert a new constant if one already exist and removes unused constants after peephole is done. You patch seems to do only the latter. It's very similar, from a quick look at your patch:
- My patch doesn't introduce any additional passes over the code (you added 2 passes).
- It preserves doc string.
- It's less code, because I reuse more of existing code.

Feel free to look at the patch and tell me if you don't agree.


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list