:\codec:\python \python import sub lower mod dir \sub\lower\mod :\codec:\python \python import sub import sub mod dir \sub\mod import sub lower mod dir \sub\lower\mod namespace pkg nested in namespace pkg same effect if accessed incrementally sub lower single-directory namespace pkg sub lower __path__ _namespacepath([' :\\code\\ns\\dir \\sub\\lower']in the precedingsub is namespace package split across two directoriesand sub lower is single-directory namespace package nested within the portion of sub physically located in dir sub lower is also the namespace package equivalent of regular package with no __init__ py this nesting behavior holds true whether the lower component is moduleregular packageor another namespace package--by serving as new import search pathsnamespace packages allow all three to be nested within them freelyc:\codemkdir ns\dir \sub\pkg :\codetype ns\dir \sub\pkg\__init__ py print( 'dir \sub\pkg\__init__ py' :\codec:\python \python import sub mod dir \sub\mod import sub pkg dir \sub\pkg\__init__ py import sub lower mod dir \sub\lower\mod nested module nested regular package nested namespace package sub modulespackages,and namespaces sub mod sub pkg sub lower sub lower mod trace through this example' files and directories for more insight as you can seenamespace packages integrate seamlessly into the former import modelsand extend it with new functionality python namespace packages