https://github.com/python/cpython/commit/051f0e5683fec3840fa7fc99723741dd2d701eae
commit: 051f0e5683fec3840fa7fc99723741dd2d701eae
branch: main
author: Damien <81557462+damien-c...@users.noreply.github.com>
committer: picnixz <10796600+picn...@users.noreply.github.com>
date: 2025-03-02T10:29:12+01:00
summary:

gh-128481: Improve documentation for `traceback.FrameSummary` (#128484)

Complete the `traceback.FrameSummary` signature and add missing
documentation for the `colno` and `end_{col,line}no` attributes.

files:
M Doc/library/traceback.rst

diff --git a/Doc/library/traceback.rst b/Doc/library/traceback.rst
index 3475b014634d58..757fdf601cd0fe 100644
--- a/Doc/library/traceback.rst
+++ b/Doc/library/traceback.rst
@@ -508,7 +508,9 @@ the module-level functions described above.
 A :class:`!FrameSummary` object represents a single :ref:`frame 
<frame-objects>`
 in a :ref:`traceback <traceback-objects>`.
 
-.. class:: FrameSummary(filename, lineno, name, lookup_line=True, locals=None, 
line=None)
+.. class:: FrameSummary(filename, lineno, name, *,\
+                        lookup_line=True, locals=None,\
+                        line=None, end_lineno=None, colno=None, end_colno=None)
 
    Represents a single :ref:`frame <frame-objects>` in the
    :ref:`traceback <traceback-objects>` or stack that is being formatted
@@ -544,6 +546,22 @@ in a :ref:`traceback <traceback-objects>`.
       trailing whitespace stripped.
       If the source is not available, it is ``None``.
 
+   .. attribute:: FrameSummary.end_lineno
+
+      The last line number of the source code for this frame.
+      By default, it is set to ``lineno`` and indexation starts from 1.
+
+   .. attribute:: FrameSummary.colno
+
+      The column number of the source code for this frame.
+      By default, it is ``None`` and indexation starts from 0.
+
+   .. attribute:: FrameSummary.end_colno
+
+      The last column number of the source code for this frame.
+      By default, it is ``None`` and indexation starts from 0.
+
+
 .. _traceback-example:
 
 Examples of Using the Module-Level Functions

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to