-
-
Notifications
You must be signed in to change notification settings - Fork 612
Description
I thought the recommended way to sort was something like this:
Sections sorted alphabetically on package name:
- standard libraries
- pip packages
- third party libraries
- packages/files defined locally (in the tree where this files resides)
For two lines (capital letters are placeholders for package names or identifiers)
import A.B.C
and
from X.Y import Z
what is compared? I would choose comparing C with Y, but maybe I've not grasped it.
This doesn't seem to be the case with isort. sometimes the lines are note sorted alphabetically, and also it doesn't seem to differentiate between pip packages and local packages. I have tried it on several files, and I don't really see the pattern. It is possible to control its behavior so that it does what I want?
I'm quite new to python, and it confuses me that there doesn't seem to be one standard of how to sort the imports. Why is this?
Best regards,
David