PEP 415: Implement suppression of __context__ display with an exception attribute
This replaces the original PEP 409 implementation. See #14133.
diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst
index 33bc3b0..faf6732 100644
--- a/Doc/library/exceptions.rst
+++ b/Doc/library/exceptions.rst
@@ -39,18 +39,17 @@
new exception is not handled the traceback that is eventually displayed will
include the originating exception(s) and the final exception.
-This implicit exception chain can be made explicit by using :keyword:`from`
-with :keyword:`raise`. The single argument to :keyword:`from` must be an
-exception or :const:`None`, and it will be set as :attr:`__cause__` on the
-raised exception. If :attr:`__cause__` is an exception it will be displayed
-instead of :attr:`__context__`; if :attr:`__cause__` is None,
-:attr:`__context__` will not be displayed by the default exception handling
-code. (Note: the default value for :attr:`__context__` is :const:`None`,
-while the default value for :attr:`__cause__` is :const:`Ellipsis`.)
+This implicit exception chain can be made explicit by using :keyword:`from` with
+:keyword:`raise`. The single argument to :keyword:`from` must be an exception
+or ``None``. It will be set as :attr:`__cause__` on the raised exception.
+Setting :attr:`__cause__` implicitly sets the :attr:`__suppress_context__` to
+``True``. If :attr:`__cause__` is an exception, it will be displayed. If
+:attr:`__cause__` is present or :attr:`__suppress_context__` has a true value,
+:attr:`__context__` will not be displayed.
-In either case, the default exception handling code will not display
-any of the remaining links in the :attr:`__context__` chain if
-:attr:`__cause__` has been set.
+In either case, the default exception handling code will not display any of the
+remaining links in the :attr:`__context__` chain if :attr:`__cause__` has been
+set.
Base classes
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index a34b1cf..bf86d8eb 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -2996,11 +2996,10 @@
The Ellipsis Object
-------------------
-This object is commonly used by slicing (see :ref:`slicings`), but may also
-be used in other situations where a sentinel value other than :const:`None`
-is needed. It supports no special operations. There is exactly one ellipsis
-object, named :const:`Ellipsis` (a built-in name). ``type(Ellipsis)()``
-produces the :const:`Ellipsis` singleton.
+This object is commonly used by slicing (see :ref:`slicings`). It supports no
+special operations. There is exactly one ellipsis object, named
+:const:`Ellipsis` (a built-in name). ``type(Ellipsis)()`` produces the
+:const:`Ellipsis` singleton.
It is written as ``Ellipsis`` or ``...``.