Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions array_api_strict/_array_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,6 @@ def __new__(cls, *args, **kwargs):
# These functions are not required by the spec, but are implemented for
# the sake of usability.

def __str__(self: Array, /) -> str:
"""
Performs the operation __str__.
"""
return self._array.__str__().replace("array", "Array")

def __repr__(self: Array, /) -> str:
"""
Performs the operation __repr__.
Expand All @@ -149,6 +143,8 @@ def __repr__(self: Array, /) -> str:
mid = np.array2string(self._array, separator=', ', prefix=prefix, suffix=suffix)
return prefix + mid + suffix

__str__ = __repr__

# In the future, _allow_array will be set to False, which will disallow
# __array__. This means calling `np.func()` on an array_api_strict array
# will give an error. If we don't explicitly disallow it, NumPy defaults
Expand Down
Loading