python【装饰器】
装饰器1:
把一个函数当作参数,返回一个替代版的函数
本质上就是一个返回函数的函数
“在不改变原函数的基础上,给函数增加功能”
# def func1():
# # print('~~~~~~~~~~~~')
# print('hello python')
#
# def outer():
# print('~~~~~~~~~~~~~~')
# func1()
# func1()
# outer()
# def outer(a):
# def inner():
# a()
# print('~~~~~~~~~~~~~~~')
# return inner
#
#
# func1 = outer(func1)
# func1()