Skip to content

Commit 5d9800a

Browse files
authored
Merge pull request gto76#14 from tilboerner/patch-1
Fix element skipping for empty iterators
2 parents 2bd6df8 + 455dbe4 commit 5d9800a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Iterator
170170

171171
#### Skips first element:
172172
```python
173-
next(<iter>)
173+
next(<iter>, None) # default of `None` avoids exception for empty <iter>
174174
for element in <iter>:
175175
...
176176
```

0 commit comments

Comments
 (0)