Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve dropwhile() example with unique data elements
  • Loading branch information
rhettinger committed May 23, 2024
commit 83a4c37f87439adb24401d74dd4f4e5c108d8860
2 changes: 1 addition & 1 deletion Doc/library/itertools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ loops that truncate the stream.
start-up time. Roughly equivalent to::

def dropwhile(predicate, iterable):
# dropwhile(lambda x: x<5, [1,4,6,4,1]) → 6 4 1
# dropwhile(lambda x: x<5, [1,4,6,3,8]) → 6 3 8
iterable = iter(iterable)
for x in iterable:
if not predicate(x):
Expand Down