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 _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com