The principle of decorators
@make_bold
def get_content():
return 'hello world'
# 上面的代码等价于下面的
def get_content():
return 'hello world'
get_content = make_bold(get_content)
The principle of decorators
@make_bold
def get_content():
return 'hello world'
# 上面的代码等价于下面的
def get_content():
return 'hello world'
get_content = make_bold(get_content)