summaryrefslogtreecommitdiff
path: root/py/runtime.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/runtime.c')
-rw-r--r--py/runtime.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/py/runtime.c b/py/runtime.c
index 3c7c0350c..47e094763 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -314,6 +314,9 @@ mp_obj_t mp_unary_op(mp_unary_op_t op, mp_obj_t arg) {
if (result != MP_OBJ_NULL) {
return result;
}
+ } else if (op == MP_UNARY_OP_HASH) {
+ // Type doesn't have unary_op so use hash of object instance.
+ return MP_OBJ_NEW_SMALL_INT((mp_uint_t)arg);
}
if (op == MP_UNARY_OP_BOOL) {
// Type doesn't have unary_op (or didn't handle MP_UNARY_OP_BOOL),