mirror of
https://github.com/python/cpython.git
synced 2025-08-09 11:29:45 +00:00
Merged revisions 76350 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76350 | benjamin.peterson | 2009-11-17 15:24:54 -0600 (Tue, 17 Nov 2009) | 1 line a better callable replacement ........
This commit is contained in:
parent
577e370709
commit
0811a44cca
1 changed files with 1 additions and 1 deletions
|
@ -224,7 +224,7 @@ static PyObject *
|
||||||
builtin_callable(PyObject *self, PyObject *v)
|
builtin_callable(PyObject *self, PyObject *v)
|
||||||
{
|
{
|
||||||
if (PyErr_WarnPy3k("callable() not supported in 3.x; "
|
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 NULL;
|
||||||
return PyBool_FromLong((long)PyCallable_Check(v));
|
return PyBool_FromLong((long)PyCallable_Check(v));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue