What are Decorators?
What is a decorator.
Decorators are a way of extending the functionality of functions by wrapping them in another function. Decorators in Ask work in the exact same way that decorators do in Python. The only difference is that decorators are used with the &
symbol
Decorators are added on the lines before a function definition like so:
&decorator1
&another_decorator
def my_function():
...
Essentially decorators are functions that take another function as their parameter. There are a few built-in decorators like &basic
and &limit
. The following chapters will focus on how to create and use your own custom decorators.
Last updated