Performs the operation __setitem__.
(
self,
key: Union[
int, slice, ellipsis, Tuple[Union[int, slice, ellipsis], ...], Array
],
value: Union[int, float, bool, Array],
/,
)
| 734 | return self.__class__._new(res) |
| 735 | |
| 736 | def __setitem__( |
| 737 | self, |
| 738 | key: Union[ |
| 739 | int, slice, ellipsis, Tuple[Union[int, slice, ellipsis], ...], Array |
| 740 | ], |
| 741 | value: Union[int, float, bool, Array], |
| 742 | /, |
| 743 | ) -> None: |
| 744 | """ |
| 745 | Performs the operation __setitem__. |
| 746 | """ |
| 747 | # Note: Only indices required by the spec are allowed. See the |
| 748 | # docstring of _validate_index |
| 749 | self._validate_index(key) |
| 750 | if isinstance(key, Array): |
| 751 | # Indexing self._array with array_api arrays can be erroneous |
| 752 | key = key._array |
| 753 | self._array.__setitem__(key, asarray(value)._array) |
| 754 | |
| 755 | def __sub__(self: Array, other: Union[int, float, Array], /) -> Array: |
| 756 | """ |
nothing calls this directly
no test coverage detected