title: How do I convert all python operations involving None to None values?
body: <p>I want all mathematical operations involving one or more None variables to return None. </p>
  
  <p>Example: </p>
  
  <pre><code>a = None
  b = 7
  a*b 
  </code></pre>
  
  <p>I want this last line to return None, but it instead gives me an error: </p>
  
  <blockquote>
    <p>TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'</p>
  </blockquote>
  
  <p>I understand why this error exists and all that, but is there any way to force the result to be just a <code>None</code>? </p>
  
  <p><strong>Background</strong>: I have a few functions that mine data and return a value, called <code>diff</code>. Later on I multiply or add <code>diff</code> to a few things to get meaningful information, but not all of my original data contains a useful <code>diff</code>, so I have it set to return <code>diff = None</code> in these cases. I want to be able to skip over these points when I'm plotting results. Python seems to have no trouble skipping over <code>None</code> elements in an array when I'm plotting, so I'd like to just have the results of the operations be <code>None</code>.</p>