Decorator accepting parameter
def tron(prefix):
def real_tron(func):
def new_func(v):
print("{} Calling {}({})".format(prefix, func.__name__, v))
return func(v)
return new_func
return real_tron
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
def tron(prefix):
def real_tron(func):
def new_func(v):
print("{} Calling {}({})".format(prefix, func.__name__, v))
return func(v)
return new_func
return real_tron