Decorator
Decorator — A decorator is a function that takes another function and extends its behavior without explicitly modifying it. Decorators are a powerful metaprogramming feature in Python. They use the `@` syntax to wrap functions or methods with additional functionality. Common uses include logging, timing, caching, access control, and validation. Decorators can be stacked (applied in order from bottom to top). Related terms: Generator, Context Manager, GIL (Global Interpreter Lock), Duck Typing, List Comprehension, Mutable vs Immutable. Understanding decorator makes the rest of the Python documentation noticeably easier to follow, because the concept recurs across function references, guides, snippets, and error messages you will meet in real projects. Look up more definitions in the Python glossary, or put the concept into practice with an example from the Python playground.