abstract syntax tree - Python ast and inspect.getsource() -


how can 1 make ast tree inspectable inspect.getsource()

exec(compile(create_module(...), 'foo.py', 'exec')) print(inspect.getsource(obj.instance.method)) 

inspect.getsource() returns newline terminated string.


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - Gamma correction doesn't look properly corrected, is this linear? -