装饰器如何装饰带参数的函数


def a(n):
print(1)
def inner(b="1"):
n(b)
# print(b)
return inner
@a
def foo(b):
print("foo")
foo()



原文地址:https://www.cnblogs.com/duoduoyichen/p/10309053.html