What's the benefit of allowing python files to import themselves
<p>I can't tell you how many times I've been bitten by accidentally naming my file like something I'm trying to import, resulting in python importing the file. This example should show what I'm talking about (my first example didn't work) if / is in PYTHONPATH:</p>

<pre><code>/foo
  __init__.py
/test
  foo.py
</code></pre>

<p><code>__init__.py</code></p>

<pre><code>def do_thingy():
    print "Swosh!"
</code></pre>

<p><code>foo.py</code></p>

<pre><code>from foo import * # Whops! Self include. Happy debugging.

do_thingy() # Not imported. You fail.
</code></pre>

<p><a href="/questions/tagged/django" class="post-tag" title="show questions tagged 'django'" rel="tag">django</a> seem to silently fail when applications, modules, plugins have this error, and the go to method of debugging that (I've been told) is to go to shell and import everything until you find the thing that's broken.</p>

<p>Is there any actual use for recursive imports?</p>
