Closed H-Shay closed 2 years ago
For the tuple index out of range
complaints, we might want to define
Choppable = Union[Tuple[Literal["alert", "alert.body"]], Tuple[Literal["alert.loc-args"], int]]
(ie. Choppable
is either ("alert",)
, ("alert.body",)
or ("alert.loc-args", int)
)
then mypy should be clever enough to figure things out.
Here is my first try at adding some type hints to the below files in Sygnal, and making very minor modifications to the code to silence some mypy errors (like
assert is not None
). A very small handful of errors remain (less than 4 I think?) across the files I changed but silencing them seemed like it might require more modification to the code, and I wanted to make sure that everything I had here was correct before I started tackling those. I think that these are mostly correct but I find typing to be a little difficult so it is entirely possible I have gotten some things wrong.