]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-96179: Fix misleading example on the bisect documentation (GH-96228)
authorprego <pedropregueiro@gmail.com>
Wed, 24 Aug 2022 15:47:13 +0000 (17:47 +0200)
committerGitHub <noreply@github.com>
Wed, 24 Aug 2022 15:47:13 +0000 (17:47 +0200)
The `movies[bisect(movies, 1960, key=by_year)]` will actually return only movies **after** 1960.

Doc/library/bisect.rst
Misc/ACKS

index 76045ea511a5e7955b38f0cf528d340df5239ce2..7856bf67a7b829fe8935b4f9ad59d5e36ac3d9ec 100644 (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)]
index 16a482e40a517336a20a0297fb7a32cad4a462a2..daa01c1a0f1dbbdbfd76811bc93abb4ae3eec5f1 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1419,6 +1419,7 @@ John Popplewell
 Matheus Vieira Portela
 Davin Potts
 Guillaume Pratte
+Pedro Pregueiro
 Florian Preinstorfer
 Alex Prengère
 Amrit Prem