-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-41171: Added method "PyMetaType_FromSpec" to allow for specifying the metaclass for the type. #21238
Conversation
…pe" to go with the "PyType" variants.
Paging @vstinner for review. |
Objects/typeobject.c
Outdated
} | ||
|
||
PyObject * | ||
PyType_FromModuleAndSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) | ||
PyMetaType_FromModuleAndSpec(PyObject *module, PyTypeObject *meta_type, PyType_Spec *spec, PyObject *bases) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose the name PyMetaType_FromSpec and remove PyMetaType_FromSpecWithBases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, you're suggesting renaming PyMetaType_FromSpecWithBases to just PyMetaType_FromSpec or just keeping the PyMetaType_FromSpec from above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename PyMetaType_FromModuleAndSpec (4 parameters) to PyMetaType_FromSpec. And so remove the other PyMetaType_FromSpec (2 parameters).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I move the method out of "Py_LIMITED_API" then?
Added a note about 'PyMetaType_FromModuleAndSpec' in regards to 'tp_new'.
@vstinner I performed the change you requested. |
Superseded by #93012 |
https://bugs.python.org/issue41171