Skip to content

Commit

Permalink
Doc: document 'return'
Browse files Browse the repository at this point in the history
  • Loading branch information
sotte committed Dec 29, 2015
1 parent c6bd2d5 commit 989eafc
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pelper/pelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ def pipe(data, *functions):
data (whatever): the data that is passed into the first function.
functions (callables): functions that create the pipeline.
Returns:
The result of your pipeline.
Examples:
``pipe`` allows you to turn something which is hard to read:
Expand Down Expand Up @@ -95,6 +98,9 @@ def take(iterable, n):
iterable (iterable): the iterable to take from.
n (int): the number of elements to take.
Returns:
list: the first n elements of iterable.
Examples:
>>> take(range(5), 2)
[0, 1]
Expand All @@ -116,6 +122,9 @@ def nth(iterable, n, default=None):
n (int): the n-th elements to take.
default (whatever): return default if nothing found
Returns:
The n-th element of iterable.
Examples:
>>> nth(range(5), 2)
2
Expand Down Expand Up @@ -224,6 +233,9 @@ def cache(f):
previous calls.
Cache is really useful for recursive functions!
Args:
f (function): the function to cache.
Warning:
Only use this with pure functions!
Expand Down Expand Up @@ -284,6 +296,9 @@ def flatten(nested_list):
Args:
nested_list (iterable): arbitrarily nested list.
Returns:
list: a flattened list.
Examples:
>>> flatten(range(5))
Expand Down

0 comments on commit 989eafc

Please sign in to comment.