[issue2506] Line tracing of continue after always-taken if is incorrect

Ned Batchelder report at bugs.python.org
Sat Mar 29 19:51:55 CET 2008


Ned Batchelder <nedbat at users.sourceforge.net> added the comment:

I see that the cause of the problem is the peephole optimizer.  That
doesn't mean this isn't a problem.

I am measuring the code coverage of a set of tests, and one of my lines
is being marked as not executed.  This is not the fault of the tests,
because in fact, without the optimization, the line would be executed. 
Conceptually, the line has been executed (the loop is restarted, rather
than execution continuing).

I don't know what the solution to this is.  Some options include fixing
the line tracing code to somehow indicate that the continue was
executed; or providing a way to disable peephole optimization for times
when accurate execution tracing is more important than speed.

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2506>
__________________________________


More information about the Python-bugs-list mailing list