Python Category
DECORATOR
Wraps behavior around another callable.
Definition
A decorator is a higher-order function that extends behavior of another function or method without editing its internal implementation.
Practical Example & Use Case
A backend team adds a logging decorator to API handlers so response time and status metadata are captured consistently across endpoints.
Editorial review date: 2026-03-11