mirror of
https://github.com/micropython/micropython.git
synced 2026-01-08 05:00:26 +01:00
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.
This commit is contained in:
1
py/obj.h
1
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);
|
||||
|
||||
Reference in New Issue
Block a user