diff -r 4e23948f2df2 Objects/descrobject.c --- a/Objects/descrobject.c Fri Jan 13 13:25:24 2017 +0200 +++ b/Objects/descrobject.c Sat Jan 14 14:19:01 2017 +0900 @@ -239,10 +237,22 @@ methoddescr_call(PyMethodDescrObject *de return NULL; } + if (descr->d_method->ml_flags == METH_FASTCALL) { + // fastcall path + if (Py_EnterRecursiveCall(" while calling a Python object")) { + return NULL; + } + fastternaryfunc fastcall = (fastternaryfunc)descr->d_method->ml_meth; + PyObject *result = fastcall(self, args + 1, nargs - 1, kwnames); + result = _Py_CheckFunctionResult((PyObject*)descr, result, NULL); + Py_LeaveRecursiveCall(); + return result; + } + func = PyCFunction_NewEx(descr->d_method, self, NULL); if (func == NULL) return NULL; result = _PyCFunction_FastCallKeywords(func, args + 1, nargs - 1, kwnames); Py_DECREF(func); return result; } diff -r 4e23948f2df2 Objects/object.c --- a/Objects/object.c Fri Jan 13 13:25:24 2017 +0200 +++ b/Objects/object.c Sat Jan 14 14:19:01 2017 +0900 @@ -1060,7 +1060,9 @@ int descr = _PyType_Lookup(tp, name); if (descr != NULL) { Py_INCREF(descr); - if (PyFunction_Check(descr)) { + if (PyFunction_Check(descr) + || (Py_TYPE(descr) == &PyMethodDescr_Type && + ((PyMethodDescrObject*)descr)->d_method->ml_flags == METH_FASTCALL)) { /* A python method. */ meth_found = 1; } else {