[issue4134] Peephole optimization: returning a temp

David Turner report at bugs.python.org
Fri Oct 17 01:33:30 CEST 2008


David Turner <novalis at novalis.org> added the comment:

The idiom appears at least 370 times in the standard library.  And,
while on its own it can't appear in a loop, a function that uses it
might get called in a loop.   

You mention some sort of AST optimizer.  I haven't really followed
Python development enough to know anything about this.  Is it worth
bothering to do other work on the peepholer which might handle some more
common cases?  If not, is there a branch or something where I can look
at the AST optimizer?

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4134>
_______________________________________


More information about the Python-bugs-list mailing list