From 83bf35cb27e28616b75c5010f94aec2641d08f60 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Sat, 27 Jul 1991 21:32:34 +0000 Subject: Add interface to call a Python function (or other callable) object from C. --- Python/ceval.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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; -- cgit v0.12