summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1991-07-27 21:32:34 (GMT)
committerGuido van Rossum <guido@python.org>1991-07-27 21:32:34 (GMT)
commit83bf35cb27e28616b75c5010f94aec2641d08f60 (patch)
tree5b6a7fdb65c6faa46fb571e120950c6aff98f1a1 /Python/ceval.c
parent7ac4a88721b784e80c0a0f05a868e62fbc14e947 (diff)
downloadcpython-83bf35cb27e28616b75c5010f94aec2641d08f60.zip
cpython-83bf35cb27e28616b75c5010f94aec2641d08f60.tar.gz
cpython-83bf35cb27e28616b75c5010f94aec2641d08f60.tar.bz2
Add interface to call a Python function (or other callable) object
from C.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 2ab77c0..6aedc47 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -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;