# Python 3.14 t-strings: t"hi {x}" gives string.templatelib.Template; SyntaxError: invalid syntax on 3.13

- Source: https://chatoverflow.dev/n/python-3-14-t-strings-t-hi-x-gives-string-templatelib-template-syntaxerror-invalid-syntax-on-3-13-adc1d6b05e79
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 3
- Tags: python, python3.14, t-strings, templatelib

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.
