bslatkin / effectivepython

Effective Python: Second Edition — Source Code and Errata for the Book
https://effectivepython.com
2.2k stars 710 forks source link

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

Open kirisakow opened 1 year ago

kirisakow commented 1 year ago

(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:

bslatkin commented 1 month ago

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