Decorator is an object-oriented design pattern that allows adding behavior to existing classes in a dynamic fashion. It is one of the Gang of Four's structural design patterns.
The Decorator pattern can be used to add new functionality to a class without changing it. Typically it is implemented by subclassing or delegating.
In Python, a decorator is a specific way of using a callable to change the behavior of a function or class.
In Python, decorators are specified in PEP318.
Decorator is one of the Gang of Four's structural design-patterns, first published in Gamma et al.'s book "Design Patterns: Elements of Reusable Object-Oriented Software".