Hi,
Say you have function or class named XXX and you want to modify the functionality or property of XXX without modifying XXX then you can use decorator to do this.
E.g
def decorator_fun(old_function) :
*****def extended_old_function(arg1,arg2):
********return 2 * old_function(arg1,arg2);
******return extended_old_function;
def multiplier(arg1,arg2) :
*******return arg1*arg2;
double_multiplier = decorator_fun(multiplier);
print double_multiplier(10,20)
in the above example multiplier is a function which functionality is extended using decorator_fun.