器必用专题

Python自学成才之路 装饰器必用的wraps注解

保留元信息 先看一个案例: def my_decorate(func):def inner_fun(*args, **kargs):print('here is my_decorate')func()return inner_fun@my_decoratedef greet():print("say hi")print(greet.__name__)输出:inner_fun Gre