Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Python Design: Good Practice, Architecture and Code Smells
New
Rating: 5.0 out of 5(1 rating)
75 students

Python Design: Good Practice, Architecture and Code Smells

Spot code smells, refactor them safely and structure Python code that stays cheap to change, with samples that run
Created byStephen Leonard
Last updated 10/2026
English
English

What you'll learn

  • Recognise common code smells in Python and remove them with named, behaviour-preserving refactorings
  • Judge coupling and cohesion, and use them to decide where code belongs
  • Choose between functions, classes, data classes, Protocols and abstract base classes for a design problem
  • Apply SOLID and classic design patterns the Pythonic way, and know when they are overkill
  • Structure a small Python application into layers, with ports and adapters, and no import cycles
  • Refactor safely under tests that check behaviour rather than implementation details

Course content

8 sections • 26 lectures • 1h 45m total length
  • Welcome: who this course is for2:27
  • What good design buys you: the cost of change3:11

Requirements

  • Working knowledge of Python 3: functions, classes, exceptions, modules and imports (PCEP/PCAP level)
  • Python 3.12 or later if you want to run the samples

Description

This course contains the use of artificial intelligence.

You can already write Python that works. This course is about writing Python that is cheap to change: code your team, and you in six months, can read, test and extend without fear.

What's covered:

  • What good design buys you, and the two forces behind every design rule: coupling and cohesion

  • The Zen of Python, good names, small functions and information hiding

  • A catalogue of code smells, each with the refactoring that removes it: long functions, long parameter lists, duplication, magic values, primitive obsession, feature envy, message chains and repeated switches

  • Python's own smells: mutable default arguments, bare except, star imports and global state

  • Functions, classes and data classes: when to use which, and why composition usually beats inheritance

  • Duck typing with a contract: Protocols and abstract base classes

  • SOLID, the Python way, and where it's overkill

  • Design patterns Python gives you for free, and the few that still earn their keep

  • Exceptions and state as design decisions

  • A small application's architecture: layers, ports and adapters, packages and import cycles

  • Refactoring safely, with tests that don't break when the design improves

How it's built:

  • Every code sample on every slide runs on Python 3.12 and 3.14. Every "this is an error" claim was checked against the real error message.

  • Every refactoring is shown as a before and after pair, and both are run to check they print exactly the same thing.

  • Design terms are attributed to where they come from (PEP 8, PEP 20, Fowler's Refactoring, the Design Patterns book, and others), and every principle comes with its cost, not just its benefits.

  • Short lectures, one idea per slide, with captions on every lecture.

Narration: the voice-over is AI-generated (text-to-speech), checked for correct pronunciation of every technical term.

This course is not affiliated with or endorsed by the Python Software Foundation. "Python" is a registered trademark of the Python Software Foundation.

Who this course is for:

  • Python developers who can write working code and want it to stay easy to change
  • Learners preparing for, or past, PCAP who want to go beyond syntax into design
  • Developers from other languages who want the Pythonic take on design principles and patterns