Skip to content

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