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
Update errors.rst
Remove mentioning of special attributes as folks think it's too much for beginners.
  • Loading branch information
greatvovan authored Nov 9, 2020
commit 2831bc0c019daa2e3281fadbc9c56db92225024b
7 changes: 0 additions & 7 deletions Doc/tutorial/errors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,6 @@ disabled by using ``from None`` idiom:
File "<stdin>", line 4, in <module>
RuntimeError

There are two special attributes that enable chaining mechanics in
exceptions: ``__context__`` and ``__cause__``. When you raise an exception
inside :keyword:`except` or :keyword:`finally`, Pyhton automatically fills
``__context__`` attribute of the new exception with the caught one. When you
use ``from exc`` syntax, Pyhon fills ``__cause__`` attribute with
the ``exc``. You can use both attributes for introspection purposes, however
when formatting exception traceback message, ``__cause__`` takes priority.
For more information about chaining mechanics, see :ref:`bltin-exceptions`.


Expand Down