print(3 in [1, 2, 3] == [1, 2, 3])
#Output: True
print((3 in [1, 2, 3]) == [1, 2, 3])
#Output: False
I'm just wondering what is happening here.
Because of Python's comparison chaining feature.
3 in [1, 2, 3] == [1, 2, 3]
is treated as
(3 in [1, 2, 3]) and ([1, 2, 3] == [1, 2, 3])