summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2022-08-14-10-04-44.gh-issue-95977.gCTZb9.rst1
-rw-r--r--Objects/typeobject.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2022-08-14-10-04-44.gh-issue-95977.gCTZb9.rst b/Misc/NEWS.d/next/Core and Builtins/2022-08-14-10-04-44.gh-issue-95977.gCTZb9.rst
new file mode 100644
index 0000000..b265c77
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2022-08-14-10-04-44.gh-issue-95977.gCTZb9.rst
@@ -0,0 +1 @@
+Optimized calling :meth:`~object.__get__` with vectorcall. Patch by Kumar Aditya.
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index da02e86..27b12a0 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -8242,7 +8242,8 @@ slot_tp_descr_get(PyObject *self, PyObject *obj, PyObject *type)
obj = Py_None;
if (type == NULL)
type = Py_None;
- return PyObject_CallFunctionObjArgs(get, self, obj, type, NULL);
+ PyObject *stack[3] = {self, obj, type};
+ return PyObject_Vectorcall(get, stack, 3, NULL);
}
static int