From: Guido van Rossum Date: Sat, 27 Jul 1991 21:32:34 +0000 (+0000) Subject: Add interface to call a Python function (or other callable) object X-Git-Tag: v0.9.8~869 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83bf35cb27e28616b75c5010f94aec2641d08f60;p=thirdparty%2FPython%2Fcpython.git Add interface to call a Python function (or other callable) object from C. --- diff --git a/Python/ceval.c b/Python/ceval.c index 2ab77c09db5d..6aedc47a3e06 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;