From 73eecc4863638152c6092db04dc3c9c7ebdef7dc Mon Sep 17 00:00:00 2001 From: Oleg Iarygin Date: Wed, 5 Apr 2023 11:53:05 +0400 Subject: [PATCH 1/3] Fix a typo in example code for bisect() function --- Doc/library/bisect.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/bisect.rst b/Doc/library/bisect.rst index b85564f17866e0..79efdd8e902fba 100644 --- a/Doc/library/bisect.rst +++ b/Doc/library/bisect.rst @@ -210,7 +210,7 @@ records in a table:: >>> Movie = namedtuple('Movie', ('name', 'released', 'director')) >>> movies = [ - ... Movie('Jaws', 1975, 'Speilberg'), + ... Movie('Jaws', 1975, 'Spielberg'), ... Movie('Titanic', 1997, 'Cameron'), ... Movie('The Birds', 1963, 'Hitchcock'), ... Movie('Aliens', 1986, 'Scott') @@ -228,7 +228,7 @@ records in a table:: >>> pprint(movies) [Movie(name='The Birds', released=1963, director='Hitchcock'), Movie(name='Love Story', released=1970, director='Hiller'), - Movie(name='Jaws', released=1975, director='Speilberg'), + Movie(name='Jaws', released=1975, director='Spielberg'), Movie(name='Aliens', released=1986, director='Scott'), Movie(name='Titanic', released=1997, director='Cameron')] From 8f52b5cbfe3c07f7f85534192b979dd47ff81126 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 5 Apr 2023 08:16:46 -0500 Subject: [PATCH 2/3] Update Doc/library/bisect.rst Co-authored-by: Hugo van Kemenade --- Doc/library/bisect.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/bisect.rst b/Doc/library/bisect.rst index 79efdd8e902fba..21d19da1497788 100644 --- a/Doc/library/bisect.rst +++ b/Doc/library/bisect.rst @@ -213,7 +213,7 @@ records in a table:: ... Movie('Jaws', 1975, 'Spielberg'), ... Movie('Titanic', 1997, 'Cameron'), ... Movie('The Birds', 1963, 'Hitchcock'), - ... Movie('Aliens', 1986, 'Scott') + ... Movie('Aliens', 1986, 'Cameron') ... ] >>> # Find the first movie released after 1960 From 381aaf28bc4cbe6daac69b908231cd0b50808c5e Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 5 Apr 2023 08:17:00 -0500 Subject: [PATCH 3/3] Update Doc/library/bisect.rst Co-authored-by: Hugo van Kemenade --- Doc/library/bisect.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/bisect.rst b/Doc/library/bisect.rst index 21d19da1497788..e3c8c801904b61 100644 --- a/Doc/library/bisect.rst +++ b/Doc/library/bisect.rst @@ -229,7 +229,7 @@ records in a table:: [Movie(name='The Birds', released=1963, director='Hitchcock'), Movie(name='Love Story', released=1970, director='Hiller'), Movie(name='Jaws', released=1975, director='Spielberg'), - Movie(name='Aliens', released=1986, director='Scott'), + Movie(name='Aliens', released=1986, director='Cameron'), Movie(name='Titanic', released=1997, director='Cameron')] If the key function is expensive, it is possible to avoid repeated function