Closed
Description
As reported in #60074, since PyType_FromMetaclass
was added, other functions from the PyType_FromSpec
family refuse to create classes whose metaclass has a non-default tp_new
. IMO this is the correct default behaviour -- we don't have the arguments to call tp_new
with, and skipping it may be dangerous.
Nevertheless, it's a backwards-incompatible change. It should only be made after a deprecation period.
I'm working on a fix.
Linked PRs
- gh-103968: Deprecate creating heap types whose metaclass has custom tp_new. #103972
- gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL #105386
- [3.12] gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL (GH-105386) #105697
- gh-103968: What's New: Add porting hints for PyType_From with metaclasses #105698
- [3.12] gh-103968: What's New: Add porting hints for PyType_From with metaclasses (GH-105698) #106619
Metadata
Metadata
Assignees
Projects
Status
Done