Suppose I have a Python function as defined below:
def foo(arg1,arg2): #do something with args a = arg1 + arg2 return a
I can g
The inspect module has methods for retrieving source code from python objects. Seemingly it only works if the source is located in a file though. If you had that I guess you wouldn't need to get the source from the object.