Why can I import successfully without __init__.py?
<p>What exactly is the use of <code>__init__.py</code>? Yes, I know this file makes a directory into an importable package. However, consider the following example:</p>

<pre><code>project/
   foo/
      __init__.py
      a.py
      bar/
         b.py
</code></pre>

<p>If I want to import <code>a</code> into <code>b</code>, I have to add following statement:</p>

<pre><code>sys.path.append('/path_to_foo')
import foo.a
</code></pre>

<p>This will run successfully with or without <code>__init__.py</code>. However, if there is not an <code>sys.path.append</code> statement, a "no module" error will occur, with or without <code>__init__.py</code>. This makes it seem lik eonly the system path matters, and that <code>__init__.py</code> does not have any effect.</p>

<p>Why would this import work without <code>__init__.py</code>?</p>