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 mod.Box[T] annotation gets a false generic_arg edge that replaces the parameter_type one ('is' on tree-sitter nodes) #5110
I have checked the Troubleshooting section in the README
What happened?
A dotted generic annotation like def f(x: mod.MyBox[Foo]) gets a false references edge to MyBox with context: generic_arg. graph.json keeps one edge per node pair, so this false edge replaces the correct parameter_type / return_type edge.
The cause is in _python_collect_type_refs (graphify/extractors/engine.py), subscript branch:
forcinnode.children:
ifcisvalueornotc.is_named:
py-tree-sitter returns a new Node object on every access, so c is value is never true (== works). The subscript's value is walked twice: once as the type, then again as one of its own generic arguments.
A plain MyBox[Foo] parses as generic_type and is not affected; only the dotted form is.
Activity
github-actions commentedon Nov 9, 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.
fix(python): skip the from-import module node by equality, not identity