Given code such as
def norm(x, y):
from math import sqrt
return sqrt(x**2 + y**2)
nesting the import
in the function keeps the outer namespace clear. However, does the import
actually occur on every call to the function and thus decrease performance or only on the first call and then somehow cached?