The Real Python Podcast· Folge 317

Demystifying Python Memory Management & Choosing a Project Layout

Freitag, 30. Oktober 2026 · 46 min

MP3

Shownotes

<p>How does Python manage memory behind the scenes? What are the common ways to lay out a Python project? Christopher Trudeau is back on the show this week with another batch of PyCoder’s Weekly articles and projects.</p>
<p>Christopher shares an article titled “First Steps into Memory Management in Python.” With recent updates to the garbage collector and the ongoing work toward removing the Global Interpreter Lock (GIL), the article covers the fundamentals of how Python allocates, tracks, and frees memory.</p>
<p>We also share other articles and projects from the Python community, including recent releases, why Parquet dominates modern data engineering, choosing the right Python project layout, developing the most cursed <code>+</code> operator in all of Python, finding which dependencies block a Django project upgrade, and a Django performance benchmark profiler.</p>
<div class="alert alert-primary" role="alert">
<p><strong>Spotlight:</strong> <a href="realpython.com/workshops/codex/">Codex for Python Developers: Hands-On Agentic Coding Course</a></p>
<p>Most Python developers use AI as fancy autocomplete. This 2-day live course teaches you to build entire projects with Codex, an AI agent that works inside your codebase.</p>
</div>
<div class="alert alert-warning" role="alert">
<p><strong markdown>Get Your Cheat Sheet:</strong> <a href="realpython.com/bonus/python-project-structure-…; class="alert-link" data-bs-toggle="modal" data-bs-target="#modal-python-project-structure-cheatsheet" markdown>Click here to download the free cheat sheet for choosing your project layout</a> and keep the flat vs. src/ decision and the entry-point wiring within reach on your next project.</p>
</div>
<p>Topics:</p>
<ul>
<li>00:00:00 – Introduction</li>
<li>00:01:56 – Python 3.16.0 Alpha 1 Is Now Available</li>
<li>00:02:24 – Django Security Releases Issued: 6.1.2, 6.0.9, and 5.2.18</li>
<li>00:02:46 – Release of Polars 2.0</li>
<li>00:03:32 – PyPy v8.0.1 Release</li>
<li>00:03:54 – Checking Email Reputation, and Allowing Outlook Again</li>
<li>00:04:48 – PyScript is in maintenance mode</li>
<li>00:05:55 – Codex for Python Developers: Hands-On Agentic Coding Course</li>
<li>00:06:21 – MLOps North: November 5th & 6th</li>
<li>00:06:46 – Why Parquet Dominates Modern Data Engineering</li>
<li>00:16:04 – First Steps Into Memory Management in Python</li>
<li>00:23:21 – Spotlight: Codex for Python Developers</li>
<li>00:25:05 – Python Project Structure: How to Choose the Right Layout</li>
<li>00:35:17 – Pendulum and the Most Cursed <code>+</code> Operator in All of Python</li>
<li>00:38:50 – django-benchmark: Django Performance Benchmark Profiler</li>
<li>00:41:53 – django-upgrade-report: Which Dependencies Block an Upgrade to Your Django Project? </li>
<li>00:44:33 – Thanks and goodbye</li>
</ul>
<p>News:</p>
<ul>
<li><a href="blog.python.org/2026/10/python-3160-alpha-1-is… 3.16.0 Alpha 1 Is Now Available</a></li>
<li><a href="djangoproject.com/weblog/2026/oct/06/security-… Security Releases Issued: 6.1.2, 6.0.9, and 5.2.18</a></li>
<li><a href="pola.rs/posts/release-polars-2/">Release of Polars 2.0</a></li>
<li><a href="pypy.org/posts/2026/10/pypy-v801-release.html&… v8.0.1 Release</a></li>
<li><a href="blog.pypi.org/posts/2026-10-16-email-reputatio… Email Reputation, and Allowing Outlook Again</a> – Two years ago, PyPI prohibited Outlook email domains in the registration of new accounts due to a large malware campaign. With an update to how email reputation is calculated, addresses from <code>outlook.com</code> and <code>hotmail.com</code> can once more be used.</li>
<li><a href="dev.to/nodex-ar/pyscript-is-in-maintenance-mod… is in maintenance mode. Here’s what’s left for Python in the browser - DEV Community</a></li>
<li><a href="realpython.com/workshops/codex/">Codex for Python Developers: Hands-On Agentic Coding Course – Real Python</a></li>
<li><a href="eventbrite.ca/e/mlops-north-building-with-agen… North: Building (with) Agents Tickets, Thursday, November 5-Friday, November 6 • AM-3 PM | Eventbrite</a></li>
</ul>
<p>Show Links:</p>
<ul>
<li><a href="oedokumaci.com/blog/posts/apache-parquet/"… Parquet Dominates Modern Data Engineering</a> – How Parquet’s columnar layout, encodings, zstd compression, and row group statistics make it smaller and faster to read than CSV, measured on NYC taxi trips data with Polars, DuckDB, and PyArrow.</li>
<li><a href="tech.daniellbastos.com.br/posts/python-memory-… Steps Into Memory Management in Python</a> – A quick introduction to how Python manages memory under the hood and how that might affect your code.</li>
<li><a href="realpython.com/python-application-layouts/&quo… Project Structure: How to Choose the Right Layout</a> – Learn how to structure Python projects: pick between flat and <code>src/</code> layouts, organize your code, and apply the patterns to CLI, web, and GUI apps.</li>
<li><a href="dev.arie.bovenberg.net/blog/pendulum-cursed-pl… and the Most Cursed <code>+</code> Operator in All of Python</a> – Pendulum, a popular Python datetime library, has a + operator that inspects the call stack to decide which answer to give you. The post explains how it ended up there, and why the design behind it, a “drop-in” subclass of datetime, still matters for your code now that the hack itself has been patched.</li>
</ul>
<p>Projects:</p>
<ul>
<li><a href="github.com/justinmayer/django-benchmark"&…: Django Performance Benchmark Profiler</a></li>
<li><a href="github.com/derblub/django-upgrade-report"…: Which Dependencies Block an Upgrade to Your Django Project?</a></li>
</ul>
<p>Additional Links:</p>
<ul>
<li><a href="peps.python.org/pep-0848/">PEP 848 – Generational Incremental Garbage Collection | peps.python.org</a></li>
<li><a href="discuss.python.org/t/reverting-the-incremental… the incremental GC in Python 3.14 and 3.15 - Core Development - Discussions on Python.org</a></li>
<li><a href="docs.python.org/3/whatsnew/3.14.html#whatsnew3… Collection: Python 3.15.2 documentation</a></li>
<li><a href="realpython.com/python-memory-management/"… Management in Python – Real Python</a></li>
</ul>
<p>Level up your Python skills with our expert-led courses:</p>
<ul>
<li><a href="realpython.com/courses/how-python-manages-memo… Python Manages Memory</a></li>
<li><a href="realpython.com/courses/set-up-django-project/&… to Set Up a Django Project</a></li>
<li><a href="realpython.com/courses/astropy-astronomy/"… Astropy for Astronomy With Python</a></li>
</ul> <p><a rel="payment" href="realpython.com/join">Support the podcast & join our community of Pythonistas</a></p>

0:00 / 0:00