Talk Python To Me

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


Listen Later

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.

Episode sponsors

Posit
Auth0
Talk Python Courses

Links from the show
Guests:
Paul on X: @paulweveritt
Paul on Mastodon: @[email protected]
Dave Peck on Github: github.com
Jim Baker: github.com

PEP 750 – Template Strings: peps.python.org
tdom - Placeholder for future library on PyPI using PEP 750 t-strings: github.com
PEP 750: Tag Strings For Writing Domain-Specific Languages: discuss.python.org
How To Teach This: peps.python.org
PEP 501 – General purpose template literal strings: peps.python.org
Python's new t-strings: davepeck.org
PyFormat: Using % and .format() for great good!: pyformat.info
flynt: A tool to automatically convert old string literal formatting to f-strings: github.com
Examples of using t-strings as defined in PEP 750: github.com
htm.py issue: github.com
Exploits of a Mom: xkcd.com
pyparsing: github.com
Watch this episode on YouTube: youtube.com
Episode transcripts: talkpython.fm

--- Stay in touch with us ---
Subscribe to Talk Python on YouTube: youtube.com
Talk Python on Bluesky: @talkpython.fm at bsky.app
Talk Python on Mastodon: talkpython
Michael on Bluesky: @mkennedy.codes at bsky.app
Michael on Mastodon: mkennedy
...more
View all episodesView all episodes
Download on the App Store

Talk Python To MeBy Michael Kennedy

  • 4.8
  • 4.8
  • 4.8
  • 4.8
  • 4.8

4.8

577 ratings


More shows like Talk Python To Me

View all
Software Engineering Radio - the podcast for professional software developers by se-radio@computer.org

Software Engineering Radio - the podcast for professional software developers

273 Listeners

The Changelog: Software Development, Open Source by Changelog Media

The Changelog: Software Development, Open Source

284 Listeners

Thoughtworks Technology Podcast by Thoughtworks

Thoughtworks Technology Podcast

42 Listeners

Data Skeptic by Kyle Polich

Data Skeptic

476 Listeners

Software Engineering Daily by Software Engineering Daily

Software Engineering Daily

629 Listeners

The TWIML AI Podcast (formerly This Week in Machine Learning & Artificial Intelligence) by Sam Charrington

The TWIML AI Podcast (formerly This Week in Machine Learning & Artificial Intelligence)

441 Listeners

Super Data Science: ML & AI Podcast with Jon Krohn by Jon Krohn

Super Data Science: ML & AI Podcast with Jon Krohn

296 Listeners

Python Bytes by Michael Kennedy and Brian Okken

Python Bytes

214 Listeners

Data Engineering Podcast by Tobias Macey

Data Engineering Podcast

140 Listeners

Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

Syntax - Tasty Web Development Treats

984 Listeners

CoRecursive: Coding Stories by Adam Gordon Bell - Software Developer

CoRecursive: Coding Stories

185 Listeners

DataFramed by DataCamp

DataFramed

268 Listeners

Practical AI by Practical AI LLC

Practical AI

188 Listeners

The Stack Overflow Podcast by The Stack Overflow Podcast

The Stack Overflow Podcast

64 Listeners

The Real Python Podcast by Real Python

The Real Python Podcast

138 Listeners