Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Pypeline: A Python library for creating concurrent data pipelines.
Piping using the | operator can make tracebacks pretty ugly with some operators.
If you want to keep the code still somewhat 'pythonic' without introducing the syntax magic using |, you can do it similarly:
range(10) | pp.flatmap(lambda x: [x + 1, x + 2]) | pp.map(lambda x: x * x) ...
xs = range(10) xs = pp.flatmap(xs, lambda x: [x + 1, x + 2]) xs = pp.map(xs, lambda x: x * x) ...
So instead of
map(fn, xs)
map(xs, fn)
There are no comments on this comment yet.
Piping using the | operator can make tracebacks pretty ugly with some operators.
If you want to keep the code still somewhat 'pythonic' without introducing the syntax magic using |, you can do it similarly:
You can do this instead: It helps to keep the operand as first argument, instead of last, because those lambdas are best kept at the end.So instead of
do