You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import numpy as np
from nptyping import Array
def testfunc(a: Array[float,10]) -> int:
c = a + 'astring' # add an array to a string, should cause error
b = np.array([1,2,3]) # should cause an error because function expects int output
reveal_locals()
return b
The mypy output on this file is:
testmodule.py:1: error: No library stub file for module 'numpy'
testmodule.py:1: note: (Stub files are from https://github.com/python/typeshed)
testmodule.py:2: error: Cannot find implementation or library stub for module named 'nptyping'
testmodule.py:2: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
testmodule.py:7: note: Revealed local types are:
testmodule.py:7: note: a: Any
testmodule.py:7: note: b: Any
testmodule.py:7: note: c: Any
Are a, b, and c interpreted as Any because I have done something wrong (perhaps by not having a stub file for nptyping?) or is there a deeper issue?
Thank you for your help, and for developing type hints for numpy.
The text was updated successfully, but these errors were encountered:
I have a testmodule.py file containing:
The mypy output on this file is:
testmodule.py:1: error: No library stub file for module 'numpy'
testmodule.py:1: note: (Stub files are from https://github.com/python/typeshed)
testmodule.py:2: error: Cannot find implementation or library stub for module named 'nptyping'
testmodule.py:2: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
testmodule.py:7: note: Revealed local types are:
testmodule.py:7: note: a: Any
testmodule.py:7: note: b: Any
testmodule.py:7: note: c: Any
Are a, b, and c interpreted as Any because I have done something wrong (perhaps by not having a stub file for nptyping?) or is there a deeper issue?
Thank you for your help, and for developing type hints for numpy.
The text was updated successfully, but these errors were encountered: