This question is a result of my python ast work.
I have a node in the ast and I want to obtain its children.
The ._field attribute gives the names of all the children of a node. However it is different for different node depending upon the syntax node.
for example if node is of type BinOp..then node._field will yield ('left','op', 'right')
Hence to access the children of node I have to use node.left, node.op and node.right
But I want to do it for any general node.
given any node if I use node._field it will give me a tupple. How do I use this tupple for obtaining the children. The node can be any general node. So I do not know what the tuple would be like beforehand.
examples in form of codes will be really nice! Thanks!