At first I want to make sure that I understand assignment of the feature correct. The local proxy functionality assigned to share a variables (objects) through modules (packages) within a thread. Am I right?
At second, the usage is still unclear for me, maybe because I misunderstood an assignment. I use Flask. If I have two (or more) modules: A, B. I want to import object C from module A to module B. But I can't do it in the usual way, from A import C
, because it will cause a looped import and thereafter ImportError. How to solve this issue with Werkzeug Local Proxy? And should I do it with Werkzeug?
module A:
from werkzeug.local import LocalSomething # LocalProxy or LocalStackC = 'C'
# Somehow add C to LocalSomething
module B:
from werkzeug.locla import LocalSomethingC = LocalSomething()['C']