title: Pythonic way to check returned value for None
body: <p>I'm looking for a pythonic way for the code below.</p>
  <p>Function <code>foo()</code> may return an int or &quot;None&quot; and in that case &quot;None&quot; should be replaced by a default value.</p>
  <p>I doubt that this can't be simplified and reduced to a one-liner, I just don't know how to do it ^^</p>
  <pre><code>def foo() -&gt; int:
     # code
  
  
  x = foo()
  x = 0 if x is None else x
  </code></pre>