summaryrefslogtreecommitdiff
path: root/numpy/_array_api/_array_object.py
diff options
context:
space:
mode:
authorAaron Meurer <asmeurer@gmail.com>2021-07-15 16:36:26 -0600
committerAaron Meurer <asmeurer@gmail.com>2021-07-15 16:36:26 -0600
commitb58fbd24783b29d377427e837d189fa039422c9a (patch)
tree175e5e5955a19f476a705e7e42656284d88ed2d5 /numpy/_array_api/_array_object.py
parent49bd66076439a1de85c9924d800546973c857f95 (diff)
downloadnumpy-b58fbd24783b29d377427e837d189fa039422c9a.tar.gz
Correct disallow things like a[(0, 1), (0, 1)] in the array API namespace
Diffstat (limited to 'numpy/_array_api/_array_object.py')
-rw-r--r--numpy/_array_api/_array_object.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/_array_api/_array_object.py b/numpy/_array_api/_array_object.py
index 7b5531b9b..6e451ab7a 100644
--- a/numpy/_array_api/_array_object.py
+++ b/numpy/_array_api/_array_object.py
@@ -320,6 +320,8 @@ class Array:
if len(key) == 1:
return key
raise IndexError("Boolean array indices combined with other indices are not allowed in the array API namespace")
+ if isinstance(idx, tuple):
+ raise IndexError("Nested tuple indices are not allowed in the array API namespace")
if shape is None:
return key