AlgoMaster Logo

Class Decorators

Medium Priority23 min readUpdated June 6, 2026

The term "class decorator" gets used for two completely different things in Python, and the confusion bites people who only learn one. The first is a class used as a decorator: a class whose instances behave like functions, wrapping another callable so it can carry state across calls. The second is a decorator applied to a class: a function that takes a class object, modifies or registers it, and hands it back. Both share the @ syntax. Neither replaces the other. This lesson covers both, in that order, with e-commerce examples that show when each one earns its place.

Premium Content

Subscribe to unlock full access to this content and more premium articles.