I use
>>> import ast
>>> T = ast.parse('a * (b + c)', mode='eval').body
to get an abstract syntax tree of some (mathematically looking; but this shouldn't matter) expression.
Now I want to get back the source string of some particular node. For example
>>> get_source_back(T.right)
'(b + c)'
Is there a solution for this somewhere?
(Of course I could use .walk or NodeVisitor and manually specify how to construct a string out of a node. But this does not give me the original source and I have to be careful with parentheses and so on.)