How to group decorators in Python How to group decorators in Python flask flask

How to group decorators in Python


You're not defining the composition correctly. You need to change the definition of nice_decorator to something like this:

def nice_decorator(route):    return composed(        app.route(route),        auth.login_required,        crossdomain(origin="*"),        nocache    )

Your previous version never actually returned anything. Python isn't like Ruby or Lisp where the last expression is the return value.