Skip to content

Commit 051f0e5

Browse files
authored
pythongh-128481: Improve documentation for traceback.FrameSummary (python#128484)
Complete the `traceback.FrameSummary` signature and add missing documentation for the `colno` and `end_{col,line}no` attributes.
1 parent 37145cb commit 051f0e5

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

Doc/library/traceback.rst

+19-1
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,9 @@ the module-level functions described above.
508508
A :class:`!FrameSummary` object represents a single :ref:`frame <frame-objects>`
509509
in a :ref:`traceback <traceback-objects>`.
510510

511-
.. class:: FrameSummary(filename, lineno, name, lookup_line=True, locals=None, line=None)
511+
.. class:: FrameSummary(filename, lineno, name, *,\
512+
lookup_line=True, locals=None,\
513+
line=None, end_lineno=None, colno=None, end_colno=None)
512514

513515
Represents a single :ref:`frame <frame-objects>` in the
514516
:ref:`traceback <traceback-objects>` or stack that is being formatted
@@ -544,6 +546,22 @@ in a :ref:`traceback <traceback-objects>`.
544546
trailing whitespace stripped.
545547
If the source is not available, it is ``None``.
546548

549+
.. attribute:: FrameSummary.end_lineno
550+
551+
The last line number of the source code for this frame.
552+
By default, it is set to ``lineno`` and indexation starts from 1.
553+
554+
.. attribute:: FrameSummary.colno
555+
556+
The column number of the source code for this frame.
557+
By default, it is ``None`` and indexation starts from 0.
558+
559+
.. attribute:: FrameSummary.end_colno
560+
561+
The last column number of the source code for this frame.
562+
By default, it is ``None`` and indexation starts from 0.
563+
564+
547565
.. _traceback-example:
548566

549567
Examples of Using the Module-Level Functions

0 commit comments

Comments
 (0)