Probably worth noting that for the vast majority of cases, implementing a decorator as a class, even if it needs arguments, is overkill, and arguably less clear code; an outter closure usually suffices, and makes for more readable code. Or at least define the decorator object outside the decorator function scope, then initialize and return an instance when the decorator is called.
–
Silas RayMar 27 '14 at 21:49

Just a minor observation, won't this code create a Decorator class every time the decorator is applied?
–
Paulo BuMar 27 '14 at 21:51

@PauloBu That is required, because we're using a free variable args in our class here. If we move the class outside of the function then the class won't be able to access args.
–
Ashwini ChaudharyMar 27 '14 at 21:54

Unless you make args the arguments to the class' __init__ and return an instance, which seems to make more sense here...
–
Silas RayMar 27 '14 at 21:55