I have a FastAPI app that uses package A as a dependency. On every request to the FastAPI app, package A stores some request string in a ContextVar inside the package. The FastAPI app also uses package B. This package B uses package A as an internal dependency to get the data of the current context variable and perform some operations with it.
I tested this scenario, and it works fine. So my question is, how does python manage to share package A resources between the FastAPI app and package B? I mean, how does it work behind the scene?
Note: I use pip as a package manager.