title: Python: User-Defined Exception That Proves The Rule
body: <p>Python documentations <a href="http://docs.python.org/tutorial/errors.html#user-defined-exceptions" rel="nofollow noreferrer">states</a>:</p>
  
  <blockquote>
    <p>Exceptions should typically be derived from the Exception class,
    either directly or indirectly.</p>
  </blockquote>
  
  <p>the word <code>'typically'</code> leaves me in an ambiguous state.</p>
  
  <p>consider the code:</p>
  
  <pre><code>class good(Exception): pass
  class bad(object): pass
  
  Heaven = good()
  Hell = bad()
  
  &gt;&gt;&gt; raise Heaven
  
  Traceback (most recent call last):
    File "&lt;pyshell#163&gt;", line 1, in &lt;module&gt;
      raise Heaven
  good
  
  &gt;&gt;&gt; raise Hell
  
  Traceback (most recent call last):
    File "&lt;pyshell#171&gt;", line 1, in &lt;module&gt;
      raise Hell
  TypeError: exceptions must be classes or instances, not bad
  </code></pre>
  
  <p>so when reading the python docs, should i replace <code>'typically'</code> with <code>''</code>?</p>
  
  <p>what if i have a class hierarchy that has nothing to do with the Exception class, and I want to 'raise' objects belonging to the hierarchy?</p>
  
  <p>I can always raise an exception with an argument:</p>
  
  <pre><code>raise Exception, Hell
  </code></pre>
  
  <p>This seems slightly awkward to me</p>
  
  <p>What's so special about the Exception (EDIT: or BaseException) class, that only its family members can be raised?</p>