Decorator
A function returning another function, usually applied as a function transformation using the @wrapper
syntax. Common examples for decorators are classmethod()
and staticmethod()
.
It was inspired in part by Java annotations, and have a similar syntax; the decorator syntax is pure syntactic sugar, using @
as the keyword: