我无法在以下代码段中打印from functools import wraps
def notification(func):
@wraps(func)
def with_logging(*args, **kwargs):
print("Entering definition : " + func.__name__)
print("Arguments passed : {0} {1}".format(args,kwargs))
d = func(*args, **kwargs)
print("Leaving definition : " + func._name_) return d
return d
return with_logging
@notification
def addition_func(x):
""""""
return x
result = addition_func(4)
print(result)
Garage