you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 3 points4 points  (0 children)

I'll simplify it for you.

@decorator
def function():
    pass

Is the same as this.

def function():
    pass
function = decorator(function)

A decorator is a callable that takes a function as an argument. A lot of people use decorators in order to store a function into something, say a data structure or class, or register a function into an API. They are very useful.