title: Boolean identity == True vs is True
body: <p>It is standard convention to use <code>if foo is None</code> rather than <code>if foo == None</code> to test if a value is specifically <code>None</code>.</p>
  
  <p>If you want to determine whether a value is exactly <code>True</code> (not just a true-like value), is there any reason to use <code>if foo == True</code> rather than <code>if foo is True</code>? Does this vary between implementations such as CPython (2.x and 3.x), Jython, PyPy, etc.?</p>
  
  <p>Example: say <code>True</code> is used as a singleton value that you want to differentiate from the value <code>'bar'</code>, or any other true-like value:</p>
  
  <pre><code>if foo is True: # vs foo == True
      ...
  elif foo == 'bar':
      ...
  </code></pre>
  
  <p>Is there a case where using <code>if foo is True</code> would yield different results from <code>if foo == True</code>?</p>
  
  <p>NOTE: I am aware of <a href="https://stackoverflow.com/q/20420934/369450">Python booleans - if x:, vs if x == True, vs if x is True</a>. However, it only addresses whether <code>if foo</code>, <code>if foo == True</code>, or <code>if foo is True</code> should generally be used to determine whether <code>foo</code> has a true-like value.</p>
  
  <hr>
  
  <p>UPDATE: According to <a href="https://www.python.org/dev/peps/pep-0285" rel="noreferrer">PEP 285</a> § Specification:</p>
  
  <blockquote>
    <p>The values False and True will be singletons, like None.</p>
  </blockquote>