Created
November 13, 2017 21:08
-
-
Save eikonomega/910512d92769b0cc382a09ae4de41771 to your computer and use it in GitHub Desktop.
Very Simple Example of NumPy Style Docstrings
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
""" | |
main.py | |
==================================== | |
The core module of my example project | |
""" | |
def about_me(your_name): | |
""" | |
Return the most important thing about a person. | |
Parameters | |
---------- | |
your_name | |
A string indicating the name of the person. | |
""" | |
return "The wise {} loves Python.".format(your_name) | |
class ExampleClass: | |
"""An example docstring for a class definition.""" | |
def __init__(self, name): | |
""" | |
Blah blah blah. | |
Parameters | |
--------- | |
name | |
A string to assign to the `name` instance attribute. | |
""" | |
self.name = name | |
def about_self(self): | |
""" | |
Return information about an instance created from ExampleClass. | |
""" | |
return "I am a very smart {} object.".format(self.name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment