Skip to content

Commit 0fbbd50

Browse files
Clarify types to allow None in indexing
I believe that the indexing specification allow `None` in a selection tuple, but the current typing does not specify this. I have changed the signature for `__getitem__` but did not change `__setitem__`. I am not sure where it is documented if the indexing specification applies to both equally.
1 parent e72b3ca commit 0fbbd50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/array_api_stubs/_draft/array_object.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ def __ge__(self: array, other: Union[int, float, array], /) -> array:
477477
def __getitem__(
478478
self: array,
479479
key: Union[
480-
int, slice, ellipsis, Tuple[Union[int, slice, ellipsis], ...], array
480+
int, slice, ellipsis, Tuple[Union[int, slice, ellipsis, None], ...], array
481481
],
482482
/,
483483
) -> array:
@@ -488,7 +488,7 @@ def __getitem__(
488488
----------
489489
self: array
490490
array instance.
491-
key: Union[int, slice, ellipsis, Tuple[Union[int, slice, ellipsis], ...], array]
491+
key: Union[int, slice, ellipsis, Tuple[Union[int, slice, ellipsis, None], ...], array]
492492
index key.
493493
494494
Returns

0 commit comments

Comments
 (0)