summaryrefslogtreecommitdiff
path: root/py/obj.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-04-09 19:55:33 +0100
committerDamien George <damien.p.george@gmail.com>2014-04-09 19:55:33 +0100
commitb5fbd0ba876b43d0f1d1d9af8dd556766bda553b (patch)
tree858468b318b2ad3f63c46add57796db729b003e7 /py/obj.h
parentd99944acddbce627e96326551e47dbf5b3ef5800 (diff)
py: Add mp_obj_is_integer; make mp_get_index check for long int.
mp_obj_is_integer should be used to check if an object is of integral type. It returns true for bool, small int and long int.
Diffstat (limited to 'py/obj.h')
-rw-r--r--py/obj.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/py/obj.h b/py/obj.h
index ab1685d4d..b944d2fcb 100644
--- a/py/obj.h
+++ b/py/obj.h
@@ -369,6 +369,7 @@ void mp_obj_print(mp_obj_t o, mp_print_kind_t kind);
void mp_obj_print_exception(mp_obj_t exc);
int mp_obj_is_true(mp_obj_t arg);
+bool mp_obj_is_integer(mp_obj_t o_in); // returns true if o_in is bool, small int, or long int
bool mp_obj_is_callable(mp_obj_t o_in);
machine_int_t mp_obj_hash(mp_obj_t o_in);
bool mp_obj_equal(mp_obj_t o1, mp_obj_t o2);