From e721da5d39838a019636213a2fe27d000bf8f579 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Thu, 30 Jun 2022 08:39:48 -0700 Subject: gh-89038: [doc] update dis.findlinestarts documentation for changes related to PEP-626 (GH-94247) (GH-94449) (cherry picked from commit d68f2d27bbf85f3573a08fc7554889e1733a30f0) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> --- Doc/library/dis.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 5ea88c4..1df281a7 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -232,15 +232,17 @@ operation is being performed, so the intermediate analysis object isn't useful: .. function:: findlinestarts(code) - This generator function uses the ``co_firstlineno`` and ``co_lnotab`` - attributes of the code object *code* to find the offsets which are starts of + This generator function uses the ``co_lines`` method + 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. - See :source:`Objects/lnotab_notes.txt` for the ``co_lnotab`` format and - how to decode it. .. versionchanged:: 3.6 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) -- cgit v0.12