title: Python multi-line expressions and stack trace
body: <p>We have a simple AssertTrue function used in our python project and I wanted to modify the output it provides to print the code statement from which it was called. The code looks something like this:</p>
  
  <pre><code>1 import traceback
  2
  3 def AssertTrue(expr, reason=None):
  4     print traceback.format_stack()[-2]
  5
  6 AssertTrue(1 == 2,
  7         reason='One is not equal to two')
  </code></pre>
  
  <p>The output:</p>
  
  <pre><code>File "/tmp/fisken.py", line 7, in &lt;module&gt;
    reason='One is not equal to two')
  </code></pre>
  
  <p>I'm wondering why traceback.format_stack only gives me the code on line 7. The statement starts on line 6 and the expression I would like to see in the output is also on that same line. Doesn't traceback handle multi-line function calls?</p>
  
  <p>(Never mind that there are better ways to do AssertTrue(...). I'm just wondering why traceback.format_stack (and .extract_stack) does not behave as I expected it to)</p>