Skip to content

Support metaclasses in get_all_subclasses - #505

Closed
rupayon123 wants to merge 1 commit into
mahmoud:masterfrom
rupayon123:contribution/metaclass-traversal-20260916
Closed

rupayon123 wants to merge 1 commit into
mahmoud:masterfrom
rupayon123:contribution/metaclass-traversal-20260916

Conversation

@rupayon123

Copy link
Copy Markdown
Contributor

The change

Call the built-in subclass descriptor with an explicit class argument so get_all_subclasses(type) and traversal from object do not raise TypeError on metaclasses. Existing traversal order and deduplication remain intact.

Both new regression tests fail before the fix; all 674 tests and module doctests pass on Python 3.11.15 afterward.

The backstory

This follows the utility-library investigation in #502. Subclass discovery through type or object is useful for class registries and introspection. This was found through source inspection and controlled regression tests.

AI assistance

  • Harness/tooling: OpenAI Codex acting on behalf of rupayon123.
  • Model: GPT-6-based Codex; exact backend variant not exposed.
  • Original task excerpt: “Execute my daily GitHub contribution and maintenance workflow on my behalf. Do real, verified work, not only research, a plan, configuration changes, or a status summary.” Required reproducible, tested fixes and no duplicate patches.

mahmoud added a commit that referenced this pull request Oct 25, 2026
…ate, support metaclasses, fix suppressed raise (#560, #559, #505, #584)
@mahmoud

mahmoud commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Folded into #609 (see the PR description for credit). Thanks for the report and the repro.

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.

2 participants