We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__str__
__repr__
Currently, both str and repr ---- I guess --- inherit from numpy, thus 0D arrays look like scalars when printed:
str
repr
In [16]: xp.asarray(1).__repr__() Out[16]: 'Array(1, dtype=array_api_strict.int64)' In [17]: xp.asarray(1).__str__() Out[17]: '1'
For ndim > 1 str is also inherited from numpy, and printed arrays look like lists only without commas.
In [18]: xp.asarray([1, 2, 3]).__str__() Out[18]: '[1 2 3]' In [19]: xp.asarray([1, 2, 3]).__repr__() Out[19]: 'Array([1, 2, 3], dtype=array_api_strict.int64)'
It might make sense to make __str__ identical to __repr__, if only to some confusion.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently, both
str
andrepr
---- I guess --- inherit from numpy, thus 0D arrays look like scalars when printed:For ndim > 1
str
is also inherited from numpy, and printed arrays look like lists only without commas.It might make sense to make
__str__
identical to__repr__
, if only to some confusion.The text was updated successfully, but these errors were encountered: