from package import item VS import package.item
There is nothing wrong with using from Package import specific submodule! In fact this becomes the recommended notation unless the importing module needs to use submodules with the same name from different packages.
1. Note that when using from package import item, the item can be either a submodule (or subpackage) of the package, or some other name defined in a the package, like a function, class or variable.
2. Contrarily, when using syntax like import item.subitem.subsubitem, each item except for thelast must be a package; the last item can be a module or a package butcan't be a class or function or variable defined in the previous item.
Package related:
1. The __init__.py files are required to make Python treat the directories as containing packages;
this is done to prevent directories with a common name, such as string, from unintentionally hiding valid modules that occur later on the module search path.
2. from package import *If __all__ is defined, "from package import * " will import it's named submodules of the package.
If __all__ is not defined, the statement from sound.effects import * does not import all submodules from the package sound.effects into thecurrent namespace; it only ensures that the package sound.effects hasbeen imported (possibly running any initialization code in __init__.py)and then imports whatever names are defined in the package. This includes anynames defined (and submodules explicitly loaded) by __init__.py. Italso includes any submodules of the package that were explicitly loaded byprevious import statements.