Skip to content

Fix element skipping for empty iterators #14

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

Merged
merged 1 commit into from
Feb 5, 2019
Merged

Conversation

tilboerner
Copy link
Contributor

next(<iter>) raises StopIteration when the iterator is empty. Providing a default returns that value instead, allowing to skip elements gracefully when you don't care if they exist.

`next(<iter>)` raises `StopIteration` when the iterator is empty. Providing a default returns that value instead, allowing to skip elements gracefully when you don't care if they exist.
@gto76
Copy link
Owner

gto76 commented Feb 5, 2019

Thanks. I will use this, but I will probably rearrange the whole iterator section because of it.

@gto76 gto76 merged commit 5d9800a into gto76:master Feb 5, 2019
@tilboerner tilboerner deleted the patch-1 branch February 5, 2019 20:13
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.

2 participants