title: Can you get the instance variable name from a class?
body: <p>I understand that you should never use variable names within the program, but I am using is strictly for debug purposes and would like to convey the name of the variable to the user for readability.</p>
  <p>I have a file like this:</p>
  <pre><code>class MyClass(object):
      def __init__(self):
          pass
  
      def foo(msg=&quot;&quot;):
          debug(&quot;Called from the %s instance.&quot;) #quazi-print function that only prints when a DEBUG variable is True.
          print(msg)
  
  m = MyClass()
  m.foo(&quot;Test&quot;)
  </code></pre>
  <p>I would like to retrieve the <code>m</code> instance variable name from within the class itself. Though this is merely an example file, I am using it to convey to the user that a raw socket has been created at a certain attribute within an instance variable, and would like to show where it is (i.e. <code>New socket at m.socket</code>)</p>
  <p>Is this feasible with Python?</p>