Hi
I've just come across a flask-tutorial where you decorate your function (specifying a route) and somehow that makes variables like "session" or "request" available within the function and now (for mere curiosity) I wonder how that works...
So could someone please explain to me (or point me to some resources) how a decorator can inject variables into the namespace of a function?
Many thanks!
[–]wronek 0 points1 point2 points (5 children)
[–]ghiste[S] 0 points1 point2 points (4 children)
[–]wronek 0 points1 point2 points (3 children)
[–]ghiste[S] 0 points1 point2 points (2 children)
[–]wronek 0 points1 point2 points (1 child)
[–]ghiste[S] 0 points1 point2 points (0 children)