Skip to content
Merged
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
PEP 678: final details update
  • Loading branch information
Zac-HD committed Mar 3, 2022
commit 0a2098663aba87a2465678a905b11ea168c71e64
5 changes: 3 additions & 2 deletions pep-0678.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ Specification

``BaseException`` gains a new new method ``.add_note(note: str)``. Notes are
exposed as a tuple via the read-only attribute ``__notes__``, and appear in
the standard traceback after the exception string. ``.add_note()`` raises
``TypeError`` if ``note`` is not a string.
the standard traceback after the exception string. ``.add_note()`` replaces
Comment thread
Zac-HD marked this conversation as resolved.
Outdated
``__notes__`` with a new tuple equal to ``__notes__ + (note,)``, if ``note``
is a string, raising ``TypeError`` otherwise.
Comment thread
Zac-HD marked this conversation as resolved.
Outdated

``del err.__notes__`` clears the contents of the ``__notes__`` attribute,
leaving it an empty tuple as if ``.add_note()`` had never been called. This
Expand Down