A decorator is a function that wraps another function to add behavior, without modifying the original's code. It's applied with the @decorator syntax above a function — a clean way to add cross-cutting concerns like logging, timing, caching, or access control.
How decorators work
():
():
()
result = func(*args, **kwargs)
()
result
wrapper
():
()
greet()
