[python's decorator&wrapper]
decorator
A function returning another function, usually applied as a function transformation using the @wrapper syntax. Common examples for decorators are classmethod() andstaticmethod().
The decorator syntax is merely syntactic sugar, the following two function definitions are semantically equivalent:
The same concept exists for classes, but is less commonly used there.
udpate_wrapper: 把wrapped的属性值拷贝到wrapper
wraps: partial of udpae_wrapper
how to use ?
参考:
1、http://docs.python.org/2.7/library/functools.html#functools.update_wrapper