[Python-Dev] bpo-36829: Add sys.unraisablehook() (original) (raw)
Victor Stinner vstinner at redhat.com
Thu May 16 14:38:17 EDT 2019
- Previous message (by thread): [Python-Dev] bpo-36829: Add sys.unraisablehook()
- Next message (by thread): [Python-Dev] bpo-36829: Add sys.unraisablehook()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
Let's say that we have: hook(*, exc_type, exc_value, exc_tb, obj). Now we pass a new err_msg keyword argument: the call fails with a TypeError :-(
Or do you mean using **kwargs? I don't think **kwargs is a good API :-( Well, the same can be done using *args and positional arguments to ignore new unknown arguments, but I also dislike such API.
Victor
-- Night gathers, and now my watch begins. It shall not end until my death. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20190516/cf786168/attachment.html>
- Previous message (by thread): [Python-Dev] bpo-36829: Add sys.unraisablehook()
- Next message (by thread): [Python-Dev] bpo-36829: Add sys.unraisablehook()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]