
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.