summaryrefslogtreecommitdiff
path: root/py/objdict.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-04-11 10:52:06 +0000
committerDamien George <damien.p.george@gmail.com>2014-04-11 10:52:06 +0000
commite22d76e73b67aafa0e8c4a05a1f2b6421564dcd5 (patch)
treedb55462f01d5e8db313d5f3b99a0cea654edc21c /py/objdict.c
parenta9ddd6d9df97637c944bfc51a66476008a88feb3 (diff)
py: Fix up object equality test.
It regressed a bit after implementing float/complex equality. Now it should be improved, and support more equality tests.
Diffstat (limited to 'py/objdict.c')
-rw-r--r--py/objdict.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/py/objdict.c b/py/objdict.c
index 963e18807..8bdd0026a 100644
--- a/py/objdict.c
+++ b/py/objdict.c
@@ -99,7 +99,6 @@ STATIC mp_obj_t dict_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) {
return MP_BOOL(elem != NULL);
}
case MP_BINARY_OP_EQUAL: {
- // TODO: Support equality to other object types
if (MP_OBJ_IS_TYPE(rhs_in, &mp_type_dict)) {
mp_obj_dict_t *rhs = rhs_in;
if (o->map.used != rhs->map.used) {
@@ -118,6 +117,9 @@ STATIC mp_obj_t dict_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) {
}
}
return mp_const_true;
+ } else {
+ // dict is not equal to instance of any other type
+ return mp_const_false;
}
}
default: