-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Make import cycles more predictable by prioritizing different import forms #1736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…t of (pri, id, line).
Add unit tests proving that it has a beneficial effect. The new algorithm always processes x before y, while the old one gives an error when y is processed before x: ``` x.py:4: note: In module imported here: y.py: note: In class "Sub": y.py:3: error: Cannot determine type of 'attr' ```
I think this is as far as I'd like to take this for now. There are a few errors in our internal repos that I have to look into. |
# suppressed contains those reachable imports that were prevented by | ||
# --silent-imports or simply not found. | ||
|
||
|
||
# Priorities used for imports. (Here, top-level includes inside a class.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe mention what priorities are used for and why.
Looks good, but look at the notes above. Also it would be nice to have tests that cover all the possible priorities in some way. |
Looks good now! Feel free to merge once you have a green build. |
Partially fixes #1530.