in the previous item importing from package now what happens when the user writes from sound effects import *ideallyone would hope that this somehow goes out to the filesystemfinds which submodules are present in the packageand imports them all this could take long time and importing sub-modules might have unwanted side-effects that should only happen when the sub-module is explicitly imported the only solution is for the package author to provide an explicit index of the package the import statement uses the following conventionif package' __init__ py code defines list named __all__it is taken to be the list of module names that should be imported when from package import is encountered it is up to the package author to keep this list up-to-date when new version of the package is released package authors may also decide not to support itif they don' see use for importing from their package for examplethe file sound/effects/__init__ py could contain the following code__all__ ["echo""surround""reverse"this would mean that from sound effects import would import the three named submodules of the sound package if __all__ is not definedthe statement from sound effects import does not import all submodules from the package sound effects into the current namespaceit only ensures that the package sound effects has been imported (possibly running any initialization code in __init__ pyand then imports whatever names are defined in the package this includes any names defined (and submodules explicitly loadedby __init__ py it also includes any submodules of the package that were explicitly loaded by previous import statements consider this codeimport sound effects echo import sound effects surround from sound effects import in this examplethe echo and surround modules are imported in the current namespace because they are defined in the sound effects package when the from import statement is executed (this also works when __all__ is defined although certain modules are designed to export only names that follow certain patterns when you use import *it is still considered bad practice in production code rememberthere is nothing wrong with using from package import specific_submodulein factthis is the recommended notation unless the importing module needs to use submodules with the same name from different packages intra-package references when packages are structured into subpackages (as with the sound package in the example)you can use absolute imports to refer to submodules of siblings packages for exampleif the module sound filters vocoder needs to use the echo module in the sound effects packageit can use from sound effects import echo you can also write relative importswith the from module import name form of import statement these imports use leading dots to indicate the current and parent packages involved in the relative import from the surround module for exampleyou might use modules