Skip to content

Commit 6a5a45f

Browse files
iritkatrielgvanrossum
authored andcommitted
pythongh-89038: [doc] update dis.findlinestarts documentation for changes related to PEP-626 (pythonGH-94247)
1 parent 2d55fea commit 6a5a45f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Doc/library/dis.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,15 +266,17 @@ operation is being performed, so the intermediate analysis object isn't useful:
266266

267267
.. function:: findlinestarts(code)
268268

269-
This generator function uses the ``co_firstlineno`` and ``co_lnotab``
270-
attributes of the code object *code* to find the offsets which are starts of
269+
This generator function uses the ``co_lines`` method
270+
of the code object *code* to find the offsets which are starts of
271271
lines in the source code. They are generated as ``(offset, lineno)`` pairs.
272-
See :source:`Objects/lnotab_notes.txt` for the ``co_lnotab`` format and
273-
how to decode it.
274272

275273
.. versionchanged:: 3.6
276274
Line numbers can be decreasing. Before, they were always increasing.
277275

276+
.. versionchanged:: 3.10
277+
The :pep:`626` ``co_lines`` method is used instead of the ``co_firstlineno``
278+
and ``co_lnotab`` attributes of the code object.
279+
278280

279281
.. function:: findlabels(code)
280282

0 commit comments

Comments
 (0)