装饰器:
1.@为语法糖
2.装饰器可以用来在调用该代码时进行身份验证
def w1(func):
def inner():
print("身份验证")
func()
return inner
# def f1():
# print("1")
# def f2():
# print("2")
# s1 = w1(f1)
# s1()
@w1
def f1():
print("1")
@w1
def f2():
print("2")
#@w1相当于
#f1 = w1(f1)
#f1()
f1()