8f19317540
I'm pretty sure these are never reached, since NOT_EQUAL is always converted into EQUAL in mp_binary_op. No one should call type.binary_op directly, they should always go through mp_binary_op (or mp_obj_is_equal).
76 lines
1.0 KiB
Python
76 lines
1.0 KiB
Python
# test equality
|
|
|
|
print(None == None)
|
|
|
|
print(False == None)
|
|
print(False == False)
|
|
print(False == True)
|
|
|
|
print(() == ())
|
|
print(() == [])
|
|
print([] == [])
|
|
print(() == {})
|
|
print({} == ())
|
|
|
|
print(() == None)
|
|
print(() == False)
|
|
print(() == print)
|
|
|
|
print([] == None)
|
|
print([] == False)
|
|
print([] == print)
|
|
|
|
print({} == None)
|
|
print({} == False)
|
|
print({} == print)
|
|
|
|
print(1 == 1)
|
|
print(1 == 2)
|
|
print(1 == ())
|
|
print(1 == [])
|
|
print(1 == {})
|
|
print(1 == 'a')
|
|
|
|
print('a' == 'a')
|
|
print('a' == 'ab')
|
|
print('a' == 1)
|
|
print('a' == ())
|
|
|
|
# same as above but with !=
|
|
|
|
print(None != None)
|
|
|
|
print(False != None)
|
|
print(False != False)
|
|
print(False != True)
|
|
|
|
print(() != ())
|
|
print(() != [])
|
|
print([] != [])
|
|
print(() != {})
|
|
print({} != ())
|
|
|
|
print(() != None)
|
|
print(() != False)
|
|
print(() != print)
|
|
|
|
print([] != None)
|
|
print([] != False)
|
|
print([] != print)
|
|
|
|
print({} != None)
|
|
print({} != False)
|
|
print({} != print)
|
|
|
|
print(1 != 1)
|
|
print(1 != 2)
|
|
print(1 != ())
|
|
print(1 != [])
|
|
print(1 != {})
|
|
print(1 != 'a')
|
|
|
|
print('a' != 'a')
|
|
print('a' != 'ab')
|
|
print('a' != 1)
|
|
print('a' != ())
|