aboutsummaryrefslogtreecommitdiff
path: root/py/objsingleton.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-12-23 00:00:53 +1100
committerDamien George <damien.p.george@gmail.com>2019-12-27 12:53:36 +1100
commitf5eec903fa961135296e2656821450979e413248 (patch)
tree2c8f804d0cc86a4b5c4d3a5febd7e63fb31900a2 /py/objsingleton.c
parentde8c04317be76222d2fbe7c5bf50ffd5ff2fd140 (diff)
py/objsingleton: Use mp_generic_unary_op for singleton objects.
So these types more closely match NoneType, eg they can be hashed, like in CPython.
Diffstat (limited to 'py/objsingleton.c')
-rw-r--r--py/objsingleton.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/py/objsingleton.c b/py/objsingleton.c
index 67535391e..2b896305c 100644
--- a/py/objsingleton.c
+++ b/py/objsingleton.c
@@ -47,6 +47,7 @@ const mp_obj_type_t mp_type_singleton = {
{ &mp_type_type },
.name = MP_QSTR_,
.print = singleton_print,
+ .unary_op = mp_generic_unary_op,
};
const mp_obj_singleton_t mp_const_ellipsis_obj = {{&mp_type_singleton}, MP_QSTR_Ellipsis};