This is a bit confusing: a decorator takes no arguments, while a decorator factory takes arguments and still returns a decorator that decorates a function. A description of when to use each would be helpful. Edit: The confusion comes from the following example: def before_run(func): print "hello from before run" def handle_arg(a,b): if(a>0): a= 100 return func(a,b) return handle_arg @before_run def running_func(a,b): print "a",a,"b", b return a+b Edit: Is there a way to do this using decorator factory by adding logging option(true or false)? Continue reading...