Decorators
A decorator wraps a class or method to extend it. In python the syntax used to wrap the original function is @decoratorname. For example let's say the original function A needs to be decorated with B:
def B(a):
def C(*args):
return 2 * a(*args);
return C
@B
def A(x, y):
return x + y;
print A(2, 3)