Let's say I have a file called example.py
with the following content:
def func_one(a):
return 1
def func_two(b):
return 2
def func_three(b):
return 3
How would I get a list of function instances for that file? I have tried playing with the compiler
,parser
and ast
modules but I can't really figure it out. It might be a lot easier than that, but it's slightly out of my depth.
EDIT: To be clear I don't want to import the functions.