I would like a function to include a type hint for NumPy ndarray's alongside with its dtype.
With lists, for example, one could do the following...
def foo(bar: List[int]):
...
...in order to give a type hint that bar has to be list consisting of int's.
Unfortunately, this syntax throws exceptions for NumPy ndarray:
def foo(bar: np.ndarray[np.bool]):
...
> np.ndarray[np.bool]) (...) TypeError: 'type' object is not subscriptable
Is it possible to give dtype-specific type hints for np.ndarray?

List.listwith lowercase is a normal Python function/type. - hpauljtypingare you importing? How are you using typing? Whatnumpyspecific typing have you found and imported? - hpauljListis a built in mypy type: mypy.readthedocs.io/en/stable/builtin_types.html#built-in-types - th3coop