From d86d22e1e7db19c4b50d92862f8eb0a430d64444 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 27 Feb 2014 22:48:25 +0200 Subject: Add mp_obj_is_subclass_fast() - intended for fast argument checking. I.e. as replacement of MP_OBJ_IS_TYPE(), which takes into account subclassing. --- py/obj.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'py/obj.h') diff --git a/py/obj.h b/py/obj.h index c7ffb4619..855b15150 100644 --- a/py/obj.h +++ b/py/obj.h @@ -256,6 +256,8 @@ mp_obj_t mp_obj_new_module(qstr module_name); mp_obj_type_t *mp_obj_get_type(mp_obj_t o_in); const char *mp_obj_get_type_str(mp_obj_t o_in); bool mp_obj_is_subclass(mp_obj_t object, mp_obj_t classinfo); +// Without supefluous arg checking +bool mp_obj_is_subclass_fast(mp_obj_t object, mp_obj_t classinfo); void mp_obj_print_helper(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t o_in, mp_print_kind_t kind); void mp_obj_print(mp_obj_t o, mp_print_kind_t kind); -- cgit v1.2.3