Metaprogramming LiteDecorators: Functions Wrapping Functions
All courses

@decorator — syntactic sugar with prestige

A decorator wraps a function to add logging, auth, caching, or existential dread.

@loud
def add(a, b):
    return a + b

Quirk: @functools.lru_cache can memoize expensive calls. Forget to clear cache and wonder why prod shows stale data until 3am.

Output
Press Run to execute your code.