I am just learning Python and I'm surprised none of the experts have provided this explanation:
If you type
help(<function name>)
Python will return the docstring text, BUT NOT YOUR COMMENTS. It seems like this is the fundamental answer to your question. The other answers are helpful and nuanced, but I submit that what you were looking for is this.