Skip to main content

Additions to more-itertools: at_least_n(), at_most_n(), throttle()

Project description

Intro

Though more-itertools contains many functions, it can never be 'complete'.

Below extensions were proposed, but not (yet) added to more-itertools. Module more-more-itertools acts as their abode until they get added to more-itertools.

Functions

at_least_n(iterable, n, too_short=None)

Validate that iterable has at least n items and return them if it does. If it has fewer than n items, call function too_short with its item-count.

Suggested for addition to more-itertools as #1053 on 9 Aug 2025.

at_most_n(iterable, n, too_long=None)

Validate that iterable has at most n items and return them if it does. If it has more than n items, call function too_long with the number n + 1.

Suggested for addition to more-itertools as #1053 on 9 Aug 2025.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

more_more_itertools-0.1.20250901.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file more_more_itertools-0.1.20250901.tar.gz.

File metadata

File hashes

Hashes for more_more_itertools-0.1.20250901.tar.gz
Algorithm Hash digest
SHA256 bfc60032d61dfe1a1a29df2d7bf3e91e8551db18fb00a8310fd522af361c47f6
MD5 4a605ef021f778f7ea13e340eda80d68
BLAKE2b-256 8733fff0cf3714e3153c5c0dd57de4ec5036787d5fa0dbebd4a9c12f2676fa7d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page