Check that name is defined [name-defined]
Mypy expects that all references to names have a correspondingdefinition in an active scope, such as an assignment, functiondefinition or an import. This can catch missing definitions, missingimports, and typos.
This example accidentally calls sort()
instead of sorted()
:
- x = sort([3, 2, 4]) # Error: Name 'sort' is not defined [name-defined]