all: Make all mp_obj_type_t defs use MP_DEFINE_CONST_OBJ_TYPE.

In preparation for upcoming rework of mp_obj_type_t layout.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
Jim Mussared
2021-07-14 14:38:38 +10:00
committed by Damien George
parent cdb880789f
commit 662b9761b3
227 changed files with 2543 additions and 2184 deletions

View File

@@ -80,15 +80,18 @@ mp_obj_t mp_obj_new_attrtuple(const qstr *fields, size_t n, const mp_obj_t *item
return MP_OBJ_FROM_PTR(o);
}
const mp_obj_type_t mp_type_attrtuple = {
{ &mp_type_type },
.name = MP_QSTR_tuple, // reuse tuple to save on a qstr
.print = mp_obj_attrtuple_print,
.unary_op = mp_obj_tuple_unary_op,
.binary_op = mp_obj_tuple_binary_op,
.attr = mp_obj_attrtuple_attr,
.subscr = mp_obj_tuple_subscr,
.getiter = mp_obj_tuple_getiter,
};
MP_DEFINE_CONST_OBJ_TYPE(
mp_type_attrtuple,
MP_QSTR_tuple,
MP_TYPE_FLAG_NONE,
MP_TYPE_NULL_MAKE_NEW,
// reuse tuple to save on a qstr
print, mp_obj_attrtuple_print,
unary_op, mp_obj_tuple_unary_op,
binary_op, mp_obj_tuple_binary_op,
attr, mp_obj_attrtuple_attr,
subscr, mp_obj_tuple_subscr,
getiter, mp_obj_tuple_getiter
);
#endif // MICROPY_PY_ATTRTUPLE