summaryrefslogtreecommitdiff
path: root/py/obj.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/obj.c')
-rw-r--r--py/obj.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/py/obj.c b/py/obj.c
index 0b57f24c5..02f75c7c4 100644
--- a/py/obj.c
+++ b/py/obj.c
@@ -34,6 +34,7 @@
#include "misc.h"
#include "qstr.h"
#include "obj.h"
+#include "objtype.h"
#include "mpz.h"
#include "objint.h"
#include "runtime0.h"
@@ -145,7 +146,11 @@ bool mp_obj_is_true(mp_obj_t arg) {
}
bool mp_obj_is_callable(mp_obj_t o_in) {
- return mp_obj_get_type(o_in)->call != NULL;
+ mp_call_fun_t call = mp_obj_get_type(o_in)->call;
+ if (call != mp_obj_instance_call) {
+ return call != NULL;
+ }
+ return mp_obj_instance_is_callable(o_in);
}
mp_int_t mp_obj_hash(mp_obj_t o_in) {