title: How to count the number of occurrences of `None` in a list?
body: <p>I'm trying to count things that are not <code>None</code>, but I want <code>False</code> and numeric zeros to be accepted too. Reversed logic: I want to count everything except what it's been explicitly declared as <code>None</code>.</p>
  
  <h1>Example</h1>
  
  <p>Just the 5th element it's not included in the count:</p>
  
  <pre><code>&gt;&gt;&gt; list = ['hey', 'what', 0, False, None, 14]
  &gt;&gt;&gt; print(magic_count(list))
  5
  </code></pre>
  
  <p>I know this isn't Python normal behavior, but how can I override Python's behavior?</p>
  
  <h2>What I've tried</h2>
  
  <p>So far I founded people suggesting that <code>a if a is not None else "too bad"</code>, but it does not work.</p>
  
  <p>I've also tried <code>isinstance</code>, but with no luck.</p>