title: Why does Python throw an error when a substring is not found?
body: <p>What's the design thinking behind this?</p>
  
  <p>To me it's easier to do something like</p>
  
  <pre><code>if string.index(substring) &gt; -1:
      # do stuff
  </code></pre>
  
  <p>than trying to catch an exception. If the <code>substring</code> is not found, at least your program doesn't break.</p>
  
  <p>Someone told me 'returning -1 is a bad pattern'. Why is that?</p>
  
  <p>What is the Pythonic way for checking substring?</p>