I have a Python AST [as returned by ast.parse()].
I know this is an AST of a class method.
How do I find all calls to other methods of the same class?
Basically, I want to collect something like:
['foo', 'bar']
for a code snippet like:
def baz(self): # this is a class method
'''baz docstring'''
self.foo() + self.bar()
I need a function that will accept an AST and will return the list of other methods [method names as strings] of the class that are being invoked inside a method of the same class.