Documentation
The docs for PyCode_Addr2Line say:
For efficiently iterating over the line numbers in a code object, use the API described in PEP 626.
That section of the PEP describes PyCodeAddressRange, PyLineTable_InitAddressRange, PyLineTable_NextAddressRange, and PyLineTable_PreviousAddressRange . Those function have been renamed with a _ prefix. Some are not exported symbols (even in private headers). That's fine for the PEP, we treat them as historical documents, but the docs should be up to date.
Ideally we:
- Document that
PyCode_Addr2Line may be O(N) in the size of the code. This is important and not obvious!
- Describe how to iterate efficiently in the docs.
- In a future version of Python, expose the functions as public, documented, unstable C APIs. (I think
PyUnstable makes sense for these)
Linked PRs
Documentation
The docs for PyCode_Addr2Line say:
That section of the PEP describes
PyCodeAddressRange,PyLineTable_InitAddressRange,PyLineTable_NextAddressRange, andPyLineTable_PreviousAddressRange. Those function have been renamed with a_prefix. Some are not exported symbols (even in private headers). That's fine for the PEP, we treat them as historical documents, but the docs should be up to date.Ideally we:
PyCode_Addr2Linemay be O(N) in the size of the code. This is important and not obvious!PyUnstablemakes sense for these)Linked PRs