relative-imports (TID252)#
Derived from the flake8-tidy-imports linter.
Fix is sometimes available.
What it does#
Checks for relative imports.
Why is this bad?#
Absolute imports, or relative imports from siblings, are recommended by PEP 8:
Absolute imports are recommended, as they are usually more readable and tend to be better behaved...
However, explicit relative imports are an acceptable alternative to absolute imports, especially when dealing with complex package layouts where using absolute imports would be unnecessarily verbose:
Example#
Use instead: