This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients Demur Rumed, amper, benjamin.peterson, brett.cannon, georg.brandl, ncoghlan, rhettinger, vstinner, yselivanov
Date 2016-04-10.00:19:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1460247583.4.0.0302425562573.issue26722@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-04-10 00:19:43rhettingersetrecipients: + rhettinger, brett.cannon, georg.brandl, ncoghlan, vstinner, benjamin.peterson, yselivanov, Demur Rumed, amper
2016-04-10 00:19:43rhettingersetmessageid: <1460247583.4.0.0302425562573.issue26722@psf.upfronthosting.co.za>
2016-04-10 00:19:43rhettingerlinkissue26722 messages
2016-04-10 00:19:41rhettingercreate