Visitar URL original
bpo-46921: Vectorcall support for `super()` by Fidget-Spinner · Pull Request #31687 · python/cpython · GitHub
Skip to content
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
Address code review
Co-Authored-By: Dong-hee Na <donghee.na@python.org>
  • Loading branch information
Fidget-Spinner and corona10 committed Mar 5, 2022
commit 0bbe8d631ae3ee6d9628c6f784703aaa01affb97
7 changes: 5 additions & 2 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -9089,15 +9089,18 @@ super_vectorcall(PyObject *self, PyObject *const *args,
if (!_PyArg_NoKwnames("super", kwnames)) {
return NULL;
}

Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
if (!_PyArg_CheckPositional("super()", nargs, 0, 2)) {
return NULL;
}
PyTypeObject *type = NULL;
PyObject *obj = NULL;
PyTypeObject *self_type = (PyTypeObject *)self;
Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
PyObject *su = self_type->tp_alloc(self_type, 0);
if (su == NULL) {
return NULL;
}
// 1 or 2 argument form super().
if (nargs != 0) {
Comment thread
Fidget-Spinner marked this conversation as resolved.
PyObject *arg0 = args[0];
if (!PyType_Check(arg0)) {
Expand Down