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>
This commit is contained in:
Ammar Askar 2021-07-12 20:29:39 -04:00 committed by GitHub
parent f6954cdfc5
commit 9c3eaf88dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 124 additions and 0 deletions

View file

@ -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.