Skip to content

Commit 2972cc3

Browse files
committed
docs: state that a module's short name answers only its own directory
1 parent 77d695f commit 2972cc3

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@
1111
top-level package`) is analysed, flask's `sansio` for one. The project symbols of its
1212
functions change with its name (`python.pkg.sub.app.view`), which a model declared on
1313
the former symbol must follow; baseline keys do not change, since they hold no module
14-
name. A script beside it still imports it by its short name. Files that share only
15-
that short name are no longer noted as `ambiguous-module`.
14+
name. A script beside it still imports it by its short name, which answers no import
15+
from another directory: at the project root, `import os` is the library even beside a
16+
`pkg/sub/os.py`, which a top-level module of a directory took before. Files that share
17+
only that short name are no longer noted as `ambiguous-module`, nor is an import that
18+
only such names from other directories match.
1619
- SARIF: each rule carries a title (`shortDescription`) and a description (`fullDescription`)
1720
instead of repeating its id (#270), and each result carries its confidence as the
1821
`confidence` property (#271). A flow reaching its sink inside a project function points at

‎docs/usage.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ package is a portion of it, as Python reads one: `pkg/sub/app.py` is `pkg.sub.ap
7272
its relative imports resolve against `pkg`. A module there can also be imported by the
7373
name a script run from its directory gives it, `app`: an absolute import from that
7474
directory reaches what lies beside it first, then what the package's root holds, and
75-
files sharing only such a name are told apart by the importer's directory. Two files
75+
files sharing only such a name are told apart by the importer's directory. From another
76+
directory that name answers nothing, as Python finds no such module there: at the
77+
project root, `import os` is the library even beside a `pkg/sub/os.py`. Two files
7678
that would share a module name, `a/app.py` and `z/app.py` outside any package, are told
7779
apart by their path from the root, `a.app` and `z.app`, and reported: each carries an `ambiguous-module` note, since a symbol
7880
`python.app.main` may name a function of either and an import of `app` resolves only

0 commit comments

Comments
 (0)