Decorators Decorators are intuitive and extremely useful. To demonstrate, we’ll look at a simple example. Let’s say we’ve got some function that sums all numbers 0 to n: and we’d like to time the performance of this function. Of course we could just modify the function like so: