摘要:
from functools import wraps def cache(func): data = {} @wraps(func) def wrapper(*args): if args in data: print "in cache" return data[args] else: ... 阅读全文
摘要:
A MonkeyPatch is a piece of Python code which extends or modifies other code at runtime (typically at startup). A simple example looks like this: For 阅读全文
摘要:
from stack overflow:http://stackoverflow.com/questions/100003/what-is-a-metaclass-in-python Classes as objects Before understanding metaclasses, you n 阅读全文