On Tuesday, December 29, 2015 at 4:18:10 PM UTC, Peter Otten wrote:
> xeon Mailinglist wrote:
> 
> > On Tuesday, December 29, 2015 at 11:16:10 AM UTC, xeon Mailinglist wrote:
> >> 1. How do I create a global variable that can be accessed by all classes?
> >> 
> >> 2. I am using `dogpile.cache` to store data in the cache [1], but if I
> >> set and get the same key from different modules, I don't get the value.
> >> Here is an example in [2]. The value than I get is `NO_VALUE.NO_VALUE`.
> >> Why this happens?
> 
> >>     region = make_region().configure('dogpile.cache.memory')
> 
> The memory backend wraps a python dict whose contents are only available to 
> a single script and forgotten when that script ends.
> 
> My crystal ball tells me that you want to communicate between processes 
> rather than "modules" and need a backend that implements persistence. 
> "dogpile.cache.file" seems to be the one without dependencies outside the 
> standard library.


No. My problem is that I have method1() that calls method2() which calls 
myset(). method1() -> method2() -> myset(5). My problem is that, if I try to 
get the value of myset() inside method1(), I can't have it. It seems that the 
program has lost the value.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to