Skip to content

Instantly share code, notes, and snippets.

@kenchangh
Created October 11, 2014 07:06
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 kenchangh/66ecae161caca043a689 to your computer and use it in GitHub Desktop.
Save kenchangh/66ecae161caca043a689 to your computer and use it in GitHub Desktop.
An example on "Googley" docstring
def public_fn_with_googley_docstring(name, state=None):
"""This function does something.
Args:
name (str): The name to use.
Kwargs:
state (bool): Current state to be in.
Returns:
int. The return code::
0 -- Success!
1 -- No good.
2 -- Try again.
Raises:
AttributeError, KeyError
A really great idea. A way you might use me is
>>> print public_fn_with_googley_docstring(name='foo', state=None)
0
BTW, this always returns 0. **NEVER** use with :class:`MyPublicClass`.
"""
return 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment