mypy/numpy type checking keeps getting stricter about our abuse of the NDArray type annotation. We use numpy arrays of python objects and use NDArray[MyCustomObject] type annotations, which numpy doesn't like. It only wants its native datatypes as generic parameters, so these should be NDArray[np.object_] but then we lose the documentation benefits. I'm not sure the best way to proceed. As a workaround, we've been adding type: ignore comments.
mypy/numpy type checking keeps getting stricter about our abuse of the
NDArraytype annotation. We use numpy arrays of python objects and useNDArray[MyCustomObject]type annotations, which numpy doesn't like. It only wants its native datatypes as generic parameters, so these should beNDArray[np.object_]but then we lose the documentation benefits. I'm not sure the best way to proceed. As a workaround, we've been adding type: ignore comments.