Skip to content

Commit d02e8fb

Browse files
GH-96179: Fix misleading example on the bisect documentation (GH-96228)
The `movies[bisect(movies, 1960, key=by_year)]` will actually return only movies **after** 1960. (cherry picked from commit 4317b25) Co-authored-by: prego <[email protected]>
1 parent bf2728b commit d02e8fb

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Doc/library/bisect.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ records in a table::
216216
... Movie('Aliens', 1986, 'Scott')
217217
... ]
218218

219-
>>> # Find the first movie released on or after 1960
219+
>>> # Find the first movie released after 1960
220220
>>> by_year = attrgetter('released')
221221
>>> movies.sort(key=by_year)
222222
>>> movies[bisect(movies, 1960, key=by_year)]

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,6 +1415,7 @@ John Popplewell
14151415
Matheus Vieira Portela
14161416
Davin Potts
14171417
Guillaume Pratte
1418+
Pedro Pregueiro
14181419
Florian Preinstorfer
14191420
Alex Prengère
14201421
Amrit Prem

0 commit comments

Comments
 (0)