I love Flask for simple stuff, but I'm a little concerned that, as someone who considers himself a relatively advanced Python developer, I don't really understand quite a lot of this.<p>I have no doubt that if I dug into it then it would all make sense, but my first instinct is this: how much of this complexity (proxy objects to thread locals, context stacks etc) results from the fact that doing:<p><pre><code> from flask import request
</code></pre>
is just a bad idea?<p>Perhaps things would be easier if instead of:<p><pre><code> from flask import request
...
@app.route('/'):
def index():
return "Hello from %s" % request.args.get('name')
</code></pre>
we did:<p><pre><code> @app.route('/'):
def index(request):
return "Hello from %s" % request.args.get('name')
</code></pre>
I'm probably massively over-simplifying things, but the idea of magically importing state is the one aspect of Flask that always felt a bit odd to me.