4 ms·
Toolz is one of my favorite python libraries. I use it all the time. It provides even more of this useful functionality. It also has a sped-up version called Cy
by j88439h84 8y ago
Toolz is one of my favorite python libraries. I use it all the time. It provides even more of this useful functionality. It also has a sped-up version called Cytoolz written with Cython.
https://toolz.readthedocs.io https://toolz.readthedocs.io
https://github.com/pytoolz/cytoolz https://github.com/pytoolz/cytoolz
- ktpsns 8y agoToolz is really a game changer since it allows you to write elegant functional code (lazy evaluations, currying, pipes, parallelism) in Python which feels native. As python has the "batteries included" philosophy, such useful gems should be included into the standard library...
- TylerE 8y agoI will kind of disagree. While having stuff in stdlib can be convenient, it all tends to be where active development goes to die. Compare httplib with something like Requests.
- maxerickson 8y agoThe comparison would be with urllib.request: https://docs.python.org/3/library/urllib.request.html https://docs.python.org/3/library/urllib.request.html Which right there recommends Requests, but for simple tasks it's kind of unfortunate that people bring in a library dependency.
- pmiller2 8y agoCan anyone comment on the efficiency or lack thereof of toolz?
- merlincorey 8y agoIt uses `itertools` internally very heavily, which means if you generally are using generators and such, you maintain those benefits, as well as get to work with infinite sequences, etc. If you do find a `toolz` function to be too slow, there's always the `cytoolz` versions.
- stochastic_monk 8y agocytoolz’s frequencies was around 10x as fast as using a vanilla dict and counting elements manually, which was in turn twice as fast as collections.Counter when I measured them a few years ago. It’s solid work.
- webmaven 8y agoHow does cytoolz performance compare with toolz under PyPy?