summaryrefslogtreecommitdiffstats
path: root/Objects/call.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/call.c')
-rw-r--r--Objects/call.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/Objects/call.c b/Objects/call.c
index f1b1408..dd022ec 100644
--- a/Objects/call.c
+++ b/Objects/call.c
@@ -2,6 +2,22 @@
#include "frameobject.h"
+int
+_PyObject_HasFastCall(PyObject *callable)
+{
+ if (PyFunction_Check(callable)) {
+ return 1;
+ }
+ else if (PyCFunction_Check(callable)) {
+ return !(PyCFunction_GET_FLAGS(callable) & METH_VARARGS);
+ }
+ else {
+ assert (PyCallable_Check(callable));
+ return 0;
+ }
+}
+
+
static PyObject *
null_error(void)
{