mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 12:40:15 +01:00
py: Improve __build_class__.
This commit is contained in:
9
py/obj.c
9
py/obj.c
@@ -13,6 +13,15 @@
|
||||
#include "runtime.h"
|
||||
#include "map.h"
|
||||
|
||||
mp_obj_t mp_obj_get_type(mp_obj_t o_in) {
|
||||
if (MP_OBJ_IS_SMALL_INT(o_in)) {
|
||||
return (mp_obj_t)&int_type;
|
||||
} else {
|
||||
mp_obj_base_t *o = o_in;
|
||||
return (mp_obj_t)o->type;
|
||||
}
|
||||
}
|
||||
|
||||
const char *mp_obj_get_type_str(mp_obj_t o_in) {
|
||||
if (MP_OBJ_IS_SMALL_INT(o_in)) {
|
||||
return "int";
|
||||
|
||||
Reference in New Issue
Block a user