Allow ABCMeta in PyType_FromMetaclass
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Feature or enhancement
Proposal:
Currently Python 3.14 will deny any metaclass that implements tp_new, which ABCMeta does.
My suggestion is to add special logic in PyType_FromMetaclass that if the metaclass is ABCMeta or a subtype uses its tp_new instead of custom that it adds the abstract flag, and calls the method that calculates abstractmethods attribute.
Currently there is logic in CPython to mark native methods as abstract.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating PyType_FromMetaclass and the existing logic that marks native methods as abstract. Trace how ABCMeta and its subtypes handle tp_new and how abstractmethods is calculated. Done means ABCMeta-compatible metaclasses are accepted while preserving the abstract flag and calculation behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100