Last time, I talked about Python’s boolean operators and and or and what can be confusing about them when “truthy” objects get into the mix. If you haven’t already read it, I would highly recommend it. This article is similar, but looks into something just a little different: the ability to string comparison operators.
The Confusing Code
Just like last time, we’ll start off looking at some code that confused someone enough to ask the community about it:
'a' in 'abc' # True
True == True # True
'a' in 'abc' == True # False
At a cursory glance, there seems to be something wrong with that it would come up with such a result. Continue Reading



