摘要:
from functools import wraps class logit(): def __init__(self, logfile='out.log'): self.log = logfile def __call__(self, func): @wraps(func) def wrapper(*args... 阅读全文
摘要:
from functools import wraps def cache(func): data = {} @wraps(func) def wrapper(*args): if args in data: print "in cache" return data[args] else: ... 阅读全文