{{ message }}
Conversation
Twix1288
requested review from
Eclips4,
JelleZijlstra,
isidentical,
lysnikolaou,
pablogsal,
rhettinger and
tomasr8
as code owners
July 8, 2026 20:59
Contributor
Author
Member
|
There are plently of unrelated changes that should be removed. I would have also waited a bit more for the OP to reply. They may have wanted to do a PR themselves. |
Twix1288
force-pushed
the
feature/heapq-oo-interface
branch
from
July 8, 2026 21:48
744410a to
ea5b53c
Compare
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Twix1288
force-pushed
the
feature/heapq-oo-interface
branch
from
July 8, 2026 22:01
ea5b53c to
08ffd3b
Compare
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR adds the
MinHeapandMaxHeapclasses to theheapqmodule to provide an object-oriented interface over the existing heap functions.This resolves issue #153357.
Changes:
MinHeapandMaxHeaptoLib/heapq.pywith__slots__ = ('_heap',)for memory efficiency.push,pop,pushpop, andreplaceto delegate to the highly optimized underlying functions.peek(),clear(),__len__(),__bool__(),__contains__(),__iter__(), and__repr__().test_heapq.pyusing mixins to verify behavior against both pure Python (py_heapq) and C (c_heapq) underlying implementations.Doc/library/heapq.rstwith class documentation and an explicit note about__iter__and__repr__yielding raw array elements rather than fully sorted output.