Skip to content

Deduplicate discovered subclasses by identity - #730

Open
Gambit-Checkmate wants to merge 1 commit into
mahmoud:masterfrom
Gambit-Checkmate:fix/subclass-identity-traversal
Open

Gambit-Checkmate wants to merge 1 commit into
mahmoud:masterfrom
Gambit-Checkmate:fix/subclass-identity-traversal

Conversation

@Gambit-Checkmate

Copy link
Copy Markdown

The change

Fixes #729.

Track visited subclasses by identity. An unhashable descendant now appears in traversal results, and distinct classes that compare equal both appear. The output list keeps visited classes alive and the breadth-first traversal still emits a shared descendant only once.

Both focused regressions fail on d31d821 and pass with the fix. The full Windows CPython 3.13 suite reports 776 passed, one skipped and 22 subtests passed. Ruff, the package build and diff checks pass.

The backstory

This follows my earlier utility fixes discussed in #601 and #609. I found this by inspecting the visited set after the metaclass descriptor fix in #505.

AI assistance

  • Harness/tooling: OpenAI Codex, GitHub CLI and pytest.
  • Model: GPT-6 family. The exact serving identifier is unavailable.
  • Relevant original prompt excerpt: “没有合适公开 issue 时可以检查代码、复现真实缺陷,确认无重复后报告问题并提交独立修复。”

This branch has not been deployed

No deployments
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.

get_all_subclasses must deduplicate by class identity

1 participant