What are the ways you can manage multithreaded code in Python? What synchronization techniques are available within Python’s threading module? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
Christopher discusses his recent Real Python video course about thread safety. The course provides a quick overview of race conditions and how to use locks in your code. It then goes on to share a collection of additional synchronization primitives to make your code thread-safe.
We dig into a tutorial by Leodanis Pozo Ramos about managing Python projects with uv. The tutorial shows you how to quickly initialize a project, build the directory structure, add dependencies, and publish your package while practicing the commands inside uv.
We also share several other articles and projects from the Python community, including a news roundup, unraveling t-strings, what’s new in pip 25.1, an SVG-first plotting library, and a data modeling tool built on top of Polars and Pydantic.
Course Spotlight: Thread Safety in Python: Locks and Other Techniques
In this video course, you’ll learn about the issues that can occur when your code is run in a multithreaded environment. Then you’ll explore the various synchronization primitives available in Python’s threading module, such as locks, which help you make your code safe.
Topics:
News:
Show Links:
uv
– In this tutorial, you’ll learn how to create and manage your Python projects using uv, an extremely fast Python package and project manager written in Rust.pre-commit
: Install With uv
– pre-commit is Adam’s favorite Git-integrated “run things on commit” tool. It acts as a kind of package manager, installing tools as necessary from their Git repositories. This post explains how to use it with uv
.t-strings
– Using f-strings is a readable way of building output, but there are situations where they can’t be used because the contents need to be verified before being string-ified. The new t-strings, coming in 3.14, are a solution to this problem.t-strings
– PEP 750 introduced t-strings
for Python 3.14. These are a template string mechanism similar to f-strings. Although they are in 3.14.0b1, there isn’t any documentation yet, so this post explains what they are how they can be used.Projects:
Additional Links:
t-strings
(Postponed to 3.15)Level up your Python skills with our expert-led courses: