Commit 83bf35cb authored by Guido van Rossum's avatar Guido van Rossum

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

from C.
parent 7ac4a887
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment