Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise LookupError in partition_all when length is invalid #603

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Mr0grog
Copy link

@Mr0grog Mr0grog commented Feb 7, 2025

Sometimes an iterable's __len__ is incorrect, which can lead to bad output from partition_all. This change ensures partition_all checks for this case and raise an exception (when it previously output bad data) so the user can more easily find the invalid iterable and fix it.

Fixes #602. /cc @eriknw

Sometimes an iterable's `__len__` is incorrect, which can lead to bad output from `partition_all`. We now raise an exception (when we previously output bad data) in these cases so the user can more easily find the invalid iterable and fix it. Fixes pytoolz#602.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

partition_all outputs padding tokens on sequences with inaccurate __len__
1 participant