Closed maggienj closed 7 years ago
There are few import patterns:
_late_import()
pattern which allows you to define cyclic module dependencies; your program has two distinct phases: a) setting up the module complex (where these cyclic dependencies are resolved), b) running the program. Late import can also be used to delay imports until a module is actually executed, making initial startup a bit faster; in which case a) setup common classes b) run common code c) setup optional classes d) run optional code
3) Import when required: You will see these as in-line imports: We do not care about speed at this point
4) Import at end: A simple case of late_import()
: where only the names are required to be in the module; technically a cyclic dependency, but of the simplest form.
For journal entry: Just stumbled upon this during debugging...
Why are these imports at the bottom of the page? in
mo_dots\__init__.py
Answer: https://stackoverflow.com/questions/13063390/when-does-import-module-at-bottom-of-file