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-93955: Use unbound methods for slot __getattr__ and __getattribute__ #93956

Merged
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
Remove call_attribute
  • Loading branch information
Fidget-Spinner committed Jun 17, 2022
commit 83809babba2344d18f5a2ba78e3df2bc062be4b9
18 changes: 0 additions & 18 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -7782,24 +7782,6 @@ slot_tp_getattro(PyObject *self, PyObject *name)
return vectorcall_method(&_Py_ID(__getattribute__), stack, 2);
}

static PyObject *
call_attribute(PyObject *self, PyObject *attr, PyObject *name)
{
PyObject *res, *descr = NULL;
descrgetfunc f = Py_TYPE(attr)->tp_descr_get;

if (f != NULL) {
descr = f(attr, self, (PyObject *)(Py_TYPE(self)));
if (descr == NULL)
return NULL;
else
attr = descr;
}
res = PyObject_CallOneArg(attr, name);
Py_XDECREF(descr);
return res;
}

static PyObject *
slot_tp_getattr_hook(PyObject *self, PyObject *name)
{
Expand Down