From b58fbd24783b29d377427e837d189fa039422c9a Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Thu, 15 Jul 2021 16:36:26 -0600 Subject: Correct disallow things like a[(0, 1), (0, 1)] in the array API namespace --- numpy/_array_api/_array_object.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'numpy/_array_api/_array_object.py') 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 -- cgit v1.2.1