Skip to content

fix: empty stream for non-positive partition_all n - #238

Closed
santhreal wants to merge 1 commit into
pytoolz:masterfrom
santhreal:fix/partition-all-zero
Closed

fix: empty stream for non-positive partition_all n#238
santhreal wants to merge 1 commit into
pytoolz:masterfrom
santhreal:fix/partition-all-zero

Conversation

@santhreal

@santhreal santhreal commented Jul 18, 2026

Copy link
Copy Markdown

partition_all hits ZeroDivisionError when partition_all(0, seq) modulo by zero vs toolz empty. This PR fixes the regression with a focused test covering the case.

partition_all(0, seq) raised ZeroDivisionError on len % n, and negative n
raised SystemError from PyTuple_New. Match toolz by yielding an empty
stream when n < 1.
@santhreal santhreal closed this Jul 28, 2026
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.

1 participant