title: `return None` in python not recommended. How to bypass?
body: <p>I have a function which connects to a url by <code>httplib</code> using <code>lxml</code>. It checks by <code>xpath</code>for a certain pattern and if the check is positive it returns a string. But if the check was negative it returns nothing.</p>
  
  <p>Now the situation is, that my function returns <code>None</code>. I call the function, check if its return value is <code>not None</code> and continue in the code.</p>
  
  <p>An example:</p>
  
  <pre><code>def foobar(arg):
      # connect to page by httplib
      # check for arg in a certain pattern by lxml
      if check:
          return result
      else:
          return None
  
  result = foobar(arg)
  if result:
      # do stuff
  else:
      # do other stuff
  </code></pre>
  
  <p>Recently I read, that this is a <em>no go</em>. How do I avoid such situations?</p>