Skip to content

Commit e0f2979

Browse files
committed
py: Add equality test for None object.
1 parent 6433bd9 commit e0f2979

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

py/obj.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ machine_int_t mp_obj_hash(mp_obj_t o_in) {
136136
bool mp_obj_equal(mp_obj_t o1, mp_obj_t o2) {
137137
if (o1 == o2) {
138138
return true;
139+
} else if (o1 == mp_const_none || o2 == mp_const_none) {
140+
return false;
139141
} else if (MP_OBJ_IS_SMALL_INT(o1) || MP_OBJ_IS_SMALL_INT(o2)) {
140142
if (MP_OBJ_IS_SMALL_INT(o1) && MP_OBJ_IS_SMALL_INT(o2)) {
141143
return false;

0 commit comments

Comments
 (0)