meta_pixel
Tapesearch Logo
Log in
Talk Python To Me

#505: t-strings in Python (PEP 750)

Talk Python To Me

Michael Kennedy

Technology

4.8635 Ratings

🗓️ 13 May 2025

⏱️ 72 minutes

🧾️ Download transcript

Summary

Python has many string formatting styles which have been added to the language over the years. Early Python used the % operator to injected formatted values into strings. And we have string.format() which offers several powerful styles. Both were verbose and indirect, so f-strings were added in Python 3.6. But these f-strings lacked security features (think little bobby tables) and they manifested as fully-formed strings to runtime code. Today we talk about the next evolution of Python string formatting for advanced use-cases (SQL, HTML, DSLs, etc): t-strings. We have Paul Everitt, David Peck, and Jim Baker on the show to introduce this upcoming new language feature.

Transcript

Click on a timestamp to play from that location

0:00.0

Python has many string formatting styles, which has been added to the language over the years.

0:04.3

Early Python used the percent operator to inject formatted values into strings,

0:09.0

and we have string.format, which offers several powerful styles.

0:13.7

Both were verbose and indirect, so f-strings were added in Python-36,

0:18.5

but these f-strings lacked security features, think little Bobby tables,

0:22.7

and they manifested as fully formed strings to runtime code. Today we talk about the next

0:28.3

evolution of Python string formatting for advanced use cases, think SQL, HTML, DSLs, and so on,

0:35.4

T-strings. We have Paul Everett, Dave Peck, and Jim Baker on the show to introduce the upcoming language feature.

0:43.5

This is Talk Pythoner Me, episode 505, recorded May 13th, 2025.

0:49.3

Are you ready for your host? There is.

0:52.0

You're listening to Michael Kennedy on Talk Python to Me.

0:55.4

Life from Portland, Oregon, and this segment was made with Python.

1:01.4

Welcome to Talk Python to Me, a weekly podcast on Python.

1:05.1

This is your host, Michael Kennedy.

1:07.2

Follow me on Massidon, where I'm at M. Kennedy, and follow the podcast using at Talk

1:11.8

Python, both accounts over at Fostodon.org, and keep up with the show and listen to over nine

1:17.7

years of episodes at TalkPython.fm. If you want to be part of our live episodes, you can find

1:23.2

the live streams over on YouTube, subscribe to our YouTube channel over at TalkPython.fm slash

1:28.4

YouTube and get notified about upcoming shows. This episode is sponsored by Posit

1:33.5

Connect from the makers of Shiny. Publish, share, and deploy all of your data projects that you're

1:38.4

creating using Python. Streamlet, Dash, Shiny, Boca, Fast API, Flask, Quarto, reports, dashboards, and APIs.

1:47.1

Posit Connect supports all of them.

...

Please login to see the full transcript.

Disclaimer: The podcast and artwork embedded on this page are from Michael Kennedy, and are the property of its owner and not affiliated with or endorsed by Tapesearch.

Generated transcripts are the property of Michael Kennedy and are distributed freely under the Fair Use doctrine. Transcripts generated by Tapesearch are not guaranteed to be accurate.

Copyright © Tapesearch 2025.