title: How to get the original variable name of variable passed to a function
body: <p>Is it possible to get the original variable name of a variable passed to a function? E.g.</p>
  
  <pre><code>foobar = "foo"
  
  def func(var):
      print var.origname
  </code></pre>
  
  <p>So that:</p>
  
  <pre><code>func(foobar)
  </code></pre>
  
  <p>Returns:</p>
  
  <p><code>&gt;&gt;foobar</code></p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>All I was trying to do was make a function like:</p>
  
  <pre><code>def log(soup):
      f = open(varname+'.html', 'w')
      print &gt;&gt;f, soup.prettify()
      f.close()
  </code></pre>
  
  <p>.. and have the function generate the filename from the name of the variable passed to it.</p>
  
  <p>I suppose if it's not possible I'll just have to pass the variable and the variable's name as a string each time.</p>