The Real Python Podcast

Design Patterns That Don't Translate to Python

24 snips
Aug 1, 2025
Christopher Trudeau returns with insights from PyCoder's Weekly, tackling the applicability of traditional design patterns in Python. He reveals that many patterns from the Gang of Four are often unnecessary in Python’s dynamic world. The conversation highlights more Pythonic solutions to common problems while emphasizing the new features in Python 3.14, including template strings. Trudeau also explores the importance of understanding built-in exceptions and the concept of 'expert generalists' in tech, advocating for versatility in coding skills.
Ask episode
AI Snips
Chapters
Books
Transcript
Episode notes
ADVICE

Run Coverage on Your Tests

  • Always run coverage tools on your test code to ensure tests actually execute and cover the intended code.
  • Avoid mistakes like duplicate test names or exhausted generators causing missing test coverage.
ANECDOTE

Copy-Paste Test Mistake Story

  • Christopher Trudeau made the common mistake of duplicate test method names, causing coverage numbers to drop.
  • This illustrates how easy it is to overlook errors in copied test code without coverage feedback.
INSIGHT

Design Patterns Not Needed in Python

  • Many classical design patterns do not translate well to Python due to its higher-level features like modules and default arguments.
  • Pythonic approaches often simplify or obviate the need for complex patterns typical in languages like Java or C++.
Get the Snipd Podcast app to discover more snips from this episode
Get the app