I was reading through the Flask doc - and came across this:
... For web applications it’s crucial to react to the data a client sent to the server. In Flask this information is provided by the global request object. If you have some experience with Python you might be wondering how that object can be global and how Flask manages to still be threadsafe. The answer are context locals ...
Now I understood context locals to be stuff like the with
statement (certainly thats what the python 2.6 doc seems to suggest). Im struggling to see how this would allow you to have globally accessible vars that reside in a local namespace? How does this conceptually work?
Also: globals are generally considered filthy I take it, so why is this OK ?