def indicator(f): f.storage = {} aspecs = getargspec(f).args f.tpos = aspecs.index('_ts') assert f.tpos == len( aspecs) - 1, 'position of _ts is invalid' #_ts必须是最后一个固定位置参数 return decorator.decorator(_indicator, f)
def indicator(f): f.storage = {} aspecs = getargspec(f).args f.tpos = aspecs.index('_ts') assert f.tpos == len(aspecs)-1,'position of _ts is invalid' #_ts必须是最后一个固定位置参数 return decorator.decorator(_indicator,f)
def icache(f): f.cache = {} return decorator.decorator(_icache, f)
def icache(f): f.cache = {} return decorator.decorator(_icache,f)