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 vstinner
Recipients Demur Rumed, amper, benjamin.peterson, brett.cannon, georg.brandl, ncoghlan, vstinner, yselivanov
Date 2016-04-09.13:17:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1460207821.01.0.346955813527.issue26722@psf.upfronthosting.co.za>
In-reply-to
Content
Hi, it looks like the author of the peephole optimizer is Raymond Hettinger and he doesn't look to want to handle too many cases, he prefers to keep the code simple.

FYI I reimplemented recently the peephole optimizer in pure Python as part of the bytecode project:
https://bytecode.readthedocs.org/en/latest/peephole.html

I didn't write it to replace the C implementation, it was more a tool to discuss modifying bytecode (when discussing the PEP 511).

More generally, there is an ongoging discussion of rewriting the peephole optimizer to work on the AST rather than working on the Python code. The FAT Python implements that in pure Python:
https://faster-cpython.readthedocs.org/fat_python.html

FAT Python is more than a peephole optimizer, it's more a framework to implement more optimizations. Well, take a look.
History
Date User Action Args
2016-04-09 13:17:01vstinnersetrecipients: + vstinner, brett.cannon, georg.brandl, ncoghlan, benjamin.peterson, yselivanov, Demur Rumed, amper
2016-04-09 13:17:01vstinnersetmessageid: <1460207821.01.0.346955813527.issue26722@psf.upfronthosting.co.za>
2016-04-09 13:17:00vstinnerlinkissue26722 messages
2016-04-09 13:17:00vstinnercreate