effectivepython icon indicating copy to clipboard operation
effectivepython copied to clipboard

Item 36, page 140: logical error in the definition of `dropwhile`

Open kirisakow opened this issue 1 year ago • 1 comments

(2nd ed)

What the book says

dropwhile, which is the opposite of takewhile, skips items from an iterator until the predicate function returns True for the first time:

What the book should say

dropwhile, which is the opposite of takewhile, skips items from an iterator as long as the predicate function returns True:

kirisakow avatar Oct 08 '22 13:10 kirisakow

Thank you for the report! It should have read "until the predicate function returns False for the first time".

bslatkin avatar Jun 01 '24 16:06 bslatkin