You can't, because you do not have a reference to the function object. It's the function object that has the __doc__
attribute, not the associated code object.
You'd have to use the filename and linenumber information to try and make an educated guess as to what the docstring might be, but due to the dynamic nature of Python that is not going to be guaranteed to be correct and current.