Skip to content
Snippets Groups Projects
Commit e0f2979a authored by Damien George's avatar Damien George
Browse files

py: Add equality test for None object.

parent 6433bd92
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment