
Episode 259: Design Patterns That Don't Translate to Python
The Real Python Podcast
Do the design patterns learned in other programming languages translate to coding in Python? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
Christopher dives into an article that tackles popular object-oriented design patterns from the famous Gang of Four book. These patterns offer solutions to common coding problems, but as Christopher explores, Python often doesn’t even have the problems these solutions try to fix. He discusses several common design patterns and the simpler, more Pythonic ways to achieve the same goals.
We also share several other articles and projects from the Python community, including an exceptionally robust news roundup, running coverage on tests, an exploration of expert generalists, a preview of template strings from Python 3.14, a quiz on f-strings, and a project that calculates the complexity of your Python code.
Course Spotlight: Working With Python’s Built-in Exceptions
Learn the most common built-in Python exceptions, when they occur, how to handle them, and how to raise them properly in your code.
Topics:
- 00:00:00 – Introduction
- 00:02:03 – Python 3.14.0b4 Released
- 00:02:11 – Python 3.14 release candidate 1 is go!
- 00:02:48 – PyPy v7.3.20 Release
- 00:03:00 – Textual 4.0.0 Released
- 00:03:23 – Announcing Toad - a universal UI for agentic coding in the terminal
- 00:03:42 – uv 0.8.0 Released
- 00:03:56 – Django Bugfix Release 5.2.4
- 00:04:14 – Django Community Ecosystem
- 00:04:52 – Happy 20th Birthday Django!
- 00:05:31 – PyData London 2025 Videos
- 00:05:48 – PEP 792: Project Status Markers in the Simple Index
- 00:06:09 – PEP 800 – Solid bases in the type system
- 00:07:06 – Run Coverage on Tests
- 00:14:32 – Design Patterns You Should Unlearn in Python
- 00:18:13 – Video Course Spotlight
- 00:19:24 – Expert Generalists
- 00:34:42 – Python 3.14 Preview: Template Strings (T-Strings)
- 00:41:00 – fstrings.wtf - Python F-String Quiz
- 00:43:09 – complexipy: Calculate Complexity of Your Python
- 00:48:18 – Thanks and goodbye
Survey:
News:
- Python 3.14.0b4 Released
- Python 3.14 release candidate 1 is go! - Core Development - Discussions on Python.org
- PyPy v7.3.20 Release
- Textual 4.0.0 Released
- Announcing Toad - a universal UI for agentic coding in the terminal – Will McGugan
uv
0.8.0 Released- Django Bugfix Release 5.2.4
- Django Community Ecosystem - Django
- Happy 20th Birthday Django!
- Django Origins (and some things I have built with Django) - YouTube
- PyData London 2025 Videos
- PEP 792: Project Status Markers in the Simple Index (Accepted)
- PEP 800 – Solid bases in the type system
Show Topics:
- Run Coverage on Tests – Code coverage tools tell you which parts of your programs got executed during test runs. They’re an important part of your test suite, and without them, you may miss errors in your tests themselves. This post has two quick examples of just why you should use a coverage tool.
- Design Patterns You Should Unlearn in Python – The Gang of Four design patterns specify object-oriented solutions to common issues in code, but Python doesn’t have many of the problems the solutions are aiming to solve. This article talks about some of the common patterns and the easier ways to solve the problems they intend to address in Python. See also Part 2.
- Expert Generalists – MartinFowler.com – “As computer systems get more sophisticated we’ve seen a growing trend to value deep specialists. But we’ve found that our most effective colleagues have a skill in spanning many specialties.”
- Python 3.14 Preview: Template Strings (T-Strings) – Python 3.14 introduces t-strings: a safer, more flexible alternative to f-strings. Learn how to process templates securely and customize string workflows.
Projects:
Additional Links:
- Design Patterns - Gang of Four - Wikipedia
- Episode #117: Measuring Python Code Quality, Simplicity, and Maintainability
- Episode #176: Building Python Best Practices and Fundamental Skills
- Cyclomatic complexity - Wikipedia
- Cognitive Complexity: A new way of measuring understandability - SonarSource
- Listener Survey - Help Shape the Future of the Real Python Podcast