def auth_decorator(check_auth):
 def decorator(method):
  def decorated(self, *args, **kwargs):
   check_auth(self)
   return method(self, *args, **kwargs)
  decorated.__name__ = method.__name__
  decorated.__doc__ = method.__doc__
  return decorated
 decorator.__name__ = check_auth.__name__
 decorator.__doc__ = check_auth.__doc__
 return decorator

def auth_decorator ( check_auth ) : def decorator ( method ) : def decorated ( self , * args , ** kwargs ) : check_auth ( self ) return method ( self , * args , ** kwargs ) decorated . __name__ = method . __name__ decorated . __doc__ = method . __doc__ return decorated decorator . __name__ = check_auth . __name__ decorator . __doc__ = check_auth . __doc__ return decorator
make an authentication decorator i heard you like decorators .