[Python-ideas] Python-ideas Digest, Vol 90, Issue 30

Skip Montanaro skip at pobox.com
Thu May 22 15:49:49 CEST 2014


On Thu, May 22, 2014 at 8:05 AM, Chris Angelico <rosuav at gmail.com> wrote:
> Correct me if I'm wrong, but as I understand it, the problem is that
> the peephole optimizer eliminated an entire line of code. Would it be
> possible to have it notice when it merges two pieces from different
> lines, and somehow mark that the resulting bytecode comes from both
> lines? That would solve the breakpoint and coverage problems
> simultaneously.

It seems to me that Ned has revealed a bug in the peephole optimizer.
It zapped an entire source line's worth of bytecode, but failed to
delete the relevant entry in the line number table of the resulting
code object. If I had my druthers, that would be the change I'd
prefer.

That said, I think Ned's proposal is fairly simple. As for the
increased testing load, I think the extra cost would be the
duplication of the buildbots (or the adjustment of their setup to test
with -O and -O0 flags). Is it still the case that -O effectively does
nothing (maybe only eliding __debug__ checks)?

Skip


More information about the Python-ideas mailing list