Why does << export PYTHONPATH=$PYTHONPATH >> put the current working directory on sys.path?
<p>Put that line in .bashrc (.profile on Mac), the working directory is on the path.  Leave it out, it isn't.</p>

<pre><code>export PYTHONPATH=$PYTHONPATH
</code></pre>

<p>I've noticed that shells with the line have a PYTHONPATH= line in their env output, those without don't, so perhaps that matters.  Python also adds the current working directory if PYTHONPATH has some valid directory but begins with a ':' character.  (Simply setting PYTHONPATH to some valid directory breaks the working directory inclusion.)</p>

<p>Why is this so?
What is best practice for ensuring the current working directory is on sys.path?</p>
