I am not completely sure how things have changed (if at all) between the different releases, but the current generation of type hints for ArrayLike can result is a broken type hint.
While NDArray or np.array support specifying the type with [dtype], ArrayLike does not. Attempting it results in an error:
np.typing.ArrayLike[float]
# TypeError: typing.Union[collections.abc.Buffer, numpy._typing._array_like._SupportsArray[numpy.dtype[typing.Any]], numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[typing.Any]]], complex, bytes, str, numpy._typing._nested_sequence._NestedSequence[complex | bytes | str]]
# is not a generic class
The examples folder clearly shows this behaviour and IIUC test_natlang_array is testing this happens.
Note: if necessary, I will try to generate a minimal example of behaviour (or different error) through pyi files. The error above happens in the command line or when attempting to import a function with that inline hint.
I am not completely sure how things have changed (if at all) between the different releases, but the current generation of type hints for ArrayLike can result is a broken type hint.
While
NDArrayornp.arraysupport specifying the type with[dtype],ArrayLikedoes not. Attempting it results in an error:The examples folder clearly shows this behaviour and IIUC
test_natlang_arrayis testing this happens.Note: if necessary, I will try to generate a minimal example of behaviour (or different error) through pyi files. The error above happens in the command line or when attempting to import a function with that inline hint.