4 ms·
It's a package, not a built in, but pytoolz [0] is a very complete solution to the type of functional programming munging you are taking about. I wish more peop
by hcrisp 5y ago
It's a package, not a built in, but pytoolz [0] is a very complete solution to the type of functional programming munging you are taking about. I wish more people knew about it (no one here seems to have mentioned it). And it has been Cython optimized in another package called cytoolz [1]. The author explains in the Heritage section how it is an extension of and plays nice with itertools and functools [2].
For Python coders new to functional programming, and how it can make working with data easier, I highly recommend reading the following sections of the pytoolz docs: Composability, Function Purity, Laziness, and Control Flow [0].
[0] https://toolz.readthedocs.io/en/latest/ https://toolz.readthedocs.io/en/latest/
[1] https://github.com/pytoolz/cytoolz https://github.com/pytoolz/cytoolz
[2] https://toolz.readthedocs.io/en/latest/heritage.html https://toolz.readthedocs.io/en/latest/heritage.html