Performs the operation __getitem__.
(
self: Array,
key: Union[
int,
slice,
ellipsis,
Tuple[Union[int, slice, ellipsis, None], ...],
Array,
],
/,
)
| 541 | return self.__class__._new(res) |
| 542 | |
| 543 | def __getitem__( |
| 544 | self: Array, |
| 545 | key: Union[ |
| 546 | int, |
| 547 | slice, |
| 548 | ellipsis, |
| 549 | Tuple[Union[int, slice, ellipsis, None], ...], |
| 550 | Array, |
| 551 | ], |
| 552 | /, |
| 553 | ) -> Array: |
| 554 | """ |
| 555 | Performs the operation __getitem__. |
| 556 | """ |
| 557 | # Note: Only indices required by the spec are allowed. See the |
| 558 | # docstring of _validate_index |
| 559 | self._validate_index(key) |
| 560 | if isinstance(key, Array): |
| 561 | # Indexing self._array with array_api arrays can be erroneous |
| 562 | key = key._array |
| 563 | res = self._array.__getitem__(key) |
| 564 | return self._new(res) |
| 565 | |
| 566 | def __gt__(self: Array, other: Union[int, float, Array], /) -> Array: |
| 567 | """ |
nothing calls this directly
no test coverage detected