One of the 50 questions in this topic
How much do you know about Python?A class decorator is a function that takes a class as input and returns a modified or enhanced class. It is applied with the @decorator syntax before the class definition. Unlike more common function decorators, they modify the entire class rather than a single method. Examples include dataclasses.dataclass, which automatically generates methods such as __init__ and __repr__, or abc.abstractmethod for defining abstract interfaces.