How is it that, in Python 2.7, the following
True == 'w' in 'what!?'
behaves differently than both
(True == 'w') in 'what!?'
and
True == ('w' in 'what!?')
?
>>> True == 'w' in 'what!?'
False
>>> (True == 'w') in 'what!?'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'in <string>' requires string as left operand, not bool
>>> True == ('w' in 'what!?')
True