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: clarify rejected idea
  • Loading branch information
Zac-HD committed Mar 2, 2022
commit 7c28ab44f2a5af783cc1bbff8c86b04b54aa3e1b
19 changes: 10 additions & 9 deletions pep-0678.rst
Original file line number Diff line number Diff line change
Expand Up @@ -319,15 +319,16 @@ proposed ``__notes__`` semantics, but this would be rarely and inconsistently
applicable.


Store notes in ``ExceptionGroup``\ s, but not other ``Exception``\ s
--------------------------------------------------------------------
Initial discussions proposed making a more focussed change by thinking about
how to associate messages with the nested exceptions in ``ExceptionGroup`` s,
such as a list of notes or mapping of exceptions to notes. However, this would
force a remarkably awkward API and retains a lesser form of the
cross-referencing problem discussed under "use ``print()``" above; if this PEP
is rejected we prefer the status quo. Finally, of course, ``__notes__`` are
not only useful with ``ExceptionGroup``\ s!
Don't attach notes to ``Exception``\ s, just store them in ``ExceptionGroup``\ s
--------------------------------------------------------------------------------
The initial motivation for this PEP was to associate a note with each error
in an ``ExceptionGroup``. At the cost of a remarkably awkward API and the
cross-referencing problem discussed under "use ``print()``" above, this
Comment thread
Zac-HD marked this conversation as resolved.
Outdated
use-case could be supported by storing notes on the ``ExceptionGroup``
instance instead of on each exception it contains.

We believe that the cleaner interface, and other use-cases described above,
are sufficient to justify the more general feature proposed by this PEP.



Expand Down