not exporting functions from Python module
<p>If I have a module/file foo.py with the following contents:</p>

<pre><code>from math import sqrt

def foo():
    pass
</code></pre>

<p>If I import it in another script, <code>sqrt</code> is also defined within the module <code>foo</code>.</p>

<pre><code>import foo    
dir(foo)
</code></pre>

<p>The output of which is</p>

<pre><code>[..., # other things
 'foo',
 'sqrt']
</code></pre>

<p>How do I prevent this (i.e., either specify <code>sqrt</code> not to be exported, or export only specific functions- in this case, only the user-defined ones). I know for user-defined functions you can define them privately within the module by prefixing with an underscore, but in this case it's not a user-defined function so I can't define it with an underscore prefix.</p>
