effectivepython
effectivepython copied to clipboard
Item 36, page 140: logical error in the definition of `dropwhile`
(2nd ed)
What the book says
dropwhile, which is the opposite oftakewhile, skips items from an iterator until the predicate function returnsTruefor the first time:
What the book should say
dropwhile, which is the opposite oftakewhile, skips items from an iterator as long as the predicate function returnsTrue:
Thank you for the report! It should have read "until the predicate function returns False for the first time".