How to list all methods/classes that have been imported into a class. Take an example
from module1 import method1
from module2 import method2
class foo(object):
def say_foo(self):
method1()
def talk(self):
method2()
is it possible to list all methods used in the foo class? i know inspect.getmembers(foo) will list talk and say_foo, how do i list method1 and method2?
use ast module to analyze you code:
the output is :