Kaydet (Commit) 90ed611f authored tarafından Benjamin Peterson's avatar Benjamin Peterson

a better callable replacement

üst fab8be2f
......@@ -224,7 +224,7 @@ static PyObject *
builtin_callable(PyObject *self, PyObject *v)
{
if (PyErr_WarnPy3k("callable() not supported in 3.x; "
"use hasattr(o, '__call__')", 1) < 0)
"use isinstance(x, collections.Callable)", 1) < 0)
return NULL;
return PyBool_FromLong((long)PyCallable_Check(v));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment