[Python-ideas] Disable all peephole optimizations

Eric Snow ericsnowcurrently at gmail.com
Fri May 23 19:17:03 CEST 2014


On Fri, May 23, 2014 at 10:49 AM, Guido van Rossum <guido at python.org> wrote:
> I'm not happy with the direction this is taking. I would prefer an approach
> that *first* implements the minimal thing (an internal flag, set by an
> environment variable, to disable the peephole optimizer) and *then* perhaps
> revisits the greater UI for specifying optimization levels and the
> consequences this has for pyc/pyo files.

Yeah, that's exactly what I was trying to convey in the followup to my
longer message about revamping the optimization levels.

> Looking at my own (frequent) use of coverage.py, I would be totally fine if
> disabling peephole optimization only affected my app's code, and kept using
> the precompiled stdlib. (How exactly this would work is left as an exercise
> for the reader.)

Would it be a problem if .pyc files weren't generated or used (a la -B
or PYTHONDONTWRITEBYTECODE) when you ran coverage?

-eric


More information about the Python-ideas mailing list