Skip to content

fix: return empty iterator from interpose on empty seq#630

Open
santhreal wants to merge 2 commits into
pytoolz:masterfrom
santhreal:fix/interpose-empty
Open

fix: return empty iterator from interpose on empty seq#630
santhreal wants to merge 2 commits into
pytoolz:masterfrom
santhreal:fix/interpose-empty

Conversation

@santhreal

@santhreal santhreal commented Jul 18, 2026

Copy link
Copy Markdown

interpose hits StopIteration when interpose(el, []). This PR fixes the regression with a focused test covering the case.

next() on the interposed stream raised StopIteration for [].
Reuse drop(1, ...) so empty sequences yield an empty iterator without catching StopIteration.
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