mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Issue #29263: LOAD_METHOD support for C methods
Calling builtin method is at most 10% faster.
This commit is contained in:
parent
144fff8b90
commit
5566bbb8d5
8 changed files with 88 additions and 36 deletions
|
|
@ -1060,8 +1060,8 @@ _PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method)
|
|||
descr = _PyType_Lookup(tp, name);
|
||||
if (descr != NULL) {
|
||||
Py_INCREF(descr);
|
||||
if (PyFunction_Check(descr)) {
|
||||
/* A python method. */
|
||||
if (PyFunction_Check(descr) ||
|
||||
(Py_TYPE(descr) == &PyMethodDescr_Type)) {
|
||||
meth_found = 1;
|
||||
} else {
|
||||
f = descr->ob_type->tp_descr_get;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue