Sorry, I pasted a patch with changes unrelated to this discussion. This is the gist of the proposed change:int
PyCallable_Check(PyObject *x)
{
if (x == NULL)
return 0;
- return x->ob_type->tp_call;
+ return x->ob_type->tp_call && _PyObject_HasAttrId(x, &PyId___call__);
}