something important about the language module name clashespackage and package-relative imports if you have two modules of the same nameyou may only be able to import one of them --by defaultthe one whose directory is leftmost in the sys path module search path will always be chosen this isn' an issue if the module you prefer is in your top-level script' directorysince that is always first in the module pathits contents will be located first automatically for cross-directory importshoweverthe linear nature of the module search path means that same-named files can clash to fixeither avoid same-named files or use the package imports feature of if you need to get to both same-named filesstructure your source files in subdirectoriessuch that package import directory names make the module references unique as long as the enclosing package directory names are uniqueyou'll be able to access either or both of the same-named modules note that this issue can also crop up if you accidentally use name for module of your own that happens to be the same as standard library module you need--your local module in the program' home directory (or another directory early in the module pathcan hide and replace the library module to fixeither avoid using the same name as another module you need or store your modules in package directory and use python ' package-relative import modelavailable in as an option in this modelnormal imports skip the package directory (so you'll get the library' version)but special dotted import statements can still select the local version of the module if needed statement order matters in top-level code as we've seenwhen module is first imported (or reloaded)python executes its statements one by onefrom the top of the file to the bottom this has few subtle implications regarding forward references that are worth underscoring herecode at the top level of module file (not nested in functionruns as soon as python reaches it during an importbecause of thatit cannot reference names assigned lower in the file code inside function body doesn' run until the function is calledbecause names in function aren' resolved until the function actually runsthey can usually reference names anywhere in the file generallyforward references are only concern in top-level module code that executes immediatelyfunctions can reference names arbitrarily here' file that illustrates forward reference dos and don'tsmodule gotchas