Offload as much type checking as possible to python instead of doing it manually.
Some sources from Amitayush -
There are libraries in Python which do static typing:
https://mypy-lang.org/
Mypy is an optional static type checker for Python.
It has generics too:
https://mypy.readthedocs.io/en/stable/generics.html