[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-29 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17834 ___ ___

[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Daniel, I've already been in the process of adding a class to the heapq module and have done substantial work on it over the last few months. I'll look at your code to see if there are any ideas that should be merged with it before I finish it up. Am

[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: See also http://bugs.python.org/issue17794 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17834 ___ ___

[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Daniel, I'm going to close this one so we can continue work in just a single tracker item: http://bugs.python.org/issue17794 I'll see if anything in your code should be merged in to mine and will list you as a co-contributor when it all goes in.

[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-29 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- Removed message: http://bugs.python.org/msg188061 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17834 ___

[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Daniel, I'm going to close this one so we can continue work in just a single tracker item: http://bugs.python.org/issue13742 I'll see if anything in your code should be merged in to mine and will list you as a co-contributor when it all goes in.

[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-29 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- Removed message: http://bugs.python.org/msg188062 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17834 ___

[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also rejected issue1162363. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17834 ___ ___

[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: queue.PriorityQueue is a locked class for use in multi-threaded code. That's like saying Queue is a good substitute for list :-) OTOH, the proposed patch raises a lot of warning signs for me. I will wait for a decision on the feature's desirability before

[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: From my multilingual experience I can say that priority queue is very rarely used type of collections (but if it needed it is very usefull). On one hand, Python stdlib already contains one such type, and this type will be good enough in

[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-24 Thread Daniel Wong
New submission from Daniel Wong: heapq already provides a bunch of functions for manipulating lists that preserve (or create) a heap invariant. My change adds two classes for representing heaps. These classes ensure that operations that violate the heap invariant are not possible (through the

[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-24 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +rhettinger stage: - patch review versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17834 ___

[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: queue.PriorityQueue? -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17834 ___ ___

[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-24 Thread Daniel Wong
Daniel Wong added the comment: Hey Serhiy, Are you suggesting that I put my new classes in a new module and rename them? I think it'd be better to keep them in heapq, unless someone intended to add more classes to your proposed queue module, because heap functionality would be spread between

[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-24 Thread R. David Murray
R. David Murray added the comment: Serhiy is pointing you to an existing use of heapq in the stdlib. I'm not quite sure what his intent is in pointing it out, though it *might* be to point out that heapq is a primitive, and PriorityQueue already implements a subclassable class using it. I

[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-24 Thread Daniel Wong
Daniel Wong added the comment: Ah, Serhiy is pointing out that there's already a class named PriorityQueue in the queue module. I didn't know that exists. Now that I've had a chance to look at it, queue.PriorityQueue is like my Heap class, but there are some interesting difference; moreover,