File tree Expand file tree Collapse file tree
python/ql/src/semmle/python Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,8 +60,10 @@ module API {
6060 /**
6161 * Gets a node representing member `m` of this API component.
6262 *
63- * For example, modules have an `exports` member representing their exports, and objects have
64- * their properties as members.
63+ * For example, a member can be:
64+ *
65+ * - A submodule of a module
66+ * - An attribute of an object
6567 */
6668 bindingset [ m]
6769 bindingset [ result ]
@@ -235,7 +237,11 @@ module API {
235237 MkRoot ( ) or
236238 /** An abstract representative for imports of the module called `name`. */
237239 MkModuleImport ( string name ) {
238- imports ( _, name ) or name = any ( ImportExpr e | not e .isRelative ( ) ) .getAnImportedModuleName ( )
240+ imports ( _, name )
241+ or
242+ // When we `import foo.bar.baz` we want to create API graph nodes also for the prefixes
243+ // `foo` and `foo.bar`:
244+ name = any ( ImportExpr e | not e .isRelative ( ) ) .getAnImportedModuleName ( )
239245 } or
240246 /** A use of an API member at the node `nd`. */
241247 MkUse ( DataFlow:: Node nd ) { use ( _, _, nd ) }
You can’t perform that action at this time.
0 commit comments