On Thu, May 16, 2019, 09:07 Steve Dower <steve.dower@python.org> wrote:

Actually, if the default implementation prints the exception message,
how is this different from sys.excepthook? Specifically, from the point
of customizing the hooks.

sys.excepthook means the program has fully unwound and is about to exit. This is pretty different from an exception inside a __del__ or background thread or whatever, where the program definitely hasn't unwound and is likely to continue. And I'm pretty sure they have behavioral differences already, like if you pass in a SystemExit exception then sys.excepthook doesn't print anything, but PyErr_WriteUnraiseable prints a traceback.

So making them two separate hooks seems right to me. Some people will override both; that's fine.

-n