Skip to content

fix(extract): emit inherits edge for Python parameterized bases - #1815

Open
Synvoya wants to merge 1 commit into
Graphify-Labs:v8from
Synvoya:fix/python-parameterized-base-inherits
Open

fix(extract): emit inherits edge for Python parameterized bases#1815
Synvoya wants to merge 1 commit into
Graphify-Labs:v8from
Synvoya:fix/python-parameterized-base-inherits

Conversation

@Synvoya

@Synvoya Synvoya commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Bug

Python parameterized bases were dropped. class Repo(Base[int]) emitted no inherits edge even though class Repo(Base) worked.

Root cause

The Python heritage walker accepted only identifier nodes. A parameterized base parses as subscript, with the concrete base in its value field and type arguments inside the brackets.

Fix

For a subscript heritage entry, unwrap its value before applying the existing identifier-only rule. Bare bases are unchanged.

The scope is intentionally narrow: qualified attribute bases and runtime expressions are separate resolution problems. They remain skipped instead of creating a potentially incorrect local target.

Validation

  • Covers single and mixed parameterized bases.
  • Covers nested type arguments such as Base[list[str]].
  • Retains bare-identifier inheritance.
  • Verifies generic arguments do not become parent edges.
  • Verifies a runtime base factory does not fabricate an inheritance edge.
  • tests/test_languages.py: 319 passed, 13 optional-DM skips.
  • Ruff and git diff --check: passed.

@Synvoya
Synvoya force-pushed the fix/python-parameterized-base-inherits branch from 1247bae to 1139f17 Compare July 22, 2026 11:19
@Synvoya
Synvoya force-pushed the fix/python-parameterized-base-inherits branch from 1139f17 to a2177ad Compare July 27, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant