summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--py/objsingleton.c1
-rw-r--r--tests/basics/builtin_ellipsis.py3
-rw-r--r--tests/basics/class_notimpl.py3
3 files changed, 7 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};
diff --git a/tests/basics/builtin_ellipsis.py b/tests/basics/builtin_ellipsis.py
index d88647a89..d66e86de4 100644
--- a/tests/basics/builtin_ellipsis.py
+++ b/tests/basics/builtin_ellipsis.py
@@ -4,3 +4,6 @@ print(...)
print(Ellipsis)
print(... == Ellipsis)
+
+# Test that Ellipsis can be hashed
+print(type(hash(Ellipsis)))
diff --git a/tests/basics/class_notimpl.py b/tests/basics/class_notimpl.py
index 308075f92..58e790716 100644
--- a/tests/basics/class_notimpl.py
+++ b/tests/basics/class_notimpl.py
@@ -48,3 +48,6 @@ except TypeError:
# NotImplemented isn't handled specially in unary methods
print(-c)
+
+# Test that NotImplemented can be hashed
+print(type(hash(NotImplemented)))