[Python-Dev] bpo-36829: Add sys.unraisablehook()
Nathaniel Smith
njs at pobox.com
Thu May 16 17:46:32 EDT 2019
On Thu, May 16, 2019 at 2:17 PM Steve Dower <steve.dower at python.org> wrote:
> You go on to say "pass an error message" and "keep repr(obj) if you
> want", but how is this different from creating an exception that
> contains the custom message, the repr of the object, and chains the
> exception that triggered it?
A clever hook might want the actual object, so it can pretty-print it,
or open an interactive debugger and let it you examine it, or
something. Morally this is similar to calling repr(obj), but it
doesn't literally call repr(obj).
-n
--
Nathaniel J. Smith -- https://vorpus.org
More information about the Python-Dev
mailing list