Python: Support flow through import *
#7246
Open
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.
Adds results for
ModuleVariableNode::getAReadcorresponding to readsthat go through (chains of)
import *.This required a bit of a change to which module variables we define.
Previously, we only included variables that were accessed elsewhere in
the same file, but now we must ensure to also include variables that may
be accessed through
import *.Can be reviewed commit-by-commit, though be aware that the second commit not only moves stuff around, but also refactores and renames a bunch of predicates (so as to make them possible to expose publically). For that reason, it's probably best to review that commit as if it's an entirely new implementation. I apologise for the inconvenience.
For figuring out which module is referred to when writing
from ... import *, I used the existing points-to machinery. It's possible this could be replaced with logic that doesn't depend on points-to, but in the short term this seemed like the easiest solution for a precise module resolution.I don't think this needs a change note, but I'll be happy to add one if the reviewer(s) think otherwise.
The text was updated successfully, but these errors were encountered: