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
# ......
ywyt738.hashnode.dev1 min read