title: Is there a way to get the variable names passed into a function from within the function?
body: <p>I'd like to know what the variable name was that was passed into a function. Is this possible in Python?</p>
  <p>Consider this case:</p>
  <pre class="lang-py prettyprint-override"><code>john = 199
  
  def foo(userId:int)-&gt;float:
     age = get_age_by_id(userId)
     return age
  
  </code></pre>
  <p>I'd like to log something like:</p>
  <pre><code>foo(john)
  
  &gt;&gt;&gt; Called with userId = 199 # john 
  </code></pre>
  <p>So, I am looking for a way to &quot;peek&quot; at the variable name that was passed as an argument to the function.</p>
  <p>Any ideas?</p>