title: When does code in __init__.py get run?
body: <p>I have read the documentation and there is something I'm still not sure about. Does all the initialisation code for the whole module in <code>__init__.py</code> get run if I do:</p>
  
  <pre><code>from mymodule import mything
  </code></pre>
  
  <p>or only if I do </p>
  
  <pre><code>import mymodule
  </code></pre>
  
  <p>What gets run from <code>__init__.py</code> and when does it get run?</p>
  
  <p>I'm sure I could also test this fairly easy, but for posterity and helpfulness for others, I thought I'd ask here.</p>