4 ms·
In Python you have the wonderful https://github.com/pytoolz/toolz https://github.com/pytoolz/toolz from toolz import pipe pipe('hello',lambda w: ( "foo
by sitkack 2y ago
In Python you have the wonderful https://github.com/pytoolz/toolz https://github.com/pytoolz/toolz
from toolz import pipe
pipe('hello',lambda w: ( "foo", w ), lambda y: [ 0, y, 1 ])
[0, ('foo', 'hello'), 1]
You can used named functions, but they would need to be define above in upper scope
def h(x):
return ( "foo", x )
def g(x):
return [ 0, x, 1]
pipe('hello', h, g)
- behnamoh 2y agothanks, I'll check this out. I've seen similar libs before, like "pipes" which also does piping through the "|" symbol.