The ExceptionHandler type is currently defined as taking a dict[str, Any] as its 2nd parameter:
|
ExceptionHandler = Callable[["Scheduler", Dict[str, Any]], None] |
But the docs explain that the set of keys of this dictionary is actually static:
|
*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].
The
ExceptionHandlertype is currently defined as taking adict[str, Any]as its 2nd parameter:aiojobs/aiojobs/_scheduler.py
Line 29 in 70fe9e5
But the docs explain that the set of keys of this dictionary is actually static:
aiojobs/docs/api.rst
Lines 161 to 168 in 70fe9e5
So it would be better for type-safety (and things that come with it like IDE completion) if this used a
TypedDictinstead of a genericdict[str, Any].