diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2022-06-30 15:18:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-30 15:18:30 (GMT) |
commit | ecc8e77cc178707495dad7539348756fbe941bc5 (patch) | |
tree | 936c3540221479fb058a46e8ac6ea556e1b94b64 | |
parent | f58c366a730ae3e68028dbf63aba7c4033eaec9b (diff) | |
download | cpython-ecc8e77cc178707495dad7539348756fbe941bc5.zip cpython-ecc8e77cc178707495dad7539348756fbe941bc5.tar.gz cpython-ecc8e77cc178707495dad7539348756fbe941bc5.tar.bz2 |
[3.11] gh-89038: [doc] update dis.findlinestarts documentation for changes related to PEP-626 (GH-94247) (GH-94450)
(cherry picked from commit d68f2d27bbf85f3573a08fc7554889e1733a30f0)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
-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 505aa81..6f882b6 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -268,15 +268,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) |