Why does `True == False is False` evaluate to False in Python? (2013)
It's just a operator precedence problem. Add parentheses and it goes away.<p><pre><code>    Python 3.6.9 (default, Apr 18 2020, 01:56:04) 
    >>> True == False is False
    False
    >>> (True == False) is False
    True
</code></pre>
There are worse problems with Python's "is".<p><pre><code>    >>> 1+1 is 2
    True
    >>> 1000+1000 is 2000
    False
</code></pre>
This comes from a bad idea borrowed from LISP. Numbers are boxed, and the small integers have boxes built in for them. Larger numbers have boxes dynamically generated. In Python "is" means "in the same box". This corresponds to (eq a b) in LISP.[1]  Exposing the implementation like that might have been a good idea when McCarthy came up with it in 1960.<p>[1] <a href="http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node74.html" rel="nofollow">http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node74.html</a>