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

Can't compile curly braces in format string #845

Open
sawczakl opened this issue Apr 23, 2023 · 0 comments
Open

Can't compile curly braces in format string #845

sawczakl opened this issue Apr 23, 2023 · 0 comments
Labels

Comments

@sawczakl
Copy link

sawczakl commented Apr 23, 2023

This expression can't compile and results in an aborted file:

s = 'foo'
f'{{{s}}}'

In Python this results in literal curly braces around the formatted variable:

>>> s = 'foo'
>>> f'{{{s}}}'
'{foo}'

Of course, a workaround is pretty trivial, but I thought it was interesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants