Add interface to call a Python function (or other callable) object

from C.
This commit is contained in:
Guido van Rossum 1991-07-27 21:32:34 +00:00
parent 7ac4a88721
commit 83bf35cb27
1 changed files with 13 additions and 0 deletions

View 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;