Decorators

python dev.to

A decorator is a function that modifies the behavior of another function. Syntax: def decorator_function(original_function): def wrapper_function(): # Code to execute before the original function original_function() # Code to execute after the original function return wrapper_function @decorator_function def display(): print("Display function executed.") display()

Read Full Tutorial open_in_new
arrow_back Back to Tutorials