Skip to content
New issue

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

Add __str__ and __repr__ for simple array #428

Open
tigercosmos opened this issue Sep 24, 2024 · 1 comment
Open

Add __str__ and __repr__ for simple array #428

tigercosmos opened this issue Sep 24, 2024 · 1 comment
Labels
array Multi-dimensional array implementation enhancement New feature or request

Comments

@tigercosmos
Copy link
Collaborator

Add str and repr for simple array. Currently, it only prints the memory address.

>>> import _modmesh as mm
>>> a = mm.SimpleArray(10, "int32")
>>> repr(a)
'<_modmesh.SimpleArray object at 0x7fb28deae270>'
>>> print(a)
<_modmesh.SimpleArray object at 0x7fb28deae270>
@yungyuc yungyuc added enhancement New feature or request array Multi-dimensional array implementation labels Sep 24, 2024
@yungyuc
Copy link
Member

yungyuc commented Sep 24, 2024

The two string representations of arrays need careful design. Once made available, the results will be widely used in test cases and go beyond our control.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
array Multi-dimensional array implementation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants