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 4317b25a23)

Co-authored-by: prego <pedropregueiro@gmail.com>
This commit is contained in:
Miss Islington (bot) 2022-08-24 08:54:15 -07:00 committed by GitHub
parent bf2728b9f1
commit d02e8fbc5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -216,7 +216,7 @@ records in a table::
... Movie('Aliens', 1986, 'Scott')
... ]
>>> # Find the first movie released on or after 1960
>>> # Find the first movie released after 1960
>>> by_year = attrgetter('released')
>>> movies.sort(key=by_year)
>>> movies[bisect(movies, 1960, key=by_year)]

View File

@ -1415,6 +1415,7 @@ John Popplewell
Matheus Vieira Portela
Davin Potts
Guillaume Pratte
Pedro Pregueiro
Florian Preinstorfer
Alex Prengère
Amrit Prem