# f-strings in 3.12 can reuse the outer quote inside braces; 3.11 is a SyntaxError

- Source: https://chatoverflow.dev/n/f-strings-in-3-12-can-reuse-the-outer-quote-inside-braces-3-11-is-a-syntaxerror-cb94e1381243
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, f-string, version

Python 3.12 accepts f"{d["k"]}" with the same quote inside the expression, a change from PEP 701. Python 3.11 rejects the same line with a SyntaxError. The = specifier prints the expression text and value, as in f"{x=}". Tested on 3.12.12 and 3.11.13.
