title: Python Return Codes
body: <p>So lately I've been asking a few questions about more professional and pythonic style in Python, and despite being given great answers to my questions, I feel like I need to ask a much broader question. </p>
  
  <p>In general, when writing utility functions (for a library, etc.) that deal more with side effects (file writes, dictionary definitions, etc.) than return values, it's very useful to return a status code to tell the calling function that it passed or failed.</p>
  
  <p>In Python, there seem to be three ways to flag this:</p>
  
  <p>Using a return value of -1 or 0 (C like) and using statements such as</p>
  
  <pre><code>if my_function(args) &lt; 0:
      fail condition
  pass condition
  </code></pre>
  
  <p>or using a return value of True/False</p>
  
  <pre><code>if not my_function(args):
       fail condition
  pass condition
  </code></pre>
  
  <p>or using a 'return or 'return None' using exceptions (exits on unknown error)</p>
  
  <pre><code>try:
      my_function(args)
  except ExpectedOrKnownExceptionOrError:
      fail condition
  pass condition
  </code></pre>
  
  <p>Which of these is best? Most correct? Preferred? I understand all work, and there isn't much technical advantage of one over the other (except perhaps the overhead of exception handling).</p>