Python 3.12 released
Python 3.12 released
Posted Oct 3, 2023 19:13 UTC (Tue) by NYKevin (subscriber, #129325)In reply to: Python 3.12 released by Karellen
Parent article: Python 3.12 released
> Many languages that allow similar syntactic constructs (normally called āstring interpolationā) allow quote reuse and arbitrary nesting. These languages include JavaScript, Ruby, C#, Bash, Swift and many others. The fact that many languages allow quote reuse can be a compelling argument in favour of allowing it in Python. This is because it will make the language more familiar to users coming from other languages.
Posted Oct 3, 2023 22:11 UTC (Tue)
by mathstuf (subscriber, #69389)
[Link]
In [2]: f'a dict: { {1: 2, "a": 4}}'
Soā¦`}}` is not an escape for `}`ā¦sometimes?
In [6]: f'a dict: { {1: 2, "a":: 4} }'
I'm not sure why this column marker seems to care so much about the first key when the second key's `::` is the actual problem. Maybe it gets caught as a format specifier somehow?
Python 3.12 released
Out[2]: "a dict: {1: 2, 'a': 4}"
Cell In[6], line 1
f'a dict: { {1: 2, "a":: 4} }'
^
SyntaxError: f-string: invalid syntax