Skip to content

Commit 131fc98

Browse files
tausbnRasmusWLyoff
authored
Python: Apply suggestions from code review
Co-authored-by: Rasmus Wriedt Larsen <[email protected]> Co-authored-by: yoff <[email protected]>
1 parent 5875498 commit 131fc98

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/ql/lib/semmle/python/dataflow/new/internal/ImportResolution.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ private import semmle.python.dataflow.new.TypeTracker
3535
* 1. If `foo` is a module, and `bar` is an attribute of `foo`, then `from foo import bar` imports
3636
* the attribute `bar` into the current module (binding it to the name `bar`).
3737
* 2. If `foo` is a package, and `bar` is a submodule of `foo`, then `from foo import bar` first imports
38-
* `foo.bar`, and then attempts to locate the `bar` attribute again. In most cases, that attribute
38+
* `foo.bar`, and then reads the `bar` attribute on `foo`. In most cases, that attribute
3939
* will then point to the `bar` submodule.
4040
*
41-
* Now, when in comes to how these imports are represented in the AST, things get a bit complicated.
41+
* Now, when it comes to how these imports are represented in the AST, things get a bit complicated.
4242
* First of all, both of the above forms of imports get mapped to the same kind of AST node:
4343
* `Import`. An `Import` node has a sequence of names, each of which is an `Alias` node. This `Alias`
4444
* node represents the `x as y` bit of each imported module.
@@ -230,7 +230,7 @@ module ImportResolution {
230230
module_reexport(p, attr_name, m)
231231
)
232232
or
233-
// Submodules that are implicitly defined when importing via `from ... import ...` statements.
233+
// Submodules that are implicitly defined whith relative imports of the form `from .foo import ...`.
234234
// In practice, we create a definition for each module in a package, even if it is not imported.
235235
exists(string submodule, Module package |
236236
SsaSource::init_module_submodule_defn(result.asVar().getSourceVariable(),

0 commit comments

Comments
 (0)