[Python-Dev] bpo-36829: Add sys.unraisablehook()

Barry Warsaw barry at python.org
Thu May 16 14:10:55 EDT 2019


On May 16, 2019, at 03:12, Victor Stinner <vstinner at redhat.com> wrote:

> I came to the UnraisableHookArgs structseq idea because of my bad
> experience with extension warnings "hooks". Let me tell you this story
> :-)

Thanks for that!

> def showwarning(message, category, filename, lineno, file=None, line=None): ...
> def formatwarning(message, category, filename, lineno, line=None): …

While I’m fine with the API you propose, you could consider keyword-only arguments to help future proof the call signature.  I don’t like it as much because it’s not as backward compatibility proof, but it’s an option to perhaps consider.

-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://mail.python.org/pipermail/python-dev/attachments/20190516/1cb765e9/attachment.sig>


More information about the Python-Dev mailing list