aio-libs / aio-libs/aiojobs

Consider using `TypedDict` for 2nd `ExceptionHandler` parameter

オープン
#565 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
929
フォーク
68
平均マージ
1分
マージ済み PR(30日)
2

説明

The `ExceptionHandler` type is currently defined as taking a `dict[str, Any]` as its 2nd parameter:

https://github.com/aio-libs/aiojobs/blob/70fe9e5dfd83bb5a9d0ce8d75bea2832b674da68/aiojobs/_scheduler.py#L29

But the docs explain that the set of keys of this dictionary is actually static:

https://github.com/aio-libs/aiojobs/blob/70fe9e5dfd83bb5a9d0ce8d75bea2832b674da68/docs/api.rst?plain=1#L161-L168

So it would be better for type-safety (and things that come with it like IDE completion) if this used a [`TypedDict`](https://docs.python.org/3/library/typing.html#typing.TypedDict) instead of a generic `dict[str, Any]`.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。