Created
August 12, 2018 07:59
-
-
Save yuchen-xue/e638c0adcd6f1ef2df0c532cb8176a87 to your computer and use it in GitHub Desktop.
A simple example on importing docstring in Python.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mymodule | |
print(mymodule.__doc__) | |
print(mymodule.f.__doc__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""This is the module docstring.""" | |
def f(x): | |
"""This is the function docstring.""" | |
return 2 * x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment