Courses / Python
67. Decorators
Decorators are a way to modify the behavior of a function or method.
1 min read Chapter 67 of 72
Python
Decorators
Decorators modify the behavior of functions or methods in Python.
"I want to add logging to my functions without changing their code."
A decorator is a function that wraps another function, allowing you to add functionality before or after the wrapped function runs.
"I want to add logging to my functions without changing their code."
A decorator is a function that wraps another function, allowing you to add functionality before or after the wrapped function runs.