From e34c097981ad573c9871f5f52d1e6e5769529dda Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Tue, 20 Jul 2021 19:32:36 -0600 Subject: Always include the dtype in the array API Array repr --- 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 54280ef37..f8bad0b59 100644 --- a/numpy/_array_api/_array_object.py +++ b/numpy/_array_api/_array_object.py @@ -81,7 +81,7 @@ class Array: """ Performs the operation __repr__. """ - return self._array.__repr__().replace('array', 'Array') + return f"Array({np.array2string(self._array, separator=', ')}, dtype={self.dtype.name})" # Helper function to match the type promotion rules in the spec def _promote_scalar(self, scalar): -- cgit v1.2.1