Raymond Hettinger added the comment: AFAICT, the cases the OP listed would be rarely found in real code.
Victor is correct is saying that we want to limit the scope of the peepholer to the most useful cases. He is also correct in saying that we've long desired constant folding to be moved upstream to the AST and don't want to go further down the path of doing more work at the bytecode level. Ideally, the only optimizations at the peephole level would be limited to rejuggling opcodes into cheaper execution sequences without regard to higher level object semantics. I recommend rejecting this and suggesting that more effort be focused on the AST optimizations. ---------- nosy: +rhettinger priority: normal -> low _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26722> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com