You will learn how to build better classes in Python. This course covers dataclasses to reduce boilerplate, descriptors for powerful validation, and even metaclasses to enforce rules at class creation time. You'll write cleaner, more robust, and more reusable object-oriented code.
Overview
Syllabus
- Unit 1: Dataclasses That Scale
- Building Bulletproof Dataclasses
- Building Bulletproof Configuration Objects
- Normalizing Data in Frozen Dataclasses
- Building Bulletproof Data Classes
- Unit 2: Descriptors Behind the Scenes
- Applying Descriptors to Character Stats
- Debugging the Range Validator
- Implementing Descriptor Value Retrieval
- Adding Default Values to Descriptors
- Completing the Descriptor Protocol
- Unit 3: Class Hooks and ABC Contracts
- Building a Price Formatter Plugin
- Debug the Invisible Plugin
- Making Plugin Registration Explicit
- Building a New Plugin Type
- Unit 4: Metaclass Contract Enforcement
- Switching Contract Requirements
- Building a Smarter Plugin Registry
- Supporting Abstract Plugin Classes
- Build Your Serializer Registry System