python装饰器 python装饰器 python装饰器 装饰器的作用是什么? 在不改变原函数的基础上,对函数执行前后进行自定义操作。 装饰器简单示例: #不使用装饰器 def index(a1): return a1 + 1000 print(index(10