Given a function:
def example():
returnGiven a function that takes as one of its inputs a function (we'll call this our decorator):
def example_decorator(function):
# do something
function()
# do something elseWe can then decorate the example function with example_decorator like so:
@example_decorator
def example():
returnWhen we call example, the semantics are:
example() == example_decorator(example)