3 ms·
I like to leverage some FP to bring readability to python from toolz import curried, pipe pipe(ages, curried.filter(lambda age: age > 17), l
by marko-lev 3y ago
I like to leverage some FP to bring readability to python
from toolz import curried, pipe
pipe(ages,
curried.filter(lambda age: age > 17),
list,
len)
This way you can follow - vertically - what happens, where, and why.
You can make your own pipe function to avoid 3rd party dependencies
import functools
pipe = lambda *args: functools.reduce(lambda acc, el: el(acc), args)