title: raise with no argument
body: <p>The <a href="http://docs.python.org/2/reference/simple_stmts.html#the-raise-statement" rel="noreferrer">documentation</a> for the raise statement with no arguments says</p>
  
  <blockquote>
    <p>If no expressions are present, raise re-raises the last exception that was active in the current scope.</p>
  </blockquote>
  
  <p>I used to think that meant that the current function had to be executing an <code>except</code> clause. After reading <a href="https://stackoverflow.com/questions/18000985/how-do-i-get-the-line-number-for-a-logging-typeerror-of-not-all-arguments-conve">this question</a> and experimenting a little, I think it means that any function on the stack has to be executing an <code>except</code> clause, but I'm not sure. Also, I've realized I have no idea how the stack trace works with a no-arg raise:</p>
  
  <pre><code>def f():
    try:
      raise Exception
    except:
      g()
  
  def g():
    raise
  
  f()
  </code></pre>
  
  <p>produces</p>
  
  <pre><code>Traceback (most recent call last):
    File "foo", line 10, in &lt;module&gt;
      f()
    File "foo", line 5, in f
      g()
    File "foo", line 3, in f
      raise Exception
  Exception
  </code></pre>
  
  <p>That doesn't look like the stack at the time of the initial raise, or the stack at the time of the re-raise, or the concatenation of both stacks, or anything I can make sense of.</p>
  
  <p>Am I right about a no-arg raise looking for any function on the stack executing an <code>except</code> clause? Also, how does the stack trace work on a reraise?</p>