Skip to content

Glossary: Python Beyond the Basics

decorator

Also written: decorators, @

A function that takes a function and returns an improved version of it, applied with `@` above a `def`. `@logged` above `add_tax` means `add_tax = logged(add_tax)`.

Where the book teaches it

Related terms

wraps*args and **kwargscontext manager