[Python-Dev] Release of astoptimizer 0.3

Terry Reedy tjreedy at udel.edu
Wed Sep 12 18:35:54 CEST 2012


On 9/12/2012 3:36 AM, Serhiy Storchaka wrote:

> I personally would prefer a 2to3-like "modernizer" (as a separate
> utility and as plugins for the IDEs), which would have found some
> templates and offered replacing by a more modern, readable (and possibly
> effective) variant. The decision on the applicability of the
> transformation in the particular case remains for the human.

IDLE has a plug-in mechanism, though I am not familiar with it yet. It 
also has a built-in parser of some sort. It is used, for instance, to 
determine the function expression that preceeds '(' in order to get the 
function object for a tool tip.

 > For the
> automatic optimizer remain only simple transformations which deteriorate
> readability, and optimizations which cannot be expressed in the source
> code.

I had just made the same observation that some of the proposed 
optimization are really source transformations and others are only ast 
or even lower level changes. We also need to differentiate changes which 
are pretty much guaranteed to be faster (at least with current releases) 
and those those might be with particular hardware, os, and python version.

-- 
Terry Jan Reedy



More information about the Python-Dev mailing list