Menu

#20 Eliminate implicitly relative imports

Unstable_(example)
accepted
None
1
2020-02-24
2020-02-24
No

Python 2 allowed import foo to mean either “import absolute module foo from the system path” or “import foo from the parent package of the current module.” Python 3 allows only the former meaning, with from . import foo or from .foo import bar being used for relative imports. Python 2 also supports these Python-3-compatible syntaxes.

In some cases, relative imports written as import foo are compatible with circular imports, while from . import foo does not work with circular imports. Therefore, convert some relative imports from relative to absolute.

1 Attachments

Discussion

  • Christopher Head

    This patch depends on 18 and 19. Import those first.

     
  • Jérome Laheurte

    • status: open --> accepted
    • assigned_to: Jérome Laheurte
     

Log in to post a comment.