Skip to content
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

gh-60074: add new stable API function PyType_FromMetaclass #93012

Merged
merged 6 commits into from
May 27, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
.. also remove unnecessary indirection from implementation
  • Loading branch information
wjakob committed May 25, 2022
commit db620804e45b8f757b26cb58c20ed02573abeac3
26 changes: 13 additions & 13 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
@@ -3365,18 +3365,6 @@ static const PySlot_Offset pyslot_offsets[] = {
#include "typeslots.inc"
};

PyObject *
PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases)
{
return PyType_FromModuleAndSpec(NULL, spec, bases);
}

PyObject *
PyType_FromModuleAndSpec(PyObject *module, PyType_Spec *spec, PyObject *bases)
{
return PyType_FromMetaclass(NULL, module, spec, bases);
}

PyObject *
PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module,
PyType_Spec *spec, PyObject *bases)
@@ -3655,10 +3643,22 @@ PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module,
return NULL;
}

PyObject *
PyType_FromModuleAndSpec(PyObject *module, PyType_Spec *spec, PyObject *bases)
{
return PyType_FromMetaclass(NULL, module, spec, bases);
}

PyObject *
PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases)
{
return PyType_FromMetaclass(NULL, NULL, spec, bases);
}

PyObject *
PyType_FromSpec(PyType_Spec *spec)
{
return PyType_FromSpecWithBases(spec, NULL);
return PyType_FromMetaclass(NULL, NULL, spec, NULL);
}

PyObject *