Skip to content

Commit 385bf9e

Browse files
committed
review
1 parent 0568043 commit 385bf9e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

array_api_compat/common/_helpers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,8 @@ def __getitem__(self, idx):
900900
which looks prettier than ``at(x, slice(start, stop, step))``
901901
and feels more intuitive coming from the JAX documentation.
902902
"""
903+
if self.idx is not _undef:
904+
raise TypeError("Index has already been set")
903905
self.idx = idx
904906
return self
905907

0 commit comments

Comments
 (0)