Python Decorator Template
without arguments from functools import wraps def decorate(func): @wraps(func) def wrapper(*args, **kwargs): # some actions before func # ... _r = func(*args, **kwargs) # some actions after func # ......
May 13, 20211 min read84