MemotivaFunctions and arguments

What is a decorator?

Functions and arguments

Audio flashcard · 0:16

Nortren·

What is a decorator?

0:16

A decorator is a callable that takes a function and returns a new function, typically extending or modifying its behavior. Decorators are applied with the at-sign syntax above a function definition. They are widely used for logging, caching, access control, registration, and similar cross-cutting concerns.
docs.python.org