mirror of
https://github.com/vinta/awesome-python.git
synced 2026-05-06 07:53:28 -05:00
[PR #1470] [MERGED] add more-itertools #3408
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/vinta/awesome-python/pull/1470
Author: @ptosi
Created: 2/7/2020
Status: ✅ Merged
Merged: 4/7/2020
Merged by: @vinta
Base:
master← Head:master📝 Commits (1)
d6b358eadd more-itertools📊 Changes
1 file changed (+1 additions, -0 deletions)
View changed files
📝
README.md(+1 -0)📄 Description
What is this Python project?
From the README of the project:
What's the difference between this Python project and similar ones?
more-itertoolsprovides most re-usable functions one would want when working with iterables. By relying on this lightweight package, similarly to whatitertoolsprovide, one can write more readable and maintainable code, while avoiding having to re-invent the wheel (and introducing bugs by doing so).As simple examples, instead of using raw iterators, one should use
itertoolswhen appropriate:and
more-itertoolsis based on the same idea and provides many more building blocks:Of course, the project also provides more advanced expressions, hard to express as one-liners. Some of my favourites (notice their high-quality documentation):
all_equal(iterable)last(iterable[, default])nth(iterable, n, default=None)consume(iterator, n=None)distribute(n, iterable)roundrobin(*iterables)windowed(seq, n, fillvalue=None, step=1)substrings(iterable)powerset(iterable)random_permutation(iterable, r=None)with_iter(context_manager)In many cases where I wondered "Why didn't they implement this in
itertools?!",most-itertoolshad a single-call solution: there's a reason why the project already has 1.2k ⭐ on GitHub!Please give
most-itertoolsa try and give this PR a 👍 if you find the package useful.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.