You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
References to names from a module that is star-imported resolve to the module symbol, not the definition #247
When a module does from a import *, every reference in that module to a name defined in a is emitted with the module symbol (a/__init__:) instead of the symbol of the function or variable. This happens even when the same name is also imported explicitly on the next line. Consumers that build call or reference graphs from the index lose all symbol-level edges into a from that file; only the file-level link survives.
Repro
a.py
X=1deff():
return1
star.py
fromaimport*fromaimportfdefg():
returnf() +X
plain.py
fromaimportf, Xdefg():
returnf() +X
scip-python index --project-name t --project-version 1
Occurrences on the return f() + X line (symbol suffix shown):
file
f
X
plain.py
a/f().
a/X.
star.py
a/__init__:
a/__init__:
Expected
star.py references resolve to a/f(). and a/X., as in plain.py.
Impact seen on a real project
In a project whose modules each start with from core import * followed by explicit imports, 12 of 20 sampled direct cross-file calls into core were recorded against core/__init__:. In one such file, 115 occurrences pointed at the module symbol and 7 at a specific symbol. A project without star imports scored 20 of 20 on the same check.
Environment
@sourcegraph/scip-python@0.6.8 via npx, Node 22.22.0, Linux x86_64.
Activity
linear-code commentedon Nov 15, 2026
OSS-24231