Commit e0f2979a authored by Damien George's avatar Damien George
Browse files

py: Add equality test for None object.

parent 6433bd92
......@@ -136,6 +136,8 @@ machine_int_t mp_obj_hash(mp_obj_t o_in) {
bool mp_obj_equal(mp_obj_t o1, mp_obj_t o2) {
if (o1 == o2) {
return true;
} else if (o1 == mp_const_none || o2 == mp_const_none) {
return false;
} else if (MP_OBJ_IS_SMALL_INT(o1) || MP_OBJ_IS_SMALL_INT(o2)) {
if (MP_OBJ_IS_SMALL_INT(o1) && MP_OBJ_IS_SMALL_INT(o2)) {
return false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment