Skip to content

Instantly share code, notes, and snippets.

@whophil
Last active April 7, 2016 23:02
Show Gist options
  • Save whophil/878a38b4aa2201e2325e88abe99a645e to your computer and use it in GitHub Desktop.
Save whophil/878a38b4aa2201e2325e88abe99a645e to your computer and use it in GitHub Desktop.
Docstring for Python method (NumPy-style, for Sphinx compatibility)
"""One line description of a module level function.
The longer, optionally multi-line description goes here. This may have multiple
sentences and multiple lines.
Parameters
----------
param1 : int
The first parameter.
param2 : Optional[str]
The second parameter.
*args
Variable length argument list.
**kwargs
Arbitrary keyword arguments.
Returns
-------
return_var1 : bool
True if successful, False otherwise.
return_var2 : float
The area of a square.
Raises
------
AttributeError
The ``Raises`` section is a list of all exceptions
that are relevant to the interface.
ValueError
If `param2` is equal to `param1`.
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment