Support mypy 1.0
Mypy 1.0 has been released on 2023-02-06. A recent typeshed update broke compatibility with mypy < 1.0
and we are starting to see test failures because of this. It’s probably a good idea to update the codebase to support mypy 1.0.