What are decorators?
Answer
•A function that modifies another function.
•@decorator above a definition.
•def log(f): def wrapper(*a): return f(*a); return wrapper.
•functools.wraps preserves name/docstring.
•Examples: @property, @staticmethod.
Was this answer helpful?