diff Python/bltinmodule.c @ 57306:349b97ff4c2b legacy-trunk

a better callable replacement
author Benjamin Peterson <benjamin@python.org>
date Tue, 17 Nov 2009 21:24:54 +0000
parents 6e4d8968e246
children 92e06cdbeab9
line wrap: on
line diff
--- a/Python/bltinmodule.c	Tue Nov 17 02:42:26 2009 +0000
+++ b/Python/bltinmodule.c	Tue Nov 17 21:24:54 2009 +0000
@@ -224,7 +224,7 @@
 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));
 }