diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2022-06-30 14:57:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-30 14:57:35 (GMT) |
commit | d68f2d27bbf85f3573a08fc7554889e1733a30f0 (patch) | |
tree | 7b39e05837eece5f93e4d7bb1a034d961322ac02 /Doc | |
parent | b152bf448b321e3a4c0a7280e0b608840f5ac661 (diff) | |
download | cpython-d68f2d27bbf85f3573a08fc7554889e1733a30f0.zip cpython-d68f2d27bbf85f3573a08fc7554889e1733a30f0.tar.gz cpython-d68f2d27bbf85f3573a08fc7554889e1733a30f0.tar.bz2 |
gh-89038: [doc] update dis.findlinestarts documentation for changes related to PEP-626 (GH-94247)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/dis.rst | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 4ec2fb0..d2c3c1a 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -266,15 +266,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) |