比如有下面如下的代码,每个函数都需要判断debug的是否为True,而默认的debug为False def a(x,debug=False): if debug: print('calling a') def b(x,y,z,debug=False): if debug: print('calling b') def c(x,y,debug=False): if debug: print('calling c') 上面的代码可以编写一个装饰器为被包装的函数添加额外的参数来简化,但是添加的参数不能…