-
-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Description
The ExceptionHandler type is currently defined as taking a dict[str, Any] as its 2nd parameter:
Line 29 in 70fe9e5
| ExceptionHandler = Callable[["Scheduler", Dict[str, Any]], None] |
But the docs explain that the set of keys of this dictionary is actually static:
Lines 161 to 168 in 70fe9e5
| *context* is a :class:`dict` with the following keys: | |
| * *message*: error message, :class:`str` | |
| * *job*: failed job, :class:`Job` instance | |
| * *exception*: caught exception, :exc:`Exception` instance | |
| * *source_traceback*: a traceback at the moment of job creation | |
| (present only for debug event loops, see also | |
| :envvar:`PYTHONASYNCIODEBUG`). |
So it would be better for type-safety (and things that come with it like IDE completion) if this used a TypedDict instead of a generic dict[str, Any].
Metadata
Metadata
Assignees
Labels
No labels