Add utils.pipe().

This commit is contained in:
Andrey Golovizin 2014-09-03 21:06:17 +02:00
parent 1b49500227
commit bd2a206940

View file

@ -63,3 +63,9 @@ def neighbourhood(lst, index, window=5):
before = lst[:index]
after = lst[index + 1:]
return before[-window:] + after[:window]
def pipe(value, *funcs):
for func in funcs:
value = func(value)
return value