My reaction to this whole discussion is to question whether it's
worth having two different forms of exception chaining in the first
place. It seems to be a subtle distinction that most programmers
either aren't aware of or can't be bothered making when they write
a 'raise' statement.

I'm not convinced that the "bug in exception handler" case warrants
special treatment. If there were a danger of the bug getting masked
by another exception, that would be a concern. But that's not what
happens -- the exception from the bug is the one that percolates
up to the top level, and it's the one you see if you scroll down
to the bottom of the traceback.

The nature of that exception will usually make it clear that
it's the result of a bug, even if there isn't any explicit message
in the traceback saying that. So you fix the bug, run your code
again, and the original exception is exposed.

So my proposal would be to merge the two kinds of chaining into
one, and use wording in the traceback that is neutral as to the
relationship between the two exceptions.

--
Greg
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/PDHQKVDQRXGZDMTEGKWZQAPE2HROZISJ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to