Skip to content

Add example of minheap and maxheap working together#137251

Merged
rhettinger merged 1 commit into
python:mainfrom
rhettinger:running_median
Jul 30, 2025
Merged

Add example of minheap and maxheap working together#137251
rhettinger merged 1 commit into
python:mainfrom
rhettinger:running_median

Conversation

@rhettinger
Copy link
Copy Markdown
Contributor

@rhettinger rhettinger commented Jul 30, 2025

In Python 3.14, max-heaps were added to the heapq module. Add a classic example of a min-heap and max-heap working together.


📚 Documentation preview 📚: https://cpython-previews--137251.org.readthedocs.build/

@rhettinger rhettinger added docs Documentation in the Doc dir skip issue skip news needs backport to 3.14 bugs and security fixes labels Jul 30, 2025
@rhettinger rhettinger added the 3.15 pre-release feature fixes, bugs and security fixes label Jul 30, 2025
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs Jul 30, 2025
@StanFromIreland
Copy link
Copy Markdown
Member

This can be put under issue #133530

Copy link
Copy Markdown
Member

@StanFromIreland StanFromIreland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Just one little PEP8/257 nit

Comment thread Doc/library/heapq.rst
@rhettinger
Copy link
Copy Markdown
Contributor Author

This can be put under issue #133530

Though related, there is no benefit to connecting these. The other issue is about a separate part of the heapq docs and is mostly stylistic.

@rhettinger rhettinger merged commit dc05d47 into python:main Jul 30, 2025
38 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Jul 30, 2025
@miss-islington-app
Copy link
Copy Markdown

Thanks @rhettinger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@rhettinger rhettinger deleted the running_median branch July 30, 2025 20:53
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 30, 2025
(cherry picked from commit dc05d47)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented Jul 30, 2025

GH-137255 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jul 30, 2025
Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request Aug 19, 2025
@rhettinger rhettinger added the needs backport to 3.14 bugs and security fixes label Jan 13, 2026
@miss-islington-app
Copy link
Copy Markdown

Thanks @rhettinger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented Jan 13, 2026

GH-143780 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jan 13, 2026
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 13, 2026
(cherry picked from commit dc05d47)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.15 pre-release feature fixes, bugs and security fixes docs Documentation in the Doc dir skip issue skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants