Skip to content

Instantly share code, notes, and snippets.

@eikonomega
Created November 13, 2017 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eikonomega/910512d92769b0cc382a09ae4de41771 to your computer and use it in GitHub Desktop.
Save eikonomega/910512d92769b0cc382a09ae4de41771 to your computer and use it in GitHub Desktop.
Very Simple Example of NumPy Style Docstrings
"""
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