4 ms·
I wonder about the usefulness of this. Doesn't the python generator syntax take care pretty well of most use-cases? The first example could have been written l
by algorias 16y ago
I wonder about the usefulness of this. Doesn't the python generator syntax take care pretty well of most use-cases?
The first example could have been written like this, which is much simpler and easier to read than both the prefix and infix versions:
sum(x * x for x in take_while(fib(), lambda x: x < 1000000) if x % 2)
- lloeki 16y agoInserting/disabling/swapping intermediate processing steps in between is immensely easier with pipes, and you don't have to take care of balanced parentheses.