By default, mypy doesn't look inside bodies of untyped functions (that is, functions that have no parameter or return value annotations). With --check-untyped-defs it does.
$ cat asd.py
def foo():
print(1 + "asd")
$ mypy asd.py
Success: no issues found in 1 source file
$ mypy --check-untyped-defs asd.py
asd.py:2: error: Unsupported operand types for + ("int" and "str")
Found 1 error in 1 file (checked 1 source file)
Checking untyped functions in mypy_primer could be useful if they call other functions that have stubs in typeshed. Some projects in mypy_primer (e.g. https://github.com/enthought/comtypes ) contain lots of untyped functions.
By default, mypy doesn't look inside bodies of untyped functions (that is, functions that have no parameter or return value annotations). With
--check-untyped-defs
it does.Checking untyped functions in mypy_primer could be useful if they call other functions that have stubs in typeshed. Some projects in mypy_primer (e.g. https://github.com/enthought/comtypes ) contain lots of untyped functions.