from functools import wraps def debug(func): @wraps(func) def out(*args, **kwargs): print('hello world') return func(*args, **kwargs) return out @debug def add(x, y): return x + y