title: Python check for NoneType not working
body: <p>I'm trying to check whether an object has a None type before checking it's length. For this, I've done an if statement with an or operator:</p>
  
  <pre><code>if (cts is None) | (len(cts) == 0):
  return
  </code></pre>
  
  <p>As far as I can tell, the object <code>cts</code> will be checked if it's None, and if it is, the length check won't run. However, the following error happens if <code>cts</code> is None:</p>
  
  <p><code>TypeError: object of type 'NoneType' has no len()</code></p>
  
  <p>Does python check both expressions in an if statement, even if the first is true?</p>