I have the following function:
def my_func():
"""My docstring is both funny and informative"""
pass
How do I get access to the docstring?
I have the following function:
def my_func():
"""My docstring is both funny and informative"""
pass
How do I get access to the docstring?
You can also use inspect.getdoc
. It cleans up the __doc__
by normalizing tabs to spaces and left shifting the doc body to remove common leading spaces.