title: Python type hinting with exceptions
body: <p>I have a function that looks like this:</p>
  
  <pre><code>def check_for_errors(result):
      if 'success' in result:
          return True
  
      if 'error' in result:
          raise TypeError
  
      return False
  </code></pre>
  
  <p>In successful run of this function, I should get a <code>bool</code>, but if there is an error I should get a <code>TypeError</code>- which is OK because I deal with it in another function.</p>
  
  <p>My function first line looks like this:</p>
  
  <pre><code>def check_for_errors(result: str) -&gt; bool:
  </code></pre>
  
  <p>My question is: Should I mention the error in my type hinting?</p>