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: obj.method() on an annotated parameter or a constructor-bound local produces no calls edge #4197
affected, explain and shortest_path miss most Python method callers. _resolve_python_member_calls resolves ClassName.method() (#1446) and module.func() (#1883), and #4176 is adding self.attr.method(). A plain local receiver never gets a calls edge, even when the function itself names its class:
from ._modelsimportRequestfrom ._clientimportClientdefsend(request: Request): # annotated parameterrequest.read() # no edge to Request.readdefbuild():
client=Client() # constructor bindingclient.send() # no edge to Client.senddefget(url):
withClient() asclient: # context manager on a constructorreturnclient.get(url) # no edge to Client.get
Measured against jedi on v8 @ f765dcb (jedi goto on every call inside every function, kept when the target is defined in the repo):
repo
real calls graphify finds
obj.method() calls found
httpx
301 / 437 (68.9%)
0 / 98
click (src/click)
376 / 502 (74.9%)
2 / 85
Proposed solution
Type the receiver from the function's own code, only when it is certain: a parameter annotation (X, "X", Optional[X], typing.Optional[X], X | None), x = X(...) / x: X, or with X(...) as x. Any other binding of the name in the function (factory call, loop, unpacking, a second class, lambda parameter, match capture, ...) drops the type. Resolve with the existing class/method index and the same origin gate as the TS receiver arm (#2553): the class name is unique and the class is defined in, imported into, or in a module imported by the caller's file. Otherwise no edge.
Activity
github-actions commentedon Oct 7, 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 9, 2026
Fixed by #4198 (thanks @rohit-jsfreaky), shipped in v0.9.80. Closing as resolved.