@app.route("/", methods = ["GET","PUT"]) - : route() . , , script.
app.route(...) - , @, , index. , :
index = app.route(...)(index)
, Python , app.route() index , index.
, . , , :
@foo
def bar()
pass
, foo() , bar. route() ! , , , ... headscratching, .
route :
def route(self, *rargs, **kargs):
args = list(rargs)
if kargs:
print(kargs['methods'])
def decorator(f):
def wrapped(index_args):
f(args[0])
return wrapped
return decorator