Skip to content

Support metaclasses in get_all_subclasses - #505

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

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

Conversation

@rupayon123

Copy link
Copy Markdown

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.

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