(nicer, more readable version of: http://www.artima.com/weblogs/viewpost.jsp?thread=240845)
In part I, I showed how to use decorators without arguments, primarily using classes as decorators because I find them easier to think about.
If we create a decorator without arguments, the function to be decorated is passed to the constructor, and the __call__()
method is called whenever the decorated function is invoked:
class decoratorWithoutArguments(object):