Handsdown API Index / Examples / Google docstrings examples
Auto-generated documentation for examples.google_docstrings module.
Show source in google_docstrings.py:13
Google-style class example
attr1str - Description ofattr1.attr2:obj:int, optional - Description ofattr2.
class ClassExample: ...Show source in google_docstrings.py:22
Summary line.
Extended description of method.
Examples should be written in doctest format, and should illustrate how to use the function
>>> print([i for i in
... example_generator(2)])
[
'one',
'two',
]>>> setup_env()
>>> func_call(
... first_name='test',
... last_name='test',
... )textstr, optional - Description of arg1*argsstr - Description of args**kwargsstr - Description of kwargs
int- Description of return value
def method_example(self, text: str = "hello") -> int: ...Show source in google_docstrings.py:56
Summary line.
Extended description of function. You can use this function like
result = function_example(
{
'key': 'value',
},
None,
)
print resultarg1int - Description of arg1arg2str - Description of arg2arg3str, optional - Description of arg3
bool- Description of return value
AttributeError- TheRaisessection is a list of all exceptions that are relevant to the interface.ValueError- Ifparam2is equal toparam1.
def function_example(arg1, arg2, arg3=None): ...Show source in google_docstrings.py:87
Example function with PEP 484 type annotations.
param1- The first parameter.param2- The second parameter.
The return value. True for success, False otherwise.
def function_with_pep484_type_annotations(param1: int, param2: str) -> bool: ...