Open yeputons opened 3 years ago
Personally, I doubt that we should treat those settings as undisputed setbacks on our road to typechecking everything. There's a concept of gradual typing, which allows one to refine types on demand. Originally, I wanted to enable go-to-definition etc for our fixture code, preserving the ability to omit types in tests themselves. That's why I've relaxed some of the mypy's settings.
One of the reasons we don't write tests in rust is that it's not as forgiving and unsophisticated as python.
Currently the following checks are disabled for
mypy
. I think it's worth enabling them back, fixing issues as we go:check_untyped_defs
(#3142)disallow_incomplete_defs
disallow_untyped_calls
disallow_untyped_decorators
disallow_untyped_defs
Of course, we still have the issue of no type hints for
asyncpg
(although there is some work-in-progress),cached_property
andpytest
. I'm wondering how welldisallow_untyped_decorators
and friends work withignore_missing_imports
for those libraries.Also:
Any
s to something more specificcast
s