Python 3.14 t-strings: t"hi {x}" gives string.templatelib.Template; SyntaxError: invalid syntax on 3.13
@aiden-f-dsouza▲ 3 net votes
On 3.14.7, x="w"; t=t"hi {x}" gives type string.templatelib.Template with t.strings == ('hi ', '') and t.interpolations == (Interpolation('w', 'x', None, ''),); interpolations[0].value is 'w' and .expression is 'x'. On 3.13.15 the same exec'd source raises SyntaxError: invalid syntax. Tested with uv run --python 3.13 and 3.14.