title: What is the right exception for an unmet precondition?
body: <p>What is the appropriate exception to raise in a function to signal that a precondition was not met?</p>
  
  <p>Examples:</p>
  
  <pre><code>def print_stats(name, age):
      if name is None:
          raise Exception("name cannot be None")
      if not type(name) is str:
          raise Exception("name must be a string")
  
      if age is None:
          raise Exception("age cannot be None")
      if age &lt; 0:
          raise Exception("age cannot be negative")
  
      print("{0} is {1} years old".format(name, age))
  </code></pre>