Skip to content

Commit 85d4e98

Browse files
committed
PEP 785: why not more attributes
1 parent f7d669e commit 85d4e98

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

peps/pep-0785.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,20 @@ less magical and tempting to use in cases where it would not be appropriate.
329329
We could be argued around though, if others prefer this form.
330330

331331

332+
Preserve additional attributes
333+
------------------------------
334+
335+
We decided against preserving the ``__cause__`` and ``__suppress_context__``
336+
attributes, because they are not changed by re-raising the exception, and we
337+
prefer to support ``raise exc from None`` or ``raise exc from cause_exc``
338+
together with ``with exc.preserve_context():``.
339+
340+
Similarly, we considered preserving the ``__traceback__`` attribute, and
341+
decided against because the additional ``raise ...`` statement may be an
342+
important clue when understanding some error. If end users wish to pop a
343+
frame from the traceback, they can do with a separate context manager.
344+
345+
332346
Footnotes
333347
=========
334348

0 commit comments

Comments
 (0)