TranscryptOrg / Transcrypt

Python 3.9 to JavaScript compiler - Lean, fast, open!
https://www.transcrypt.org
Apache License 2.0
2.82k stars 215 forks source link

Can't compile curly braces in format string #845

Open sawczakl opened 1 year ago

sawczakl commented 1 year ago

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.