I like the options offered by the _ast module, it's really powerful. Is there a way of getting the full AST from it?
For example, if I get the AST of the following code :
import os
os.listdir(".")
by using :
ast = compile(source_string,"<string>","exec",_ast.PyCF_ONLY_AST)
the body of the ast object will have two elements, an import object, and a expr object. However, I'd like to go further, and obtain the AST of import and listdir, in other words, I'd like to make _ast descend to the lowest level possible.
I think it's logical that this sort of thing should be possible. The question is how?
EDIT: by the lowest level possible, I didn't mean accesing what's "visible". I'd like to get the AST for the implementation of listdir as well: like stat and other function calls that may be executed for it.