[3.11] gh-89038: [doc] update dis.findlinestarts documentation for changes related to PEP-626 (GH-94247) (GH-94450)

(cherry picked from commit d68f2d27bb)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
This commit is contained in:
Irit Katriel 2022-06-30 16:18:30 +01:00 committed by GitHub
parent f58c366a73
commit ecc8e77cc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -268,15 +268,17 @@ operation is being performed, so the intermediate analysis object isn't useful:
.. function:: findlinestarts(code) .. function:: findlinestarts(code)
This generator function uses the ``co_firstlineno`` and ``co_lnotab`` This generator function uses the ``co_lines`` method
attributes of the code object *code* to find the offsets which are starts of of the code object *code* to find the offsets which are starts of
lines in the source code. They are generated as ``(offset, lineno)`` pairs. lines in the source code. They are generated as ``(offset, lineno)`` pairs.
See :source:`Objects/lnotab_notes.txt` for the ``co_lnotab`` format and
how to decode it.
.. versionchanged:: 3.6 .. versionchanged:: 3.6
Line numbers can be decreasing. Before, they were always increasing. Line numbers can be decreasing. Before, they were always increasing.
.. versionchanged:: 3.10
The :pep:`626` ``co_lines`` method is used instead of the ``co_firstlineno``
and ``co_lnotab`` attributes of the code object.
.. function:: findlabels(code) .. function:: findlabels(code)