def save_method_args(method):
 args_and_kwargs = collections.namedtuple(u'args_and_kwargs', u'args kwargs')
 @functools.wraps(method)
 def wrapper(self, *args, **kwargs):
  attr_name = (u'_saved_' + method.__name__)
  attr = args_and_kwargs(args, kwargs)
  setattr(self, attr_name, attr)
  return method(self, *args, **kwargs)
 return wrapper

def save_method_args ( method ) : args_and_kwargs = collections . namedtuple ( u'args_and_kwargs' , u'args kwargs' ) @ functools . wraps ( method ) def wrapper ( self , * args , ** kwargs ) : attr_name = ( u'_saved_' + method . __name__ ) attr = args_and_kwargs ( args , kwargs ) setattr ( self , attr_name , attr ) return method ( self , * args , ** kwargs ) return wrapper
wrap a method such that when it is called .