title: how import * and __all__ work with submodules imports
body: <p>The tutorial (4th paragraph, <a href="https://docs.python.org/3/tutorial/modules.html#importing-from-a-package" rel="nofollow">https://docs.python.org/3/tutorial/modules.html#importing-from-a-package</a>) mentions :</p>
  
  <blockquote>
    <p>It also includes any submodules of the package that were explicitly
    loaded by previous import statements. Consider this code:</p>
  </blockquote>
  
  <pre><code>import sound.effects.echo
  import sound.effects.surround
  from sound.effects import *
  </code></pre>
  
  <blockquote>
    <p>In this example, the echo and surround modules are imported in the
    current namespace because they are defined in the sound.effects
    package when the from...import statement is executed. (This also works
    when <code>__all__</code> is defined.)</p>
  </blockquote>
  
  <p>Doubts:</p>
  
  <ol>
  <li>In the first statement, which <code>previous import statements</code> is it referring to?</li>
  <li>I cannot understand the statements and the example. To <code>from sound.effects import *</code> should not import anything unless defined in <code>__all__</code> of <code>__init__.py</code> in the package.</li>
  </ol>