Regarding the python module symtable
<p>I'm working on a plugin which is sort of a class browser for python codes. I found the python module <em>symtable</em> helpful. However, it seems that the module has a drawback. I cannot get instance attributes using this module. Here's an example python code in a file named <em>src.py</em>:</p>

<pre><code>import os

class A():
    cl_attr = 1
    def fn1(self):
        self.attr1 = 'hello'
    def fn2(self, arg):
        self.attr2 = arg
</code></pre>

<p>Then in the python interpreter:</p>

<pre><code>Python 2.7 (r27:82500, Jul  9 2010, 09:28:49) 
[GCC 4.1.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; src = open('src.py', 'r').read()
&gt;&gt;&gt; import symtable
&gt;&gt;&gt; table = symtable.symtable(src, 'src.py', 'exec')
&gt;&gt;&gt; table.get_children()[0].get_identifiers()
['fn1', 'cl_attr', 'fn2']
</code></pre>

<p>The above results indicate that the class attribute <code>cl_attr</code> is returned. However, when I try:</p>

<pre><code>&gt;&gt;&gt; table.get_children()[0].get_children()[0].get_identifiers()
['self']
&gt;&gt;&gt; table.get_children()[0].get_children()[1].get_identifiers()
['self', 'arg']
</code></pre>

<p>I can only get the arguments of the instance methods, while the instance attributes are missing.</p>

<p>Therefore, I'm wondering if there is a way to get the instance attributes. If not, I have to resort to another python module <em>ast</em>. Can anybody help me with this? Thanks!</p>
