relative import basics why relative importsthe scope of relative imports module lookup rules summary relative imports in action pitfalls of package-relative importsmixed use python namespace packages namespace package semantics impacts on regular packagesoptional __init__ py namespace packages in action namespace package nesting files still have precedence over directories summary test your knowledgequiz test your knowledgeanswers advanced module topics module design concepts data hiding in modules minimizing from damage_x and __all__ enabling future language features__future__ mixed usage modes__name__ and __main__ unit tests with __name__ exampledual mode code currency symbolsunicode in action docstringsmodule documentation at work changing the module search path the as extension for import and from examplemodules are objects importing modules by name string running code strings direct callstwo options exampletransitive module reloads recursive reloader alternative codings module gotchas module name clashespackage and package-relative imports statement order matters in top-level code from copies names but doesn' link from can obscure the meaning of variables reload may not impact from imports reloadfromand interactive testing table of contents xix