Closed
Description
The current spec is silent on what the return value from an indexing operation should be: https://data-apis.github.io/array-api/latest/API_specification/indexing.html
I propose that the return value should always be another array object, i.e., so __getitem__
could be type annotated as __getitem__(self: Array, key: IndexKey) -> Array
. However, this is inconsistent with NumPy, which returns NumPy scalars in some cases when indexing with integers.
Metadata
Metadata
Assignees
Labels
No labels