mirror of
https://github.com/python/cpython.git
synced 2025-07-27 21:24:32 +00:00
a better callable replacement
This commit is contained in:
parent
fab8be2f99
commit
90ed611f6d
1 changed files with 1 additions and 1 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue