Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

CodeSignal

Python Class Machinery: Dataclasses, Descriptors, Metaclasses

via CodeSignal

Overview

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.

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

Reviews

Start your review of Python Class Machinery: Dataclasses, Descriptors, Metaclasses

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.