title: Python module variable in __init__.py
body: <p>I create a module with one function (read_file) which read a file and add data in one dict (DATA).</p>
  
  <p>The goal is to have access to the dict (DATA) everywhere in other modules, but with only one call to the function read_file. I need this module compatible with python2 and Python3</p>
  
  <p>The tree is :</p>
  
  <pre><code>Config\
      __init__.py
      config.py
  OtherModule\
      __init__.py
      module1.py
      module2.py
  </code></pre>
  
  <p>The code are:</p>
  
  <pre><code> Config
   ==== __init__.py ====
   from config.config import read_file
   DATA = dict()
  
   ==== config.py ====
   import config
   def read_file(param):
      ....
      config.DATA = (depend of param)
  
  OtherModule
  ==== module1.py =====
  import config
  config.read_file(param)
  
  ==== module2.py =====
  import config
  print(config.DATA) -&gt; Empty
  import module2
  print(config.DATA) -&gt; NotEmpty
  </code></pre>
  
  <p>The question is why this works very fine in python3 but it's always empty in python2 ?</p>
  
  <p>I know I can pass with another module, like config.varaible.DATA but I would like to not do it. It is possible ?</p>
  
  <p>I using python2.7 et python 3.6</p>