Skip to content

Fix hang in partition/chunks when n or step is zero - #173

Closed
santhreal wants to merge 2 commits into
Suor:masterfrom
santhreal:upstream/partition-zero-step-final
Closed

Fix hang in partition/chunks when n or step is zero#173
santhreal wants to merge 2 commits into
Suor:masterfrom
santhreal:upstream/partition-zero-step-final

Conversation

@santhreal

Copy link
Copy Markdown

funcy.seqs.partition hits Hang when partition(2, 0, iter(...)) infinite loop. This PR fixes the regression with a focused test covering the case.

Zero step never advances the iterator pool, so partition(2, 0, iter(...))
looped forever; reject non-positive n/step with ValueError instead.
@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