Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
reword __note__ description
  • Loading branch information
iritkatriel committed Dec 21, 2021
commit 2b76b038505db4452b16ab75da710adde2aa0842
4 changes: 3 additions & 1 deletion Doc/library/traceback.rst
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ capture data for later printing in a lightweight fashion.

.. attribute:: __note__

The ``__note__`` value from the original exception.
The ``__note__`` value from the original exception, which is
string or ``None``. If it is not ``None`` is it formatted in
the traceback after the exception string.

.. versionadded:: 3.11

Expand Down
5 changes: 3 additions & 2 deletions Doc/tutorial/errors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,9 @@ Enriching Exceptions with Notes
When an exception is created in order to be raised, it is usually initialized
with information that describes the error that has occurred. There are cases
where it is useful to add information after the exception was caught. For this
purpose, exceptions have a mutable field ``__note__`` that can be assigned to
a string which is included in formatted tracebacks. ::
purpose, exceptions have a mutable field ``__note__`` that can be string or
``None`` (``None`` by default). If it is a string, it is included in the
formatted tracebacks after the exception. ::

>>> try:
... raise TypeError('bad type')
Expand Down