def userIdMatch(func): @functools.wraps(func) def wrapper(*args, **kwargs): for i in args: print(i) return wrapper class User(Resource): @userIdMatch def get(self, _id): print(_id)