8000 [3.11] gh-103266: Fix a typo in example code for bisect() function (GH-103267) by miss-islington · Pull Request #103327 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.11] gh-103266: Fix a typo in example code for bisect() function (GH-103267) #103327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Doc/library/bisect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@ 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')
... Movie('Aliens', 1986, 'Cameron')
... ]

>>> # Find the first movie released after 1960
Expand All @@ -228,8 +228,8 @@ 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='Aliens', released=1986, director='Scott'),
Movie(name='Jaws', released=1975, director='Spielberg'),
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
Expand Down
0