davidhalter/jedi — pull request #217 by hynekcer (2013-05-15 09:12:58+00:00)
Title: Removed import hack. Relative imports changed to absolute. Closed #160.

Description:
- Absolute import commands "from jedi import XXX [as yyy]" stay unchanged.
(except the note)
- All relative import commands "import XXX" are replaced by absolute imports by
3 ways:
* "from jedi import XXX" # preferred if possible
# unchanged code
* "import jedi"
# ensure that XXX is imported just in time later by other module, usually
# by jedi.api replace "XXX." by "jedi.XXX.", It completely removes the
# cycle.
* "import jedi.XXX"
replace "XXX." by "jedi.XXX."
- These changes combined in order to minimize adding "jedi." and to prevent
cyclic import.
- The aliases "er" and "pr" for evaluate_representation and parsing_representation
are so frequent, that they should be preserved, but in the "recursion" module
was necessary to replace it once because decorators defined in "recursion"
must be imported very soon without cyclic dependencies.
- Modules docstrings, dynamic, evaluate and recursion are not imported also by
all modules that access them by "jedi.xxx". This is also due to preserve "er"
alias.
- Everything relevant is imported by "import jedi". Therefore the order is
indepentent on the usage of jedi, whether a "jedi.X" or "jedi.Y" is imported
first or later.