From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 2 Mar 2025 09:50:32 +0000 (+0100) Subject: [3.12] gh-128481: Improve documentation for `traceback.FrameSummary` (GH-128484)... X-Git-Tag: v3.12.10~140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0676db61efd08ff9cefc878dd47c007c9793a8f;p=thirdparty%2FPython%2Fcpython.git [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 051f0e5683fec3840fa7fc99723741dd2d701eae) Co-authored-by: Damien <81557462+Damien-Chen@users.noreply.github.com> --- diff --git a/Doc/library/traceback.rst b/Doc/library/traceback.rst index d7e9dadf9ca2..89b7d024f687 100644 --- a/Doc/library/traceback.rst +++ b/Doc/library/traceback.rst @@ -478,7 +478,9 @@ the module-level functions described above. A :class:`!FrameSummary` object represents a single :ref:`frame ` in a :ref:`traceback `. -.. 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 ` in the :ref:`traceback ` or stack that is being formatted @@ -514,6 +516,22 @@ in a :ref:`traceback `. 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