下述代码运行的结果是:defdecorator_a(func):print...
发布于 2022-03-03 14:34:48
下述代码运行的结果是:
def decorator_a(func):
print('Get in decorator_a')
def inner_a(*args,**kwargs):
print('Get in inner_a')
res = func(*args,**kwargs)
return res
return inner_a
def decorator_b(func):
print('Get in decorator_b')
def inner_b(*args,**kwargs):
print('Get in inner_b')
res = func(*args,**kwargs)
return res
return inner_b
@decorator_b
@decorator_a
def f(x):
print('Get in f')
return x * 2
if __name__ == "__main__":
print(f(1))
登录后免费查看答案
关注者
0
被浏览
33