Skip to content

Instantly share code, notes, and snippets.

@tkf
Created July 13, 2010 12:36
Show Gist options
  • Save tkf/473795 to your computer and use it in GitHub Desktop.
Save tkf/473795 to your computer and use it in GitHub Desktop.
"""Module docstring"""
def myfunc():
"""Function docstring"""
print __doc__
print myfunc.__doc__
class MyClass(object):
"""Class docstring"""
def __init__(self, ):
"""Method docstring"""
print __doc__
print self.__doc__
print self.__init__.__doc__
if __name__ == '__main__':
myfunc() ## Module, Function docstring
MyClass() ## Module, Class, Method docstring
Module docstring
Function docstring
Module docstring
Class docstring
Method docstring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment