Python 3.14 introduces t-strings, and if you've read about them you probably know the headline feature: unlike f-strings, they don't just produce a final string. They give you a Template object with a strings tuple and an interpolations list, so your code can inspect, transform, or reject values before anything gets assembled.
That's a meaningful shift. It means the same template can render five completely different ways depending on what you do with those interpolations: HTML with every value entity-escaped, SQL with values pulled out into a parameterized params list instead of concatenated into the query string, structured JSON logs with one field per interpolation, or an LLM prompt that gets scanned for injection phrases before it's sent anywhere.
The catch is that Pyodide doesn't ship Python 3.14 yet, so there's no easy way to try t-strings in-browser against a real interpreter. I built a JavaScript approximation instead: you type a template with {placeholder} markers, fill in values, and pick a renderer to see how the exact same input produces different output depending on the renderer's logic.
You also get a Template breakdown panel showing the raw strings and interpolations before any renderer touches them, which makes the underlying model a lot easier to reason about than reading it in prose.
I walk through why each renderer behaves the way it does, and the actual code you'd use in production, in the companion guide linked from the tool. Try the playground here: https://devencyclopedia.com/tools/t-string-playground
Top comments (0)