Mark Shannon <m...@hotpy.org> added the comment:
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) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue42693> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com