]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add interface to call a Python function (or other callable) object
authorGuido van Rossum <guido@python.org>
Sat, 27 Jul 1991 21:32:34 +0000 (21:32 +0000)
committerGuido van Rossum <guido@python.org>
Sat, 27 Jul 1991 21:32:34 +0000 (21:32 +0000)
from C.

Python/ceval.c

index 2ab77c09db5da6a120418f6b10c3a7ee55708f57..6aedc47a3e06826765b083a15fe3a4af0fdd19ff 100644 (file)
@@ -1132,6 +1132,19 @@ not(v)
        return w;
 }
 
+/* External interface to call any callable object. The arg may be NULL. */
+
+object *
+call_object(func, arg)
+       object *func;
+       object *arg;
+{
+       if (is_instancemethodobject(func) || is_funcobject(func))
+               return call_function(func, arg);
+       else
+               return call_builtin(func, arg);
+}
+
 static object *
 call_builtin(func, arg)
        object *func;