diff options
author | Ammar Askar <ammar@ammaraskar.com> | 2021-07-13 00:29:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-13 00:29:39 (GMT) |
commit | 9c3eaf88dc5d5bed80cc45936de06b7b3162bc6d (patch) | |
tree | 939b88e14214adcc49e19f4a3d9c12b3192046d3 /Doc/c-api/code.rst | |
parent | f6954cdfc50060a54318fb2aea4d80408381243a (diff) | |
download | cpython-9c3eaf88dc5d5bed80cc45936de06b7b3162bc6d.zip cpython-9c3eaf88dc5d5bed80cc45936de06b7b3162bc6d.tar.gz cpython-9c3eaf88dc5d5bed80cc45936de06b7b3162bc6d.tar.bz2 |
bpo-43950: Add documentation for PEP-657 (GH-27047)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
Diffstat (limited to 'Doc/c-api/code.rst')
-rw-r--r-- | Doc/c-api/code.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/c-api/code.rst b/Doc/c-api/code.rst index 6e18a42..2b0cdf4 100644 --- a/Doc/c-api/code.rst +++ b/Doc/c-api/code.rst @@ -59,3 +59,11 @@ bound into a function. For efficiently iterating over the line numbers in a code object, use `the API described in PEP 626 <https://www.python.org/dev/peps/pep-0626/#out-of-process-debuggers-and-profilers>`_. + +.. c:function:: int PyCode_Addr2Location(PyObject *co, int byte_offset, int *start_line, int *start_column, int *end_line, int *end_column) + + Sets the passed ``int`` pointers to the source code line and column numbers + for the instruction at ``byte_offset``. Sets the value to ``0`` when + information is not available for any particular element. + + Returns ``1`` if the function succeeds and 0 otherwise. |