diff options
author | Damien George <damien.p.george@gmail.com> | 2019-12-23 00:00:53 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-12-27 12:53:36 +1100 |
commit | f5eec903fa961135296e2656821450979e413248 (patch) | |
tree | 2c8f804d0cc86a4b5c4d3a5febd7e63fb31900a2 /py/objsingleton.c | |
parent | de8c04317be76222d2fbe7c5bf50ffd5ff2fd140 (diff) | |
download | micropython-f5eec903fa961135296e2656821450979e413248.tar.gz micropython-f5eec903fa961135296e2656821450979e413248.zip |
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.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/py/objsingleton.c b/py/objsingleton.c index 67535391ea..2b896305cf 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}; |