title: Exit in a function using Python
body: <p>A quick function question in Python. Is it possible to stop a function from processing and return early. i.e like this:</p>
  
  <pre><code>def _do_something():
  
      if not exists('/etc/', use_sudo=True):
          # no files don't do any more
          return
      # if ok continue with stuff
      sudo('/etc/init.d/nginx stop')
  </code></pre>
  
  <p>Is this ok? Or is there something like 'exit' ?</p>