title: Python: how to import a module which has the same name as a subpackage?
body: <p>I haven't come across this problem yet, but I'm curious about how to import a module that has the same name as a sub-package. For instance, a possible module-structure could look like this:</p>
  
  <pre><code>mymodule\
      __init__.py
      string.py
  </code></pre>
  
  <p>Now, what if I need the <code>mymodule.string</code> subpackage <strong>and</strong> the <code>string</code> module that is delivered with every Python distribution from a package that is within the same directory, such as <code>__init__.py</code>? The following lines of code <em>all</em> import the subpackage.</p>
  
  <pre><code>from   .                import string
  import mymodule.string  as string
  import string
  </code></pre>