summaryrefslogtreecommitdiffstatshomepage
path: root/py/objsingleton.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/objsingleton.c')
-rw-r--r--py/objsingleton.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/py/objsingleton.c b/py/objsingleton.c
index 2b896305cf..4a099657d4 100644
--- a/py/objsingleton.c
+++ b/py/objsingleton.c
@@ -43,12 +43,11 @@ STATIC void singleton_print(const mp_print_t *print, mp_obj_t self_in, mp_print_
mp_printf(print, "%q", self->name);
}
-const mp_obj_type_t mp_type_singleton = {
- { &mp_type_type },
- .name = MP_QSTR_,
- .print = singleton_print,
- .unary_op = mp_generic_unary_op,
-};
+MP_DEFINE_CONST_OBJ_TYPE(
+ mp_type_singleton, MP_QSTR_, MP_TYPE_FLAG_NONE, MP_TYPE_NULL_MAKE_NEW,
+ print, singleton_print,
+ unary_op, mp_generic_unary_op
+ );
const mp_obj_singleton_t mp_const_ellipsis_obj = {{&mp_type_singleton}, MP_QSTR_Ellipsis};
#if MICROPY_PY_BUILTINS_NOTIMPLEMENTED