| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Please document the new function in Doc/whatsnew/3.11.rst.
Sorry, something went wrong.
| \n\ | ||
| displayhook() -- print an object to the screen, and save it in builtins._\n\ | ||
| excepthook() -- print an exception and its traceback to sys.stderr\n\ | ||
| exception() -- return the current exception (thread safe)\n\ |
There was a problem hiding this comment.
What is this "(thread safe)" note? It's not mentioned anywhere else.
Sorry, something went wrong.
There was a problem hiding this comment.
The next line for exc_info mentions it's thread-safe, so I didn't want it to look like this isn't. But maybe I should remove it from both lines?
Sorry, something went wrong.
There was a problem hiding this comment.
My concern is more that it's only in help(sys), but nowhere else. If it's thread safe and this information matters, it should be in the documentation as well. Maybe also in the function docstring.
Sorry, something went wrong.
There was a problem hiding this comment.
I don’t know if it matters. This info is thread specific anyway, so you would assume this is thread safe (this is mentioned in the doc).
Sorry, something went wrong.
There was a problem hiding this comment.
Are the other functions in sys, like getrefcount, not thread safe?
Sorry, something went wrong.
There was a problem hiding this comment.
I think it could be that the intention in the help line for exc_info was to say that it’s a thread-specific value, but it was worded incorrectly. I’d change both to say this instead of thread-safe.
Sorry, something went wrong.
There was a problem hiding this comment.
Most functions implemented in C are thread-safe. I agree, remove the mention from both functions.
The exact behavior can be elaborated in the documentation, if needed.
Yeah, the current exception is per-thread.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM. But I suggest to remove "(thread safe)" from sys docstring.
Sorry, something went wrong.
|
Nice @iritkatriel! That looks like an useful feature ;-) I dislike sys.exc_info() which smells like a legacy of Python 2 exceptions. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
https://bugs.python.org/issue46328