-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Detect and support module aliasing via assignment. #3435
Merged
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
ad646b9
Detect and support module aliasing via assignment.
carljm c498e2a
Handle chained assignment and iterable unpacking assignment.
carljm fdb3af1
Remove test case that was only for exploration, not intended for incl…
carljm 14d7d0f
Merge branch 'master' into module-alias
carljm ee8bd80
Add some more tests for module assignment.
carljm 7efbdb7
Also add tests for access/assignment of nonexistent module attribute.
carljm fd3eb84
Break down code and add comments for clarity; add test for mismatch l…
carljm 4006d0a
Naming improvements.
carljm 7aeb65f
Merge branch 'master' into module-alias
carljm 6dc0757
Support tracking module assignment in non-global scope.
carljm 9aa8169
Add more tests for unpacking mismatch cases.
carljm 6e7cd24
Keep rvals always on the right.
carljm d3d8f9f
Don't use a form of unpacking that is Py35+ only.
carljm 1cbe94c
It's the zip that is problematic, not just the unpacking.
carljm 325ae94
Add tests for module assignment in class and local scopes.
carljm 2326425
Merge branch 'master' into module-alias
carljm 9592ce9
Simplify to single method.
carljm f438f9c
Go back to annotating genericpath as Any in stdlib-sample.
carljm e1ce5b8
Respect explicit type annotation and don't propagate module reference.
carljm c51a916
Merge branch 'master' into module-alias
carljm 4d40207
Backtrack to simple ModuleType var in case of incompatible module ali…
carljm a8a4f44
Remove stray pdb comment.
carljm 6584b0b
Also handle reassignment of an original (non-alias) module reference.
carljm b292673
Simplify: fail on assignment of different modules to same variable wi…
carljm f62d58e
Style and working tweaks.
carljm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why do you need a function that just unconditionally calls another function? Maybe one is enough?
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.
Yes, good point. This was to present a cleaner API (pass in only the
AssignmentStmt
), but given there's only one call site and will never be more, that's not very useful. Consolidated.