Open
Description
Feature description
Apologies if I'm misunderstanding about how mypy
is set up with this repo. mypy
currently produces a litany of errors when run on its own even though it passes when run as part of pre-commit
:
> mypy --ignore-missing-imports --install-types --non-interactive .
dynamic_programming/fibonacci.py:37: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
dynamic_programming/fibonacci.py:42: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
searches/binary_tree_traversal.py:21: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
maths/sigmoid_linear_unit.py:20: error: Function "numpy.core.multiarray.array" is not valid as a type [valid-type]
maths/sigmoid_linear_unit.py:20: note: Perhaps you need "Callable[...]" or a callback protocol?
maths/sigmoid_linear_unit.py:29: error: Unsupported operand type for unary - (np.array?) [operator]
maths/sigmoid_linear_unit.py:32: error: Function "numpy.core.multiarray.array" is not valid as a type [valid-type]
maths/sigmoid_linear_unit.py:32: note: Perhaps you need "Callable[...]" or a callback protocol?
maths/sigmoid_linear_unit.py:51: error: Unsupported left operand type for * (np.array?) [operator]
maths/sigmoid.py:14: error: Function "numpy.core.multiarray.array" is not valid as a type [valid-type]
...
Found 87 errors in 13 files (checked 1143 source files)
Is this expected behavior? Should we expect mypy
, when run on its own, to agree with pre-commit
?