Skip to content

BUG: array_api.Array has wrong type hints in __getitem__ #24982

@Illviljan

Description

@Illviljan

Describe the issue:

The __getitem__ is missing a None in the tuple:

def __getitem__(
self: Array,
key: Union[
int, slice, ellipsis, Tuple[Union[int, slice, ellipsis], ...], Array
],
/,
) -> Array:

Probably should look like:
https://github.com/data-apis/array-api/blob/e2b373dd497a1e49b43529e66d1196e504c673cd/src/array_api_stubs/_draft/array_object.py#L502-L506

References:
https://data-apis.org/array-api/latest/API_specification/generated/array_api.array.__getitem__.html
https://data-apis.org/array-api/latest/API_specification/indexing.html

Runtime information:

Seen in main.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions