title: Is there any difference between "foo is None" and "foo == None"?
body: <p>Is there any difference between:</p>
  
  <pre><code>if foo is None: pass
  </code></pre>
  
  <p>and</p>
  
  <pre><code>if foo == None: pass
  </code></pre>
  
  <p>The convention that I've seen in most Python code (and the code I myself write) is the former, but I recently came across code which uses the latter.  None is an instance (and the only instance, IIRC) of NoneType, so it shouldn't matter, right?  Are there any circumstances in which it might?</p>