Answer the question
In order to leave comments, you need to log in
Passing parameter to python decorator?
What does @app.route("/") mean? Not what it does, but what it means in python. The only thought is calling a decorator with a parameter, but this is nonsense in my opinion.
app = Flask()
@app.route("/")
def nothing():
pass
Answer the question
In order to leave comments, you need to log in
A description and valid syntax for function decorators is given in function-definitions .
On my own, I’ll add that I understand the decorator syntax with brackets as a kind of function of the decorator factory, although this is clearly not written anywhere in the documentation, but such a decorator is implemented in this way.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question