Update from Ethan Furman.

This commit is contained in:
Brett Cannon 2012-02-06 15:19:16 -05:00
parent 7506ff282f
commit 68a77c80f0
1 changed files with 15 additions and 6 deletions

View File

@ -113,17 +113,26 @@ were put forth on how to implement this at the language level:
* Use ``Ellipsis`` as the default value (the ``...`` singleton).
Accepted. There are no other possible values; it cannot be raised as it is
not an exception; it has the connotation of 'fill in the rest...' as in
``__cause__`` is not set, look in ``__context__`` for it.
Accepted.
Ellipses are commonly used in English as place holders when words are
omitted. This works in our favor here as a signal that ``__cause__`` is
omitted, so look in ``__context__`` for more details.
Ellipsis is not an exception, so cannot be raised.
There is only one Ellipsis, so no unused values.
Error information is not thrown away, so custom code can trace the entire
exception chain even if the default code does not.
Language Details
================
To support ``from None``, ``__context__`` will stay as it is, but
``__cause__`` will start out as ``Ellipsis`` and will change to ``None``
when the ``raise ... from None`` method is used.
To support ``raise Exception from None``, ``__context__`` will stay as it is,
but ``__cause__`` will start out as ``Ellipsis`` and will change to ``None``
when the ``raise Exception from None`` method is used.
============================================ ================== =======================================
form __context__ __cause__