[EMAIL PROTECTED] wrote:
> some time ago I have written a bug
> into small program that uses the functions of the heapq module, because
> I have added an item to the head of the heap using a normal list
> method, breaking the heap invariant.

I know I've had similar bugs in my code before.

> from heapq import heapify, heappush, heappop, heapreplace
> 
> class Heap(object):
[snip implementation]

+1 for adding a Heap object like this to the collections module. If you 
can make a little time to add some tests (you could probably steal a lot 
of what you need from test_heapq.py) you should definitely submit it as 
a patch for 2.6.

STeVe
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to