Skip to main content

Additions to more-itertools: at_least_n() and at_most_n()

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.20250810.2.tar.gz (1.9 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for more_more_itertools-0.1.20250810.2.tar.gz
Algorithm Hash digest
SHA256 57a8297fe0c8efb86c62cc2f316d9bfb4926e2d720f3bc44cf0f67c64c94a5e7
MD5 79decbf1e25f1035b056fea30c78cddc
BLAKE2b-256 a57ecc838e28a3ede6698856b4681e2c9c0602c67e0a8206f70242a6c199d6f2

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