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
[Bug]: Python typed-receiver calls get no edge inside a nested function or a nested class's method #4226
I have checked the Troubleshooting section in the README
What happened?
The typed-receiver arm of _resolve_python_member_calls (#4198) checks that the receiver's class is defined in, or imported into, the caller's file. It finds the caller's file with _file_node, which returns the caller's firstcontains parent. For a top-level function or a method that parent is the file, but for a nested function it is the enclosing function, and for a method of a nested class it is the outer class. The check then compares a function (or class) id with the file's imports, fails, and the call gets no edge, although the extractor stamped the right receiver_type.
Nested typed callbacks are common, e.g. click's option factories:
# click/decorators.pydefconfirmation_option(*param_decls, **kwargs):
defcallback(ctx: Context, param: Parameter, value: bool) ->None:
ifnotvalue:
ctx.abort() # receiver_type: Context, but no edge to Context.abort
Measured against jedi on 0.9.80: click has 10 such calls (ctx.exit(), ctx.abort(), ...), rich 4; all 14 are real calls jedi resolves to the same method.
Steps to reproduce
mkdir -p demo/pkg &&cd demo
touch pkg/__init__.py
printf'class Client:\n def send(self):\n return 1\n'> pkg/client.py
cat > pkg/use.py <<'EOF'from .client import Clientdef top(c: Client): return c.send()def outer(): def inner(c: Client): return c.send() return innerEOF
graphify update . --no-cluster
python -c "import json; g=json.load(open('graphify-out/graph.json')); n={x['id']:x['label'] for x in g['nodes']}; [print(n[e['source']], '->', n[e['target']]) for e in g.get('links', g.get('edges', [])) if e['relation']=='calls']"
Error output or graph output
top() -> .send()
`inner() -> .send()` is missing. Same for `class Outer: class Inner: def go(self, c: Client): c.send()`.
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 #4227 (thanks @rohit-jsfreaky), shipped in v0.9.81. Closing as resolved.