Master the advanced object-oriented features that make Python expressive — dunder methods, properties, iterators, generators, decorators, context managers, dataclasses and abstract base classes. Every idea is taught with runnable Python 3.10+ code and a hands-on lab of ten exercises. This course helps you prepare for the Python Institute PCPP certification.
Watch the free preview
Dunder methods and the Python data model — free to watch, no account needed.
What you'll learn
- Implement the core dunder methods so custom classes behave like built-in types
- Control attribute access with properties, class methods and static methods
- Build iterators and generators using the iteration protocol and the yield keyword
- Write function decorators, decorators that take arguments, and context managers
- Model data and type hierarchies with dataclasses and abstract base classes
Syllabus
Objects That Behave Like Built-ins
Dunder methods and the Python data modelFree preview
Properties, class methods and static methods
Iteration Protocols
Iterators — __iter__ and __next__
Generators and the yield keyword
Decorators and Context Managers
Decorators — wrapping and configuring functions
Context managers and the with statement
Modern Class Tooling
Dataclasses
Abstract base classes
Lab — 10 Programming Exercises & Solutions
Programming Exercises 1–5
Programming Exercises 6–10