mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
[3.12] gh-128481: Improve documentation for traceback.FrameSummary
(GH-128484) (#130754)
* gh-128481: Improve documentation for `traceback.FrameSummary` (GH-128484)
Complete the `traceback.FrameSummary` signature and add missing
documentation for the `colno` and `end_{col,line}no` attributes.
(cherry picked from commit 051f0e5683
)
Co-authored-by: Damien <81557462+Damien-Chen@users.noreply.github.com>
This commit is contained in:
parent
c192944362
commit
a0676db61e
1 changed files with 19 additions and 1 deletions
|
@ -478,7 +478,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
|
||||
|
@ -514,6 +516,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 ``None`` 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue