I want to print the docstring of a python function from inside the function itself. for eg.
def my_function(self): \"\"\"Doc string for my function.\"\"\"
Try:
class MyClass(): # ... def my_function(self): """Docstring for my function""" print MyClass.my_function.__doc__ # ...
(*) There was a colon (:) missing after my_function()
:
my_function()