Type hints for unhandled exceptions code #1476
Answered
by
erictraut
dineshbvadhia
asked this question in
Q&A
Replies: 2 comments 3 replies
-
from types import TracebackType
def handle_unhandled_exception(
exc_type: type[BaseException],
exc_value: BaseException,
exc_traceback: TracebackType | None,
) -> None:
... |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
dineshbvadhia
-
In addition to Eric's answer, two things that could help you figure this out yourself next time:
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Below is a function to catch unhandled exceptions using excepthook.
Running mypy generates the error:
What is the correct way to type the traceback parameters in the function? Also, is None the correct return type? Thank-you :)
Beta Was this translation helpful? Give feedback.
All reactions