You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[3rd Ed][Item 102] Discrepancy in find_closest function example (p. 501) #126
In Effective Python, 3rd Edition, Item 102 (“Consider Searching Sorted Sequences with bisect”), page 501, the prose says the function should return the index that “is equal to or exceeds” the goal value.
The example implementation right below that line uses the condition:
ifgoal<value:
returnindex
This condition handles only the “greater than” case and ignores the “equal to” case mentioned in the text.
Just wanted to flag this discrepancy.
Thanks for the excellent book!
Activity