title: How can I override a constant in an imported Python module?
body: <p>In my application I am using module within the package <code>example</code> called <code>examplemod</code>.</p>
  
  <p><strong>My app:</strong></p>
  
  <pre><code>from example import examplemod
  examplemod.do_stuff()
  </code></pre>
  
  <p>It imports another module within <code>example</code> like so.</p>
  
  <p><strong>examplemod.py:</strong></p>
  
  <pre><code>from example import config
  # uses config
  # then does stuff
  </code></pre>
  
  <p><code>config</code> uses a constant.</p>
  
  <p><strong>config.py:</strong></p>
  
  <pre><code>CONSTANT = "Unfortunate value"
  </code></pre>
  
  <p>I'd like to override this constant when I'm using <code>examplemod</code> in my application (setting it to <code>CONSTANT = "Better value"</code>) and I'd prefer not to modify the underlying module so I don't have to maintain my own package. How can I do this?</p>