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

Register hy.models.FString with hy-repr + tests. #2033

Closed

Conversation

peaceamongworlds
Copy link
Contributor

Currently hy-repr treats f-strings as a sequence, which produces unexpected results:

=> (hy-repr 'f"a{:a}")
'\'(, "a" (, :a))'

This makes it so that

=> (hy-repr 'f"a{:a}")
'\'f"a{:a}"'

Kodiologist
Kodiologist previously approved these changes Apr 6, 2021
Copy link
Member

@Kodiologist Kodiologist left a comment

Choose a reason for hiding this comment

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

Note the typo hy-rep in NEWS.

@peaceamongworlds
Copy link
Contributor Author

Note the typo hy-rep in NEWS.

Fixed.

@scauligi
Copy link
Member

scauligi commented Apr 10, 2021

Make sure it handles conversions and other parameters correctly (and add corresponding tests):

=> (print (hy-repr 'f"a{:a =}"))
'f"a:a ={:a}"

@Kodiologist
Copy link
Member

@peaceamongworlds Are you thinking of picking this back up soon? I'd like to make some long overdue changes to hy-repr, but I'd like to have these changes in first.

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.

3 participants