title: Using module's own objects in __main__.py
body: <p>I’m trying to access a module’s data from inside its <code>__main__.py</code>.</p>
  
  <p>The structure is as follows:</p>
  
  <pre><code>mymod/
      __init__.py
      __main__.py
  </code></pre>
  
  <p>Now, if I expose a variable in <code>__init__.py</code> like this:</p>
  
  <pre><code>__all__ = ['foo']
  foo = {'bar': 'baz'}
  </code></pre>
  
  <p>How can I access <code>foo</code> from <code>__main__.py</code>?</p>