Python: Lifetime of module-global variables
问题 I have a shared resource with high initialisation cost and thus I want to access it across the system (it's used for some instrumentation basically, so has to be light weight). So I created a module managing the setup and access to it. It does a lazy initialise of the resource and stores it in a module global variable. I then use functions of this module across the system to operate on the resource. - Now I am wondering whether (or how often) I will have to reinitialise the resource? - I know