× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

python decorators are just syntactic sugar

Kyle J. Roux
Jan 12, 2016
<p>using decorators in python can look very confusing, but just remember, a decorator is just a function, that takes a function as its first argument so this</p> <pre>@app.route('/') def index(): return 'hello' </pre> <p>is the same as</p> <pre>def index(): return 'hello' index = app.route(index,'/') </pre>
comments powered by Disqus