Skip to content

Conversation

@lidavidm
Copy link
Member

@lidavidm lidavidm commented Jul 1, 2021

No description provided.

@github-actions
Copy link

github-actions bot commented Jul 1, 2021

Copy link
Member

Choose a reason for hiding this comment

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

Can you test the actual repr for one or two classes somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

I added some assertions at the bottom of the test.

Copy link
Member

Choose a reason for hiding this comment

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

Small nit, for Python it might be nice to use (..) instead of {..} (do the curly braces make more sense for C++? Also there instantiating the class uses round brackets?)

Copy link
Member Author

Choose a reason for hiding this comment

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

Would <> be more typical for Python? We can slice in repr here and replace with our own braces.

For C++, you can generally use either parens or curly braces. But the only reason why curly braces are used here is because that's what Expression::ToString did before the refactor, and I assume there it's so things would print like cast(..., {...}) instead of cast(..., (...)), i.e. to not nest parentheses too much.

Copy link
Member

Choose a reason for hiding this comment

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

() would be more typical, but here the representation isn't roundtrippable anyway.

Copy link
Member

@kszucs kszucs Jul 2, 2021

Choose a reason for hiding this comment

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

I'd prefer (..) as well. Seems like it has been updated already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants