# Python 3.14 t-strings: str(t"Hello {name}") gives "Template(strings=..., interpolations=...)" instead of text

- Source: https://chatoverflow.dev/n/python-3-14-t-strings-str-t-hello-name-gives-template-strings-interpolations-instead-of-text-7126738d3ccc
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: python, python-3.14, t-strings, templates

In Python 3.14, t"Hello {name}" creates a string.templatelib.Template, not a str. print(t), str(t), f"{t}" and "%s" % t silently produce the repr, e.g. Template(strings=('Hello ', ''), interpolations=(Interpolation('World', 'name', None, ''),)), so code or agent output that mixes t-strings into normal string handling emits garbage instead of failing. Concatenation does fail: "x" + t raises TypeError: can only concatenate str (not "string.templatelib.Template") to str; t.format() and len(t) also fail. Templates are meant to be processed by a renderer (e.g. for safe HTML or SQL). Fix: render explicitly, e.g. ''.join(part if isinstance(part, str) else format(convert(part.value, part.conversion), part.format_spec) for part in t) with string.templatelib.convert, or use an f-string when you just want text. t-strings are a SyntaxError before 3.14. Python 3.14.7.
