This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Mark.Shannon
Recipients Mark.Shannon, nedbat, pablogsal, rhettinger, serhiy.storchaka
Date 2020-12-22.16:14:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1608653663.91.0.377499933253.issue42693@roundup.psfhosted.org>
In-reply-to
Content
Ned, I agree that up until 3.9, it is wasn't that simple.
But from 3.10 onward, it should be that simple.
That's the point of PEP 626.

If a transformation changes observable behavior within the scope of language specification, then it is not an optimization but a bug.

Up to 3.9, the language did not specify the behavior of sys.settrace w.r.t. line numbers, so coverage.py had to second guess what the bytecode optimizer was doing. 

In 3.10 onwards, the behavior of sys.settrace w.r.t. line numbers is part of the language spec. The optimizer cannot change it, and coverage.py should not need care what the optimizer does.

If you can observe the effect of the optimizer, w.r.t. line numbers, then it's a bug.

(According to that definition, there are still bugs in the optimizer relating to jumps-to-jumps. I plan to fix them)
History
Date User Action Args
2020-12-22 16:14:23Mark.Shannonsetrecipients: + Mark.Shannon, rhettinger, nedbat, serhiy.storchaka, pablogsal
2020-12-22 16:14:23Mark.Shannonsetmessageid: <1608653663.91.0.377499933253.issue42693@roundup.psfhosted.org>
2020-12-22 16:14:23Mark.Shannonlinkissue42693 messages
2020-12-22 16:14:23Mark.Shannoncreate