How to access __init__.py variables from deeper parts of a package
<p>I apologize for yet another <code>__init__.py</code> question.</p>

<p>I have the following package structure:</p>

<pre><code>+contrib
  +--__init__.py
  |
  +database
      +--__init__.py
      |
      +--connection.py
</code></pre>

<p>In the top-level <code>__init__.py</code> I define: <code>USER='me'</code>. If I <code>import contrib</code> from the command line, then I can access <code>contrib.USER</code>. </p>

<p>Now, I want to access <code>contrib.user</code> from withih <code>connection.py</code> but I cannot do it.</p>

<p>The top-level <code>__init__.py</code> is called when I issue <code>from contrib.database import connection</code>, so Python is really creating the parameter <code>USER</code>.</p>

<p>So the question is: how to you access the parameters and variables declared in the top-level <code>__init__.py</code> from within the <em>children</em>.</p>

<p>Thank you.</p>

<p>EDIT:</p>

<p>I realize that you can add <code>import contrib</code> to <code>connection.py</code>, but it seems repetitive, as it is obvious (incorrectly so?) that if you need <code>connection.py</code> you already imported <code>contrib</code>.</p>
