Finding the variables (read or write)
Question: I'd like to develop a small debugging tool for python programs.In Dynamic
Slicing How can I find the variables that are accessed in a statement? And
find the type of access (read or write) for those variables (in Python).###
Write: A statement can change the program state Read : A statement can read
the program state ._*_ *For example in these 4 lines we have: (1) x = a+b =>
write{x} & reads{a,b} (2)y=6 => write{y}&reads{} (3) while(n>1) => write{}
&reads{n} (4) n=n-1 write{n} & reads{n}


Answer: Not sure what your goal is. Perhaps
[`dis`](http://docs.python.org/2/library/dis.html) is what you're looking for?

    
    
    >>> import dis
    >>> dis.dis("x=a+b")
      1           0 LOAD_NAME                0 (a)
                  3 LOAD_NAME                1 (b)
                  6 BINARY_ADD
                  7 STORE_NAME               2 (x)
                 10 LOAD_CONST               0 (None)
                 13 RETURN_VALUE
    

