
Episode 251
Python Thread Safety & Managing Projects With uv
The Real Python Podcast · Real Python
May 30, 202534m 48s
Audio is streamed directly from the publisher (dts.podtrac.com) as published in their RSS feed. Play Podcasts does not host this file. Rights-holders can request removal through the copyright & takedown page.
Show Notes
<p>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.</p>
<p>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. </p>
<p>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.</p>
<p>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.</p>
<div class="alert alert-primary" role="alert">
<p><strong>Course Spotlight:</strong> <a href="https://realpython.com/courses/thread-safety-locks-other-techniques/">Thread Safety in Python: Locks and Other Techniques</a></p>
<p>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.</p>
</div>
<p>Topics:</p>
<ul>
<li>00:00:00 – Introduction</li>
<li>00:02:23 – PEP 773: A Python Installation Manager for Windows</li>
<li>00:03:09 – PEP 784: Adding Zstandard to the Standard Library</li>
<li>00:03:28 – Python Insider: Python 3.14.0 Beta 1 Is Here!</li>
<li>00:03:48 – Django Security Releases Issued: 5.2.1, 5.1.9 and 4.2.2</li>
<li>00:04:09 – ty: New Type Checker and Language Server by Astral</li>
<li>00:05:01 – pyrefly: A Fast Type Checker and IDE for Python</li>
<li>00:06:03 – The Future of Textualize</li>
<li>00:07:08 – Managing Python Projects With uv</li>
<li>00:12:20 – pre-commit: Install With uv</li>
<li>00:13:03 – Python’s New t-strings</li>
<li>00:16:38 – Unraveling t-strings</li>
<li>00:18:33 – Video Course Spotlight</li>
<li>00:19:50 – What’s New in Pip 25.1</li>
<li>00:24:30 – Thread Safety in Python: Locks and Other Techniques</li>
<li>00:28:40 – glyphx: SVG-first Plotting Library</li>
<li>00:31:20 – patito: A data modeling layer built on top of Polars and Pydantic</li>
<li>00:34:02 – Thanks and goodbye</li>
</ul>
<p>News:</p>
<ul>
<li><a href="https://peps.python.org/pep-0773/">PEP 773: A Python Installation Manager for Windows (Accepted)</a></li>
<li><a href="https://peps.python.org/pep-0784/">PEP 784: Adding Zstandard to the Standard Library (Accepted)</a></li>
<li><a href="https://pythoninsider.blogspot.com/2025/05/python-3140-beta-1-is-here.html">Python Insider: Python 3.14.0 Beta 1 Is Here!</a></li>
<li><a href="https://www.djangoproject.com/weblog/2025/may/07/security-releases/">Django Security Releases Issued: 5.2.1, 5.1.9 and 4.2.21</a></li>
<li><a href="https://github.com/astral-sh/ty">ty: New Type Checker and Language Server by Astral</a></li>
<li><a href="https://github.com/facebook/pyrefly">pyrefly: A Fast Type Checker and IDE for Python</a></li>
<li><a href="https://textual.textualize.io/blog/2025/05/07/the-future-of-textualize/">The Future of Textualize</a> – Will McGugan, founder of Textualize the company has announced that they will be closing their doors. Textualize the open source project will remain.</li>
</ul>
<p>Show Links:</p>
<ul>
<li><a href="https://realpython.com/python-uv/">Managing Python Projects With <code>uv</code></a> – 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.</li>
<li><a href="https://adamj.eu/tech/2025/05/07/pre-commit-install-uv/"><code>pre-commit</code>: Install With <code>uv</code></a> – 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 <code>uv</code>.</li>
<li><a href="https://davepeck.org/2025/04/11/pythons-new-t-strings/">Python’s New <code>t-strings</code></a> – 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.</li>
<li><a href="https://snarky.ca/unravelling-t-strings/">Unraveling <code>t-strings</code></a> – PEP 750 introduced <code>t-strings</code> 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.</li>
<li><a href="https://ichard26.github.io/blog/2025/04/whats-new-in-pip-25.1/">What’s New in Pip 25.1</a> – pip 25.1 introduces support for Dependency Groups (PEP 735), resumable downloads, and an installation progress bar. Dependency resolution has also received a raft of bugfixes and improvements.</li>
<li><a href="https://realpython.com/courses/thread-safety-locks-other-techniques/">Thread Safety in Python: Locks and Other Techniques</a> – 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.</li>
</ul>
<p>Projects:</p>
<ul>
<li><a href="https://github.com/kjkoeller/glyphx">glyphx: SVG-first Plotting Library</a></li>
<li><a href="https://github.com/JakobGM/patito">JakobGM/patito: A data modeling layer built on top of Polars and Pydantic</a></li>
</ul>
<p>Additional Links:</p>
<ul>
<li><a href="https://realpython.com/podcasts/rpp/238/">Episode #238: Charlie Marsh: Accelerating Python Tooling With Ruff and uv</a></li>
<li><a href="https://github.com/pgjones/sql-tstring">pgjones/sql-tstring: SQL-tString allows for f-string like construction of sql queries</a></li>
<li><a href="https://peps.python.org/pep-0787/">PEP 787: Safer Subprocess Usage Using <code>t-strings</code> (Postponed to 3.15)</a></li>
<li><a href="https://github.com/davepeck/pep750-examples/">davepeck/pep750-examples: Examples of using t-strings as defined in PEP 750</a></li>
<li><a href="https://xkcd.com/327/">xkcd: Exploits of a Mom</a></li>
<li><a href="https://www.explainxkcd.com/wiki/index.php/Little_Bobby_Tables">Little Bobby Tables - explain xkcd</a></li>
</ul>
<p>Level up your Python skills with our expert-led courses:</p>
<ul>
<li><a href="https://realpython.com/courses/threading-python/">Threading in Python</a></li>
<li><a href="https://realpython.com/courses/thread-safety-locks-other-techniques/">Thread Safety in Python: Locks and Other Techniques</a></li>
<li><a href="https://realpython.com/courses/basics-exercises-install-packages-with-pip/">Python Basics Exercises: Installing Packages With pip</a></li>
</ul> <p><a rel="payment" href="https://realpython.com/join">Support the podcast & join our community of Pythonistas</a></p>