Numpy 1.21 NDArray Type Error #1565
Labels
bug
Something isn't working
fixed in next version (main)
A fix has been implemented and will appear in an upcoming version
Environment data
Expected behaviour
Numpy v1.21.0 introduced runtime subscriptable aliases for ndarrays.
When defining variables using the generic type hint
numpy.typing.NDArray
, Pylance should not raise an error when attempting to index into it.Actual behaviour
Pylance raises the error:
If using slice notation (
a[:]
), the error message is basically the same, but refers to"slice"
instead of "int"`Logs
Code Snippet / Additional information
The text was updated successfully, but these errors were encountered: