Meaning
A decorator that counts how many times a wrapped function is called while preserving the original function's metadata via functools.wraps.
Primary Function
Counts function calls and preserves the wrapped function's __name__, __doc__, and other attributes.
Communicative Purpose
To provide a reusable call‑counting decorator that maintains the wrapped function's interface for debugging, profiling, or instrumentation.
Função primária
Counts function calls and preserves the wrapped function's __name__, __doc__, and other attributes.
Propósito comunicativo
To provide a reusable call‑counting decorator that maintains the wrapped function's interface for debugging, profiling, or instrumentation.
Situações de gatilho
When you need to monitor how often a function is invoked without changing its public signature or breaking introspection tools.
Contextos
Used in debugging, performance profiling, memoization decorators, or any scenario where call frequency must be tracked while keeping the function's signature intact.
Família do chunk
- Python decorators
- functools.wraps
- function decorators
- call counting
Log in to save chunks.