func.py/func_py/debug.py
2025-06-15 22:39:15 +02:00

21 lines
393 B
Python

"""
def log(func):
def new_func(*args):
r = func(*args)
print(">>> " + str(func).split(" ")[1] + str(list(args)) + " -> " + str(r))
return r
return new_func
"""
def log(f):
def g(*args):
r = f(*args)
print("Calculating: %s(%s) = %s" % ( str(f).split(" ")[1], str(",".join(map(str,list(args)))), str(r)) )
return r
return g