-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Compare the docs:
cpython/Doc/library/traceback.rst
Lines 138 to 146 in 7237fb5
| .. function:: format_exception_only(exc, /[, value]) | |
| Format the exception part of a traceback using an exception value such as | |
| given by ``sys.last_value``. The return value is a list of strings, each | |
| ending in a newline. The list contains the exception's message, which is | |
| normally a single string; however, for :exc:`SyntaxError` exceptions, it | |
| contains several lines that (when printed) display detailed information | |
| about where the syntax error occurred. Following the message, the list | |
| contains the exception's :attr:`notes <BaseException.__notes__>`. |
With the docstring:
Lines 151 to 165 in 7237fb5
| def format_exception_only(exc, /, value=_sentinel): | |
| """Format the exception part of a traceback. | |
| The return value is a list of strings, each ending in a newline. | |
| Normally, the list contains a single string; however, for | |
| SyntaxError exceptions, it contains several lines that (when | |
| printed) display detailed information about where the syntax | |
| error occurred. | |
| The message indicating which exception occurred is always the last | |
| string in the list. | |
| """ | |
| if value is _sentinel: |
Docstring is missing
Following the message, the list contains the exception's :attr:`notes <BaseException.__notes__>`.
part.
I think that it would be better to mention __notes__ there as well.
PR is incoming.
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error