From 3a69ffb9958fa67baa164f4665fbd730b5ce209f Mon Sep 17 00:00:00 2001 From: Irit Katriel Date: Fri, 24 Jun 2022 22:22:26 +0100 Subject: [PATCH 1/2] gh-89038: [doc] update dis.findlinestarts documentation for changes related to PEP-626 --- Doc/library/dis.rst | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 10154d8b0892901..a42c2c993c69057 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -266,15 +266,19 @@ 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. + See :source:`Objects/lnotab_notes.txt` for details about the ``co_lines`` + method. .. 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) From e8056612ce0d66ed5ba1156c54033d56b7ab8ffd Mon Sep 17 00:00:00 2001 From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Date: Thu, 30 Jun 2022 14:49:25 +0100 Subject: [PATCH 2/2] Drop reference to more-info. --- Doc/library/dis.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index a42c2c993c69057..387a8b6132b5052 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -269,8 +269,6 @@ operation is being performed, so the intermediate analysis object isn't useful: 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 details about the ``co_lines`` - method. .. versionchanged:: 3.6 Line numbers can be decreasing. Before, they were always increasing.