Skip to content

Adding __repr__ methods to Grid, Node and Finder#42

Merged
brean merged 2 commits intobrean:mainfrom
ClementJ18:object-representations
Jun 24, 2023
Merged

Adding __repr__ methods to Grid, Node and Finder#42
brean merged 2 commits intobrean:mainfrom
ClementJ18:object-representations

Conversation

@ClementJ18
Copy link
Copy Markdown
Contributor

I've always found the ability to just print an object very handy for debugging so I've taken the liberty of adding it to some of the key objects of the library.

Copy link
Copy Markdown
Owner

@brean brean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not so sure about this. datamodels __repr__ makes more sense for the Node class, although it might be a bit verbose.

@ClementJ18
Copy link
Copy Markdown
Contributor Author

ClementJ18 commented Jun 24, 2023

That's a good point. I missed the part that is is a dataclass on the master branch. On the pipy version it's just an object. I'll remove the __repr__ for Node, it doesn't have that many attributes so just using the built-in __repr__ is fine in my opinion.

@brean brean merged commit 1e6c61c into brean:main Jun 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants