Skip to content

GH-96179: Fix misleading example on the bisect documentation #96228

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 2 commits into from
Aug 24, 2022

Conversation

pedropregueiro
Copy link
Contributor

@pedropregueiro pedropregueiro commented Aug 24, 2022

Fix minor issue with docs for bisect where example could mislead users:

>>> # Find the first movie released on or after 1960
>>> by_year = attrgetter('released')
>>> movies.sort(key=by_year)
>>> movies[bisect(movies, 1960, key=by_year)]
Movie(name='The Birds', released=1963, director='Hitchcock')

The movies[bisect(movies, 1960, key=by_year)] will actually return only movies after 1960.

@ghost
Copy link

ghost commented Aug 24, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

@pedropregueiro
Copy link
Contributor Author

Ugh, forgot to set up the auto-sign commits for the repo (first contribution 😅 ). Is it worth amending and push --force the branch, or just let it be this time? Couldn't find anything in the contrib docs regarding this.

@encukou encukou added skip news needs backport to 3.10 only security fixes needs backport to 3.11 only security fixes labels Aug 24, 2022
@encukou
Copy link
Member

encukou commented Aug 24, 2022

This minor issue does not need a NEWS entry. Could you remove that file?
Don't worry about signing commits.

@pedropregueiro
Copy link
Contributor Author

Sorted @encukou!

@encukou encukou merged commit 4317b25 into python:main Aug 24, 2022
@miss-islington
Copy link
Contributor

Thanks @pedropregueiro for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒⛏🤖

@encukou
Copy link
Member

encukou commented Aug 24, 2022

Thank you, and welcome to Python development!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 24, 2022
…ythonGH-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]>
@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Aug 24, 2022
@bedevere-bot
Copy link

GH-96244 is a backport of this pull request to the 3.11 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 24, 2022
…ythonGH-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]>
@bedevere-bot
Copy link

GH-96245 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Aug 24, 2022
miss-islington added a commit that referenced this pull request Aug 24, 2022
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]>
miss-islington added a commit that referenced this pull request Aug 24, 2022
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]>
@pedropregueiro pedropregueiro deleted the fix-docs-typo-96179 branch August 24, 2022 15:57
mdboom pushed a commit to mdboom/cpython that referenced this pull request Aug 24, 2022
…ythonGH-96228)

The `movies[bisect(movies, 1960, key=by_year)]` will actually return only movies **after** 1960.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants