我想从函数本身内部打印python函数的docstring.例如.
def my_function(self):
"""Doc string for my function."""
# print the Docstring here.
Run Code Online (Sandbox Code Playgroud)
目前我my_function在定义之后直接这样做.
print my_function.__doc__
Run Code Online (Sandbox Code Playgroud)
但宁愿让函数自己这样做.
我已经打过电话print self.__doc__ print self.my_function.__doc__和print this.__doc__内部创建my_function但这并没有工作.