Вот мой mypy.ini
Код: Выделить всё
[mypy]
python_version = 3.9
# Needed because of bug in MyPy
disallow_subclassing_any = False
# Options to make the checking stricter.
check_untyped_defs = True
disallow_untyped_defs = True
disallow_untyped_calls = True
#Plugins
plugins = numpy.typing.mypy_plugin
[mypy-numpy.*]
allow_untyped_defs = True
allow_untyped_calls = True
implicit_reexport = True
Код: Выделить всё
import numpy as np
import numpy.typing as npt
def test() -> npt.NDArray[np.float32]:
distance_win: npt.NDArray[np.float32] = np.kron(
np.ones((10, 1))
, np.ones((10, 1))
)
print (distance_win)
return distance_win
if __name__ == '__main__':
print (test())
Код: Выделить всё
mypy --config-file mypy.ini tests/experiments/py_templ.py
Код: Выделить всё
tests\experiments\py_templ.py:32: error: Call to untyped function "kron" in typed context [no-untyped-call]
Found 1 error in 1 file (checked 1 source file)
В общем, мне не удалось получить представление о спецификации MyPy.ini. Пожалуйста, помогите.
Подробнее здесь: https://stackoverflow.com/questions/687 ... typed-call
Мобильная версия