Decorate function with any signature - implementation
examples/decorators/decor_any.py
def tron(func): def new_func(*args, **kw): params = list(map(lambda p: str(p), args)) for (k, v) in kw.items(): params.append(f"{k}={v}") print("Calling {}({})".format(func.__name__, ', '.join(params))) return func(*args, **kw) return new_func
Calling one(hello) one(hello) Calling one(param=world) one(world) Calling two(hi) two(hi, 42) Calling two(first=Foo, second=Bar) two(Foo, Bar)