title: How to list the variables or attribute inside a function of a class?
body: <p><strong>Sample code:</strong></p>
  <pre><code>class hello:
      cls_var_name='Hello_Class'
      def setdata(self, value):
          self.data=value
          fun1_var_name='Setdata_Function'
      def showdata(self):
          fun2_var_name='Showdata_Function'
          print(self.data)
  </code></pre>
  <p>So, With the help of the <code>dir()</code> function, we can list all the attribute of a class. but how to list out variables/attributes inside the function of a class.</p>
  <p><strong>Demo:</strong></p>
  <pre><code>&gt;&gt;&gt; dir(hello)
  ['__doc__', '__module__', 'cls_var_name', 'setdata', 'showdata']
  &gt;&gt;&gt;
  &gt;&gt;&gt; dir(hello.setdata)
  ['__call__', '__class__', '__cmp__', '__delattr__', '__doc__', '__format__', '__func__', '__get__', 
  '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', 
  '__self__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'im_class', 'im_func', 'im_self']
  &gt;&gt;&gt;
  &gt;&gt;&gt; dir(hello.showdata)
  ['__call__', '__class__', '__cmp__', '__delattr__', '__doc__', '__format__', '__func__', '__get__',
   '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__',
   '__self__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'im_class', 'im_func', 'im_self']
  </code></pre>
  <p>In the above output you can seen the list of attribute of a class in <code>dir(hello)</code> result:
  <code>'cls_var_name', 'setdata', 'showdata'</code></p>
  <p>But for <code>dir(hello.setdata)</code> and <code>dir(hello.showdata)</code> result it list out all the related attribute but not a <code>fun1_var_name</code> and <code>fun2_var_name</code> variable, why?</p>