title: Built in function undefined in imported function
body: <p>I think I miss something important in the way imports work in Python, and I couldn't find a solution. I reduced the problem to its simple expression :
  I have two files :
  <em>test_fonctions.py</em></p>
  <pre><code>def fonction2(x):
      return sqrt(x)
  </code></pre>
  <p><em>test_preambule.py</em></p>
  <pre><code>from math import sqrt
  </code></pre>
  <p>these files are placed in a subfolder called lib, containing as well an empty file called <strong>init</strong>.py</p>
  <p>when I run this code in my main file :</p>
  <pre><code>exec(open(&quot;lib/test_preambule.py&quot;).read())
  from lib.test_fonctions import *
  
  print(sqrt(5))
  print(fonction2(5))
  </code></pre>
  <p>sqrt works fine, but the second function yields to :</p>
  <p>File &quot;....\Tests\lib\test_fonctions.py&quot;, line 2, in fonction2
  return sqrt(x)
  NameError: name 'sqrt' is not defined</p>
  <p>Undefined but defined, listed as builtin_function_or_method in the workspace...</p>
  <p>What did I miss ?</p>
  <p>(the real question is : &quot;Is there a way to make my imports work properly?&quot;)</p>