I use the following code to get the caller's method name in the called method:
import inspect
def B():
outerframe = inspect.currentframe().f_back
functionname = outerframe.f_code.co_name
docstring = ??
return "caller's name: {0}, docsting: {1}".format(functionname, docstring)
def A():
"""docstring for A"""
return B()
print A()
but I also want to get the docstring from the caller's method in the called method. How do I do that?