title: A module imported in a packages __init__.py is not dot accessible
body: <p>This may be python's desired behavior, but I find it puzzling nonetheless - </p>
  
  <p>I have the following file structure:</p>
  
  <pre><code>repo/
      foo/
          __init__.py
          foo/
              bar.py
  </code></pre>
  
  <p>where <code>__init__.py</code> is the following:</p>
  
  <pre><code>from .foo import bar
  </code></pre>
  
  <p>When I enter a python interpreter from within <code>repo/</code>, I am able to import <code>bar</code> like so:</p>
  
  <pre><code>&gt;&gt;&gt; from foo import bar
  &gt;&gt;&gt; bar
  &lt;module 'foo.foo.bar' from '.../repo/foo/foo/bar.py'&gt;
  </code></pre>
  
  <p>Great! However, the following does not work:</p>
  
  <pre><code>&gt;&gt;&gt; import foo.bar as foobar
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  ModuleNotFoundError: No module named 'foo.bar'
  </code></pre>
  
  <p>Perhaps I lack an understanding of how python's import statement works, but I would very much like to be able import as I showed above. If this is desired behavior, does anyone know of a workaround? Perhaps I can change something in <code>__init__.py</code>?</p>
  
  <p>Out of concern for naming caveats, I have also tested this with the following file structure:</p>
  
  <pre><code>repo/
      foo/
          __init__.py
          baz/
              bar.py
  </code></pre>
  
  <p>... and I got the same result</p>
  
  <p>I've tested this in python 3.6.2 and 3.6.6 on linux and macOS. I also saw the same behavior in python 2.7.13 (where, of course, I added an <code>__init__.py</code> into the lower <code>foo/</code> directory.</p>
  
  <p>If I am unable to make this style of import work, <code>repo/</code> will have to undergo a bit of refactoring. Help me prevent this!</p>