Skip to content

Add mypy typchecking of untyped functions for source code (not tests) #5657

@f-schnabel

Description

@f-schnabel

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions