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
[Feature]: Python: self.m() / super().m() / cls.m() get no calls edge when m is defined on a base class in another file #4221
When the base class is imported from another module, the call gets no edge at all:
# flask/app.pyfrom .sansio.appimportAppclassFlask(App):
def__init__(self, ...):
super().__init__(...) # no edge to App.__init__self.add_url_rule(...) # no edge to App.add_url_rule (defined on App)defhandle_exception(self, e):
handler=self._find_error_handler(...) # no edge to App._find_error_handler
That is the normal shape of any project that splits a base class into its own module, so affected App._find_error_handler misses its callers in subclasses. Measured against jedi on 0.9.80, Flask has 162 / 243 real call pairs (66.7%), the lowest of httpx / click / flask, and inherited calls are a large part of the gap.
Proposed solution
In _resolve_python_member_calls, for a self.m(), cls.m() or bare super().m() raw call the in-file pass could not bind, walk the caller's class up its inherits edges and bind the first class that owns m (nearest first, as in the MRO). Fail closed, no edge, when the order is not certain:
a class with two or more bases (MRO across files is not modelled),
a base the edge list cannot show (mod.Base, Generic[T], a call; only bare-name bases become inherits edges),
a base outside the corpus, or a self-loop base,
the caller's own base is neither defined in nor imported by the caller's file,
super(Cls, obj).m() with arguments (its MRO starts after Cls, not after the caller's class).
Alternatives considered
Bind self.m() to any method named m in the corpus: the god-node collision the shared pass skips on purpose.
Model the full C3 MRO across files: possible, but multiple inheritance across modules is rare in practice and much harder to get exactly right; single inheritance covers the cases measured.
Area
Extraction or language support
Are you willing to submit a PR?
Yes, I can work on this
Compatibility / behavior impact
Adds calls edges only (EXTRACTED, the same rule the in-file base walk already uses). No node id or existing edge changes.
Python class nodes with a base that is not a bare name get metadata.python_opaque_bases: true; that key is forwarded on changed-files rebuilds like ruby_lookup_unsafe.
Raw calls gain _python_super_args for super(...) with arguments. AST cache schema 6 -> 7.
A changed-files rebuild gives the same edges as a full build (tested both ways).
Additional context
PR right after this issue. 0.9.80 (6478eb7), Windows 11, Python 3.12.12.
Activity
github-actions commentedon Oct 8, 2026
Thanks for opening this issue, @rohit-jsfreaky. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.
safishamsi commentedon Oct 8, 2026
Fixed by #4222 (thanks @rohit-jsfreaky), shipped in v0.9.81. Closing as resolved.