PEP 626
E909747
PEP 626 is a Python Enhancement Proposal that precisely defines how Python should map executed bytecode instructions to source code lines, improving debugging, coverage measurement, and tooling accuracy.
Statements (46)
| Predicate | Object |
|---|---|
| instanceOf | Python Enhancement Proposal ⓘ |
| addresses | line number table semantics in CPython ⓘ |
| affects | CPython bytecode line number information ⓘ |
| aimsTo |
improve code coverage measurement
ⓘ
improve debugging accuracy ⓘ improve tooling accuracy ⓘ |
| author | Mark Shannon NERFINISHED ⓘ |
| belongsTo | Python PEP index NERFINISHED ⓘ |
| benefits |
coverage tool authors
ⓘ
debugger authors ⓘ static and dynamic analysis tool authors ⓘ |
| category |
Debugging
ⓘ
Interpreter semantics ⓘ Tooling ⓘ |
| clarifies |
how exceptions are associated with source lines
ⓘ
semantics of co_firstlineno and line number tables ⓘ |
| defines | precise mapping from executed bytecode instructions to source code lines ⓘ |
| discusses |
behavior of coverage tools
ⓘ
behavior of debuggers ⓘ behavior of tracing functions ⓘ |
| ensures |
backwards jumps do not arbitrarily change reported line numbers
ⓘ
every bytecode instruction has a well-defined source line ⓘ line number information is stable across minor code changes ⓘ line numbers are monotonic within a frame ⓘ |
| governs | mapping from bytecode offsets to source lines ⓘ |
| implementedIn | CPython 3.10 NERFINISHED ⓘ |
| improves |
reliability of branch coverage analysis
ⓘ
reliability of breakpoints ⓘ reliability of stack traces ⓘ reliability of stepping in debuggers ⓘ |
| language | Python NERFINISHED ⓘ |
| motivatedBy | inconsistent line number reporting in earlier Python versions ⓘ |
| motivates |
changes to CPython compiler line number generation
ⓘ
changes to CPython interpreter tracing behavior ⓘ |
| number | 626 ⓘ |
| pepUrl | https://peps.python.org/pep-0626/ ⓘ |
| proposes | well-defined rules for when line numbers change during execution ⓘ |
| relatedTo |
Python coverage tools
ⓘ
Python debugging tools ⓘ Python profilers ⓘ |
| repository | https://github.com/python/peps ⓘ |
| scope | CPython implementation details visible to tools NERFINISHED ⓘ |
| status | Accepted ⓘ |
| targetVersion | Python 3.10 NERFINISHED ⓘ |
| title | Precise line numbers for debugging and other tools ⓘ |
| type | Standards track PEP ⓘ |
Referenced by (1)
Full triples — surface form annotated when it differs from this entity's canonical label.