Is your feature request related to a problem? Please describe.
MyPy currently only checks functions with type definitions. It would be great to add more type annotations to untyped functions, so they are also type checked.
Following config can be added to the setup.cfg so that MyPy also checks untyped functions:
check_untyped_defs = True
But running MyPy with this setting will show ~1000 type errors.
Describe the solution you'd like
Adding type annotations to the codebase so that MyPy runs without errors even when enabling:
check_untyped_defs = True
Since most of the type errors happen inside test cases this issue will only include the main source code. Test code can remain dynamically typed without any problems.
Additional context
Follow up of #5605.