関数自体の内部から Python 関数のドキュメント文字列を出力したいと考えています。たとえば。
def my_function(self):
"""Doc string for my function."""
# print the Docstring here.
現時点では、my_function
定義された直後にこれを行っています。
print my_function.__doc__
しかし、関数自体にこれをさせたいと思います。
my_function 内で呼び出してみprint self.__doc__
print self.my_function.__doc__
ましたが、うまくいきませんでした。print this.__doc__