Re:Common Python Mistakes
by cridenour on Thursday May 08, 2014 @11:49AM
(#7715922)
For #7, now you have a performance problem of importing every time you run that function. Rather, you can place the import at the bottom of b.py and be okay.
[ Parent
| on HN ]
Python caches modules imported, you can check it out in your local shell with: import sys ; sys.modules. That's why whenever you make changes to a module which has been already loaded you won't see the changes until you load the module again, either quitting the shell or using reload(module) on Python 2.x