Skip to content

gh-140456: Document that FrameSummary.line is a single line - #153469

Closed
harjothkhara wants to merge 6 commits into
python:mainfrom
harjothkhara:codex/gh-140456-traceback-docs
Closed

harjothkhara wants to merge 6 commits into
python:mainfrom
harjothkhara:codex/gh-140456-traceback-docs

Conversation

@harjothkhara

@harjothkhara harjothkhara commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

FrameSummary.line only ever holds one line of source, but that stopped being obvious once end_lineno was added. This says so in the docs and in the FrameSummary docstring.

As serhiy-storchaka noted on the issue, the behavior for a multi-line line was never specified, so this doesn't describe it. The change is two sentences, one in the docs and one in the docstring. Lib/traceback.py is docstring-only, so there is no behavior change.

Checked with sphinx-lint and a scoped docs build (no warnings from traceback.rst), and test_traceback passes. No NEWS entry, since it is a docs and docstring change.

I used AI assistance for this and have reviewed the change.

@read-the-docs-community

read-the-docs-community Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

@harjothkhara
harjothkhara force-pushed the codex/gh-140456-traceback-docs branch 2 times, most recently from 6202ef6 to 5bc4855 Compare July 10, 2026 01:14
@harjothkhara
harjothkhara force-pushed the codex/gh-140456-traceback-docs branch from 5bc4855 to 67bab37 Compare July 10, 2026 01:22
Column position information alone is not enough: end_lineno defaults to
lineno, so a frame with colno/end_colno but no end_lineno still shows
only its first physical line.  Say so, and test it.
@harjothkhara
harjothkhara marked this pull request as ready for review July 10, 2026 02:19
@harjothkhara

harjothkhara commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Docs only change for #140456, could someone take a look?

Drops the multi-line formatting docs, tests and NEWS entry, as suggested on the issue.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@harjothkhara harjothkhara changed the title gh-140456: Clarify traceback source line documentation gh-140456: Document that FrameSummary.line is a single line Oct 27, 2026
@harjothkhara

Copy link
Copy Markdown
Contributor Author

@serhiy-storchaka following your comment on the issue closely, I trimmed this to only say that FrameSummary.line is a single line, in the docs and the class docstring. Is that okay and what you had in mind?

@methane

methane commented Nov 11, 2026

Copy link
Copy Markdown
Member

I feel that this explanation makes the entire paragraph unnecessarily verbose, and its relevance to the original issue is rather limited.

@methane methane closed this Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants