def before(func):
def new_now():
print("setup")
func()
return func
return new_now
@before
def now():
print("2019")
def test_demo():
now()
def before(func):
def new_now():
print("setup")
func()
return func
return new_now
@before
def now():
print("2019")
def test_demo():
now()
本文标题:类(8)装饰器
本文链接:https://www.haomeiwen.com/subject/qpyheltx.html
网友评论