I've noticed some odd behavior when comparing booleans:
>>> '1' in '123'
True
>>> '1' in '123' == True
False
I thought that maybe it's an issue related to order of operations, but
>>> '1' in ('123' == True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: argument of type 'bool' is not iterable
>>> ('1' in '123') == True
True
Or that maybe x in y
didn't actually return a boolean value, but
>>> type('1' in '123') is type(True)
True
Can somebody explain this? Is it a bug? (Tested in python2.7 and python3.5.)