裝飾器的本質(zhì)就是返回一個(gè)函數(shù)
def test(func):
def inner():
print("裝飾器")
func()
return inner
@test
def test1():
print("調(diào)用")
def test(func):
def inner():
print("裝飾器")
func()
return inner
@test
def test1():
print("調(diào)用")