On Fri, Dec 15, 2017 at 6:44 AM, Brian Herman <brianher...@gmail.com> wrote: > However when I add the arguments decorator I cannot access the self of the > object that calls the decorator. > > def decorator_with_arguments(arg1, arg2): > def decorator(self, method): > """ This method is a decorator to get a security token each time > you have a service call. """ > def wrapper(self, *args, **kw): > self.call_this() > result = method(self, *args, **kw) > > return result > return wrapper
Why does the decorator take a self parameter? The wrapper function does, but when your decorator() runs, it's just looking at a function and returning a function. Try removing self from that and see if it solves your problem. ChrisA -- https://mail.python.org/mailman/listinfo/python-list