From a16d76388d57f34856803dfef19bacd3a9980b60 Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Thu, 22 Jul 2021 16:38:25 -0600 Subject: Use ValueError instead of TypeError for array API @= This is consistent with @ and with NumPy. --- numpy/_array_api/_array_object.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 f6371fbf4..2d999e2f3 100644 --- a/numpy/_array_api/_array_object.py +++ b/numpy/_array_api/_array_object.py @@ -741,7 +741,7 @@ class Array: # of self. other_shape = other.shape if self.shape == () or other_shape == (): - raise TypeError("@= requires at least one dimension") + raise ValueError("@= requires at least one dimension") if len(other_shape) == 1 or other_shape[-1] != other_shape[-2]: raise ValueError("@= cannot change the shape of the input array") self._array[:] = self._array.__matmul__(other._array) -- cgit v1.2.1