Python装饰器的几种书写方式
Python装饰器的几种书写方式 python装饰器的几种使用方式,带参数,不带参数,闭包装饰器,以及类装饰器等 from functools import wraps import wrapt class Authorparams(object): """带参数的类的装饰器""" def __init__(self, level): self.level = level def __call__(self, func): @wraps(func) def warpper(*args, **kwargs):
下载地址
用户评论