What is "good practice" for importing modules? For example, if I had a module named 'module' and a function named 'func' which would be preferable?
1:
def do_things():
from module import func
func()
2:
from module import func
def do_things():
func()
3:
import module as mod
def do_things():
mod.func()
4:
def do_things():
import module as mod
mod.func()
I need to make sure my code is written well for this project. Also with importing classes from modules (such as "from bs4 import BeautifulSoup") is it fine to import them into the global namespace at the top of my program? If not, do the same rules as here apply?