-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[stdlib][Draft] Introduce heapq module #2999
Conversation
d860e53
to
8a856a2
Compare
Maybe we can wait a bit before introducing new data structures? We are constantly in the middle of rewrites (new hash, new type of copy, new I'm all for good python compatibility, but with heapq we would be biting more than we can chew at the moment. |
That's fair, but in this case the |
I'll let the maintainers chim in but in my opinion, we do not have enough bandwidth at the moment. Furthermore some rewrites may affect free functions (like references being constantly changing). |
Signed-off-by: Brian Grenier <[email protected]>
|
Any interest in rebasing this branch since the stdlib has come quite a ways since this was first introduced? We're happy to review once that is done. |
@JoeLoser I'm curious given the new attitude around loosening our commitment to being a "superset" if we might rather refactor this into it's own distinct data structure instead of a collection of functions operating on lists like in Python? |
I'm glad that you asked! Personally, yes, I'd go that direction. Do you have any interest in writing up a small API design sketch proposal and we can discuss and go that route before going too far? Feel free to consider inspiration from https://doc.rust-lang.org/std/collections/struct.BinaryHeap.html and friends. |
Great I'd love to! |
Closing this now that the proposal for a dedicated BinaryHeap struct is in progress #3776 |
Going down the list of "stuff we need because Python has it", we have the
heapq
module.There exists a pure python implementation in the Python standard library, so for now we can follow it basically exactly, then write some benchmarks and tweak if from there if possible?